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

workbench: add "File" / "Open repository" menu entry

removed the "Edit" menu for now

Changeset 9cb6ba747ab5

Parent 7efbeaed7346

by Adrian Buehlmann

Changes to 3 files · Browse files at 9cb6ba747ab5 Showing diff from parent 7efbeaed7346 Diff from another changeset...

 
41
42
43
44
 
 
45
46
47
 
55
56
57
58
59
60
61
 
101
102
103
104
 
 
 
105
106
107
 
301
302
303
 
 
 
 
 
 
 
 
 
 
 
 
 
304
305
306
 
380
381
382
383
 
 
41
42
43
 
44
45
46
47
48
 
56
57
58
 
59
60
61
 
101
102
103
 
104
105
106
107
108
109
 
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
 
395
396
397
 
398
@@ -41,7 +41,8 @@
 class Workbench(QtGui.QMainWindow, HgDialogMixin):   """hg repository viewer/browser application"""   _uifile = 'workbench.ui' - def __init__(self, repo, fromhead=None): + def __init__(self, ui, repo, fromhead=None): + self.ui = ui   self.repo = repo   self._closed_branch_supp = has_closed_branch_support(self.repo)   @@ -55,7 +56,6 @@
  HgDialogMixin.__init__(self)     self.setWindowTitle('TortoiseHg Workbench') - self.menubar.hide()     self.createActions()   self.createToolbars() @@ -101,7 +101,9 @@
  '''opens the given repo in a new tab'''   reponame = os.path.basename(repo.root)   self.repowidget = rw = RepoWidget(repo, fromhead) - self.repoTabsWidget.addTab(rw, reponame) + tw = self.repoTabsWidget + index = self.repoTabsWidget.addTab(rw, reponame) + tw.setCurrentIndex(index)     def setupBranchCombo(self, *args):   allbranches = sorted(self.repo.branchtags().items()) @@ -301,6 +303,19 @@
  self.clearStartAtRev)   self.addAction(self.actionClearStartAtRev)   + connect(self.actionOpen_repository, SIGNAL('triggered()'), + self.openRepository) + + def openRepository(self): + caption = "Select repository directory to open" + FD = QtGui.QFileDialog + path = FD.getExistingDirectory( + parent=self, caption=caption, + options=FD.ShowDirsOnly | FD.ReadOnly) + path = str(path) + repo = hg.repository(self.ui, path=path) + self.addRepoTab(repo) +   def startAtCurrentRev(self):   pass   @@ -380,4 +395,4 @@
  root = paths.find_root()   if root:   repo = hg.repository(ui, path=root) - return Workbench(repo) + return Workbench(ui, repo)
 
69
70
71
72
73
74
75
76
77
78
79
80
81
 
69
70
71
 
 
 
 
 
72
 
73
74
75
@@ -69,13 +69,7 @@
  <addaction name="actionAbout"/>   <addaction name="actionHelp"/>   </widget> - <widget class="QMenu" name="menu_Edit"> - <property name="title"> - <string>&amp;Edit</string> - </property> - </widget>   <addaction name="menuFile"/> - <addaction name="menu_Edit"/>   <addaction name="menuHelp"/>   </widget>   <widget class="QStatusBar" name="statusbar"/>
 
2
3
4
5
 
6
7
8
 
36
37
38
39
40
41
42
43
 
78
79
80
81
82
83
84
 
93
94
95
96
97
98
99
 
2
3
4
 
5
6
7
8
 
36
37
38
 
 
39
40
41
 
76
77
78
 
79
80
81
 
90
91
92
 
93
94
95
@@ -2,7 +2,7 @@
   # Form implementation generated from reading ui file 'C:\Users\adi\hgrepos\thg-qt\tortoisehg\hgqt\workbench.ui'  # -# Created: Tue May 11 15:17:48 2010 +# Created: Tue May 11 19:47:28 2010  # by: PyQt4 UI code generator 4.7.3  #  # WARNING! All changes made in this file will be lost! @@ -36,8 +36,6 @@
  self.menuFile.setObjectName("menuFile")   self.menuHelp = QtGui.QMenu(self.menubar)   self.menuHelp.setObjectName("menuHelp") - self.menu_Edit = QtGui.QMenu(self.menubar) - self.menu_Edit.setObjectName("menu_Edit")   MainWindow.setMenuBar(self.menubar)   self.statusbar = QtGui.QStatusBar(MainWindow)   self.statusbar.setObjectName("statusbar") @@ -78,7 +76,6 @@
  self.menuHelp.addAction(self.actionAbout)   self.menuHelp.addAction(self.actionHelp)   self.menubar.addAction(self.menuFile.menuAction()) - self.menubar.addAction(self.menu_Edit.menuAction())   self.menubar.addAction(self.menuHelp.menuAction())   self.toolBar_file.addAction(self.actionQuit)   self.toolBar_file.addAction(self.actionRefresh) @@ -93,7 +90,6 @@
  self.repoTabsWidget.setTabText(self.repoTabsWidget.indexOf(self.firstRepoTab), QtGui.QApplication.translate("MainWindow", "repo1", None, QtGui.QApplication.UnicodeUTF8))   self.menuFile.setTitle(QtGui.QApplication.translate("MainWindow", "&File", None, QtGui.QApplication.UnicodeUTF8))   self.menuHelp.setTitle(QtGui.QApplication.translate("MainWindow", "&Help", None, QtGui.QApplication.UnicodeUTF8)) - self.menu_Edit.setTitle(QtGui.QApplication.translate("MainWindow", "&Edit", None, QtGui.QApplication.UnicodeUTF8))   self.toolBar_file.setWindowTitle(QtGui.QApplication.translate("MainWindow", "File toolbar", None, QtGui.QApplication.UnicodeUTF8))   self.toolBar_edit.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Edit toolbar", None, QtGui.QApplication.UnicodeUTF8))   self.toolBar_treefilters.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Filter toolbar", None, QtGui.QApplication.UnicodeUTF8))