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

commit: implement context menu for message pane

Changeset fdda762c6b15

Parent 0c7e65d3597b

by Steve Borho

Changes to one file · Browse files at fdda762c6b15 Showing diff from parent 0c7e65d3597b Diff from another changeset...

 
20
21
22
23
 
24
25
26
 
116
117
118
 
 
 
 
119
120
121
 
215
216
217
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
219
220
 
20
21
22
 
23
24
25
26
 
116
117
118
119
120
121
122
123
124
125
 
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
@@ -20,7 +20,7 @@
 from tortoisehg.hgqt import qtlib, status, cmdui, branchop    # Technical Debt for CommitWidget -# auto-wrap / paste filenames +# auto-wrap  # qrefresh support  # refresh parent changeset descriptions after refresh  # threaded / wrapped commit (need a CmdRunner equivalent) @@ -116,6 +116,10 @@
  vbox.addLayout(hbox, 0)   msgte = QPlainTextEdit()   msgte.textChanged.connect(self.msgChanged) + msgte.setContextMenuPolicy(Qt.CustomContextMenu) + self.connect(msgte, + SIGNAL('customContextMenuRequested(const QPoint &)'), + self.customContextMenuRequested)   vbox.addWidget(msgte, 1)   upperframe = QFrame()   sp = SP(SP.Expanding, SP.Expanding) @@ -215,6 +219,26 @@
  # Replace selection with new sentence   cursor.insertText(reflow)   + def customContextMenuRequested(self, point): + cursor = self.msgte.cursorForPosition(point) + point = self.msgte.mapToGlobal(point) + + def paste(): + files = self.stwidget.getChecked() + cursor.insertText(', '.join(files)) + def settings(): + from tortoisehg.hgqt.settings import SettingsDialog + dlg = SettingsDialog(True, focus='tortoisehg.summarylen') + return dlg.exec_() + + menu = self.msgte.createStandardContextMenu() + for name, func in [(_('Paste &Filenames'), paste), + (_('C&onfigure Format'), settings)]: + action = menu.addAction(name) + action.wrapper = lambda f=func: f() + self.connect(action, SIGNAL('triggered()'), action.wrapper) + return menu.exec_(point) +   def getLengths(self):   repo = self.stwidget.repo   try: