Merge lp://qastaging/~3v1n0/ubuntuone-client/sync-menu-use-gappinfo-launch into lp://qastaging/ubuntuone-client

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: dobey
Approved revision: 1399
Merged at revision: 1393
Proposed branch: lp://qastaging/~3v1n0/ubuntuone-client/sync-menu-use-gappinfo-launch
Merge into: lp://qastaging/ubuntuone-client
Diff against target: 352 lines (+205/-48)
2 files modified
tests/platform/sync_menu/test_linux.py (+139/-20)
ubuntuone/platform/sync_menu/linux.py (+66/-28)
To merge this branch: bzr merge lp://qastaging/~3v1n0/ubuntuone-client/sync-menu-use-gappinfo-launch
Reviewer Review Type Date Requested Status
dobey (community) Approve
Diego Sarmentero (community) Approve
Roberto Alsina (community) Approve
Review via email: mp+158503@code.qastaging.launchpad.net

Commit message

UbuntuOneSyncMenuLinux: use GAppInfo with proper context to launch URIs

This allows to correctly open the application with proper startup notify.

Description of the change

The linux sync-menu should use GAppInfo with LaunchContext to launch applications and URIs so that the window manager and the applications will be properly focused and launched with startup notification.

To post a comment you must log in.
Revision history for this message
Roberto Alsina (ralsina) :
review: Approve
1393. By Marco Trevisan (Treviño)

UbuntuOneSyncMenuLinux: protect the commandline-app-creation from error too

Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

Tests are failing, and there isn't new tests for the new code.

review: Needs Fixing
Revision history for this message
dobey (dobey) wrote :

+CLIENT_DESKTOP_ID = 'ubuntuone-control-panel-qt-gnome.desktop'
+INSTALLER_DESKTOP_ID = 'ubuntuone-installer.desktop'

Why are both of these being used? There is no more "installer" exactly, but the filename is unchanged, to avoid breaking the launcher. Also, the "-qt-gnome.desktop" file is only for GNOME, so I think we want to use the "ubuntuone-installer.desktop" everywhere. But I wouldn't call it "INSTALLER_DESKTOP_ID" as the variable, as it's not an installer. Maybe CONTROL_PANEL_DESKTOP_ID or CLIENT_DESKTOP_ID, and use that constant for all the instances.

Revision history for this message
dobey (dobey) :
review: Needs Fixing
1394. By Marco Trevisan (Treviño)

UbuntuOneSyncMenuLinux: don't crash if the display is not set, don't use the Context

1395. By Marco Trevisan (Treviño)

SyncMenuTestCase: add new tests to cover changes and update the old ones

1396. By Marco Trevisan (Treviño)

SyncMenuTestCase: use random values for timestasmp

1397. By Marco Trevisan (Treviño)

UbuntuOneSyncMenuLinux: always use CLIENT_DESKTOP_ID as client

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> +CLIENT_DESKTOP_ID = 'ubuntuone-control-panel-qt-gnome.desktop'
> +INSTALLER_DESKTOP_ID = 'ubuntuone-installer.desktop'
>
> Why are both of these being used? There is no more "installer" exactly, but
> the filename is unchanged, to avoid breaking the launcher. Also, the "-qt-
> gnome.desktop" file is only for GNOME, so I think we want to use the
> "ubuntuone-installer.desktop" everywhere. But I wouldn't call it
> "INSTALLER_DESKTOP_ID" as the variable, as it's not an installer. Maybe
> CONTROL_PANEL_DESKTOP_ID or CLIENT_DESKTOP_ID, and use that constant for all
> the instances.

Fine, I've moved everything to CLIENT_DESKTOP_ID set to "ubuntuone-installer.desktop" now.

Revision history for this message
dobey (dobey) wrote :

There are some lint issues in the test file.

== Python Lint Notices ==

./tests/platform/sync_menu/test_linux.py:
    276: redefinition of unused 'time' from line 32
    286: redefinition of unused 'time' from line 32
    297: redefinition of unused 'time' from line 32
    306: redefinition of unused 'time' from line 32
    317: redefinition of unused 'time' from line 32
    326: redefinition of unused 'time' from line 32
    335: redefinition of unused 'time' from line 32
    344: redefinition of unused 'time' from line 32
    353: redefinition of unused 'time' from line 32

make: *** [lint] Error 1

Revision history for this message
dobey (dobey) wrote :

Also, is there any reason to use use randint() here instead of time.time()?

Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

This branch contains some lint issues:

== Python Lint Notices ==

./tests/platform/sync_menu/test_linux.py:
    276: redefinition of unused 'time' from line 32
    286: redefinition of unused 'time' from line 32
    297: redefinition of unused 'time' from line 32
    306: redefinition of unused 'time' from line 32
    317: redefinition of unused 'time' from line 32
    326: redefinition of unused 'time' from line 32
    335: redefinition of unused 'time' from line 32
    344: redefinition of unused 'time' from line 32
    353: redefinition of unused 'time' from line 32

review: Needs Fixing
1398. By Marco Trevisan (Treviño)

SyncMenuTestCase: use time.time() instead of random.randint().

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> This branch contains some lint issues:

They should be fixed now, thanks for pointing out.

Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
Revision history for this message
dobey (dobey) wrote :

8 +

E303 too many blank lines (3)

+ def __init__(self, command_line = "", name = "", flags = 0):
+ def __init__(self, desktop_id = ""):
+ def _open_uri(self, uri, timestamp = 0):
+ def _open_control_panel_by_command_line(self, timestamp, args = ''):
+ def open_control_panel(self, menuitem = None, timestamp = 0):
+ def open_ubuntu_one_folder(self, menuitem = None, timestamp = 0):
+ def open_share_file_tab(self, menuitem = None, timestamp = 0):
+ def open_go_to_web(self, menuitem = None, timestamp = 0):
+ def open_web_help(self, menuitem = None, timestamp = 0):
+ def open_get_more_storage(self, menuitem = None, timestamp = 0):

E251 no spaces around keyword / parameter equals

68 + self.context = context
69 +
70 +class FakeDesktopAppInfo(FakeAppInfo):

E302 expected 2 blank lines, found 1

1399. By Marco Trevisan (Treviño)

UbuntuOneSyncMenuLinux: fixing spaces issues

Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches