Merge lp:~jelmer/bzr-gtk/vertical-layout into lp:bzr-gtk/gtk2

Proposed by Jelmer Vernooij
Status: Superseded
Proposed branch: lp:~jelmer/bzr-gtk/vertical-layout
Merge into: lp:bzr-gtk/gtk2
Diff against target: 161 lines (+56/-13)
3 files modified
NEWS (+5/-0)
branchview/treeview.py (+4/-4)
viz/branchwin.py (+47/-9)
To merge this branch: bzr merge lp:~jelmer/bzr-gtk/vertical-layout
Reviewer Review Type Date Requested Status
John A Meinel Needs Information
Review via email: mp+50302@code.launchpad.net

Description of the change

Patch from Ximin Luo to allow using bzr viz in "widescreen mode" where the
revision details are shown next to the graph.

https://bugs.launchpad.net/bzr-gtk/+bug/649273/+attachment/1645811/+files/bzr-gtk_vertical.png

To post a comment you must log in.
lp:~jelmer/bzr-gtk/vertical-layout updated
712. By Jelmer Vernooij

Add lock dialog. (Daniel Schierbeck)

713. By Jelmer Vernooij

Remove some unused imports, fix some formatting.

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2/18/2011 5:01 AM, Jelmer Vernooij wrote:
> Jelmer Vernooij has proposed merging lp:~jelmer/bzr-gtk/vertical-layout into lp:bzr-gtk.
>
> Requested reviews:
> Bazaar GTK maintainers (bzr-gtk)
> Related bugs:
> #271822 bad characters in branchview/treemodel.py
> https://bugs.launchpad.net/bugs/271822
> #649273 add vertical layout option
> https://bugs.launchpad.net/bugs/649273
>
> For more details, see:
> https://code.launchpad.net/~jelmer/bzr-gtk/vertical-layout/+merge/50302
>
> Patch from Ximin Luo to allow using bzr viz in "widescreen mode" where the
> revision details are shown next to the graph.
>
> https://bugs.launchpad.net/bzr-gtk/+bug/649273/+attachment/1645811/+files/bzr-gtk_vertical.png

There seem to be some UTF-8 issues with the patch:

- -__copyright__ = "Copyright © 2005 Canonical Ltd."
+__copyright__ = "Copyright © 2005 Canonical Ltd."
 __author__ = "Gary van der Merwe <email address hidden>"

That looks like someone opened a UTF-8 file as iso-8859-1 and then saved
it as UTF-8 again.

This also seems to carry a lot more changes than just that. Since it
seems to be adding credits.pickle, and changes to HACKING, etc.

 review: needsinfo

John
=:_>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1enIoACgkQJdeBCYSNAAN1dwCgjNBs6UCnPuJAcdHu3x/Ijt23
XoMAn0pdjy5vOZDc7V/2Vu67IzwAmf+N
=68le
-----END PGP SIGNATURE-----

review: Needs Information
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Garr, this is a rebase gone wrong. Sorry.

lp:~jelmer/bzr-gtk/vertical-layout updated
714. By Ximin Luo

Add option to use 'bzr viz' with a vertical layout.

715. By Jelmer Vernooij

Merge trunk.

716. By Jelmer Vernooij

Merge trunk.

717. By Jelmer Vernooij

Fix some formatting.

718. By Jelmer Vernooij

Construct model early.

719. By Jelmer Vernooij

