- KDE's file manager didn't have a plugin for Ubuntu One, like Nautilus does, so I had to use u1sdtool on the command line or the web interface to publish files and do other operations.
- It used the Gnome Keyring to store the token and I had to enter the password to it every time I logged in.
- The Control Panel was written in python and GTK and was ugly and slow under KDE.
That only leaves the dolphin integration. Unfortunately the dolphin plugin was actually the only part of apache logger's Ubuntu One for KDE project that he didn't really like. He says it is no where near production quality. I therefore decided to roll up my sleeves and write my own.
First I decided to add some context context menus so I would be able to carry out common Ubuntu One operations without the need to use the console. So created a few .desktop files to configure them and created a ruby script to run the necessary commands.
#!/usr/bin/ruby require "open3" class UbuntuOne def unsync_folder input streams = Open3.popen3 "u1sdtool --info="+input info = "" while(info != nil && !(info.include? "share_id")) info = streams.gets end if(info != nil) info[" share_id: "] = "" share_id = info.chomp exec "u1sdtool --delete-folder="+share_id end end def publish_file input streams = Open3.popen3 "u1sdtool --publish-file="+input url = streams.gets puts url url["File is published at "] = "" streams.each do |i| i.close end exec "qdbus org.kde.klipper /klipper org.kde.klipper.klipper.setClipboardContents "+url end end #arg0 is the function to call #arg1 is the file input = "" ARGV.each_char do |c| #put the spaces back if(c != " ") input += c else input += "\\ " end end puts ARGV+" "+input if(ARGV == "unsync_folder") UbuntuOne.new.unsync_folder input elsif ARGV == "publish_file" UbuntuOne.new.publish_file input else puts "Something went wrong :(" end
Note the ruby script only contains methods for the commands that needed some logic.
At the moment the menu for files support :
- Publish and Copy Weblink
- Stop Publishing
- Stop Synchronizing
To install the menu plugin just extract this tar ball into "home/yourusername/.kde/share/kde4/services/ServiceMenus/UbuntuOne/" and yes the tar ball was published with the plugin :)
If you have any issues or questions don't hesitate to ask.
I'm now going to take a look at apachelogger's old code for the version control plugin he wrote and the code for the git and svn dolphin plugins to see about showing what files are in sync, like nautilus does. I'm starting a job on Monday so I probably won't have the time for it for a while but I'll post it here whenever I finish it. Also on a side note I'll have to do it in C++ and I don't like C++ as a language but it'll get done ;)