diff options
author | fujiwarat <takao.fujiwara1@gmail.com> | 2014-02-17 11:52:39 +0900 |
---|---|---|
committer | fujiwarat <takao.fujiwara1@gmail.com> | 2014-02-17 11:52:39 +0900 |
commit | 02f18ee424e14cbe592fbb293097fd8a7f0f0324 (patch) | |
tree | 7461ffefb94e7b47bae47d7853088df1135d7c5d | |
parent | 644a749ec444fcccff7dc5c0dff04c567dc0433c (diff) |
Fix deprecated GtkHBox, GtkVBox and GtkStock since GTK+ 3.10.
Review URL: https://codereview.appspot.com/63750043
-rw-r--r-- | setup/setup.ui | 72 | ||||
-rw-r--r-- | ui/gtk3/candidatearea.vala | 14 | ||||
-rw-r--r-- | ui/gtk3/candidatepanel.vala | 5 | ||||
-rw-r--r-- | ui/gtk3/iconwidget.vala | 12 | ||||
-rw-r--r-- | ui/gtk3/keybindingmanager.vala | 3 | ||||
-rw-r--r-- | ui/gtk3/panel.vala | 17 | ||||
-rw-r--r-- | ui/gtk3/property.vala | 11 | ||||
-rw-r--r-- | 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 @@ <property name="window_position">center-always</property> <property name="icon_name">ibus-setup</property> <child> - <object class="GtkVBox" id="vbox1"> + <object class="GtkBox" id="vbox1"> + <property name="orientation">vertical</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="spacing">12</property> @@ -80,7 +81,8 @@ <property name="left_padding">12</property> <property name="right_padding">12</property> <child> - <object class="GtkVBox" id="vbox5"> + <object class="GtkBox" id="vbox5"> + <property name="orientation">vertical</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="spacing">18</property> @@ -136,7 +138,8 @@ </packing> </child> <child> - <object class="GtkHBox" id="hbox4"> + <object class="GtkBox" id="hbox4"> + <property name="orientation">horizontal</property> <property name="no_show_all">True</property> <property name="can_focus">False</property> <property name="spacing">6</property> @@ -176,7 +179,8 @@ </packing> </child> <child> - <object class="GtkHBox" id="hbox5"> + <object class="GtkBox" id="hbox5"> + <property name="orientation">horizontal</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="spacing">6</property> @@ -218,7 +222,8 @@ </packing> </child> <child> - <object class="GtkHBox" id="hbox6"> + <object class="GtkBox" id="hbox6"> + <property name="orientation">horizontal</property> <property name="no_show_all">True</property> <property name="can_focus">False</property> <property name="spacing">6</property> @@ -289,7 +294,8 @@ </packing> </child> <child> - <object class="GtkHBox" id="hbox2"> + <object class="GtkBox" id="hbox2"> + <property name="orientation">horizontal</property> <property name="no_show_all">True</property> <property name="can_focus">False</property> <property name="spacing">6</property> @@ -345,7 +351,8 @@ </packing> </child> <child> - <object class="GtkHBox" id="hbox3"> + <object class="GtkBox" id="hbox3"> + <property name="orientation">horizontal</property> <property name="no_show_all">True</property> <property name="can_focus">False</property> <property name="spacing">6</property> @@ -665,7 +672,8 @@ <property name="left_padding">12</property> <property name="right_padding">12</property> <child> - <object class="GtkVBox" id="vbox2"> + <object class="GtkBox" id="vbox2"> + <property name="orientation">vertical</property> <property name="visible">True</property> <property name="can_focus">False</property> <child> @@ -677,7 +685,8 @@ <property name="visible">True</property> <property name="can_focus">False</property> <child> - <object class="GtkVBox" id="vbox3"> + <object class="GtkBox" id="vbox3"> + <property name="orientation">vertical</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="spacing">6</property> @@ -739,7 +748,8 @@ <property name="layout_style">start</property> <child> <object class="GtkButton" id="button_engine_add"> - <property name="label">gtk-add</property> + <property name="label" translatable="yes">_Add</property> + <property name="use_underline">True</property> <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="sensitive">False</property> @@ -747,7 +757,6 @@ <property name="receives_default">True</property> <property name="tooltip_text" translatable="yes">Add the selected input method into the enabled input methods</property> <property name="use_action_appearance">False</property> - <property name="use_stock">True</property> </object> <packing> <property name="expand">False</property> @@ -757,7 +766,8 @@ </child> <child> <object class="GtkButton" id="button_engine_remove"> - <property name="label">gtk-remove</property> + <property name="label" translatable="yes">_Remove</property> + <property name="use_underline">True</property> <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="sensitive">False</property> @@ -765,7 +775,6 @@ <property name="receives_default">True</property> <property name="tooltip_text" translatable="yes">Remove the selected input method from the enabled input methods</property> <property name="use_action_appearance">False</property> - <property name="use_stock">True</property> </object> <packing> <property name="expand">False</property> @@ -775,7 +784,8 @@ </child> <child> <object class="GtkButton" id="button_engine_up"> - <property name="label">gtk-go-up</property> + <property name="label" translatable="yes">_Up</property> + <property name="use_underline">True</property> <property name="use_action_appearance">False</property> <property name="no_show_all">True</property> <property name="sensitive">False</property> @@ -783,7 +793,6 @@ <property name="receives_default">True</property> <property name="tooltip_text" translatable="yes">Move up the selected input method in the enabled input methods list</property> <property name="use_action_appearance">False</property> - <property name="use_stock">True</property> </object> <packing> <property name="expand">False</property> @@ -793,7 +802,8 @@ </child> <child> <object class="GtkButton" id="button_engine_down"> - <property name="label">gtk-go-down</property> + <property name="label" translatable="yes">_Down</property> + <property name="use_underline">True</property> <property name="use_action_appearance">False</property> <property name="no_show_all">True</property> <property name="sensitive">False</property> @@ -801,7 +811,6 @@ <property name="receives_default">True</property> <property name="tooltip_text" translatable="yes">Move down the selected input method in the enabled input methods</property> <property name="use_action_appearance">False</property> - <property name="use_stock">True</property> </object> <packing> <property name="expand">False</property> @@ -811,7 +820,8 @@ </child> <child> <object class="GtkButton" id="button_engine_about"> - <property name="label">gtk-about</property> + <property name="label" translatable="yes">_About</property> + <property name="use_underline">True</property> <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="sensitive">False</property> @@ -819,7 +829,6 @@ <property name="receives_default">True</property> <property name="tooltip_text" translatable="yes">Show information of the selected input method</property> <property name="use_action_appearance">False</property> - <property name="use_stock">True</property> </object> <packing> <property name="expand">False</property> @@ -829,7 +838,8 @@ </child> <child> <object class="GtkButton" id="button_engine_preferences"> - <property name="label">gtk-preferences</property> + <property name="label" translatable="yes">_Preferences</property> + <property name="use_underline">True</property> <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="sensitive">False</property> @@ -837,7 +847,6 @@ <property name="receives_default">True</property> <property name="tooltip_text" translatable="yes">Show setup of the selected input method</property> <property name="use_action_appearance">False</property> - <property name="use_stock">True</property> </object> <packing> <property name="expand">False</property> @@ -867,7 +876,8 @@ <property name="can_focus">False</property> <property name="top_padding">6</property> <child> - <object class="GtkHBox" id="hbox8"> + <object class="GtkBox" id="hbox8"> + <property name="orientation">horizontal</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="spacing">6</property> @@ -875,7 +885,7 @@ <object class="GtkImage" id="image1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="stock">gtk-info</property> + <property name="icon-name">dialog-information</property> <property name="icon-size">2</property> </object> <packing> @@ -935,7 +945,8 @@ <property name="left_padding">12</property> <property name="right_padding">12</property> <child> - <object class="GtkVBox" id="vbox7"> + <object class="GtkBox" id="vbox7"> + <property name="orientation">vertical</property> <property name="visible">True</property> <property name="can_focus">False</property> <child> @@ -956,7 +967,8 @@ <property name="top_padding">6</property> <property name="left_padding">12</property> <child> - <object class="GtkVBox" id="vbox8"> + <object class="GtkBox" id="vbox8"> + <property name="orientation">vertical</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="spacing">6</property> @@ -1017,7 +1029,8 @@ <property name="top_padding">6</property> <property name="left_padding">12</property> <child> - <object class="GtkVBox" id="vbox9"> + <object class="GtkBox" id="vbox9"> + <property name="orientation">vertical</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="spacing">6</property> @@ -1078,7 +1091,8 @@ </packing> </child> <child> - <object class="GtkVBox" id="vbox4"> + <object class="GtkBox" id="vbox4"> + <property name="orientation">vertical</property> <property name="can_focus">False</property> <property name="no_show_all">True</property> <child> @@ -1177,13 +1191,13 @@ Homepage: http://code.google.com/p/ibus <property name="layout_style">end</property> <child> <object class="GtkButton" id="button_close"> - <property name="label">gtk-close</property> + <property name="label" translatable="yes">_Close</property> + <property name="use_underline">True</property> <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_action_appearance">False</property> - <property name="use_stock">True</property> </object> <packing> <property name="expand">False</property> 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 <shawn.p.huang@gmail.com> + * Copyright(c) 2011-2014 Peng Huang <shawn.p.huang@gmail.com> * * 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 <shawn.p.huang@gmail.com> + * Copyright(c) 2011-2014 Peng Huang <shawn.p.huang@gmail.com> * * 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 <shawn.p.huang@gmail.com> + * Copyright(c) 2011-2014 Peng Huang <shawn.p.huang@gmail.com> * * 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 <shawn.p.huang@gmail.com> + * Copyright(c) 2011-2014 Peng Huang <shawn.p.huang@gmail.com> * * 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 <shawn.p.huang@gmail.com> + * Copyright(c) 2011-2014 Peng Huang <shawn.p.huang@gmail.com> * * 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 ); } |