Fix signal handling.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2011-02-18 13:16:37 +0000
3+++ NEWS 2011-02-19 12:30:25 +0000
4@@ -20,6 +20,11 @@
5
6 * Add lock dialog. (Daniel Schierbeck, #93652)
7
8+ FEATURES
9+
10+ * Add option to use "bzr viz" with a vertical layout.
11+ (Ximin Luo, #649273)
12+
13 0.99.1 2010-08-26
14
15 BUG FIXES
16
17=== modified file 'branchview/treeview.py'
18--- branchview/treeview.py 2011-02-18 13:16:37 +0000
19+++ branchview/treeview.py 2011-02-19 12:30:25 +0000
20@@ -359,7 +359,7 @@
21 cell.set_property("width-chars", 15)
22 cell.set_property("ellipsize", pango.ELLIPSIZE_END)
23 self.revno_column = gtk.TreeViewColumn("Revision No")
24- self.revno_column.set_resizable(False)
25+ self.revno_column.set_resizable(True)
26 self.revno_column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
27 self.revno_column.set_fixed_width(cell.get_size(self.treeview)[2])
28 self.revno_column.pack_start(cell, expand=True)
29@@ -368,7 +368,7 @@
30
31 self.graph_cell = CellRendererGraph()
32 self.graph_column = gtk.TreeViewColumn()
33- self.graph_column.set_resizable(False)
34+ self.graph_column.set_resizable(True)
35 self.graph_column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
36 self.graph_column.pack_start(self.graph_cell, expand=True)
37 self.graph_column.add_attribute(self.graph_cell, "node", treemodel.NODE)
38@@ -381,7 +381,7 @@
39 cell.set_property("width-chars", 65)
40 cell.set_property("ellipsize", pango.ELLIPSIZE_END)
41 self.summary_column = gtk.TreeViewColumn("Summary")
42- self.summary_column.set_resizable(False)
43+ self.summary_column.set_resizable(True)
44 self.summary_column.set_expand(True)
45 self.summary_column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
46 self.summary_column.set_fixed_width(cell.get_size(self.treeview)[2])
47@@ -405,7 +405,7 @@
48 cell.set_property("ellipsize", pango.ELLIPSIZE_END)
49 self.date_column = gtk.TreeViewColumn("Date")
50 self.date_column.set_visible(False)
51- self.date_column.set_resizable(False)
52+ self.date_column.set_resizable(True)
53 self.date_column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
54 self.date_column.set_fixed_width(130)
55 self.date_column.pack_start(cell, expand=True)
56
57=== modified file 'viz/branchwin.py'
58--- viz/branchwin.py 2011-02-18 13:01:03 +0000
59+++ viz/branchwin.py 2011-02-19 12:30:25 +0000
60@@ -98,7 +98,7 @@
61 self.refresh_action.connect("activate", self._refresh_clicked)
62 self.refresh_action.connect_accelerator()
63
64- self.construct()
65+ self.vbox = self.construct()
66
67 def _save_size_on_destroy(self, widget, config_name):
68 """Creates a hook that saves the size of widget to config option
69@@ -117,18 +117,15 @@
70 vbox = gtk.VBox(spacing=0)
71 self.add(vbox)
72
73- self.paned = gtk.VPaned()
74- self.paned.pack1(self.construct_top(), resize=False, shrink=True)
75- self.paned.pack2(self.construct_bottom(), resize=True, shrink=False)
76- self.paned.show()
77-
78+ # order is important here
79+ paned = self.construct_paned()
80 nav = self.construct_navigation()
81 menubar = self.construct_menubar()
82+
83 vbox.pack_start(menubar, expand=False, fill=True)
84 vbox.pack_start(nav, expand=False, fill=True)
85-
86- vbox.pack_start(self.paned, expand=True, fill=True)
87- vbox.set_focus_child(self.paned)
88+ vbox.pack_start(paned, expand=True, fill=True)
89+ vbox.set_focus_child(paned)
90
91 self.treeview.connect('revision-selected',
92 self._treeselection_changed_cb)
93@@ -138,6 +135,21 @@
94 self.treeview.connect('tag-added', lambda w, t, r: self._update_tags())
95 vbox.show()
96
97+ return vbox
98+
99+ def construct_paned(self):
100+ """Construct the main HPaned/VPaned contents."""
101+ if self.config.get_user_option('viz-vertical') == 'True':
102+ self.paned = gtk.HPaned()
103+ else:
104+ self.paned = gtk.VPaned()
105+
106+ self.paned.pack1(self.construct_top(), resize=False, shrink=True)
107+ self.paned.pack2(self.construct_bottom(), resize=True, shrink=False)
108+ self.paned.show()
109+
110+ return self.paned
111+
112 def construct_menubar(self):
113 menubar = gtk.MenuBar()
114
115@@ -189,6 +201,12 @@
116 view_menu_compact.set_active(self.compact_view)
117 view_menu_compact.connect('activate', self._brokenlines_toggled_cb)
118
119+ view_menu_vertical = gtk.CheckMenuItem("Side-by-side Layout")
120+ view_menu_vertical.set_active(False)
121+ if self.config.get_user_option('viz-vertical') == 'True':
122+ view_menu_vertical.set_active(True)
123+ view_menu_vertical.connect('toggled', self._vertical_layout)
124+
125 view_menu_diffs = gtk.CheckMenuItem("Show Diffs")
126 view_menu_diffs.set_active(False)
127 if self.config.get_user_option('viz-show-diffs') == 'True':
128@@ -209,6 +227,7 @@
129
130 view_menu.add(view_menu_toolbar)
131 view_menu.add(view_menu_compact)
132+ view_menu.add(view_menu_vertical)
133 view_menu.add(gtk.SeparatorMenuItem())
134 view_menu.add(view_menu_diffs)
135 view_menu.add(view_menu_wide_diffs)
136@@ -531,6 +550,25 @@
137 self.toolbar.hide()
138 self.config.set_user_option('viz-toolbar-visible', col.get_active())
139
140+ def _vertical_layout(self, col):
141+ """Toggle the layout vertical/horizontal"""
142+ self.config.set_user_option('viz-vertical', str(col.get_active()))
143+
144+ old = self.paned
145+ self.vbox.remove(old)
146+ self.vbox.pack_start(self.construct_paned(), expand=True, fill=True)
147+ self._make_diff_paned_nonzero_size()
148+ self._make_diff_nonzero_size()
149+
150+ self.treeview.emit('revision-selected')
151+
152+ def _make_diff_paned_nonzero_size(self):
153+ """make sure the diff/revision pane isn't zero-width or zero-height"""
154+ alloc = self.diff_paned.get_allocation()
155+ if (alloc.width < 10) or (alloc.height < 10):
156+ width, height = self.get_size()
157+ self.diff_paned.set_size_request(width/3, int(height / 2.5))
158+
159 def _make_diff_nonzero_size(self):
160 """make sure the diff isn't zero-width or zero-height"""
161 alloc = self.diff.get_allocation()

Subscribers

People subscribed via source and target branches

to all changes: