# HG changeset patch
# User Adrian Buehlmann <adr...@cadifra.com>
# Date 1252153721 -7200
# Node ID 327cc8b960826d62bbe10c3abf68e37b3545dd17
# Parent  af6783dea990d29938756f997301b31132b1b0d8
thgmq: put toolbar on top, using horizontal layout

This frees up the space that was used by the lengthy vertical
toolbar on the left (we have already done the same change for
the "load more" and "load all" buttons in the history dialog).

The buttons in the toolbar on top use the left/right idom
for "backwards" / "forward", which is known by left-to-right
written languages like English.

The buttons are layed out like this:

   |<      <      >       >|
   [1]    [2]    [3]     [4]

using the follwoing tooltip texts:

  [1] "Unapply all patches"
  [2] "Unapply last patch"
  [3] "Apply next patch"
  [4] "Apply all patches"

For the case of using the MQWidget in the history dialog (which
currently is the only one where it is used):

The right arrows nicley point towards the changelist pane, to the
right of the queue pane.

When a patch is applied, it effectively "goes to the changelist pane
on the right". When a patch is unapplied, it effectivley is "taken
away from the changelist pane, putting it back to the qeue pane on
the left".

diff --git a/hggtk/thgmq.py b/hggtk/thgmq.py
--- a/hggtk/thgmq.py
+++ b/hggtk/thgmq.py
@@ -25,7 +25,7 @@ MQ_SUMMARY = 3
 INDEX_SEPARATOR = -1
 INDEX_QPARENT   = -2
 
-class MQWidget(gtk.HBox):
+class MQWidget(gtk.VBox):
 
     __gproperties__ = {
         'index-column-visible': (gobject.TYPE_BOOLEAN,
@@ -66,19 +66,48 @@ class MQWidget(gtk.HBox):
     }
 
     def __init__(self, repo, accelgroup=None):
-        gtk.HBox.__init__(self)
+        gtk.VBox.__init__(self)
 
         self.repo = repo
         self.mqloaded = hasattr(repo, 'mq')
 
-        # side toolbar
+        # top toolbar
         toolbar = gtk.Toolbar()
         toolbar.set_style(gtk.TOOLBAR_ICONS)
-        toolbar.set_orientation(gtk.ORIENTATION_VERTICAL)
+        toolbar.set_orientation(gtk.ORIENTATION_HORIZONTAL)
         toolbar.set_property('icon-size', gtk.ICON_SIZE_SMALL_TOOLBAR)
 
         self.btn = {}
 
+        popallbtn = gtk.ToolButton(gtk.STOCK_GOTO_FIRST)
+        popallbtn.set_tooltip_text(_('Unapply all patches'))
+        popallbtn.connect('clicked', self.popall_clicked)
+        toolbar.insert(popallbtn, -1)
+        self.btn['popall'] = popallbtn
+
+        popbtn = gtk.ToolButton(gtk.STOCK_GO_BACK)
+        popbtn.set_tooltip_text(_('Unapply last patch'))
+        popbtn.connect('clicked', self.pop_clicked)
+        toolbar.insert(popbtn, -1)
+        self.btn['pop'] = popbtn
+
+        pushbtn = gtk.ToolButton(gtk.STOCK_GO_FORWARD)
+        pushbtn.set_tooltip_text(_('Apply next patch'))
+        pushbtn.connect('clicked', self.push_clicked)
+        toolbar.insert(pushbtn, -1)
+        self.btn['push'] = pushbtn
+
+        pushallbtn = gtk.ToolButton(gtk.STOCK_GOTO_LAST)
+        pushallbtn.set_tooltip_text(_('Apply all patches'))
+        pushallbtn.connect('clicked', self.pushall_clicked)
+        toolbar.insert(pushallbtn, -1)
+        self.btn['pushall'] = pushallbtn
+
+        sep = gtk.SeparatorToolItem()
+        sep.set_draw(False)
+        sep.set_expand(True)
+        toolbar.insert(sep, -1)
+
         menubtn = gtk.MenuToolButton('')
         menubtn.set_menu(self.create_view_menu())
         toolbar.insert(menubtn, -1)
@@ -89,34 +118,9 @@ class MQWidget(gtk.HBox):
             menubtn.child.get_children()[0].hide()
         gobject.idle_add(after_init)
 
-        popallbtn = gtk.ToolButton(gtk.STOCK_GOTO_TOP)
-        popallbtn.connect('clicked', self.popall_clicked)
-        toolbar.insert(popallbtn, -1)
-        self.btn['popall'] = popallbtn
-
-        popbtn = gtk.ToolButton(gtk.STOCK_GO_UP)
-        popbtn.connect('clicked', self.pop_clicked)
-        toolbar.insert(popbtn, -1)
-        self.btn['pop'] = popbtn
-
-        sep = gtk.SeparatorToolItem()
-        sep.set_draw(False)
-        sep.set_expand(True)
-        toolbar.insert(sep, -1)
-
-        pushbtn = gtk.ToolButton(gtk.STOCK_GO_DOWN)
-        pushbtn.connect('clicked', self.push_clicked)
-        toolbar.insert(pushbtn, -1)
-        self.btn['push'] = pushbtn
-
-        pushallbtn = gtk.ToolButton(gtk.STOCK_GOTO_BOTTOM)
-        pushallbtn.connect('clicked', self.pushall_clicked)
-        toolbar.insert(pushallbtn, -1)
-        self.btn['pushall'] = pushallbtn
 
         self.pack_start(toolbar, False, False)
 
-        # right box
         mainbox = gtk.VBox()
         self.pack_start(mainbox, True, True)
 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to