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

quickop: it lives!

Changeset 9a21b3a07882

Parent c183946c6e51

by Steve Borho

Changes to one file · Browse files at 9a21b3a07882 Showing diff from parent c183946c6e51 Diff from another changeset...

 
14
15
16
17
 
18
19
20
21
22
23
24
25
26
27
28
29
 
63
64
65
 
66
67
68
 
91
92
93
94
95
96
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
99
100
 
14
15
16
 
17
18
19
20
21
22
23
 
 
 
24
25
26
 
60
61
62
63
64
65
66
 
89
90
91
 
 
 
 
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
@@ -14,16 +14,13 @@
 from tortoisehg.util.i18n import _  from tortoisehg.util import hglib, shlib, paths   -from tortoisehg.hgqt import qtlib, status +from tortoisehg.hgqt import qtlib, status, cmdui    LABELS = { 'add': (_('Select files to add'), _('Add')),   'forget': (_('Select files to forget'), _('Forget')),   'revert': (_('Select files to revert'), _('Revert')),   'remove': (_('Select files to remove'), _('Remove')),}   -# Technical Debt -# command running functionality -  class QuickOpDialog(QtGui.QDialog):   """ Dialog for performing quick dirstate operations """   def __init__(self, command, pats, parent=None): @@ -63,6 +60,7 @@
  if self.command == 'revert':   ## no backup checkbox   chk = QtGui.QCheckBox(_('Do not save backup files (*.orig)')) + self.chk = chk   layout.addWidget(chk)     BB = QtGui.QDialogButtonBox @@ -91,10 +89,25 @@
  return super(QtGui.QDialog, self).keyPressEvent(event)     def accept(self): - s = QtCore.QSettings() - s.setValue('quickop/state', self.stwidget.saveState()) - s.setValue('quickop/geom', self.saveGeometry()) - QtGui.QDialog.accept(self) + cmdline = [self.command] + if hasattr(self, 'chk') and self.chk.isChecked(): + cmdline.append('--no-backup') + files = self.stwidget.getChecked() + if files: + cmdline.extend(files) + else: + qtlib.WarningMsgBox(_('No files selected'), + _('No operation to perform'), + parent=self) + return + cmd = cmdui.Dialog(cmdline, parent=self) + cmd.setWindowTitle('hg ' + self.command) + cmd.show_output(False) + if cmd.exec_(): + s = QtCore.QSettings() + s.setValue('quickop/state', self.stwidget.saveState()) + s.setValue('quickop/geom', self.saveGeometry()) + QtGui.QDialog.accept(self)     def reject(self):   s = QtCore.QSettings()