[gnome-panel] [wncklet] Port to GtkBuilder
- From: Vincent Untz <vuntz src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-panel] [wncklet] Port to GtkBuilder
- Date: Tue, 11 Aug 2009 14:00:03 +0000 (UTC)
commit 91f937eeb3588eccb82f24332c1c6434e68bd91c
Author: Vincent Untz <vuntz gnome org>
Date: Tue Aug 11 15:28:52 2009 +0200
[wncklet] Port to GtkBuilder
applets/wncklet/Makefile.am | 16 +-
applets/wncklet/window-list.c | 41 +++--
.../wncklet/{window-list.glade => window-list.ui} | 198 +++++++++++--------
applets/wncklet/workspace-switcher.c | 47 +++--
...kspace-switcher.glade => workspace-switcher.ui} | 210 +++++++++++---------
configure.in | 2 +-
po/POTFILES.in | 4 +-
7 files changed, 296 insertions(+), 222 deletions(-)
---
diff --git a/applets/wncklet/Makefile.am b/applets/wncklet/Makefile.am
index 99785a7..522d7c7 100644
--- a/applets/wncklet/Makefile.am
+++ b/applets/wncklet/Makefile.am
@@ -8,8 +8,8 @@ INCLUDES = \
$(DISABLE_DEPRECATED_CFLAGS) \
$(WARN_CFLAGS) \
-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
- -DPAGER_GLADEDIR=\""$(gladedir)"\" \
- -DTASKLIST_GLADEDIR=\""$(gladedir)"\" \
+ -DPAGER_BUILDERDIR=\""$(uidir)"\" \
+ -DTASKLIST_BUILDERDIR=\""$(uidir)"\" \
-DPREFIX=\"$(prefix)\" \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DDATADIR=\"$(datadir)\" \
@@ -56,9 +56,9 @@ endif
EXTRA_DIST = \
GNOME_Wncklet_Factory.server.in.in \
- $(ui_DATA) \
+ $(xmlui_DATA) \
$(schemas_in_files) \
- $(glade_DATA)
+ $(ui_DATA)
serverdir = $(libdir)/bonobo/servers
server_in_files = GNOME_Wncklet_Factory.server.in
@@ -75,8 +75,8 @@ $(server_in_files): $(server_in_files).in Makefile
CLEANFILES = $(server_in_files) $(server_DATA) $(BUILT_SOURCES) $(schemas_DATA)
-uidir = $(datadir)/gnome-2.0/ui
-ui_DATA = \
+xmluidir = $(datadir)/gnome-2.0/ui
+xmlui_DATA = \
GNOME_WindowMenuApplet.xml \
GNOME_WorkspaceSwitcherApplet.xml \
GNOME_ShowDesktopApplet.xml \
@@ -100,8 +100,8 @@ else
install-data-local:
endif
-gladedir = $(datadir)/gnome-panel/glade
-glade_DATA = workspace-switcher.glade window-list.glade
+uidir = $(datadir)/gnome-panel/ui
+ui_DATA = workspace-switcher.ui window-list.ui
-include $(top_srcdir)/git.mk
diff --git a/applets/wncklet/window-list.c b/applets/wncklet/window-list.c
index d3168ef..7f3659d 100644
--- a/applets/wncklet/window-list.c
+++ b/applets/wncklet/window-list.c
@@ -21,7 +21,6 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include <glade/glade-xml.h>
#include <libwnck/libwnck.h>
#include <gconf/gconf-client.h>
@@ -649,10 +648,12 @@ display_all_workspaces_toggled (GtkToggleButton *button,
NULL);
}
+#define WID(s) GTK_WIDGET (gtk_builder_get_object (builder, s))
+
static void
setup_sensitivity (TasklistData *tasklist,
GConfClient *client,
- GladeXML *xml,
+ GtkBuilder *builder,
const char *wid1,
const char *wid2,
const char *wid3,
@@ -670,27 +671,25 @@ setup_sensitivity (TasklistData *tasklist,
}
g_free (fullkey);
- w = glade_xml_get_widget (xml, wid1);
+ w = WID (wid1);
g_assert (w != NULL);
gtk_widget_set_sensitive (w, FALSE);
if (wid2 != NULL) {
- w = glade_xml_get_widget (xml, wid2);
+ w = WID (wid2);
g_assert (w != NULL);
gtk_widget_set_sensitive (w, FALSE);
}
if (wid3 != NULL) {
- w = glade_xml_get_widget (xml, wid3);
+ w = WID (wid3);
g_assert (w != NULL);
gtk_widget_set_sensitive (w, FALSE);
}
}
-#define WID(s) glade_xml_get_widget (xml, s)
-
static void
-setup_dialog (GladeXML *xml,
+setup_dialog (GtkBuilder *builder,
TasklistData *tasklist)
{
GConfClient *client;
@@ -701,7 +700,7 @@ setup_dialog (GladeXML *xml,
tasklist->show_current_radio = WID ("show_current_radio");
tasklist->show_all_radio = WID ("show_all_radio");
- setup_sensitivity (tasklist, client, xml,
+ setup_sensitivity (tasklist, client, builder,
"show_current_radio",
"show_all_radio",
NULL,
@@ -711,7 +710,7 @@ setup_dialog (GladeXML *xml,
tasklist->auto_group_radio = WID ("auto_group_radio");
tasklist->always_group_radio = WID ("always_group_radio");
- setup_sensitivity (tasklist, client, xml,
+ setup_sensitivity (tasklist, client, builder,
"never_group_radio",
"auto_group_radio",
"always_group_radio",
@@ -721,7 +720,7 @@ setup_dialog (GladeXML *xml,
tasklist->move_minimized_radio = WID ("move_minimized_radio");
tasklist->change_workspace_radio = WID ("change_workspace_radio");
- setup_sensitivity (tasklist, client, xml,
+ setup_sensitivity (tasklist, client, builder,
"move_minimized_radio",
"change_workspace_radio",
NULL,
@@ -772,17 +771,27 @@ display_properties_dialog (BonoboUIComponent *uic,
const gchar *verbname)
{
if (tasklist->properties_dialog == NULL) {
- GladeXML *xml;
+ GtkBuilder *builder;
+ GError *error;
+
+ builder = gtk_builder_new ();
+
+ error = NULL;
+ gtk_builder_add_from_file (builder, TASKLIST_BUILDERDIR "/window-list.ui", &error);
+ if (error) {
+ g_warning ("Error loading preferences: %s", error->message);
+ g_error_free (error);
+ return;
+ }
- xml = glade_xml_new (TASKLIST_GLADEDIR "/window-list.glade", NULL, NULL);
- tasklist->properties_dialog = glade_xml_get_widget (xml, "tasklist_properties_dialog");
+ tasklist->properties_dialog = WID ("tasklist_properties_dialog");
g_object_add_weak_pointer (G_OBJECT (tasklist->properties_dialog),
(void**) &tasklist->properties_dialog);
- setup_dialog (xml, tasklist);
+ setup_dialog (builder, tasklist);
- g_object_unref (G_OBJECT (xml));
+ g_object_unref (builder);
}
gtk_window_set_icon_name (GTK_WINDOW (tasklist->properties_dialog),
diff --git a/applets/wncklet/window-list.glade b/applets/wncklet/window-list.ui
similarity index 67%
rename from applets/wncklet/window-list.glade
rename to applets/wncklet/window-list.ui
index 4ceabe0..f931295 100644
--- a/applets/wncklet/window-list.glade
+++ b/applets/wncklet/window-list.ui
@@ -1,138 +1,153 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--*- mode: xml -*-->
-<glade-interface>
- <widget class="GtkDialog" id="tasklist_properties_dialog">
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkDialog" id="tasklist_properties_dialog">
<property name="border_width">5</property>
<property name="title" translatable="yes">Window List Preferences</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="type_hint">normal</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox2">
+ <object class="GtkVBox" id="dialog-vbox2">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
- <widget class="GtkVBox" id="vbox1">
+ <object class="GtkVBox" id="vbox1">
<property name="visible">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="border_width">5</property>
+ <property name="orientation">vertical</property>
<property name="spacing">18</property>
<child>
- <widget class="GtkVBox" id="vbox7">
+ <object class="GtkVBox" id="vbox7">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label1">
+ <object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Window List Content</b></property>
- <property name="use_markup">True</property>
- </widget>
+ <property name="label" translatable="yes">Window List Content</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkAlignment" id="alignment1">
+ <object class="GtkAlignment" id="alignment1">
<property name="visible">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="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox9">
+ <object class="GtkVBox" id="vbox9">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkRadioButton" id="show_current_radio">
+ <object class="GtkRadioButton" id="show_current_radio">
+ <property name="label" translatable="yes">Sh_ow windows from current workspace</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Sh_ow windows from current workspace</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkRadioButton" id="show_all_radio">
+ <object class="GtkRadioButton" id="show_all_radio">
+ <property name="label" translatable="yes">Show windows from a_ll workspaces</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Show windows from a_ll workspaces</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
<property name="group">show_current_radio</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkVBox" id="vbox11">
+ <object class="GtkVBox" id="vbox11">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label3">
+ <object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Window Grouping</b></property>
- <property name="use_markup">True</property>
- </widget>
+ <property name="label" translatable="yes">Window Grouping</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkAlignment" id="alignment2">
+ <object class="GtkAlignment" id="alignment2">
<property name="visible">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="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox12">
+ <object class="GtkVBox" id="vbox12">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkRadioButton" id="never_group_radio">
+ <object class="GtkRadioButton" id="never_group_radio">
+ <property name="label" translatable="yes">_Never group windows</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">_Never group windows</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkRadioButton" id="auto_group_radio">
+ <object class="GtkRadioButton" id="auto_group_radio">
+ <property name="label" translatable="yes">Group windows when _space is limited</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Group windows when _space is limited</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
<property name="group">never_group_radio</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
@@ -140,140 +155,159 @@
</packing>
</child>
<child>
- <widget class="GtkRadioButton" id="always_group_radio">
+ <object class="GtkRadioButton" id="always_group_radio">
+ <property name="label" translatable="yes">_Always group windows</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">_Always group windows</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
<property name="group">never_group_radio</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
- </widget>
+ </object>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkVBox" id="vbox13">
+ <object class="GtkVBox" id="vbox13">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="minimized_windows_label">
+ <object class="GtkLabel" id="minimized_windows_label">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Restoring Minimized Windows</b></property>
- <property name="use_markup">True</property>
- </widget>
+ <property name="label" translatable="yes">Restoring Minimized Windows</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkAlignment" id="alignment3">
+ <object class="GtkAlignment" id="alignment3">
<property name="visible">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="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox14">
+ <object class="GtkVBox" id="vbox14">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkRadioButton" id="move_minimized_radio">
+ <object class="GtkRadioButton" id="move_minimized_radio">
+ <property name="label" translatable="yes">Restore to current _workspace</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Restore to current _workspace</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkRadioButton" id="change_workspace_radio">
+ <object class="GtkRadioButton" id="change_workspace_radio">
+ <property name="label" translatable="yes">Restore to na_tive workspace</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Restore to na_tive workspace</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
<property name="group">move_minimized_radio</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
- </widget>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
</child>
<child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area2">
+ <object class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
- <widget class="GtkButton" id="help_button">
+ <object class="GtkButton" id="help_button">
+ <property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="label">gtk-help</property>
+ <property name="receives_default">False</property>
<property name="use_stock">True</property>
- <property name="response_id">-11</property>
- </widget>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <widget class="GtkButton" id="done_button">
+ <object class="GtkButton" id="done_button">
+ <property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
- <property name="label">gtk-close</property>
+ <property name="receives_default">False</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
- </widget>
+ </object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
</child>
- </widget>
-</glade-interface>
+ <action-widgets>
+ <action-widget response="-11">help_button</action-widget>
+ <action-widget response="0">done_button</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/applets/wncklet/workspace-switcher.c b/applets/wncklet/workspace-switcher.c
index 5cf5153..2324514 100644
--- a/applets/wncklet/workspace-switcher.c
+++ b/applets/wncklet/workspace-switcher.c
@@ -23,7 +23,6 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include <glade/glade-xml.h>
#include <libwnck/libwnck.h>
#include <gconf/gconf-client.h>
@@ -821,8 +820,6 @@ response_cb (GtkWidget *widget,
gtk_widget_destroy (widget);
}
-#define WID(s) glade_xml_get_widget (xml, s)
-
static void
close_dialog (GtkWidget *button,
gpointer data)
@@ -844,9 +841,11 @@ close_dialog (GtkWidget *button,
gtk_widget_destroy (pager->properties_dialog);
}
+#define WID(s) GTK_WIDGET (gtk_builder_get_object (builder, s))
+
static void
setup_sensitivity (PagerData *pager,
- GladeXML *xml,
+ GtkBuilder *builder,
const char *wid1,
const char *wid2,
const char *wid3,
@@ -870,21 +869,21 @@ setup_sensitivity (PagerData *pager,
g_object_unref (G_OBJECT (client));
g_free (fullkey);
- w = glade_xml_get_widget (xml, wid1);
+ w = WID (wid1);
g_assert (w != NULL);
g_object_set_data (G_OBJECT (w), NEVER_SENSITIVE,
GINT_TO_POINTER (1));
gtk_widget_set_sensitive (w, FALSE);
if (wid2 != NULL) {
- w = glade_xml_get_widget (xml, wid2);
+ w = WID (wid2);
g_assert (w != NULL);
g_object_set_data (G_OBJECT (w), NEVER_SENSITIVE,
GINT_TO_POINTER (1));
gtk_widget_set_sensitive (w, FALSE);
}
if (wid3 != NULL) {
- w = glade_xml_get_widget (xml, wid3);
+ w = WID (wid3);
g_assert (w != NULL);
g_object_set_data (G_OBJECT (w), NEVER_SENSITIVE,
GINT_TO_POINTER (1));
@@ -894,8 +893,8 @@ setup_sensitivity (PagerData *pager,
}
static void
-setup_dialog (GladeXML *xml,
- PagerData *pager)
+setup_dialog (GtkBuilder *builder,
+ PagerData *pager)
{
gboolean value;
GtkTreeViewColumn *column;
@@ -907,7 +906,7 @@ setup_dialog (GladeXML *xml,
pager->workspace_names_scroll = WID ("workspace_names_scroll");
pager->display_workspaces_toggle = WID ("workspace_name_toggle");
- setup_sensitivity (pager, xml,
+ setup_sensitivity (pager, builder,
"workspace_name_toggle",
NULL,
NULL,
@@ -915,7 +914,7 @@ setup_dialog (GladeXML *xml,
pager->all_workspaces_radio = WID ("all_workspaces_radio");
pager->current_only_radio = WID ("current_only_radio");
- setup_sensitivity (pager, xml,
+ setup_sensitivity (pager, builder,
"all_workspaces_radio",
"current_only_radio",
"label_row_col",
@@ -923,21 +922,21 @@ setup_dialog (GladeXML *xml,
pager->num_rows_spin = WID ("num_rows_spin");
pager->label_row_col = WID("label_row_col");
- setup_sensitivity (pager, xml,
+ setup_sensitivity (pager, builder,
"num_rows_spin",
NULL,
NULL,
"num_rows" /* key */);
pager->num_workspaces_spin = WID ("num_workspaces_spin");
- setup_sensitivity (pager, xml,
+ setup_sensitivity (pager, builder,
"num_workspaces_spin",
NULL,
NULL,
NUM_WORKSPACES /* key */);
pager->workspaces_tree = WID ("workspaces_tree_view");
- setup_sensitivity (pager, xml,
+ setup_sensitivity (pager, builder,
"workspaces_tree_view",
NULL,
NULL,
@@ -1041,17 +1040,27 @@ display_properties_dialog (BonoboUIComponent *uic,
const gchar *verbname)
{
if (pager->properties_dialog == NULL) {
- GladeXML *xml;
+ GtkBuilder *builder;
+ GError *error;
+
+ builder = gtk_builder_new ();
+
+ error = NULL;
+ gtk_builder_add_from_file (builder, PAGER_BUILDERDIR "/workspace-switcher.ui", &error);
+ if (error) {
+ g_warning ("Error loading preferences: %s", error->message);
+ g_error_free (error);
+ return;
+ }
- xml = glade_xml_new (PAGER_GLADEDIR "/workspace-switcher.glade", NULL, NULL);
- pager->properties_dialog = glade_xml_get_widget (xml, "pager_properties_dialog");
+ pager->properties_dialog = WID ("pager_properties_dialog");
g_object_add_weak_pointer (G_OBJECT (pager->properties_dialog),
(gpointer *) &pager->properties_dialog);
- setup_dialog (xml, pager);
+ setup_dialog (builder, pager);
- g_object_unref (G_OBJECT (xml));
+ g_object_unref (builder);
}
gtk_window_set_icon_name (GTK_WINDOW (pager->properties_dialog),
diff --git a/applets/wncklet/workspace-switcher.glade b/applets/wncklet/workspace-switcher.ui
similarity index 66%
rename from applets/wncklet/workspace-switcher.glade
rename to applets/wncklet/workspace-switcher.ui
index c55c37c..2b84e7e 100644
--- a/applets/wncklet/workspace-switcher.glade
+++ b/applets/wncklet/workspace-switcher.ui
@@ -1,185 +1,197 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--*- mode: xml -*-->
-<glade-interface>
- <widget class="GtkDialog" id="pager_properties_dialog">
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkDialog" id="pager_properties_dialog">
<property name="border_width">5</property>
<property name="title" translatable="yes">Workspace Switcher Preferences</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="resizable">False</property>
+ <property name="type_hint">normal</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
+ <object class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
- <widget class="GtkVBox" id="vbox2">
+ <object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="border_width">5</property>
+ <property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
- <widget class="GtkFrame" id="frame1">
+ <object class="GtkFrame" id="frame1">
<property name="visible">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="label_xalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="shadow_type">none</property>
<child>
- <widget class="GtkAlignment" id="alignment2">
+ <object class="GtkAlignment" id="alignment2">
<property name="visible">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="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox5">
+ <object class="GtkVBox" id="vbox5">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkRadioButton" id="current_only_radio">
+ <object class="GtkRadioButton" id="current_only_radio">
+ <property name="label" translatable="yes">Show _only the current workspace</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Show _only the current workspace</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox9">
+ <object class="GtkHBox" id="hbox9">
<property name="visible">True</property>
<property name="spacing">12</property>
<child>
- <widget class="GtkRadioButton" id="all_workspaces_radio">
+ <object class="GtkRadioButton" id="all_workspaces_radio">
+ <property name="label" translatable="yes">Show _all workspaces in:</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Show _all workspaces in:</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
<property name="group">current_only_radio</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox10">
+ <object class="GtkHBox" id="hbox10">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkSpinButton" id="num_rows_spin">
+ <object class="GtkSpinButton" id="num_rows_spin">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">1 1 16 1 10 0</property>
+ <property name="adjustment">adjustment2</property>
<property name="climb_rate">1</property>
<property name="numeric">True</property>
- </widget>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <widget class="GtkLabel" id="label_row_col">
+ <object class="GtkLabel" id="label_row_col">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">rows</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
+ <property name="justify">center</property>
<property name="mnemonic_widget">num_rows_spin</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
</child>
- </widget>
+ </object>
</child>
- <child>
- <widget class="GtkLabel" id="label2">
+ <child type="label">
+ <object class="GtkLabel" id="label2">
<property name="visible">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="label" translatable="yes"><b>Switcher</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <property name="label" translatable="yes">Switcher</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
</child>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkFrame" id="workspaces_frame">
+ <object class="GtkFrame" id="workspaces_frame">
<property name="visible">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="label_xalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="shadow_type">none</property>
<child>
- <widget class="GtkAlignment" id="alignment1">
+ <object class="GtkAlignment" id="alignment1">
<property name="visible">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="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox1">
+ <object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkHBox" id="hbox4">
+ <object class="GtkHBox" id="hbox4">
<property name="visible">True</property>
<property name="spacing">12</property>
<child>
- <widget class="GtkLabel" id="num_workspaces_label">
+ <object class="GtkLabel" id="num_workspaces_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Number of _workspaces:</property>
<property name="use_underline">True</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
+ <property name="justify">center</property>
<property name="mnemonic_widget">num_workspaces_spin</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkSpinButton" id="num_workspaces_spin">
+ <object class="GtkSpinButton" id="num_workspaces_spin">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">1 1 36 1 10 0</property>
+ <property name="adjustment">adjustment1</property>
<property name="climb_rate">1</property>
<property name="numeric">True</property>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="workspace_names_label">
+ <object class="GtkLabel" id="workspace_names_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Workspace na_mes:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">workspaces_tree_view</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
@@ -187,101 +199,111 @@
</packing>
</child>
<child>
- <widget class="GtkScrolledWindow" id="workspace_names_scroll">
+ <object class="GtkScrolledWindow" id="workspace_names_scroll">
<property name="height_request">100</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
<child>
- <widget class="GtkTreeView" id="workspaces_tree_view">
+ <object class="GtkTreeView" id="workspaces_tree_view">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Workspace Names</property>
+ <property name="tooltip_text" translatable="yes">Workspace Names</property>
<property name="headers_visible">False</property>
- </widget>
+ </object>
</child>
- </widget>
+ </object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="workspace_name_toggle">
+ <object class="GtkCheckButton" id="workspace_name_toggle">
+ <property name="label" translatable="yes">Show workspace _names in switcher</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Show workspace _names in switcher</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
- </widget>
+ </object>
</child>
- </widget>
+ </object>
</child>
- <child>
- <widget class="GtkLabel" id="label1">
+ <child type="label">
+ <object class="GtkLabel" id="label1">
<property name="visible">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="label" translatable="yes"><b>Workspaces</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <property name="label" translatable="yes">Workspaces</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
<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="layout_style">GTK_BUTTONBOX_END</property>
<child>
- <widget class="GtkButton" id="help_button">
+ <object class="GtkButton" id="help_button">
+ <property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="label">gtk-help</property>
+ <property name="receives_default">False</property>
<property name="use_stock">True</property>
- <property name="response_id">-11</property>
- </widget>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <widget class="GtkButton" id="done_button">
+ <object class="GtkButton" id="done_button">
+ <property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
- <property name="label">gtk-close</property>
+ <property name="receives_default">False</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
- </widget>
+ </object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<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>
</child>
- </widget>
+ </object>
</child>
- </widget>
-</glade-interface>
+ <action-widgets>
+ <action-widget response="-11">help_button</action-widget>
+ <action-widget response="0">done_button</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/configure.in b/configure.in
index d500a84..7baa47e 100644
--- a/configure.in
+++ b/configure.in
@@ -87,7 +87,7 @@ PKG_CHECK_MODULES(NOTIFICATION_AREA, gtk+-2.0 >= $GTK_REQUIRED)
AC_SUBST(NOTIFICATION_AREA_CFLAGS)
AC_SUBST(NOTIFICATION_AREA_LIBS)
-PKG_CHECK_MODULES(WNCKLET, gtk+-2.0 >= $GTK_REQUIRED libwnck-1.0 >= $LIBWNCK_REQUIRED libglade-2.0 >= $LIBGLADE_REQUIRED)
+PKG_CHECK_MODULES(WNCKLET, gtk+-2.0 >= $GTK_REQUIRED libwnck-1.0 >= $LIBWNCK_REQUIRED)
AC_SUBST(WNCKLET_CFLAGS)
AC_SUBST(WNCKLET_LIBS)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 92ed0c4..b239ba1 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -28,12 +28,12 @@ applets/wncklet/GNOME_Wncklet_Factory.server.in.in
applets/wncklet/GNOME_WorkspaceSwitcherApplet.xml
applets/wncklet/showdesktop.c
applets/wncklet/window-list.c
-applets/wncklet/window-list.glade
+applets/wncklet/window-list.ui
applets/wncklet/window-list.schemas.in
applets/wncklet/window-menu.c
applets/wncklet/wncklet.c
applets/wncklet/workspace-switcher.c
-applets/wncklet/workspace-switcher.glade
+applets/wncklet/workspace-switcher.ui
applets/wncklet/workspace-switcher.schemas.in
gnome-panel/libpanel-util/panel-error.c
gnome-panel/libpanel-util/panel-launch.c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]