Merge lp:~aniket-deole/switchboard/bug-fix into lp:~elementary-pantheon/switchboard/switchboard

Proposed by Cody Garver
Status: Rejected
Rejected by: David Gomes
Proposed branch: lp:~aniket-deole/switchboard/bug-fix
Merge into: lp:~elementary-pantheon/switchboard/switchboard
Diff against target: 186 lines (+90/-3) (has conflicts)
3 files modified
CMakeLists.txt (+1/-0)
src/Buttons.vala (+50/-0)
src/Switchboard.vala (+39/-3)
Text conflict in src/Switchboard.vala
To merge this branch: bzr merge lp:~aniket-deole/switchboard/bug-fix
Reviewer Review Type Date Requested Status
Sergey "Shnatsel" Davidoff (community) Needs Fixing
Danielle Foré Approve
Review via email: mp+194643@code.launchpad.net

Commit message

Use AppCenter style button instead of arrow to fix bug #1039269

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

Looks good on design side. Just needs code approval :)

review: Approve
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Things like "<<<<<<< TREE" should not creep into the diff - they are Bazaar conflict markers, which the conflict should be resolved before committing. The code in its current state is not workable.

See http://doc.bazaar.canonical.com/beta/en/user-guide/resolving_conflicts.html for information on resolving conflicts.

review: Needs Fixing
Revision history for this message
Aniket Deole (aniket-deole) wrote :

I updated my local repo to the latest from lp:switchboard using "bzr merge" and now it requires gtk 3.6. But I'm still on Luna which has 3.4! Any help ?

Revision history for this message
Aniket Deole (aniket-deole) wrote :

"Any help" as in... Can I solve this without upgrading / getting all the Isis stuff ?

Revision history for this message
David Gomes (davidgomes) wrote :

Unmerged revisions

401. By Aniket Deole

