Merge lp:~elementary-apps/switchboard/fix-gtk-deprecations into lp:~elementary-pantheon/switchboard/switchboard

Proposed by Danielle Foré
Status: Merged
Approved by: David Gomes
Approved revision: 408
Merged at revision: 402
Proposed branch: lp:~elementary-apps/switchboard/fix-gtk-deprecations
Merge into: lp:~elementary-pantheon/switchboard/switchboard
Diff against target: 98 lines (+14/-11)
2 files modified
CMakeLists.txt (+2/-1)
src/Switchboard.vala (+12/-10)
To merge this branch: bzr merge lp:~elementary-apps/switchboard/fix-gtk-deprecations
Reviewer Review Type Date Requested Status
David Gomes (community) Approve
Review via email: mp+187615@code.launchpad.net

Commit message

fix deprecated gtk widgets and methods. Requires gtk >= 3.6

Description of the change

This branch fixes the following deprecations:

Granite search entry -> Gtk.SearchEntry
Gtk.VBox -> Gtk.Box
Stock icons -> named icons

To post a comment you must log in.
405. By Raphael Isemann

fixed codestyle

406. By Cody Garver

Require GTK >= 3.6

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

pkg_check_modules(DEPS REQUIRED granite gio-2.0 gee-1.0 gtk+-3.0>=3.6 unity)

I think we need that too, no?

Revision history for this message
Cody Garver (codygarver) wrote :

no

407. By Raphael Isemann

another codestyle-fix

Revision history for this message
Rico Tzschichholz (ricotz) wrote :

> pkg_check_modules(DEPS REQUIRED granite gio-2.0 gee-1.0 gtk+-3.0>=3.6 unity)
>
> I think we need that too, no?

+1

Does adding the version to the vala-macro even work?

408. By Cody Garver

Properly require GTK >= 3.6

Revision history for this message
Cody Garver (codygarver) wrote :

Fixed GTK requirement

Revision history for this message
David Gomes (davidgomes) :
review: Approve

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-06-16 23:14:21 +0000
3+++ CMakeLists.txt 2013-09-26 11:17:15 +0000
4@@ -61,7 +61,7 @@
5 #
6
7 find_package(PkgConfig)
8-pkg_check_modules(DEPS REQUIRED granite gio-2.0 gee-1.0 unity)
9+pkg_check_modules(DEPS REQUIRED granite gio-2.0 gee-1.0 gtk+-3.0>=3.6 unity)
10 add_definitions(${DEPS_CFLAGS})
11 link_directories(${DEPS_LIBRARY_DIRS})
12 find_package(Vala REQUIRED)
13@@ -78,6 +78,7 @@
14 granite
15 gee-1.0
16 gio-2.0
17+ gtk+-3.0
18 unity
19 CUSTOM_VAPIS
20 vapi/config.vapi
21
22=== modified file 'src/Switchboard.vala'
23--- src/Switchboard.vala 2013-06-15 00:38:19 +0000
24+++ src/Switchboard.vala 2013-09-26 11:17:15 +0000
25@@ -43,7 +43,7 @@
26 // Chrome widgets
27 Gtk.ProgressBar progress_bar;
28 Gtk.Label progress_label;
29- Granite.Widgets.SearchBar search_box;
30+ Gtk.SearchEntry search_box;
31 Gtk.Toolbar toolbar;
32 Gtk.ToolButton navigation_button;
33 // Public so we can hide it after show_all()
34@@ -244,7 +244,7 @@
35 // ensure the button is sensitive; it might be the first plug loaded
36 if (!@extern) {
37 navigation_button.set_sensitive(true);
38- navigation_button.stock_id = Gtk.Stock.HOME;
39+ navigation_button.set_icon_name ("go-home");
40 current_plug["title"] = title;
41 current_plug["executable"] = executable;
42 switch_to_socket ();
43@@ -253,7 +253,7 @@
44 } catch { warning(_("Failed to launch plug: title %s | executable %s"), title, executable); }
45 } else {
46 navigation_button.set_sensitive(true);
47- navigation_button.stock_id = Gtk.Stock.HOME;
48+ navigation_button.set_icon_name ("go-home");
49 }
50
51 if (@extern) {
52@@ -268,13 +268,14 @@
53
54 // Handles clicking the navigation button
55 void handle_navigation_button_clicked () {
56- if (navigation_button.stock_id == Gtk.Stock.HOME) {
57+ string icon_name = navigation_button.get_icon_name ();
58+ if (icon_name == "go-home") {
59 switch_to_icons();
60- navigation_button.stock_id = Gtk.Stock.GO_BACK;
61+ navigation_button.set_icon_name ("go-previous");
62 }
63 else {
64 load_plug (current_plug["title"], current_plug["executable"], current_plug["extern"] == "1");
65- navigation_button.stock_id = Gtk.Stock.HOME;
66+ navigation_button.set_icon_name ("go-home");
67 }
68 }
69
70@@ -482,7 +483,7 @@
71 rspace.set_expand(true);
72
73 // Progressbar
74- var progress_vbox = new Gtk.VBox (true, 0);
75+ var progress_vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
76 progress_label = new Gtk.Label ("");
77 progress_label.set_use_markup(true);
78 progress_bar = new Gtk.ProgressBar ();
79@@ -493,8 +494,8 @@
80 progress_toolitem.set_expand(true);
81
82 // Searchbar
83- search_box = new Granite.Widgets.SearchBar (_("Search Settings"));
84- search_box.primary_icon_stock = "gtk-find";
85+ search_box = new Gtk.SearchEntry ();
86+ search_box.set_placeholder_text (_("Search Settings"));
87 search_box.activate.connect(() => search_box_activated());
88 search_box.changed.connect(() => {
89 category_view.filter_plugs(search_box.get_text (), this);
90@@ -515,7 +516,8 @@
91 });
92
93 // Nav button
94- navigation_button = new Gtk.ToolButton.from_stock(Gtk.Stock.GO_BACK);
95+ navigation_button = new Gtk.ToolButton (null, null);
96+ navigation_button.set_icon_name ("go-previous");
97 navigation_button.clicked.connect (handle_navigation_button_clicked);
98 navigation_button.set_sensitive(false);
99

Subscribers

People subscribed via source and target branches