[gswitchit_plugins] Conversion from libglade to gtkbuilder
- From: Sergey V. Udaltsov <svu src gnome org>
- To: svn-commits-list gnome org
- Subject: [gswitchit_plugins] Conversion from libglade to gtkbuilder
- Date: Sun, 24 May 2009 07:51:57 -0400 (EDT)
commit e6bcbed1d9679bb817264c9400a67b3ed655c0c4
Author: Sergey V. Udaltsov <svu gnome org>
Date: Sat May 23 01:11:39 2009 +0100
Conversion from libglade to gtkbuilder
Since all gnome (including libgnomekbd) is going to become
libglade-free, plugins have to be converted as well.
---
.gitignore | 2 +
Makefile.am | 1 -
anim/Makefile.am | 8 +-
anim/anim.glade | 2 +-
anim/anim.ui | 291 +++++++++++++++++++++++++++++++++++++++++++++
configure.in | 6 +-
custlbls/Makefile.am | 8 +-
custlbls/custlbls.c | 47 ++++----
custlbls/custlbls.glade | 2 -
custlbls/custlbls.ui | 132 ++++++++++++++++++++
debian/control | 1 -
flags/Makefile.am | 8 +-
flags/flags.c | 93 ++++++++-------
flags/flags.glade | 5 +-
flags/flags.ui | 201 +++++++++++++++++++++++++++++++
grp4app/Makefile.am | 10 +-
grp4app/grp4app.c | 111 +++++++++--------
grp4app/grp4app.ui | 170 ++++++++++++++++++++++++++
highlight/Makefile.am | 8 +-
highlight/highlight.c | 73 +++++++-----
highlight/highlight.glade | 2 -
highlight/highlight.ui | 129 ++++++++++++++++++++
22 files changed, 1130 insertions(+), 180 deletions(-)
diff --git a/.gitignore b/.gitignore
index dd39757..8ff8c48 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,7 @@ config.status
config.sub
configure
COPYING
+gswitchit_plugins.schemas
gswitchit_plugins.spec
INSTALL
install-sh
@@ -24,4 +25,5 @@ po/Makefile.in.in
po/POTFILES
po/stamp-it
*.so
+sound/gswitchit.soundlist
stamp-h1
diff --git a/Makefile.am b/Makefile.am
index bc6f18c..1a56c3c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,5 @@
## Process this file with automake to produce Makefile.in.
-# SUBDIRS=po grp4app flags highlight sound test
SUBDIRS=po anim custlbls flags highlight sound test
schemasdir = @GCONF_SCHEMA_FILE_DIR@
diff --git a/anim/Makefile.am b/anim/Makefile.am
index de871a3..3efa5e0 100644
--- a/anim/Makefile.am
+++ b/anim/Makefile.am
@@ -7,7 +7,7 @@ plugin_cFLAGS = -I$(top_srcdir) \
-DG_LOG_DOMAIN=\"GSwitchIt\" \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I../intl -I.. -I$(top_srcdir)/intl \
- -DGLADE_DIR=\""$(gladedir)"\" \
+ -DUI_DIR=\""$(uidir)"\" \
$(LOCALURLDEF) \
$(OTHER_CFLAGS)
@@ -15,9 +15,9 @@ plugin_ldFLAGS = $(LINKED_GNOME_LIBS) $(LIBGNUTLS_LIBS)
plugin_DATA = anim.so
-gladedir = $(GLADE_DIR)
-glade_DATA = anim.glade
+uidir = $(UI_DIR)
+ui_DATA = anim.ui
-EXTRA_DIST = anim.c ${glade_DATA}
+EXTRA_DIST = anim.c ${ui_DATA}
include ../plugins.make
diff --git a/anim/anim.glade b/anim/anim.glade
index 3ae8260..5535ae0 100644
--- a/anim/anim.glade
+++ b/anim/anim.glade
@@ -249,7 +249,7 @@
</child>
<child>
- <widget class="GtkLabel" id="label19">
+ <widget class="GtkLabel" id="label20">
<property name="visible">True</property>
<property name="label" translatable="yes">Download</property>
<property name="use_underline">False</property>
diff --git a/anim/anim.ui b/anim/anim.ui
new file mode 100644
index 0000000..f2111fb
--- /dev/null
+++ b/anim/anim.ui
@@ -0,0 +1,291 @@
+<?xml version="1.0"?>
+<!--*- mode: xml -*-->
+<interface>
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="upper">10</property>
+ <property name="lower">0</property>
+ <property name="page_increment">2</property>
+ <property name="step_increment">1</property>
+ <property name="page_size">2</property>
+ <property name="value">0</property>
+ </object>
+ <object class="GtkDialog" id="flags_dialog">
+ <property name="width_request">500</property>
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Flags plugin properties</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="has_separator">True</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox2">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area2">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <object class="GtkButton" id="btnCloseHighlightPluginSettings">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-close</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox4">
+ <property name="border_width">12</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">0.5</property>
+ <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <child>
+ <object class="GtkHBox" id="hbox2">
+ <property name="border_width">6</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkVBox" id="vbox6">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+ <child>
+ <object class="GtkButton" id="btnStartDownload">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <signal handler="on_btnStartDownload_clicked" last_modification_time="Mon, 29 Mar 2004 20:10:38 GMT" name="clicked"/>
+ <child>
+ <object class="GtkAlignment" id="alignment14">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+ <child>
+ <object class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="stock">gtk-network</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label19">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Start</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox7">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+ <child>
+ <object class="GtkButton" id="btnCancelDownload">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <signal handler="on_btnCancelDownload_clicked" last_modification_time="Mon, 29 Mar 2004 20:16:08 GMT" name="clicked"/>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox5">
+ <property name="border_width">6</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+ <child>
+ <object class="GtkHScale" id="downloadProgress">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="draw_value">False</property>
+ <property name="value_pos">GTK_POS_TOP</property>
+ <property name="digits">1</property>
+ <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
+ <property name="inverted">False</property>
+ <property name="adjustment">adjustment1</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="lblDownloadStatus">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"/>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label20">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Download</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="chkEnableFlags">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Enable flags</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <signal handler="on_chkEnableFlags_toggled" last_modification_time="Fri, 26 Mar 2004 23:36:25 GMT" name="toggled"/>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-7">btnCloseHighlightPluginSettings</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/configure.in b/configure.in
index 17718ab..a49ba1b 100644
--- a/configure.in
+++ b/configure.in
@@ -29,7 +29,7 @@ AC_ISC_POSIX
AC_HEADER_STDC
AM_PROG_LIBTOOL
-PKG_CHECK_MODULES(LINKED_GNOME, gdk-pixbuf-2.0 libglade-2.0 gconf-2.0 gmodule-2.0 libgnomeui-2.0 libgnomekbd >= 2.18.0 libsoup-2.4 cairo librsvg-2.0)
+PKG_CHECK_MODULES(LINKED_GNOME, gdk-pixbuf-2.0 gconf-2.0 gmodule-2.0 libgnomeui-2.0 libgnomekbd >= 2.18.0 libsoup-2.4 cairo librsvg-2.0)
AC_SUBST(LINKED_GNOME_CFLAGS)
AC_SUBST(LINKED_GNOME_LIBS)
@@ -55,8 +55,8 @@ AM_GLIB_GNU_GETTEXT
AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)
-GLADE_DIR='$(datadir)/'${PACKAGE}'/interfaces'
-AC_SUBST(GLADE_DIR)
+UI_DIR='$(datadir)/'${PACKAGE}'/interfaces'
+AC_SUBST(UI_DIR)
AC_PROG_INTLTOOL
diff --git a/custlbls/Makefile.am b/custlbls/Makefile.am
index 1f73123..b9b4c36 100644
--- a/custlbls/Makefile.am
+++ b/custlbls/Makefile.am
@@ -3,14 +3,14 @@ plugin_cFLAGS = -I$(top_srcdir) \
-DG_LOG_DOMAIN=\"GSwitchIt\" \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I../intl -I.. -I$(top_srcdir)/intl \
- -DGLADE_DIR=\""$(gladedir)"\" \
+ -DUI_DIR=\""$(uidir)"\" \
$(OTHER_CFLAGS)
plugin_DATA = custlbls.so
-gladedir = $(GLADE_DIR)
-glade_DATA = custlbls.glade
+uidir = $(UI_DIR)
+ui_DATA = custlbls.ui
-EXTRA_DIST = custlbls.c ${glade_DATA}
+EXTRA_DIST = custlbls.c ${ui_DATA}
include ../plugins.make
diff --git a/custlbls/custlbls.c b/custlbls/custlbls.c
index 19b15ad..2eb40a9 100644
--- a/custlbls/custlbls.c
+++ b/custlbls/custlbls.c
@@ -19,8 +19,6 @@
#include <gmodule.h>
#include <gnome.h>
-#include <glade/glade.h>
-
#include "libgnomekbd/gkbd-indicator-plugin.h"
#define PLUGIN_GCONF_DIR "/apps/" PACKAGE "/CustomLabels"
@@ -34,7 +32,7 @@ static GtkTreeModel *layoutLabelsModel = NULL;
static guint listener;
-static GladeXML *data;
+static GtkBuilder *builder;
static void
LoadConfig (void)
@@ -149,7 +147,8 @@ AddLabelToList (gchar * labelText)
static void
UpdateList ()
{
- GtkWidget *list = glade_xml_get_widget (data, "lstLabels");
+ GtkWidget *list =
+ GTK_WIDGET (gtk_builder_get_object (builder, "lstLabels"));
if (layoutLabelsModel == NULL) {
layoutLabelsModel =
GTK_TREE_MODEL (gtk_list_store_new (1, G_TYPE_STRING));
@@ -166,7 +165,8 @@ UpdateList ()
static void
AddLabel (GtkButton * btn)
{
- GtkWidget *txtLabel = glade_xml_get_widget (data, "txtLabel");
+ GtkWidget *txtLabel =
+ GTK_WIDGET (gtk_builder_get_object (builder, "txtLabel"));
layoutLabels =
g_slist_append (layoutLabels,
g_strdup (gtk_entry_get_text
@@ -179,7 +179,8 @@ AddLabel (GtkButton * btn)
static void
DelLabel (GtkButton * btn)
{
- GtkWidget *list = glade_xml_get_widget (data, "lstLabels");
+ GtkWidget *list =
+ GTK_WIDGET (gtk_builder_get_object (builder, "lstLabels"));
GtkTreeIter iter;
GtkTreeSelection *selection =
@@ -208,9 +209,12 @@ DelLabel (GtkButton * btn)
static void
ListSelectionChanged (GtkTreeSelection * selection)
{
- GtkWidget *list = glade_xml_get_widget (data, "lstLabels");
- GtkWidget *btnDel = glade_xml_get_widget (data, "btnDelete");
- GtkWidget *txtLabel = glade_xml_get_widget (data, "txtLabel");
+ GtkWidget *list =
+ GTK_WIDGET (gtk_builder_get_object (builder, "lstLabels"));
+ GtkWidget *btnDel =
+ GTK_WIDGET (gtk_builder_get_object (builder, "btnDelete"));
+ GtkWidget *txtLabel =
+ GTK_WIDGET (gtk_builder_get_object (builder, "txtLabel"));
GtkTreeIter selectedIter;
gboolean isAnythingSelected = FALSE;
@@ -235,28 +239,29 @@ ConfigurePlugin (GkbdIndicatorPluginContainer * pc, GtkWindow * parent)
gtk_tree_view_column_new_with_attributes (NULL, renderer,
"text", 0,
NULL);
+ GError *error = NULL;
container = pc;
LoadConfig ();
- data =
- glade_xml_new (GLADE_DIR "/custlbls.glade",
- "custlbls_dialog", PACKAGE);
+ builder = gtk_builder_new ();
+ gtk_builder_add_from_file (builder, UI_DIR "/custlbls.ui", &error);
- dialog = glade_xml_get_widget (data, "custlbls_dialog");
+ dialog =
+ GTK_WIDGET (gtk_builder_get_object
+ (builder, "custlbls_dialog"));
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
- glade_xml_signal_connect_data (data,
- "on_btnAdd_clicked",
- GTK_SIGNAL_FUNC (AddLabel), NULL);
-
- glade_xml_signal_connect_data (data,
- "on_btnDelete_clicked",
- GTK_SIGNAL_FUNC (DelLabel), NULL);
+ g_signal_connect (GTK_WIDGET
+ (gtk_builder_get_object (builder, "btnAdd")),
+ "clicked", G_CALLBACK (AddLabel), NULL);
+ g_signal_connect (GTK_WIDGET
+ (gtk_builder_get_object (builder, "btnDelete")),
+ "clicked", G_CALLBACK (DelLabel), NULL);
- list = glade_xml_get_widget (data, "lstLabels");
+ list = GTK_WIDGET (gtk_builder_get_object (builder, "lstLabels"));
gtk_tree_view_append_column (GTK_TREE_VIEW (list), column);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (list));
diff --git a/custlbls/custlbls.glade b/custlbls/custlbls.glade
index 75d75f4..1ed9f29 100644
--- a/custlbls/custlbls.glade
+++ b/custlbls/custlbls.glade
@@ -66,7 +66,6 @@
<property name="label" translatable="yes">gtk-add</property>
<property name="use_stock">True</property>
<property name="response_id">0</property>
- <signal name="clicked" handler="on_btnAdd_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
@@ -81,7 +80,6 @@
<property name="label" translatable="yes">gtk-remove</property>
<property name="use_stock">True</property>
<property name="response_id">0</property>
- <signal name="clicked" handler="on_btnDelete_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
diff --git a/custlbls/custlbls.ui b/custlbls/custlbls.ui
new file mode 100644
index 0000000..b2926e8
--- /dev/null
+++ b/custlbls/custlbls.ui
@@ -0,0 +1,132 @@
+<?xml version="1.0"?>
+<!--*- mode: xml -*-->
+<interface>
+ <object class="GtkDialog" id="custlbls_dialog">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Custom Labels</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox2">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkVBox" id="vbox4">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Label:</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="txtLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkTreeView" id="lstLabels">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_clickable">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkButton" id="btnAdd">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="label" translatable="yes">gtk-add</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="btnDelete">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="label" translatable="yes">gtk-remove</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">3</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area2">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <object class="GtkButton" id="btnClose">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-close</property>
+ <property name="use_stock">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">btnAdd</action-widget>
+ <action-widget response="0">btnDelete</action-widget>
+ <action-widget response="-7">btnClose</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/debian/control b/debian/control
index 8397004..83eef64 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,6 @@ Build-Depends: debhelper,
cdbs,
pkg-config,
libgtk2.0-dev,
- libglade2-dev,
libgconf2-dev,
libglib2.0-dev,
libgnomeui-dev,
diff --git a/flags/Makefile.am b/flags/Makefile.am
index 6632944..ae6bf62 100644
--- a/flags/Makefile.am
+++ b/flags/Makefile.am
@@ -7,7 +7,7 @@ plugin_cFLAGS = -I$(top_srcdir) \
-DG_LOG_DOMAIN=\"GSwitchIt\" \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I../intl -I.. -I$(top_srcdir)/intl \
- -DGLADE_DIR=\""$(gladedir)"\" \
+ -DUI_DIR=\""$(uidir)"\" \
$(LOCALURLDEF) \
$(OTHER_CFLAGS)
@@ -15,9 +15,9 @@ plugin_ldFLAGS = $(LINKED_GNOME_LIBS) $(LIBGNUTLS_LIBS)
plugin_DATA = flags.so
-gladedir = $(GLADE_DIR)
-glade_DATA = flags.glade flags.pl
+uidir = $(UI_DIR)
+ui_DATA = flags.ui flags.pl
-EXTRA_DIST = flags.c ${glade_DATA}
+EXTRA_DIST = flags.c ${ui_DATA}
include ../plugins.make
diff --git a/flags/flags.c b/flags/flags.c
index 1ce720d..45be9da 100644
--- a/flags/flags.c
+++ b/flags/flags.c
@@ -21,7 +21,6 @@
#include <gmodule.h>
#include <gnome.h>
-#include <glade/glade.h>
#include <libsoup/soup.h>
#include "libgnomekbd/gkbd-indicator-plugin.h"
@@ -42,7 +41,7 @@ static gboolean showFlags = FALSE;
static guint listener;
-static GladeXML *data = NULL;
+static GtkBuilder *builder = NULL;
static SoupSession *soupSession = NULL;
static SoupMessage *soupMessage = NULL;
@@ -95,9 +94,10 @@ ConfigChangedCallback (GConfClient * client,
LoadConfig ();
if (isCfg) {
- if (data != NULL) {
+ if (builder != NULL) {
GtkWidget *chkBtn =
- glade_xml_get_widget (data, "chkEnableFlags");
+ GTK_WIDGET (gtk_builder_get_object
+ (builder, "chkEnableFlags"));
if (chkBtn != NULL) {
gtk_toggle_button_set_active
(GTK_TOGGLE_BUTTON (chkBtn),
@@ -170,8 +170,8 @@ ChangeShowFlag (GtkCheckButton * chkBtn)
static void
SetDownloadStatus (const char *status)
{
- gtk_label_set_text (GTK_LABEL (glade_xml_get_widget
- (data, "lblDownloadStatus")),
+ gtk_label_set_text (GTK_LABEL (gtk_builder_get_object
+ (builder, "lblDownloadStatus")),
status);
gtk_main_iteration ();
}
@@ -179,10 +179,14 @@ SetDownloadStatus (const char *status)
static void
EnableDisableDownloadButtons (gboolean inProcess)
{
- gtk_widget_set_sensitive (glade_xml_get_widget
- (data, "btnStartDownload"), !inProcess);
- gtk_widget_set_sensitive (glade_xml_get_widget
- (data, "btnCancelDownload"), inProcess);
+ gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object
+ (builder,
+ "btnStartDownload")),
+ !inProcess);
+ gtk_widget_set_sensitive (GTK_WIDGET
+ (gtk_builder_get_object
+ (builder, "btnCancelDownload")),
+ inProcess);
}
static void
@@ -198,9 +202,10 @@ GotFile (SoupSession * session, SoupMessage * msg)
(G_OBJECT (msg), "totalSize"));
int responseBodyLength = msg->response_body->length;
- printf ("Got the file %s, resp body length %d/current size %d/total size %d\n",
- soup_message_get_uri (msg)->path, responseBodyLength,
- currentSize, totalSize);
+ printf
+ ("Got the file %s, resp body length %d/current size %d/total size %d\n",
+ soup_message_get_uri (msg)->path, responseBodyLength,
+ currentSize, totalSize);
printf ("status: %d [%s]\n", msg->status_code,
soup_status_get_phrase (msg->status_code));
@@ -223,7 +228,7 @@ GotFile (SoupSession * session, SoupMessage * msg)
gchar *cmdLine =
g_strdup_printf
("%s %s/flags.pl %s %s",
- perlPath, GLADE_DIR,
+ perlPath, UI_DIR,
tarname, g_get_tmp_dir ());
GError *err = NULL;
gint exitStatus;
@@ -254,8 +259,8 @@ GotFile (SoupSession * session, SoupMessage * msg)
0.75);
gtk_range_set_value
(GTK_RANGE
- (glade_xml_get_widget
- (data,
+ (gtk_builder_get_object
+ (builder,
"downloadProgress")),
newVal);
break;
@@ -311,26 +316,26 @@ GotFile (SoupSession * session, SoupMessage * msg)
static void
GotHeaders (SoupMessage * msg)
{
- gint cl =
- (gint) soup_message_headers_get_content_length (msg->
- response_headers);
+ gint cl = (gint)
+ soup_message_headers_get_content_length
+ (msg->response_headers);
printf ("content length: %d\n", cl);
if (cl != 0) {
g_object_set_data (G_OBJECT (msg), "totalSize",
GINT_TO_POINTER (cl));
gtk_range_set_range (GTK_RANGE
- (glade_xml_get_widget
- (data, "downloadProgress")), 0,
+ (gtk_builder_get_object
+ (builder, "downloadProgress")), 0,
(int) (cl * 3 / 4));
} else
- gtk_range_set_range (GTK_RANGE (glade_xml_get_widget
- (data,
+ gtk_range_set_range (GTK_RANGE (gtk_builder_get_object
+ (builder,
"downloadProgress")), 0,
2);
g_object_set_data (G_OBJECT (msg), "currentSize",
GINT_TO_POINTER (0));
- gtk_range_set_value (GTK_RANGE (glade_xml_get_widget
- (data, "downloadProgress")), 0);
+ gtk_range_set_value (GTK_RANGE (gtk_builder_get_object
+ (builder, "downloadProgress")), 0);
}
static void
@@ -341,8 +346,8 @@ GotMsgChunk (SoupMessage * msg)
GINT_TO_POINTER (cs));
if (GPOINTER_TO_INT
(g_object_get_data (G_OBJECT (msg), "totalSize"))) {
- gtk_range_set_value (GTK_RANGE (glade_xml_get_widget
- (data,
+ gtk_range_set_value (GTK_RANGE (gtk_builder_get_object
+ (builder,
"downloadProgress")), cs);
}
}
@@ -384,30 +389,32 @@ static void
ConfigurePlugin (GkbdIndicatorPluginContainer * pc, GtkWindow * parent)
{
GtkWidget *dialog;
+ GError *error = NULL;
container = pc;
LoadConfig ();
- data =
- glade_xml_new (GLADE_DIR "/flags.glade", "flags_dialog",
- PACKAGE);
+ builder = gtk_builder_new ();
+ gtk_builder_add_from_file (builder, UI_DIR "/flags.ui", &error);
- dialog = glade_xml_get_widget (data, "flags_dialog");
+ dialog =
+ GTK_WIDGET (gtk_builder_get_object (builder, "flags_dialog"));
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
- glade_xml_signal_connect_data (data,
- "on_chkEnableFlags_toggled",
- GTK_SIGNAL_FUNC (ChangeShowFlag),
- NULL);
- glade_xml_signal_connect_data (data, "on_btnStartDownload_clicked",
- GTK_SIGNAL_FUNC
- (DoStartDownloadFlags), NULL);
- glade_xml_signal_connect_data (data,
- "on_btnCancelDownload_clicked",
- GTK_SIGNAL_FUNC
- (DoCancelDownloadFlags), NULL);
+ g_signal_connect (GTK_WIDGET
+ (gtk_builder_get_object
+ (builder, "chkEnableFlags")), "toggled",
+ G_CALLBACK (ChangeShowFlag), NULL);
+ g_signal_connect (GTK_WIDGET
+ (gtk_builder_get_object
+ (builder, "btnStartDownload")), "clicked",
+ G_CALLBACK (DoStartDownloadFlags), NULL);
+ g_signal_connect (GTK_WIDGET
+ (gtk_builder_get_object
+ (builder, "btnCancelDownload")), "clicked",
+ G_CALLBACK (DoCancelDownloadFlags), NULL);
ConfigChangedCallback (NULL, 0, NULL, TRUE);
StartGConfListening (TRUE);
@@ -415,7 +422,7 @@ ConfigurePlugin (GkbdIndicatorPluginContainer * pc, GtkWindow * parent)
StopListening ();
gtk_widget_destroy (dialog);
- data = NULL;
+ builder = NULL;
container = NULL;
}
diff --git a/flags/flags.glade b/flags/flags.glade
index 28f1830..061c9d4 100644
--- a/flags/flags.glade
+++ b/flags/flags.glade
@@ -32,7 +32,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="response_id">0</property>
- <signal name="clicked" handler="on_btnStartDownload_clicked"/>
<child>
<widget class="GtkAlignment" id="alignment14">
<property name="visible">True</property>
@@ -118,7 +117,6 @@
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="response_id">0</property>
- <signal name="clicked" handler="on_btnCancelDownload_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
@@ -136,7 +134,7 @@
</widget>
</child>
<child>
- <widget class="GtkLabel" id="label19">
+ <widget class="GtkLabel" id="label20">
<property name="visible">True</property>
<property name="label" translatable="yes">Download</property>
</widget>
@@ -158,7 +156,6 @@
<property name="use_underline">True</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_chkEnableFlags_toggled"/>
</widget>
<packing>
<property name="expand">False</property>
diff --git a/flags/flags.ui b/flags/flags.ui
new file mode 100644
index 0000000..b3fd098
--- /dev/null
+++ b/flags/flags.ui
@@ -0,0 +1,201 @@
+<?xml version="1.0"?>
+<!--*- mode: xml -*-->
+<interface>
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="upper">10</property>
+ <property name="lower">0</property>
+ <property name="page_increment">2</property>
+ <property name="step_increment">1</property>
+ <property name="page_size">2</property>
+ <property name="value">0</property>
+ </object>
+ <object class="GtkDialog" id="flags_dialog">
+ <property name="width_request">500</property>
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Flags</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox2">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkVBox" id="vbox4">
+ <property name="visible">True</property>
+ <property name="border_width">12</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <child>
+ <object class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkVBox" id="vbox6">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkButton" id="btnStartDownload">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkAlignment" id="alignment14">
+ <property name="visible">True</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <object class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="stock">gtk-network</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label19">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Start</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox5">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <child>
+ <object class="GtkHScale" id="downloadProgress">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">adjustment1</property>
+ <property name="draw_value">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="lblDownloadStatus">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox7">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkButton" id="btnCancelDownload">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label20">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Download</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="chkEnableFlags">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Enable flags</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area2">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <object class="GtkButton" id="btnCloseHighlightPluginSettings">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-close</property>
+ <property name="use_stock">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">btnStartDownload</action-widget>
+ <action-widget response="0">btnCancelDownload</action-widget>
+ <action-widget response="0">chkEnableFlags</action-widget>
+ <action-widget response="-7">btnCloseHighlightPluginSettings</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/grp4app/Makefile.am b/grp4app/Makefile.am
index a7af201..8d775e3 100644
--- a/grp4app/Makefile.am
+++ b/grp4app/Makefile.am
@@ -3,17 +3,17 @@ plugin_cFLAGS = -I$(top_srcdir) \
-DG_LOG_DOMAIN=\"GSwitchIt\" \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I../intl -I.. -I$(top_srcdir)/intl \
- -DGLADE_DIR=\""$(gladedir)"\" \
+ -DUI_DIR=\""$(uidir)"\" \
$(OTHER_CFLAGS)
# BAD but I'll fix it later. Need for XmuClientWindow
-plugin_ldFLAGS = -L$(x_libraries) -lXmu
+plugin_ldFLAGS = -lXmu
-gladedir = $(GLADE_DIR)
-glade_DATA = grp4app.glade
+uidir = $(UI_DIR)
+ui_DATA = grp4app.ui
plugin_DATA = grp4app.so
-EXTRA_DIST = grp4app.c ${glade_DATA}
+EXTRA_DIST = grp4app.c ${ui_DATA}
include ../plugins.make
diff --git a/grp4app/grp4app.c b/grp4app/grp4app.c
index 79cd111..a00ee79 100644
--- a/grp4app/grp4app.c
+++ b/grp4app/grp4app.c
@@ -24,8 +24,6 @@
#include <X11/cursorfont.h>
-#include <glade/glade.h>
-
#include "libgnomekbd/gkbd-indicator-plugin.h"
#define PLUGIN_GCONF_DIR "/apps/" PACKAGE "/Grp4App"
@@ -34,16 +32,16 @@
#define CLASSES2_CONFIG_KEY PLUGIN_GCONF_DIR "/classes2"
#define GROUPS_CONFIG_KEY PLUGIN_GCONF_DIR "/groups"
-static GSwitchItPluginContainer *container;
+static GkbdIndicatorPluginContainer *container;
static guint listener;
-static GladeXML *data;
+static GtkBuilder *builder;
static GSList *classes1 = NULL;
static GSList *classes2 = NULL;
static GSList *groups = NULL;
-static GSList *groupNames;
+static gchar **groupNames;
static GtkWindow *configParent;
static GtkWidget *configDialog, *windowList, *btnDel, *btnAdd,
@@ -78,7 +76,8 @@ LoadList (const gchar * key, GConfValueType type)
GSList *lst;
lst =
- gconf_client_get_list (container->confClient, key, type, &err);
+ gconf_client_get_list (container->conf_client, key, type,
+ &err);
if (lst == NULL || err != NULL) {
if (err != NULL) {
g_warning ("Error reading configuration:%s\n",
@@ -114,7 +113,7 @@ SaveConfig (void)
GCONF_VALUE_STRING, classes2);
gconf_change_set_set_list (cs, GROUPS_CONFIG_KEY, GCONF_VALUE_INT,
groups);
- gconf_client_commit_change_set (container->confClient, cs, TRUE,
+ gconf_client_commit_change_set (container->conf_client, cs, TRUE,
&err);
}
@@ -129,7 +128,7 @@ static void
StartListening (void)
{
GError *err = NULL;
- listener = gconf_client_notify_add (container->confClient,
+ listener = gconf_client_notify_add (container->conf_client,
PLUGIN_GCONF_DIR,
(GConfClientNotifyFunc)
ConfigChangedCallback, NULL,
@@ -144,16 +143,16 @@ StartListening (void)
static void
StopListening (void)
{
- gconf_client_notify_remove (container->confClient, listener);
+ gconf_client_notify_remove (container->conf_client, listener);
}
static gboolean
-PluginInit (GSwitchItPluginContainer * pc)
+PluginInit (GkbdIndicatorPluginContainer * pc)
{
GError *gerror = NULL;
container = pc;
- gconf_client_add_dir (container->confClient,
+ gconf_client_add_dir (container->conf_client,
PLUGIN_GCONF_DIR,
GCONF_CLIENT_PRELOAD_NONE, &gerror);
if (gerror != NULL) {
@@ -190,7 +189,7 @@ WindowCreated (const Window win, const Window parent)
classes2, *groupIter = groups;
wmClass1 = classHint->res_name;
wmClass2 = classHint->res_class;
- printf( "Win: [%s][%s]\n", wmClass1, wmClass2 );
+ printf ("Win: [%s][%s]\n", wmClass1, wmClass2);
if (wmClass1 != NULL && wmClass2 != NULL) {
int idx = 0;
@@ -205,8 +204,8 @@ WindowCreated (const Window win, const Window parent)
&& !strcmp (class2, wmClass2)) {
/* printf( "Found element %d\n", idx ); */
group =
- GPOINTER_TO_INT (groupIter->
- data);
+ GPOINTER_TO_INT
+ (groupIter->data);
break;
}
class1Iter = class1Iter->next;
@@ -220,7 +219,7 @@ WindowCreated (const Window win, const Window parent)
}
XFree (classHint);
- printf( "asked for group %d\n", group );
+ printf ("asked for group %d\n", group);
return group;
}
@@ -296,7 +295,7 @@ DefaultGroupChanged (GtkWidget * defaultGroupsOMenuItem, void *param)
gtk_list_store_set (GTK_LIST_STORE (windowListModel), &selectedRow,
2,
newGroupNo >=
- 0 ? g_slist_nth_data (groupNames, newGroupNo) :
+ 0 ? groupNames[newGroupNo] :
dgettext (PACKAGE, "not used"), 3, newGroupNo,
-1);
}
@@ -467,27 +466,29 @@ DelWindow (GtkWidget * btn, void *param)
}
static void
-ConfigurePlugin (GSwitchItPluginContainer * pc, GtkWindow * parent)
+ConfigurePlugin (GkbdIndicatorPluginContainer * pc, GtkWindow * parent)
{
GtkWidget *defaultGroupsMenu, *menuItem;
guint nGroups;
- const char *groupName;
+ gchar **groupName;
int i;
GtkCellRenderer *renderer;
GtkTreeViewColumn *class1Col, *class2Col, *groupCol;
GtkTreeSelection *selection;
GSList *class1Iter, *class2Iter, *groupIter;
+ GError *error = NULL;
container = pc;
configParent = parent;
LoadConfig ();
- data =
- glade_xml_new (GLADE_DIR "/grp4app.glade", "grp4app_dialog",
- PACKAGE);
+ builder = gtk_builder_new ();
+ gtk_builder_add_from_file (builder, UI_DIR "/grp4app.ui", &error);
- configDialog = glade_xml_get_widget (data, "grp4app_dialog");
+ configDialog =
+ GTK_WIDGET (gtk_builder_get_object
+ (builder, "grp4app_dialog"));
gtk_window_set_modal (GTK_WINDOW (configDialog), TRUE);
gtk_window_set_transient_for (GTK_WINDOW (configDialog), parent);
@@ -497,10 +498,12 @@ ConfigurePlugin (GSwitchItPluginContainer * pc, GtkWindow * parent)
"defaultGroupsMenu", defaultGroupsMenu);
defaultGroupsOMenu =
- glade_xml_get_widget (data, "defaultGroupsOMenu");
- windowList = glade_xml_get_widget (data, "windowList");
- btnAdd = glade_xml_get_widget (data, "btnAdd");
- btnDel = glade_xml_get_widget (data, "btnDel");
+ GTK_WIDGET (gtk_builder_get_object
+ (builder, "defaultGroupsOMenu"));
+ windowList =
+ GTK_WIDGET (gtk_builder_get_object (builder, "windowList"));
+ btnAdd = GTK_WIDGET (gtk_builder_get_object (builder, "btnAdd"));
+ btnDel = GTK_WIDGET (gtk_builder_get_object (builder, "btnDel"));
menuItem =
gtk_menu_item_new_with_label (dgettext (PACKAGE, "not used"));
@@ -513,24 +516,26 @@ ConfigurePlugin (GSwitchItPluginContainer * pc, GtkWindow * parent)
gtk_menu_shell_append (GTK_MENU_SHELL (defaultGroupsMenu),
menuItem);
gtk_widget_show (menuItem);
- nGroups = GSwitchItPluginGetNumGroups (pc);
- groupNames = groupIter = GSwitchItPluginLoadLocalizedGroupNames (pc);
-
- while (groupIter != NULL)
- {
- groupName = (const char *) groupIter->data;
- if (groupName != NULL)
- {
- menuItem = gtk_menu_item_new_with_label (groupName);
- gtk_object_set_data (GTK_OBJECT (menuItem), "group",
- GINT_TO_POINTER (i));
- g_signal_connect (GTK_OBJECT (menuItem), "activate",
- G_CALLBACK (DefaultGroupChanged), NULL);
- gtk_menu_shell_append (GTK_MENU_SHELL (defaultGroupsMenu),
+ nGroups = gkbd_indicator_plugin_get_num_groups (pc);
+ groupNames = groupName =
+ gkbd_indicator_plugin_load_localized_group_names (pc);
+
+ if (groupName != NULL) {
+ while (*groupName != NULL) {
+ menuItem =
+ gtk_menu_item_new_with_label (*groupName);
+ gtk_object_set_data (GTK_OBJECT (menuItem),
+ "group", GINT_TO_POINTER (i));
+ g_signal_connect (GTK_OBJECT (menuItem),
+ "activate",
+ G_CALLBACK (DefaultGroupChanged),
+ NULL);
+ gtk_menu_shell_append (GTK_MENU_SHELL
+ (defaultGroupsMenu),
menuItem);
gtk_widget_show (menuItem);
}
- groupIter= groupIter->next;
+ groupName++;
}
gtk_option_menu_set_menu (GTK_OPTION_MENU (defaultGroupsOMenu),
@@ -593,7 +598,7 @@ ConfigurePlugin (GSwitchItPluginContainer * pc, GtkWindow * parent)
&iter, 0, class1Iter->data, 1,
class2Iter->data, 2,
group >=
- 0 ? g_slist_nth_data (groupNames, group) :
+ 0 ? groupNames[group] :
dgettext (PACKAGE, "not used"), 3,
group, -1);
class1Iter = class1Iter->next;
@@ -604,10 +609,12 @@ ConfigurePlugin (GSwitchItPluginContainer * pc, GtkWindow * parent)
g_signal_connect (G_OBJECT (selection), "changed",
G_CALLBACK (WinClassSelected), NULL);
- glade_xml_signal_connect (data, "on_btnAdd_clicked",
- (GCallback) AddWindow);
- glade_xml_signal_connect (data, "on_btnDel_clicked",
- (GCallback) DelWindow);
+ g_signal_connect (GTK_WIDGET
+ (gtk_builder_get_object (builder, "btnAdd")),
+ "clicked", G_CALLBACK (AddWindow), NULL);
+ g_signal_connect (GTK_WIDGET
+ (gtk_builder_get_object (builder, "btnDel")),
+ "clicked", G_CALLBACK (DelWindow), NULL);
gtk_tree_selection_unselect_all (selection);
WinClassSelected (NULL, NULL);
@@ -619,10 +626,10 @@ ConfigurePlugin (GSwitchItPluginContainer * pc, GtkWindow * parent)
configParent = NULL;
}
-G_MODULE_EXPORT const GSwitchItPlugin *
+G_MODULE_EXPORT const GkbdIndicatorPlugin *
GetPlugin (void)
{
- static GSwitchItPlugin gswitchitPlugin = {
+ static GkbdIndicatorPlugin gswitchitPlugin = {
NULL
};
if (gswitchitPlugin.name == NULL) {
@@ -634,10 +641,10 @@ GetPlugin (void)
gswitchitPlugin.description =
dgettext (PACKAGE,
"Sets initial layout on per-application basis");
- gswitchitPlugin.initCallback = PluginInit;
- gswitchitPlugin.termCallback = PluginTerm;
- gswitchitPlugin.windowCreatedCallback = WindowCreated;
- gswitchitPlugin.configurePropertiesCallback =
+ gswitchitPlugin.init_callback = PluginInit;
+ gswitchitPlugin.term_callback = PluginTerm;
+ gswitchitPlugin.window_created_callback = WindowCreated;
+ gswitchitPlugin.configure_properties_callback =
ConfigurePlugin;
}
return &gswitchitPlugin;
diff --git a/grp4app/grp4app.ui b/grp4app/grp4app.ui
new file mode 100644
index 0000000..623d853
--- /dev/null
+++ b/grp4app/grp4app.ui
@@ -0,0 +1,170 @@
+<?xml version="1.0"?>
+<!--*- mode: xml -*-->
+<interface>
+ <object class="GtkDialog" id="grp4app_dialog">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Layout Per Application</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox2">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <child>
+ <object class="GtkVBox" id="vbox5">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="label19">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Window types:</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <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>
+ <child>
+ <object class="GtkTreeView" id="windowList">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label20">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Default group to use:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkOptionMenu" id="defaultGroupsOMenu">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox4">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkButton" id="btnAdd">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="border_width">6</property>
+ <property name="label">gtk-add</property>
+ <property name="use_stock">True</property>
+ <signal handler="on_btnAdd_clicked" name="clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="btnDel">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="border_width">6</property>
+ <property name="label">gtk-remove</property>
+ <property name="use_stock">True</property>
+ <signal handler="on_btnDel_clicked" name="clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area2">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <object class="GtkButton" id="closebutton1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-close</property>
+ <property name="use_stock">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">defaultGroupsOMenu</action-widget>
+ <action-widget response="0">btnAdd</action-widget>
+ <action-widget response="0">btnDel</action-widget>
+ <action-widget response="-7">closebutton1</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/highlight/Makefile.am b/highlight/Makefile.am
index e149bfe..9740612 100644
--- a/highlight/Makefile.am
+++ b/highlight/Makefile.am
@@ -3,14 +3,14 @@ plugin_cFLAGS = -I$(top_srcdir) \
-DG_LOG_DOMAIN=\"GSwitchIt\" \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I../intl -I.. -I$(top_srcdir)/intl \
- -DGLADE_DIR=\""$(gladedir)"\" \
+ -DUI_DIR=\""$(uidir)"\" \
$(OTHER_CFLAGS)
plugin_DATA = highlight.so
-gladedir = $(GLADE_DIR)
-glade_DATA = highlight.glade
+uidir = $(UI_DIR)
+ui_DATA = highlight.ui
-EXTRA_DIST = highlight.c ${glade_DATA}
+EXTRA_DIST = highlight.c ${ui_DATA}
include ../plugins.make
diff --git a/highlight/highlight.c b/highlight/highlight.c
index 48736c8..8e54fe5 100644
--- a/highlight/highlight.c
+++ b/highlight/highlight.c
@@ -20,8 +20,6 @@
#include <gnome.h>
#include <pango/pango.h>
-#include <glade/glade.h>
-
#include "libgnomekbd/gkbd-indicator-plugin.h"
#define PLUGIN_GCONF_DIR "/apps/" PACKAGE "/Highlight"
@@ -36,7 +34,7 @@ static GdkColor fgColor = { 0L, 0xFFFF, 0xFFFF, 0xFFFF };
static guint listener;
-static GladeXML *data;
+static GtkBuilder *builder;
static void
LoadColor (GdkColor * color, const char *key)
@@ -162,22 +160,38 @@ PluginTerm (void)
static void
UpdateColorChooserButtons ()
{
- gtk_widget_modify_bg (glade_xml_get_widget (data, "btnFgColor"),
- GTK_STATE_NORMAL, &fgColor);
- gtk_widget_modify_bg (glade_xml_get_widget (data, "btnFgColor"),
- GTK_STATE_ACTIVE, &fgColor);
- gtk_widget_modify_bg (glade_xml_get_widget (data, "btnFgColor"),
+ gtk_widget_modify_bg (GTK_WIDGET
+ (gtk_builder_get_object
+ (builder, "btnFgColor")), GTK_STATE_NORMAL,
+ &fgColor);
+ gtk_widget_modify_bg (GTK_WIDGET
+ (gtk_builder_get_object
+ (builder, "btnFgColor")), GTK_STATE_ACTIVE,
+ &fgColor);
+ gtk_widget_modify_bg (GTK_WIDGET
+ (gtk_builder_get_object
+ (builder, "btnFgColor")),
GTK_STATE_PRELIGHT, &fgColor);
- gtk_widget_modify_bg (glade_xml_get_widget (data, "btnFgColor"),
+ gtk_widget_modify_bg (GTK_WIDGET
+ (gtk_builder_get_object
+ (builder, "btnFgColor")),
GTK_STATE_SELECTED, &fgColor);
- gtk_widget_modify_bg (glade_xml_get_widget (data, "btnBgColor"),
- GTK_STATE_NORMAL, &bgColor);
- gtk_widget_modify_bg (glade_xml_get_widget (data, "btnBgColor"),
- GTK_STATE_ACTIVE, &bgColor);
- gtk_widget_modify_bg (glade_xml_get_widget (data, "btnBgColor"),
+ gtk_widget_modify_bg (GTK_WIDGET
+ (gtk_builder_get_object
+ (builder, "btnBgColor")), GTK_STATE_NORMAL,
+ &bgColor);
+ gtk_widget_modify_bg (GTK_WIDGET
+ (gtk_builder_get_object
+ (builder, "btnBgColor")), GTK_STATE_ACTIVE,
+ &bgColor);
+ gtk_widget_modify_bg (GTK_WIDGET
+ (gtk_builder_get_object
+ (builder, "btnBgColor")),
GTK_STATE_PRELIGHT, &bgColor);
- gtk_widget_modify_bg (glade_xml_get_widget (data, "btnBgColor"),
+ gtk_widget_modify_bg (GTK_WIDGET
+ (gtk_builder_get_object
+ (builder, "btnBgColor")),
GTK_STATE_SELECTED, &bgColor);
}
@@ -198,8 +212,8 @@ ChooseColor (GtkButton * btn, GdkColor * color)
if (GTK_RESPONSE_OK == dr) {
gtk_color_selection_get_current_color (GTK_COLOR_SELECTION
(GTK_COLOR_SELECTION_DIALOG
- (dlgSelection)->
- colorsel), color);
+ (dlgSelection)->colorsel),
+ color);
UpdateColorChooserButtons ();
SaveConfig ();
}
@@ -210,28 +224,29 @@ static void
ConfigurePlugin (GkbdIndicatorPluginContainer * pc, GtkWindow * parent)
{
GtkWidget *dialog;
+ GError *error = NULL;
container = pc;
LoadConfig ();
- data =
- glade_xml_new (GLADE_DIR "/highlight.glade",
- "highlight_dialog", PACKAGE);
+ builder = gtk_builder_new ();
+ gtk_builder_add_from_file (builder, UI_DIR "/highlight.ui",
+ &error);
- dialog = glade_xml_get_widget (data, "highlight_dialog");
+ dialog =
+ GTK_WIDGET (gtk_builder_get_object
+ (builder, "highlight_dialog"));
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
- glade_xml_signal_connect_data (data,
- "on_btnFgColor_clicked",
- GTK_SIGNAL_FUNC (ChooseColor),
- &fgColor);
+ g_signal_connect (GTK_WIDGET
+ (gtk_builder_get_object (builder, "btnFgColor")),
+ "clicked", G_CALLBACK (ChooseColor), &fgColor);
+ g_signal_connect (GTK_WIDGET
+ (gtk_builder_get_object (builder, "btnBgColor")),
+ "clicked", G_CALLBACK (ChooseColor), &bgColor);
- glade_xml_signal_connect_data (data,
- "on_btnBgColor_clicked",
- GTK_SIGNAL_FUNC (ChooseColor),
- &bgColor);
UpdateColorChooserButtons ();
diff --git a/highlight/highlight.glade b/highlight/highlight.glade
index 137d69a..31cdc78 100644
--- a/highlight/highlight.glade
+++ b/highlight/highlight.glade
@@ -39,7 +39,6 @@
<property name="label" translatable="yes"> </property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
- <signal name="clicked" handler="on_btnFgColor_clicked"/>
</widget>
</child>
</widget>
@@ -81,7 +80,6 @@
<property name="label" translatable="yes"> </property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
- <signal name="clicked" handler="on_btnBgColor_clicked"/>
</widget>
</child>
</widget>
diff --git a/highlight/highlight.ui b/highlight/highlight.ui
new file mode 100644
index 0000000..be07d46
--- /dev/null
+++ b/highlight/highlight.ui
@@ -0,0 +1,129 @@
+<?xml version="1.0"?>
+<!--*- mode: xml -*-->
+<interface>
+ <object class="GtkDialog" id="highlight_dialog">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Highlighter</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox2">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkVBox" id="vbox4">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="label18">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Text color</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment14">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <child>
+ <object class="GtkButton" id="btnFgColor">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes"> </property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="label19">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Background color</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment15">
+ <property name="visible">True</property>
+ <property name="border_width">6</property>
+ <child>
+ <object class="GtkButton" id="btnBgColor">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes"> </property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area2">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <object class="GtkButton" id="btnCloseHighlightPluginSettings">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-close</property>
+ <property name="use_stock">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">btnFgColor</action-widget>
+ <action-widget response="0">btnBgColor</action-widget>
+ <action-widget response="-7">btnCloseHighlightPluginSettings</action-widget>
+ </action-widgets>
+ </object>
+</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]