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

Proposed by Vadim Rutkovsky
Status: Rejected
Rejected by: Natalia Bidart
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 Needs Fixing
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.
Revision history for this message
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
Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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

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
=== modified file 'ubuntuone/controlpanel/gui/gtk/gui.py'
--- ubuntuone/controlpanel/gui/gtk/gui.py 2012-02-06 21:02:54 +0000
+++ ubuntuone/controlpanel/gui/gtk/gui.py 2012-02-16 05:12:18 +0000
@@ -1622,6 +1622,14 @@
1622 self.set_size_request(736, 525) # bug #6831641622 self.set_size_request(736, 525) # bug #683164
16231623
1624 self.connect('delete-event', lambda w, e: gtk.main_quit())1624 self.connect('delete-event', lambda w, e: gtk.main_quit())
1625
1626 self.accel_group = gtk.AccelGroup()
1627 self.add_accel_group(self.accel_group)
1628 self.accel_group.connect_group(ord('Q'), gtk.gdk.CONTROL_MASK, 0,
1629 lambda *etc: gtk.main_quit())
1630 self.accel_group.connect_group(ord('W'), gtk.gdk.CONTROL_MASK, 0,
1631 lambda *etc: gtk.main_quit())
1632
1625 if alert:1633 if alert:
1626 self.draw_attention()1634 self.draw_attention()
1627 else:1635 else:
16281636
=== modified file 'ubuntuone/controlpanel/gui/qt/gui.py'
--- ubuntuone/controlpanel/gui/qt/gui.py 2012-02-07 13:54:46 +0000
+++ ubuntuone/controlpanel/gui/qt/gui.py 2012-02-16 05:12:18 +0000
@@ -39,6 +39,15 @@
39 def _setup(self):39 def _setup(self):
40 """Do some extra setupping for the UI."""40 """Do some extra setupping for the UI."""
41 self.ui.control_panel.ui.signin.signinCanceled.connect(self.close)41 self.ui.control_panel.ui.signin.signinCanceled.connect(self.close)
42 self.closeCtrlW = QtGui.QAction('Close', self)
43 self.closeCtrlW.setShortcut('Ctrl+W')
44 self.closeCtrlW.triggered.connect(self.close_callback)
45 self.ui.centralwidget.addAction(self.closeCtrlW)
46
47 self.closeCtrlQ = QtGui.QAction('Close', self)
48 self.closeCtrlQ.setShortcut('Ctrl+Q')
49 self.closeCtrlQ.triggered.connect(self.close_callback)
50 self.ui.centralwidget.addAction(self.closeCtrlQ)
4251
43 # Invalid name "closeEvent"52 # Invalid name "closeEvent"
44 # pylint: disable=C010353 # pylint: disable=C0103

Subscribers

People subscribed via source and target branches