Change localization from Glade to GtkBuilder

This commit is contained in:
Robert Ancell 2009-07-31 09:23:31 +10:00
parent d8414ccbc5
commit 7350d76e13
3 changed files with 102 additions and 75 deletions

View file

@ -13,13 +13,13 @@ desktopdir = $(datadir)/applications
Desktop_in_files = localization.desktop.in Desktop_in_files = localization.desktop.in
desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop) desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop)
gladedir = $(pkgdatadir)/glade uidir = $(pkgdatadir)/ui
dist_glade_DATA = localization.glade dist_ui_DATA = localization.ui
INCLUDES = \ INCLUDES = \
$(CAPPLET_CFLAGS) \ $(CAPPLET_CFLAGS) \
$(GNOMECC_CAPPLETS_CFLAGS) \ $(GNOMECC_CAPPLETS_CFLAGS) \
-DGNOMECC_GLADEDIR="\"$(gladedir)\"" \ -DGNOMECC_UI_DIR="\"$(uidir)\"" \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \ -DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" -DGNOMECC_DATA_DIR="\"$(pkgdatadir)\""

View file

@ -1,136 +1,150 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> <interface>
<!--*- mode: xml -*--> <!-- interface-requires gtk+ 2.12 -->
<glade-interface> <!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkDialog" id="i18n_dialog"> <object class="GtkDialog" id="i18n_dialog">
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="border_width">5</property> <property name="border_width">5</property>
<property name="title" translatable="yes">Localization Preferences</property> <property name="title" translatable="yes">Localization Preferences</property>
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property> <property name="window_position">center-on-parent</property>
<property name="icon_name">preferences-desktop-locale</property> <property name="icon_name">preferences-desktop-locale</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> <property name="type_hint">dialog</property>
<property name="has_separator">False</property> <property name="has_separator">False</property>
<child internal-child="vbox"> <child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1"> <object class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property> <property name="spacing">2</property>
<child> <child>
<widget class="GtkVBox" id="vbox1"> <object class="GtkVBox" id="vbox1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="border_width">5</property> <property name="border_width">5</property>
<property name="orientation">vertical</property>
<property name="spacing">18</property> <property name="spacing">18</property>
<child> <child>
<widget class="GtkHBox" id="hbox2"> <object class="GtkHBox" id="hbox2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<widget class="GtkImage" id="image2"> <object class="GtkImage" id="image2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-dialog-info</property> <property name="stock">gtk-dialog-info</property>
<property name="icon_size">5</property> <property name="icon-size">5</property>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label7"> <object class="GtkLabel" id="label7">
<property name="width_request">280</property> <property name="width_request">280</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="label" translatable="yes">&lt;i&gt;Region and language changes take effect the next time you log in.&lt;/i&gt;</property> <property name="label" translatable="yes">&lt;i&gt;Region and language changes take effect the next time you log in.&lt;/i&gt;</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
<property name="wrap">True</property> <property name="wrap">True</property>
</widget> </object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox3"> <object class="GtkHBox" id="hbox3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">12</property> <property name="spacing">12</property>
<child> <child>
<widget class="GtkLabel" id="label5"> <object class="GtkLabel" id="label5">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Region:</property> <property name="label" translatable="yes">Region:</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkButton" id="region_choose"> <object class="GtkButton" id="region_choose">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="response_id">0</property> </object>
</widget>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkVBox" id="vbox1"> <object class="GtkVBox" id="vbox2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<widget class="GtkLabel" id="label4"> <object class="GtkLabel" id="label4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="label" translatable="yes">Selected languages:</property> <property name="label" translatable="yes">Selected languages:</property>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkTable" id="table1"> <object class="GtkTable" id="table1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="n_rows">1</property>
<property name="n_columns">2</property> <property name="n_columns">2</property>
<property name="column_spacing">3</property> <property name="column_spacing">3</property>
<child> <child>
<widget class="GtkVButtonBox" id="vbuttonbox1"> <object class="GtkVButtonBox" id="vbuttonbox1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property> <property name="spacing">3</property>
<property name="layout_style">GTK_BUTTONBOX_START</property> <property name="layout_style">start</property>
<child> <child>
<widget class="GtkButton" id="language_add"> <object class="GtkButton" id="language_add">
<property name="label">gtk-add</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
<property name="label">gtk-add</property> <property name="receives_default">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="response_id">0</property> </object>
</widget> <packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child> </child>
<child> <child>
<widget class="GtkButton" id="language_remove"> <object class="GtkButton" id="language_remove">
<property name="label">gtk-remove</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
<property name="label">gtk-remove</property> <property name="receives_default">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="response_id">0</property> </object>
</widget>
<packing> <packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
@ -139,84 +153,96 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkScrolledWindow" id="scrolledwindow3"> <object class="GtkScrolledWindow" id="scrolledwindow3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> <property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> <property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">GTK_SHADOW_IN</property> <property name="shadow_type">in</property>
<child> <child>
<widget class="GtkTreeView" id="language_list"> <object class="GtkTreeView" id="language_list">
<property name="height_request">100</property> <property name="height_request">100</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</widget> </object>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property> <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
<property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property> <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
</packing> </packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkHButtonBox" id="hbuttonbox1"> <object class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<property name="layout_style">GTK_BUTTONBOX_END</property> <property name="layout_style">end</property>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child internal-child="action_area"> <child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1"> <object class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property> <property name="layout_style">end</property>
<child> <child>
<widget class="GtkButton" id="button14"> <object class="GtkButton" id="button14">
<property name="label">gtk-help</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="label">gtk-help</property> <property name="receives_default">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="response_id">-11</property> </object>
</widget> <packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child> </child>
<child> <child>
<widget class="GtkButton" id="button13"> <object class="GtkButton" id="button13">
<property name="label">gtk-close</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="label">gtk-close</property> <property name="receives_default">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="response_id">0</property> </object>
</widget>
<packing> <packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="pack_type">GTK_PACK_END</property> <property name="pack_type">end</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
</widget> </object>
</child> </child>
</widget> <action-widgets>
</glade-interface> <action-widget response="-11">button14</action-widget>
<action-widget response="0">button13</action-widget>
</action-widgets>
</object>
</interface>

View file

@ -20,17 +20,18 @@
*/ */
#include <config.h> #include <config.h>
#include <glade/glade-xml.h> #include <gtk/gtk.h>
static GtkWidget * static GtkWidget *
create_dialog (void) create_dialog (void)
{ {
GladeXML *xml; GtkBuilder *ui;
GtkWidget *dialog; GtkWidget *dialog;
xml = glade_xml_new (GNOMECC_GLADEDIR "/localization.glade", "i18n_dialog", NULL); ui = gtk_builder_new ();
dialog = glade_xml_get_widget (xml, "i18n_dialog"); gtk_builder_add_from_file (ui, GNOMECC_UI_DIR "/localization.ui", NULL);
g_object_unref (xml); dialog = GTK_WIDGET (gtk_builder_get_object (ui, "i18n_dialog"));
g_object_unref (ui);
return dialog; return dialog;
} }