# HG changeset patch
# User Alain Leufroy <alain@leufroy.fr>
# Date 1371161058 -7200
# Fri Jun 14 00:04:18 2013 +0200
# Node ID 1631798f68b3758252d0718c912b530b09bda133
# Parent d0a1583639e5af6f28dc38f7366440943e67642e
[qt4] enable Ctrl-Q even if the window toolbar is hidden (closes #109856)
The ``Ctrl-Q`` keybinding is related to the action ``actionQuit``
which is added into the window toolbar only.
Adding it to the mainwindow let him active even if the
window toolbar is hidden.
.. admonition:: How to test
Start hgview, then hide the toolbar containing the quit button.
Now hitting ``Ctrl-Q`` shall close the window.
# User Alain Leufroy <alain@leufroy.fr>
# Date 1371161058 -7200
# Fri Jun 14 00:04:18 2013 +0200
# Node ID 1631798f68b3758252d0718c912b530b09bda133
# Parent d0a1583639e5af6f28dc38f7366440943e67642e
[qt4] enable Ctrl-Q even if the window toolbar is hidden (closes #109856)
The ``Ctrl-Q`` keybinding is related to the action ``actionQuit``
which is added into the window toolbar only.
Adding it to the mainwindow let him active even if the
window toolbar is hidden.
.. admonition:: How to test
Start hgview, then hide the toolbar containing the quit button.
Now hitting ``Ctrl-Q`` shall close the window.
@@ -160,10 +160,11 @@
1 self.find_toolbar.setMode('file') 2 self.filerevmodel.setFilename(self.filename) 3 4 def createActions(self): 5 self.actionClose.triggered.connect(self.close) 6 + self.addAction(self.actionClose) 7 self.actionReload.triggered.connect(self.reload) 8 self.actionClose.setIcon(geticon('quit')) 9 self.actionReload.setIcon(geticon('reload')) 10 11 self.actionDiffMode = QtGui.QAction('Diff mode', self)
@@ -307,10 +308,11 @@
12 self.tableView_revisions_left.setModel(self.filerevmodel) 13 self.tableView_revisions_right.setModel(self.filerevmodel) 14 15 def createActions(self): 16 self.actionClose.triggered.connect(self.close) 17 + self.addAction(self.actionClose) 18 self.actionReload.triggered.connect(self.reload) 19 self.actionClose.setIcon(geticon('quit')) 20 self.actionReload.setIcon(geticon('reload')) 21 22 self.actionNextDiff = QtGui.QAction(geticon('down'), 'Next diff', self)
@@ -65,10 +65,11 @@
23 self.fileSelected) 24 25 def createActions(self): 26 self.actionClose.triggered.connect(self.close) 27 self.actionClose.setIcon(geticon('quit')) 28 + self.addAction(self.actionClose) 29 30 def setupTextview(self): 31 lay = QtGui.QHBoxLayout(self.mainFrame) 32 lay.setSpacing(0) 33 lay.setContentsMargins(0,0,0,0)
@@ -273,10 +273,12 @@
34 if self.textview_header.rst_action is not None: 35 self.toolBar_rev.addAction(self.textview_header.rst_action) 36 37 self._handle_toolbar_visibility() 38 39 + self.addAction(self.actionQuit) 40 + 41 def _handle_toolbar_visibility(self): 42 """Initial value and event hooking 43 44 This function read toolbar related persistent settings from QT API. 45 It also setup hooks on visibility changes so to make the setting