Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

commit: add MQ panel to the left of TextView

Changeset f9d1d3278058

Parent bb30b446a8e8

by Yuki KODAMA

Changes to one file · Browse files at f9d1d3278058 Showing diff from parent bb30b446a8e8 Diff from another changeset...

 
15
16
17
18
 
19
20
21
22
23
24
25
 
26
27
28
 
139
140
141
 
142
143
144
 
305
306
307
 
 
308
309
310
 
398
399
400
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
402
403
 
518
519
520
 
 
 
521
522
523
 
15
16
17
 
18
19
20
21
22
23
24
 
25
26
27
28
 
139
140
141
142
143
144
145
 
306
307
308
309
310
311
312
313
 
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
 
551
552
553
554
555
556
557
558
559
@@ -15,14 +15,14 @@
 import cStringIO  import time   -from mercurial import hg, util, patch, cmdutil +from mercurial import hg, util, patch, cmdutil, extensions    from tortoisehg.util.i18n import _  from tortoisehg.util import shlib, hglib    from tortoisehg.hgtk.status import GStatus, FM_STATUS, FM_CHECKED  from tortoisehg.hgtk.status import FM_PATH, FM_PATH_UTF8 -from tortoisehg.hgtk import csinfo, gtklib, thgconfig, gdialog, hgcmd +from tortoisehg.hgtk import csinfo, gtklib, thgconfig, gdialog, hgcmd, thgmq    class BranchOperationDialog(gtk.Dialog):   def __init__(self, branch, close, repo): @@ -139,6 +139,7 @@
  self.notify_func = None   self.patch_text = None   self.runner = hgcmd.CmdRunner() + self.mqloaded = bool(extensions.find('mq'))     def get_help_url(self):   return 'commit.html' @@ -305,6 +306,8 @@
  if self.qnew:   self.qnew_name.grab_focus() # set focus back   self.qnew_name.set_position(-1) + if hasattr(self, 'mqwidget'): + self.mqwidget.refresh()     def get_body(self):   self.connect('delete-event', self.delete) @@ -398,6 +401,36 @@
  scroller.add(self.text)   gtklib.addspellcheck(self.text, self.repo.ui)   + # MQ panel + if self.mqloaded: + self.mqwidget = thgmq.MQWidget(self.repo, accelgroup, + self.tooltips) + self.mqwidget.connect('repo-invalidated', self.repo_invalidated) + + def wrapframe(widget): + frame = gtk.Frame() + frame.set_shadow_type(gtk.SHADOW_ETCHED_IN) + frame.add(widget) + return frame + self.mqpaned = gtk.HPaned() + self.mqpaned.add1(wrapframe(self.mqwidget)) + self.mqpaned.add2(wrapframe(midpane)) + + # register signal handler + def notify(paned, gparam): + if not hasattr(self, 'mqtb'): + return + pos = paned.get_position() + if self.cmd_get_active('mq'): + if pos < 140: + paned.set_position(140) + else: + if pos != 0: + paned.set_position(0) + self.mqpaned.connect('notify::position', notify) + + midpane = self.mqpaned +   botbox = gtk.VBox()   botbox.pack_start(status_body)   @@ -518,6 +551,9 @@
  self.closebranch = True   self.refresh_branchop()   + def repo_invalidated(self, mqwidget): + self.reload_status() +   def update_commit_button(self):   label = _('Commit')   tooltip = _('commit')