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
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2013-06-16 23:14:21 +0000
+++ CMakeLists.txt 2013-09-26 11:17:15 +0000
@@ -61,7 +61,7 @@
61#61#
6262
63find_package(PkgConfig)63find_package(PkgConfig)
64pkg_check_modules(DEPS REQUIRED granite gio-2.0 gee-1.0 unity)64pkg_check_modules(DEPS REQUIRED granite gio-2.0 gee-1.0 gtk+-3.0>=3.6 unity)
65add_definitions(${DEPS_CFLAGS})65add_definitions(${DEPS_CFLAGS})
66link_directories(${DEPS_LIBRARY_DIRS})66link_directories(${DEPS_LIBRARY_DIRS})
67find_package(Vala REQUIRED)67find_package(Vala REQUIRED)
@@ -78,6 +78,7 @@
78 granite78 granite
79 gee-1.079 gee-1.0
80 gio-2.080 gio-2.0
81 gtk+-3.0
81 unity82 unity
82CUSTOM_VAPIS83CUSTOM_VAPIS
83 vapi/config.vapi84 vapi/config.vapi
8485
=== modified file 'src/Switchboard.vala'
--- src/Switchboard.vala 2013-06-15 00:38:19 +0000
+++ src/Switchboard.vala 2013-09-26 11:17:15 +0000
@@ -43,7 +43,7 @@
43 // Chrome widgets43 // Chrome widgets
44 Gtk.ProgressBar progress_bar;44 Gtk.ProgressBar progress_bar;
45 Gtk.Label progress_label;45 Gtk.Label progress_label;
46 Granite.Widgets.SearchBar search_box;46 Gtk.SearchEntry search_box;
47 Gtk.Toolbar toolbar;47 Gtk.Toolbar toolbar;
48 Gtk.ToolButton navigation_button;48 Gtk.ToolButton navigation_button;
49 // Public so we can hide it after show_all()49 // Public so we can hide it after show_all()
@@ -244,7 +244,7 @@
244 // ensure the button is sensitive; it might be the first plug loaded244 // ensure the button is sensitive; it might be the first plug loaded
245 if (!@extern) {245 if (!@extern) {
246 navigation_button.set_sensitive(true);246 navigation_button.set_sensitive(true);
247 navigation_button.stock_id = Gtk.Stock.HOME;247 navigation_button.set_icon_name ("go-home");
248 current_plug["title"] = title;248 current_plug["title"] = title;
249 current_plug["executable"] = executable;249 current_plug["executable"] = executable;
250 switch_to_socket ();250 switch_to_socket ();
@@ -253,7 +253,7 @@
253 } catch { warning(_("Failed to launch plug: title %s | executable %s"), title, executable); }253 } catch { warning(_("Failed to launch plug: title %s | executable %s"), title, executable); }
254 } else {254 } else {
255 navigation_button.set_sensitive(true);255 navigation_button.set_sensitive(true);
256 navigation_button.stock_id = Gtk.Stock.HOME;256 navigation_button.set_icon_name ("go-home");
257 }257 }
258 258
259 if (@extern) {259 if (@extern) {
@@ -268,13 +268,14 @@
268268
269 // Handles clicking the navigation button269 // Handles clicking the navigation button
270 void handle_navigation_button_clicked () {270 void handle_navigation_button_clicked () {
271 if (navigation_button.stock_id == Gtk.Stock.HOME) {271 string icon_name = navigation_button.get_icon_name ();
272 if (icon_name == "go-home") {
272 switch_to_icons();273 switch_to_icons();
273 navigation_button.stock_id = Gtk.Stock.GO_BACK;274 navigation_button.set_icon_name ("go-previous");
274 }275 }
275 else {276 else {
276 load_plug (current_plug["title"], current_plug["executable"], current_plug["extern"] == "1");277 load_plug (current_plug["title"], current_plug["executable"], current_plug["extern"] == "1");
277 navigation_button.stock_id = Gtk.Stock.HOME;278 navigation_button.set_icon_name ("go-home");
278 }279 }
279 }280 }
280281
@@ -482,7 +483,7 @@
482 rspace.set_expand(true);483 rspace.set_expand(true);
483484
484 // Progressbar485 // Progressbar
485 var progress_vbox = new Gtk.VBox (true, 0);486 var progress_vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
486 progress_label = new Gtk.Label ("");487 progress_label = new Gtk.Label ("");
487 progress_label.set_use_markup(true);488 progress_label.set_use_markup(true);
488 progress_bar = new Gtk.ProgressBar ();489 progress_bar = new Gtk.ProgressBar ();
@@ -493,8 +494,8 @@
493 progress_toolitem.set_expand(true);494 progress_toolitem.set_expand(true);
494495
495 // Searchbar496 // Searchbar
496 search_box = new Granite.Widgets.SearchBar (_("Search Settings"));497 search_box = new Gtk.SearchEntry ();
497 search_box.primary_icon_stock = "gtk-find";498 search_box.set_placeholder_text (_("Search Settings"));
498 search_box.activate.connect(() => search_box_activated());499 search_box.activate.connect(() => search_box_activated());
499 search_box.changed.connect(() => {500 search_box.changed.connect(() => {
500 category_view.filter_plugs(search_box.get_text (), this);501 category_view.filter_plugs(search_box.get_text (), this);
@@ -515,7 +516,8 @@
515 });516 });
516517
517 // Nav button518 // Nav button
518 navigation_button = new Gtk.ToolButton.from_stock(Gtk.Stock.GO_BACK);519 navigation_button = new Gtk.ToolButton (null, null);
520 navigation_button.set_icon_name ("go-previous");
519 navigation_button.clicked.connect (handle_navigation_button_clicked);521 navigation_button.clicked.connect (handle_navigation_button_clicked);
520 navigation_button.set_sensitive(false);522 navigation_button.set_sensitive(false);
521523

Subscribers

People subscribed via source and target branches