Merge lp:~roignac/ubuntuone-control-panel/close_window_shortcuts into lp:ubuntuone-control-panel

Proposed by Vadim Rutkovsky on 2012-02-16
Status: Rejected
Rejected by: Natalia Bidart on 2012-03-08
Proposed branch: lp:~roignac/ubuntuone-control-panel/close_window_shortcuts
Merge into: lp:ubuntuone-control-panel
Diff against target: 38 lines (+17/-0)
2 files modified
ubuntuone/controlpanel/gui/gtk/gui.py (+8/-0)
ubuntuone/controlpanel/gui/qt/gui.py (+9/-0)
To merge this branch: bzr merge lp:~roignac/ubuntuone-control-panel/close_window_shortcuts
Reviewer Review Type Date Requested Status
Natalia Bidart 2012-02-16 Needs Fixing on 2012-02-16
Review via email: mp+93332@code.launchpad.net

Description of the change

This change adds shortcuts to main windows (both GTK and QT) - close on Ctrl+W or Ctrl+Q

To post a comment you must log in.
Natalia Bidart (nataliabidart) wrote :

Hello Vadim!

First of all, thanks a lot for your contribution.
Secondly, I will have to set this branch as Needs Fixing since we have a strict policy about not adding new code without having the matching test suite validating the change.

To run the whole test suite, you can run the command:

./run-tests

At the moment, that command depends on a patched version of twisted that you can find out in our nightlies PPA: ppa:ubuntuone/nightlies.

Let me know if you need any other guidance.
Regards, Natalia.

review: Needs Fixing
Vadim Rutkovsky (roignac) wrote :

I guess, I should install a trunk version of ubuntu-sso-client, as the version from PPA lacks tests:

$ apt-cache policy ubuntu-sso-client
ubuntu-sso-client:
  Installed: 3.1+r874-38~precise1
  Candidate: 3.1+r874-38~precise1
  Version table:
 *** 3.1+r874-38~precise1 0
        500 http://ppa.launchpad.net/ubuntuone/nightlies/ubuntu/ precise/main i386 Packages
        100 /var/lib/dpkg/status
     2.99.4-0ubuntu1 0
        500 http://by.archive.ubuntu.com/ubuntu/ precise/main i386 Packages

$ ./run-tests
*** Running test suite for ubuntuone/controlpanel ***
Traceback (most recent call last):
  File "/usr/bin/u1trial", line 325, in <module>
    main()
  File "/usr/bin/u1trial", line 305, in main
    suite = trial_runner.get_suite(config)
  File "/usr/bin/u1trial", line 184, in get_suite
    config['ignore-paths']))
  File "/usr/bin/u1trial", line 168, in _collect_tests
    module_suite = self._load_unittest(filepath)
  File "/usr/bin/u1trial", line 108, in _load_unittest
    module = __import__(modpath, None, None, [""])
  File "/home/vadik/Devel/ubuntuone-control-panel/close_window_shortcuts/ubuntuone/controlpanel/tests/test_web_client.py", line 24, in <module>
    from ubuntu_sso.utils.webclient.tests import BaseMockWebServer
ImportError: No module named tests

I'll try using trunk version of ubuntu-sso-client.
Not sure whether it is a bug, as it doesn't affect ubuntuone-control-panel, however, new developers might encounter this issue too.

dobey (dobey) wrote :

You can install the python-ubuntu-sso-client.tests package, to get the test modules for sso which control-panel needs now.

Natalia Bidart (nataliabidart) wrote :

Hello Vadim,

Once again, thanks a lot for contributing to Ubuntu One. Since we did not heard back from you, we implemented this ourselves, so I will have to close this merge proposal.

Thanks again!
Please feel welcomed to keep contributing.

Regards, Natalia.

Unmerged revisions

260. By Vadim Rutkovsky on 2012-02-16

Close window on Ctrl+Q or Ctrl+W

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/controlpanel/gui/gtk/gui.py'
2--- ubuntuone/controlpanel/gui/gtk/gui.py 2012-02-06 21:02:54 +0000
3+++ ubuntuone/controlpanel/gui/gtk/gui.py 2012-02-16 05:12:18 +0000
4@@ -1622,6 +1622,14 @@
5 self.set_size_request(736, 525) # bug #683164
6
7 self.connect('delete-event', lambda w, e: gtk.main_quit())
8+
9+ self.accel_group = gtk.AccelGroup()
10+ self.add_accel_group(self.accel_group)
11+ self.accel_group.connect_group(ord('Q'), gtk.gdk.CONTROL_MASK, 0,
12+ lambda *etc: gtk.main_quit())
13+ self.accel_group.connect_group(ord('W'), gtk.gdk.CONTROL_MASK, 0,
14+ lambda *etc: gtk.main_quit())
15+
16 if alert:
17 self.draw_attention()
18 else:
19
20=== modified file 'ubuntuone/controlpanel/gui/qt/gui.py'
21--- ubuntuone/controlpanel/gui/qt/gui.py 2012-02-07 13:54:46 +0000
22+++ ubuntuone/controlpanel/gui/qt/gui.py 2012-02-16 05:12:18 +0000
23@@ -39,6 +39,15 @@
24 def _setup(self):
25 """Do some extra setupping for the UI."""
26 self.ui.control_panel.ui.signin.signinCanceled.connect(self.close)
27+ self.closeCtrlW = QtGui.QAction('Close', self)
28+ self.closeCtrlW.setShortcut('Ctrl+W')
29+ self.closeCtrlW.triggered.connect(self.close_callback)
30+ self.ui.centralwidget.addAction(self.closeCtrlW)
31+
32+ self.closeCtrlQ = QtGui.QAction('Close', self)
33+ self.closeCtrlQ.setShortcut('Ctrl+Q')
34+ self.closeCtrlQ.triggered.connect(self.close_callback)
35+ self.ui.centralwidget.addAction(self.closeCtrlQ)
36
37 # Invalid name "closeEvent"
38 # pylint: disable=C0103

Subscribers

People subscribed via source and target branches