From 02f18ee424e14cbe592fbb293097fd8a7f0f0324 Mon Sep 17 00:00:00 2001 From: fujiwarat Date: Mon, 17 Feb 2014 11:52:39 +0900 Subject: Fix deprecated GtkHBox, GtkVBox and GtkStock since GTK+ 3.10. Review URL: https://codereview.appspot.com/63750043 --- setup/setup.ui | 72 +++++++++++++++++++++++++----------------- ui/gtk3/candidatearea.vala | 14 ++++---- ui/gtk3/candidatepanel.vala | 5 +-- ui/gtk3/iconwidget.vala | 12 ++----- ui/gtk3/keybindingmanager.vala | 3 +- ui/gtk3/panel.vala | 17 ++++------ ui/gtk3/property.vala | 11 ++----- ui/gtk3/separator.vala | 8 +++-- 8 files changed, 70 insertions(+), 72 deletions(-) diff --git a/setup/setup.ui b/setup/setup.ui index 65dcee44..ec207d2e 100644 --- a/setup/setup.ui +++ b/setup/setup.ui @@ -63,7 +63,8 @@ center-always ibus-setup - + + vertical True False 12 @@ -80,7 +81,8 @@ 12 12 - + + vertical True False 18 @@ -136,7 +138,8 @@ - + + horizontal True False 6 @@ -176,7 +179,8 @@ - + + horizontal True False 6 @@ -218,7 +222,8 @@ - + + horizontal True False 6 @@ -289,7 +294,8 @@ - + + horizontal True False 6 @@ -345,7 +351,8 @@ - + + horizontal True False 6 @@ -665,7 +672,8 @@ 12 12 - + + vertical True False @@ -677,7 +685,8 @@ True False - + + vertical True False 6 @@ -739,7 +748,8 @@ start - gtk-add + _Add + True False True False @@ -747,7 +757,6 @@ True Add the selected input method into the enabled input methods False - True False @@ -757,7 +766,8 @@ - gtk-remove + _Remove + True False True False @@ -765,7 +775,6 @@ True Remove the selected input method from the enabled input methods False - True False @@ -775,7 +784,8 @@ - gtk-go-up + _Up + True False True False @@ -783,7 +793,6 @@ True Move up the selected input method in the enabled input methods list False - True False @@ -793,7 +802,8 @@ - gtk-go-down + _Down + True False True False @@ -801,7 +811,6 @@ True Move down the selected input method in the enabled input methods False - True False @@ -811,7 +820,8 @@ - gtk-about + _About + True False True False @@ -819,7 +829,6 @@ True Show information of the selected input method False - True False @@ -829,7 +838,8 @@ - gtk-preferences + _Preferences + True False True False @@ -837,7 +847,6 @@ True Show setup of the selected input method False - True False @@ -867,7 +876,8 @@ False 6 - + + horizontal True False 6 @@ -875,7 +885,7 @@ True False - gtk-info + dialog-information 2 @@ -935,7 +945,8 @@ 12 12 - + + vertical True False @@ -956,7 +967,8 @@ 6 12 - + + vertical True False 6 @@ -1017,7 +1029,8 @@ 6 12 - + + vertical True False 6 @@ -1078,7 +1091,8 @@ - + + vertical False True @@ -1177,13 +1191,13 @@ Homepage: http://code.google.com/p/ibus end - gtk-close + _Close + True False True True False False - True False diff --git a/ui/gtk3/candidatearea.vala b/ui/gtk3/candidatearea.vala index 066b26cc..b9f500cf 100644 --- a/ui/gtk3/candidatearea.vala +++ b/ui/gtk3/candidatearea.vala @@ -2,7 +2,7 @@ * * ibus - The Input Bus * - * Copyright(c) 2011 Peng Huang + * Copyright(c) 2011-2014 Peng Huang * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -36,13 +36,13 @@ class CandidateArea : Gtk.Box { }; private const string PREV_PAGE_ICONS[] = { - Gtk.Stock.GO_BACK, - Gtk.Stock.GO_UP + "go-previous", + "go-up" }; private const string NEXT_PAGE_ICONS[] = { - Gtk.Stock.GO_FORWARD, - Gtk.Stock.GO_DOWN + "go-next", + "go-down" }; public signal void candidate_clicked(uint index, uint button, uint state); @@ -139,14 +139,14 @@ class CandidateArea : Gtk.Box { Gtk.Button prev_button = new Gtk.Button(); prev_button.clicked.connect((b) => page_up()); - prev_button.set_image(new Gtk.Image.from_stock( + prev_button.set_image(new Gtk.Image.from_icon_name( PREV_PAGE_ICONS[orientation], Gtk.IconSize.MENU)); prev_button.set_relief(Gtk.ReliefStyle.NONE); Gtk.Button next_button = new Gtk.Button(); next_button.clicked.connect((b) => page_down()); - next_button.set_image(new Gtk.Image.from_stock( + next_button.set_image(new Gtk.Image.from_icon_name( NEXT_PAGE_ICONS[orientation], Gtk.IconSize.MENU)); next_button.set_relief(Gtk.ReliefStyle.NONE); diff --git a/ui/gtk3/candidatepanel.vala b/ui/gtk3/candidatepanel.vala index 396c78a0..e22135b1 100644 --- a/ui/gtk3/candidatepanel.vala +++ b/ui/gtk3/candidatepanel.vala @@ -2,7 +2,7 @@ * * ibus - The Input Bus * - * Copyright(c) 2011 Peng Huang + * Copyright(c) 2011-2014 Peng Huang * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,7 +20,7 @@ * USA */ -public class CandidatePanel : Gtk.HBox{ +public class CandidatePanel : Gtk.Box{ private bool m_vertical = true; private Gtk.Window m_toplevel; private Gtk.Box m_vbox; @@ -44,6 +44,7 @@ public class CandidatePanel : Gtk.HBox{ // Call base class constructor GLib.Object( name : "IBusCandidate", + orientation: Gtk.Orientation.HORIZONTAL, visible: true ); diff --git a/ui/gtk3/iconwidget.vala b/ui/gtk3/iconwidget.vala index fbb9e3cb..d322650c 100644 --- a/ui/gtk3/iconwidget.vala +++ b/ui/gtk3/iconwidget.vala @@ -2,7 +2,7 @@ * * ibus - The Input Bus * - * Copyright(c) 2011 Peng Huang + * Copyright(c) 2011-2014 Peng Huang * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -46,15 +46,7 @@ class IconWidget: Gtk.Image { var theme = Gtk.IconTheme.get_default(); pixbuf = theme.load_icon("ibus-engine", fixed_width, 0); } catch (GLib.Error e) { - /* "gtk-missing-image.png" is the symlink of - * "image-missing.png" and included in - * gnome-icon-theme-legacy package in fedora. - * gtk_image_set_from_stock() can fallback the stock name - * to the real name instead of gtk_image_set_from_icon_name() - * or gtk_icon_theme_load_icon() and - * could remove gnome-icon-theme-legacy. - */ - set_from_stock(Gtk.Stock.MISSING_IMAGE, size); + set_from_icon_name("image-missing", size); return; } } diff --git a/ui/gtk3/keybindingmanager.vala b/ui/gtk3/keybindingmanager.vala index 12d731de..4f5f0da4 100644 --- a/ui/gtk3/keybindingmanager.vala +++ b/ui/gtk3/keybindingmanager.vala @@ -152,8 +152,9 @@ public class KeybindingManager : GLib.Object { else pointer = device; + double[] axes = null; uint modifier = 0; - pointer.get_state(keyevent.window, null, out modifier); + pointer.get_state(keyevent.window, axes, out modifier); if ((primary_modifier & modifier) == primary_modifier) return true; diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala index aecaae8d..8cca3a7c 100644 --- a/ui/gtk3/panel.vala +++ b/ui/gtk3/panel.vala @@ -726,25 +726,24 @@ class Panel : IBus.PanelService { uint activate_time) { // Show system menu if (m_sys_menu == null) { - Gtk.ImageMenuItem item; + Gtk.MenuItem item; m_sys_menu = new Gtk.Menu(); - item = new Gtk.ImageMenuItem.from_stock(Gtk.Stock.PREFERENCES, null); + item = new Gtk.MenuItem.with_label(_("Preferences")); item.activate.connect((i) => show_setup_dialog()); m_sys_menu.append(item); - item = new Gtk.ImageMenuItem.from_stock(Gtk.Stock.ABOUT, null); + item = new Gtk.MenuItem.with_label(_("About")); item.activate.connect((i) => show_about_dialog()); m_sys_menu.append(item); m_sys_menu.append(new Gtk.SeparatorMenuItem()); - item = new Gtk.ImageMenuItem.from_stock(Gtk.Stock.REFRESH, null); - item.set_label(_("Restart")); + item = new Gtk.MenuItem.with_label(_("Restart")); item.activate.connect((i) => m_bus.exit(true)); m_sys_menu.append(item); - item = new Gtk.ImageMenuItem.from_stock(Gtk.Stock.QUIT, null); + item = new Gtk.MenuItem.with_label(_("Quit")); item.activate.connect((i) => m_bus.exit(false)); m_sys_menu.append(item); @@ -770,12 +769,8 @@ class Panel : IBus.PanelService { foreach (var engine in m_engines) { var language = engine.get_language(); var longname = engine.get_longname(); - var item = new Gtk.ImageMenuItem.with_label( + var item = new Gtk.MenuItem.with_label( "%s - %s".printf (IBus.get_language_name(language), longname)); - if (engine.get_icon() != "") { - var icon = new IconWidget(engine.get_icon(), Gtk.IconSize.MENU); - item.set_image(icon); - } // Make a copy of engine to workaround a bug in vala. // https://bugzilla.gnome.org/show_bug.cgi?id=628336 var e = engine; diff --git a/ui/gtk3/property.vala b/ui/gtk3/property.vala index 0ce93cd8..aef880f1 100644 --- a/ui/gtk3/property.vala +++ b/ui/gtk3/property.vala @@ -2,7 +2,7 @@ * * ibus - The Input Bus * - * Copyright(c) 2011-2013 Peng Huang + * Copyright(c) 2011-2014 Peng Huang * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -100,7 +100,7 @@ public interface IPropItem : GLib.Object { public signal void property_activate(string key, int state); } -public class PropImageMenuItem : Gtk.ImageMenuItem, IPropItem { +public class PropImageMenuItem : Gtk.MenuItem, IPropItem { private IBus.Property m_property; public PropImageMenuItem(IBus.Property property) { assert(property != null); @@ -115,7 +115,6 @@ public class PropImageMenuItem : Gtk.ImageMenuItem, IPropItem { return; m_property.set_label(property.get_label()); - m_property.set_icon(property.get_icon()); m_property.set_visible(property.get_visible()); m_property.set_sensitive(property.get_sensitive()); m_property.set_tooltip(property.get_tooltip()); @@ -125,16 +124,10 @@ public class PropImageMenuItem : Gtk.ImageMenuItem, IPropItem { private void sync() { set_label(m_property.get_label().get_text()); - if (m_property.get_icon() != "") - set_icon(m_property.get_icon()); set_visible(m_property.get_visible()); set_sensitive(m_property.get_sensitive()); } - private void set_icon(string icon) { - set_image(new IconWidget(icon, Gtk.IconSize.MENU)); - } - public override void activate() { property_activate(m_property.get_key(), m_property.get_state()); } diff --git a/ui/gtk3/separator.vala b/ui/gtk3/separator.vala index a8b23b8e..b5ff5471 100644 --- a/ui/gtk3/separator.vala +++ b/ui/gtk3/separator.vala @@ -2,7 +2,7 @@ * * ibus - The Input Bus * - * Copyright(c) 2011 Peng Huang + * Copyright(c) 2011-2014 Peng Huang * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,17 +20,19 @@ * USA */ -class HSeparator : Gtk.HSeparator { +class HSeparator : Gtk.Separator { public HSeparator() { GLib.Object( + orientation : Gtk.Orientation.HORIZONTAL, margin : 2 ); } } -class VSeparator : Gtk.VSeparator { +class VSeparator : Gtk.Separator { public VSeparator() { GLib.Object( + orientation : Gtk.Orientation.VERTICAL, margin : 2 ); } -- cgit v1.2.3