Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

stable hgemail: provide Select All and Select None buttons

Changeset d8c664df3faf

Parent aed4b26a4818

by David Golub

Changes to 2 files · Browse files at d8c664df3faf Showing diff from parent aed4b26a4818 Diff from another changeset...

 
354
355
356
 
 
 
 
 
 
 
 
357
358
359
 
437
438
439
 
 
 
 
 
 
 
 
 
 
 
 
 
440
441
442
 
354
355
356
357
358
359
360
361
362
363
364
365
366
367
 
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
@@ -354,6 +354,14 @@
  self._repo.invalidateui() # force reloading config immediately   self._filldefaults()   + @pyqtSlot() + def on_selectall_button_clicked(self): + self._changesets.selectAll() + + @pyqtSlot() + def on_selectnone_button_clicked(self): + self._changesets.selectNone() +  class _ChangesetsModel(QAbstractTableModel): # TODO: use component of log viewer?   _COLUMNS = [('rev', lambda ctx: '%d:%s' % (ctx.rev(), ctx)),   ('author', lambda ctx: hglib.username(ctx.user())), @@ -437,6 +445,19 @@
    return QVariant(self._COLUMNS[section][0].capitalize())   + def selectAll(self): + self._selectedrevs = set(self._revs) + self.updateAll() + + def selectNone(self): + self._selectedrevs = set() + self.updateAll() + + def updateAll(self): + first = self.createIndex(0, 0) + last = self.createIndex(len(self._revs) - 1, 0) + self.dataChanged.emit(first, last) +  def run(ui, *revs, **opts):   # TODO: same options as patchbomb   if opts.get('rev'):
 
7
8
9
10
 
11
12
13
 
357
358
359
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
361
362
 
7
8
9
 
10
11
12
13
 
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
@@ -7,7 +7,7 @@
  <x>0</x>   <y>0</y>   <width>660</width> - <height>506</height> + <height>519</height>   </rect>   </property>   <property name="windowTitle"> @@ -357,6 +357,37 @@
  </property>   </widget>   </item> + <item> + <layout class="QHBoxLayout" name="selectallnone_layout"> + <item> + <widget class="QPushButton" name="selectall_button"> + <property name="text"> + <string>Select &amp;All</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="selectnone_button"> + <property name="text"> + <string>Select &amp;None</string> + </property> + </widget> + </item> + <item> + <spacer name="selectallnone_spacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item>   </layout>   </widget>   </widget>