Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1, 2.1.1, and 2.1.2

qtlib.openshell: set terminal window title to repo name

Changeset 708d95144c97

Parent eb1e0092d34f

by David Wilhelm

Changes to 7 files · Browse files at 708d95144c97 Showing diff from parent eb1e0092d34f Diff from another changeset...

 
306
307
308
309
 
310
311
312
 
306
307
308
 
309
310
311
312
@@ -306,7 +306,7 @@
  def terminal(self):   root = self._repo.wjoin(self.path)   if os.path.isdir(root): - qtlib.openshell(root) + qtlib.openshell(root, self.path)     def showEvent(self, event):   QWidget.showEvent(self, event)
 
134
135
136
137
 
138
139
140
141
 
142
143
 
144
145
146
 
155
156
157
158
 
159
160
 
161
162
163
 
134
135
136
 
137
138
139
140
141
142
143
 
144
145
146
147
 
156
157
158
 
159
160
 
161
162
163
164
@@ -134,13 +134,14 @@
  return False    _user_shell = None -def openshell(root): +def openshell(root, reponame):   global _user_shell   if _user_shell:   cwd = os.getcwd()   try: + shellcmd = _user_shell % {'reponame': reponame}   os.chdir(root) - QProcess.startDetached(_user_shell) + QProcess.startDetached(shellcmd)   finally:   os.chdir(cwd)   else: @@ -155,9 +156,9 @@
  if sys.platform == 'darwin':   return # Terminal.App does not support open-to-folder   elif os.name == 'nt': - _user_shell = 'cmd.exe' + _user_shell = 'cmd.exe /K title %(reponame)s'   else: - _user_shell = 'xterm' + _user_shell = 'xterm -T "%(reponame)s"'    # _styles maps from ui labels to effects  # _effects maps an effect to font style properties. We define a limited
 
427
428
429
430
431
 
 
432
433
434
 
427
428
429
 
 
430
431
432
433
434
@@ -427,8 +427,8 @@
  QDesktopServices.openUrl(QUrl.fromLocalFile(root))     def terminal(self): - root = self.selitem.internalPointer().rootpath() - qtlib.openshell(root) + repoitem = self.selitem.internalPointer() + qtlib.openshell(repoitem.rootpath(), repoitem.shortname())     def addNewRepo(self):   'menu action handler for adding a new repository'
 
409
410
411
412
 
413
414
415
 
409
410
411
 
412
413
414
415
@@ -409,7 +409,7 @@
  def terminal(self):   root = self.repo.wjoin(self.filelist.currentFile())   if os.path.isdir(root): - qtlib.openshell(root) + qtlib.openshell(root, self.filelist.currentFile())     #@pyqtSlot(QModelIndex)   def onDoubleClick(self, index):
 
370
371
372
373
 
 
 
 
 
 
 
374
375
376
 
370
371
372
 
373
374
375
376
377
378
379
380
381
382
@@ -370,7 +370,13 @@
  'See <a href="%s">OpenAtLine</a>'   % 'http://bitbucket.org/tortoisehg/thg/wiki/OpenAtLine')),   _fi(_('Shell'), 'tortoisehg.shell', genEditCombo, - _('Specify your preferred terminal shell application'), + _('Specify the command to launch your preferred terminal shell ' + 'application. If the value includes the string %(reponame)s, the ' + 'name of the repository will be substituted in place of ' + '%(reponame)s. (restart needed)<br>' + 'Default, Windows: cmd.exe /K title %(reponame)s<br>' + 'Default, OS X: not set<br>' + 'Default, other: xterm -T "%(reponame)s"'),   globalonly=True),   _fi(_('Immediate Operations'), 'tortoisehg.immediate', genEditCombo,   _('Space separated list of shell operations you would like '
 
532
533
534
535
 
536
537
538
 
532
533
534
 
535
536
537
538
@@ -532,7 +532,7 @@
  qtlib.InfoMsgBox(_('Repository not local'),   _('A terminal shell cannot be opened for remote'))   return - qtlib.openshell(folder) + qtlib.openshell(folder, 'repo ' + folder)     def removeurl(self):   if qtlib.QuestionMsgBox(_('Confirm path delete'),
 
863
864
865
866
 
867
868
869
 
863
864
865
 
866
867
868
869
@@ -863,7 +863,7 @@
  def terminal(self):   w = self.repoTabsWidget.currentWidget()   if w: - qtlib.openshell(w.repo.root) + qtlib.openshell(w.repo.root, w.repo.displayname)     def editSettings(self):   tw = self.repoTabsWidget