Modified Back button related to bug 1039269.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-09-30 06:42:11 +0000
3+++ CMakeLists.txt 2013-11-10 18:40:27 +0000
4@@ -74,6 +74,7 @@
5 src/Resources.vala
6 src/DesktopLauncher.vala
7 src/EmbeddedAlert.vala
8+ src/Buttons.vala
9 PACKAGES
10 granite
11 gee-1.0
12
13=== added file 'src/Buttons.vala'
14--- src/Buttons.vala 1970-01-01 00:00:00 +0000
15+++ src/Buttons.vala 2013-11-10 18:40:27 +0000
16@@ -0,0 +1,50 @@
17+/***
18+ BEGIN LICENSE
19+
20+ Copyright (C) 2012-2013 Mario Guerriero <mario@elementaryos.org>
21+ This program is free software: you can redistribute it and/or modify it
22+ under the terms of the GNU Lesser General Public License version 3, as
23+ published by the Free Software Foundation.
24+
25+ This program is distributed in the hope that it will be useful, but
26+ WITHOUT ANY WARRANTY; without even the implied warranties of
27+ MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
28+ PURPOSE. See the GNU General Public License for more details.
29+
30+ You should have received a copy of the GNU General Public License along
31+ with this program. If not, see <http://www.gnu.org/licenses>
32+
33+ END LICENSE
34+***/
35+
36+namespace Switchboard {
37+ public class NavigationButton : Gtk.Button {
38+
39+ private Gtk.Label text;
40+
41+ public NavigationButton () {
42+ can_focus = false;
43+ valign = Gtk.Align.CENTER;
44+ vexpand = false;
45+
46+ Gtk.Box button_b = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
47+ var icon = new Gtk.Image.from_icon_name ("go-previous-symbolic",
48+ Gtk.IconSize.MENU);
49+ text = new Gtk.Label ("");
50+
51+ button_b.pack_start (icon, true, true, 2);
52+ button_b.pack_start (text, true, true, 2);
53+
54+ this.add (button_b);
55+ }
56+
57+ public string get_text () {
58+ return text.label;
59+ }
60+
61+ public void set_text (string text) {
62+ this.text.label = text;
63+ }
64+
65+ }
66+}
67
68=== modified file 'src/Switchboard.vala'
69--- src/Switchboard.vala 2013-09-26 08:05:15 +0000
70+++ src/Switchboard.vala 2013-11-10 18:40:27 +0000
71@@ -45,7 +45,7 @@
72 Gtk.Label progress_label;
73 Gtk.SearchEntry search_box;
74 Gtk.Toolbar toolbar;
75- Gtk.ToolButton navigation_button;
76+ Switchboard.NavigationButton navigation_button;
77 // Public so we can hide it after show_all()
78 public Gtk.ToolItem progress_toolitem;
79 // These two wrap the progress bar
80@@ -75,6 +75,8 @@
81 string search_box_buffer = "";
82
83 private const string[] SUPPORTED_GETTEXT_DOMAINS_KEYS = {"X-Ubuntu-Gettext-Domain", "X-GNOME-Gettext-Domain"};
84+
85+ string all_settings_label = _("All Settings");
86
87 public SwitchboardApp () {
88 }
89@@ -149,6 +151,8 @@
90 category_view.recalculate_columns (width);
91 });
92
93+ navigation_button.hide ();
94+
95 foreach (var label in category_view.category_labels.values)
96 label.hide ();
97 foreach (var view in category_view.category_views.values)
98@@ -243,8 +247,14 @@
99
100 // ensure the button is sensitive; it might be the first plug loaded
101 if (!@extern) {
102+<<<<<<< TREE
103 navigation_button.set_sensitive(true);
104 navigation_button.set_icon_name ("go-home");
105+=======
106+ navigation_button.set_sensitive (true);
107+ navigation_button.set_text (all_settings_label);
108+ navigation_button.show ();
109+>>>>>>> MERGE-SOURCE
110 current_plug["title"] = title;
111 current_plug["executable"] = executable;
112 switch_to_socket ();
113@@ -252,8 +262,14 @@
114 }
115 } catch { warning(_("Failed to launch plug: title %s | executable %s"), title, executable); }
116 } else {
117+<<<<<<< TREE
118 navigation_button.set_sensitive(true);
119 navigation_button.set_icon_name ("go-home");
120+=======
121+ navigation_button.set_sensitive (true);
122+ navigation_button.set_text (all_settings_label);
123+ navigation_button.show ();
124+>>>>>>> MERGE-SOURCE
125 }
126
127 if (@extern) {
128@@ -268,15 +284,28 @@
129
130 // Handles clicking the navigation button
131 void handle_navigation_button_clicked () {
132+<<<<<<< TREE
133 string icon_name = navigation_button.get_icon_name ();
134 if (icon_name == "go-home") {
135+=======
136+ if (navigation_button.get_text () != current_plug["title"]) {
137+>>>>>>> MERGE-SOURCE
138 switch_to_icons();
139+<<<<<<< TREE
140 navigation_button.set_icon_name ("go-previous");
141+=======
142+ navigation_button.set_text (current_plug["title"]);
143+>>>>>>> MERGE-SOURCE
144 }
145 else {
146 load_plug (current_plug["title"], current_plug["executable"], current_plug["extern"] == "1");
147+<<<<<<< TREE
148 navigation_button.set_icon_name ("go-home");
149 }
150+=======
151+ navigation_button.set_text (all_settings_label);
152+ }
153+>>>>>>> MERGE-SOURCE
154 }
155
156 // Switches to the socket view
157@@ -502,6 +531,7 @@
158 search_box_text_changed();
159 });
160 search_box.sensitive = (count_plugs () > 0);
161+ search_box.margin = 5;
162 var find_toolitem = new Gtk.ToolItem ();
163 find_toolitem.add(search_box);
164 find_toolitem.margin_right = 6;
165@@ -516,13 +546,19 @@
166 });
167
168 // Nav button
169+<<<<<<< TREE
170 navigation_button = new Gtk.ToolButton (null, null);
171 navigation_button.set_icon_name ("go-previous");
172+=======
173+ navigation_button = new NavigationButton ();
174+>>>>>>> MERGE-SOURCE
175 navigation_button.clicked.connect (handle_navigation_button_clicked);
176- navigation_button.set_sensitive(false);
177+ navigation_button.margin = 5;
178
179 // Add everything to the toolbar
180- toolbar.insert (navigation_button, -1);
181+ Gtk.ToolItem tool = new Gtk.ToolItem ();
182+ tool.add (navigation_button);
183+ toolbar.insert (tool, -1);
184 toolbar.insert (lspace, -1);
185 toolbar.insert (progress_toolitem, -1);
186 toolbar.insert (rspace, -1);

Subscribers

People subscribed via source and target branches

to all changes: