Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

workbench: rewire back and forward buttons

needs new back and forward actions in workbench

TODO: enable/disable back and forward buttons

Changeset 61ff6bd4fe8e

Parent 691cf090e7f1

by Adrian Buehlmann

Changes to 4 files · Browse files at 61ff6bd4fe8e Showing diff from parent 691cf090e7f1 Diff from another changeset...

 
186
187
188
 
 
 
 
 
 
189
190
191
 
186
187
188
189
190
191
192
193
194
195
196
197
@@ -186,6 +186,12 @@
  self.disab_shortcuts.append(self.actionActivateFile)   self.disab_shortcuts.append(self.actionActivateRev)   + def back(self): + self.repoview.back() + + def forward(self): + self.repoview.forward() +   def setMode(self, mode):   self.fileview.setMode(mode)  
 
186
187
188
189
190
191
192
193
194
195
 
248
249
250
251
252
253
254
255
256
 
 
 
 
 
257
258
259
 
351
352
353
 
 
 
 
 
 
 
 
 
 
354
355
356
 
186
187
188
 
 
 
 
189
190
191
 
244
245
246
 
 
 
 
 
 
247
248
249
250
251
252
253
254
 
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
@@ -186,10 +186,6 @@
    self.attachQuickBar(tb)   - # navigation toolbar - #self.toolBar_edit.addAction(self.repoview._actions['back']) - #self.toolBar_edit.addAction(self.repoview._actions['forward']) -   findaction = self.find_toolbar.toggleViewAction()   findaction.setIcon(geticon('find'))   self.toolBar_edit.addAction(findaction) @@ -248,12 +244,11 @@
    def createActions(self):   # main window actions (from .ui file) - connect(self.actionRefresh, SIGNAL('triggered()'), - self.reload) - connect(self.actionAbout, SIGNAL('triggered()'), - self.on_about) - connect(self.actionQuit, SIGNAL('triggered()'), - self.close) + connect(self.actionRefresh, SIGNAL('triggered()'), self.reload) + connect(self.actionAbout, SIGNAL('triggered()'), self.on_about) + connect(self.actionQuit, SIGNAL('triggered()'), self.close) + connect(self.actionBack, SIGNAL('triggered()'), self.back) + connect(self.actionForward, SIGNAL('triggered()'), self.forward)   self.actionQuit.setIcon(geticon('quit'))   self.actionRefresh.setIcon(geticon('reload'))   @@ -351,6 +346,16 @@
  connect(self.actionOpen_repository, SIGNAL('triggered()'),   self.openRepository)   + def back(self): + w = self.repoTabsWidget.currentWidget() + if w: + w.back() + + def forward(self): + w = self.repoTabsWidget.currentWidget() + if w: + w.forward() +   def openRepository(self):   caption = _('Select repository directory to open')   FD = QtGui.QFileDialog
 
102
103
104
 
 
105
106
107
 
185
186
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
189
190
 
102
103
104
105
106
107
108
109
 
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
@@ -102,6 +102,8 @@
  <attribute name="toolBarBreak">   <bool>false</bool>   </attribute> + <addaction name="actionBack"/> + <addaction name="actionForward"/>   </widget>   <widget class="QToolBar" name="toolBar_treefilters">   <property name="enabled"> @@ -185,6 +187,24 @@
  <string>Help</string>   </property>   </action> + <action name="actionBack"> + <property name="icon"> + <iconset resource="workbench.qrc"> + <normaloff>:/icons/back.svg</normaloff>:/icons/back.svg</iconset> + </property> + <property name="text"> + <string>Back</string> + </property> + </action> + <action name="actionForward"> + <property name="icon"> + <iconset resource="workbench.qrc"> + <normaloff>:/icons/forward.svg</normaloff>:/icons/forward.svg</iconset> + </property> + <property name="text"> + <string>Forward</string> + </property> + </action>   </widget>   <resources>   <include location="workbench.qrc"/>
 
2
3
4
5
 
6
7
8
 
73
74
75
 
 
 
 
 
 
 
 
 
 
76
77
78
 
82
83
84
 
 
85
86
87
 
108
109
110
 
 
111
112
 
2
3
4
 
5
6
7
8
 
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
 
92
93
94
95
96
97
98
99
 
120
121
122
123
124
125
126
@@ -2,7 +2,7 @@
   # Form implementation generated from reading ui file 'C:\Users\adi\hgrepos\thg-qt\tortoisehg\hgqt\workbench.ui'  # -# Created: Wed May 12 00:19:14 2010 +# Created: Sat May 15 02:22:38 2010  # by: PyQt4 UI code generator 4.7.3  #  # WARNING! All changes made in this file will be lost! @@ -73,6 +73,16 @@
  self.actionDisplayAllBranches.setObjectName("actionDisplayAllBranches")   self.actionHelp = QtGui.QAction(MainWindow)   self.actionHelp.setObjectName("actionHelp") + self.actionBack = QtGui.QAction(MainWindow) + icon1 = QtGui.QIcon() + icon1.addPixmap(QtGui.QPixmap(":/icons/back.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.actionBack.setIcon(icon1) + self.actionBack.setObjectName("actionBack") + self.actionForward = QtGui.QAction(MainWindow) + icon2 = QtGui.QIcon() + icon2.addPixmap(QtGui.QPixmap(":/icons/forward.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.actionForward.setIcon(icon2) + self.actionForward.setObjectName("actionForward")   self.menuFile.addAction(self.actionOpen_repository)   self.menuFile.addAction(self.actionRefresh)   self.menuFile.addSeparator() @@ -82,6 +92,8 @@
  self.menubar.addAction(self.menuFile.menuAction())   self.menubar.addAction(self.menuHelp.menuAction())   self.toolBar_file.addAction(self.actionRefresh) + self.toolBar_edit.addAction(self.actionBack) + self.toolBar_edit.addAction(self.actionForward)   self.toolBar_help.addAction(self.actionHelp)     self.retranslateUi(MainWindow) @@ -108,5 +120,7 @@
  self.actionAbout.setText(QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8))   self.actionDisplayAllBranches.setText(QtGui.QApplication.translate("MainWindow", "displayAllBranches", None, QtGui.QApplication.UnicodeUTF8))   self.actionHelp.setText(QtGui.QApplication.translate("MainWindow", "Help", None, QtGui.QApplication.UnicodeUTF8)) + self.actionBack.setText(QtGui.QApplication.translate("MainWindow", "Back", None, QtGui.QApplication.UnicodeUTF8)) + self.actionForward.setText(QtGui.QApplication.translate("MainWindow", "Forward", None, QtGui.QApplication.UnicodeUTF8))    import workbench_rc