Merge lp:~dobey/ubuntuone-installer/launch-cp into lp:ubuntuone-installer

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 3
Merged at revision: 7
Proposed branch: lp:~dobey/ubuntuone-installer/launch-cp
Merge into: lp:ubuntuone-installer
Diff against target: 33 lines (+18/-7)
1 file modified
bin/ubuntuone-installer (+18/-7)
To merge this branch: bzr merge lp:~dobey/ubuntuone-installer/launch-cp
Reviewer Review Type Date Requested Status
Natalia Bidart Approve
Eric Casteleijn (community) Approve
Review via email: mp+70479@code.launchpad.net

Commit message

Launch the control-panel straight away if already installed

To post a comment you must log in.
Revision history for this message
Eric Casteleijn (thisfred) :
review: Approve
Revision history for this message
Natalia Bidart (nataliabidart) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/ubuntuone-installer'
2--- bin/ubuntuone-installer 2011-07-29 14:31:29 +0000
3+++ bin/ubuntuone-installer 2011-08-04 18:29:24 +0000
4@@ -16,11 +16,22 @@
5 # with this program. If not, see <http://www.gnu.org/licenses/>.
6 """The main script for the Ubuntu One Installer."""
7
8-from gi.repository import Gtk
9-
10-
11+import apt
12+
13+from gi.repository import Gtk, GLib
14+
15+
16+def is_installed(package):
17+ """Check if things are installed already."""
18+ cache = apt.Cache()
19+ return package in cache and cache[package].is_installed
20+
21+
22 if __name__ == "__main__":
23- from ubuntuone.installer.gui import Window
24- dialog = Window()
25- dialog.run()
26- Gtk.main()
27+ if is_installed('ubuntuone-control-panel-gtk'):
28+ GLib.spawn_command_line_async('ubuntuone-control-panel-gtk')
29+ else:
30+ from ubuntuone.installer.gui import Window
31+ dialog = Window()
32+ dialog.run()
33+ Gtk.main()

Subscribers

People subscribed via source and target branches

to all changes: