Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0.3, 2.0.4, and 2.0.5

stable filelistview: Add handler for subrepository double click

When double clicking on a subrepository item, the corresponding item will be
open, or a warning message will be shown if the subrepository is not found in
the working directory.

Changeset e882f630e4c3

Parent 8e16e0f59ddd

by Angel Ezquerra

Changes to one file · Browse files at e882f630e4c3 Showing diff from parent 8e16e0f59ddd Diff from another changeset...

 
48
49
50
51
 
52
53
54
 
214
215
216
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
218
219
 
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
 
48
49
50
 
51
52
53
54
 
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
 
277
278
279
 
 
 
 
 
 
 
 
 
280
281
282
@@ -48,7 +48,7 @@
    self.createActions()   - self.doubleClicked.connect(self.vdiff) + self.doubleClicked.connect(self.doubleClickHandler)   self._diff_dialogs = {}   self._nav_dialogs = {}   @@ -214,6 +214,22 @@
  dlg.raise_()   dlg.activateWindow()   + def opensubrepo(self): + path = os.path.join(self.model().repo.root, self.currentFile()) + if os.path.isdir(path): + self.linkActivated.emit(u'subrepo:'+hglib.tounicode(path)) + else: + QMessageBox.warning(self, + _("Cannot open subrepository"), + _("The selected subrepository does not exist on the working directory")) + + def doubleClickHandler(self): + itemissubrepo = (self.model().dataFromIndex(self.currentIndex())['status'] == 'S') + if itemissubrepo: + self.opensubrepo() + else: + self.vdiff() +   def createActions(self):   self.actionShowAllMerge = QAction(_('Show All'), self)   self.actionShowAllMerge.setToolTip( @@ -261,15 +277,6 @@
  self._actions[name] = act   self.addAction(act)   - def opensubrepo(self): - path = os.path.join(self.model().repo.root, self.currentFile()) - if os.path.isdir(path): - self.linkActivated.emit(u'subrepo:'+hglib.tounicode(path)) - else: - QMessageBox.warning(self, - _("Cannot open subrepository"), - _("The selected subrepository does not exist on the working directory")) -   def contextMenuEvent(self, event):   itemissubrepo = (self.model().dataFromIndex(self.currentIndex())['status'] == 'S')