[vino] Migrate from libglade to GtkBuilder (solves GnomeBug:582507)
- From: Jonh Wendell <jwendell src gnome org>
- To: svn-commits-list gnome org
- Subject: [vino] Migrate from libglade to GtkBuilder (solves GnomeBug:582507)
- Date: Fri, 19 Jun 2009 22:06:57 -0400 (EDT)
commit c01b7771e0b7b4527184876346ca4ba92e6954c9
Author: Javier Jardón <javierjc1982 gmail com>
Date: Fri May 22 07:18:07 2009 +0200
Migrate from libglade to GtkBuilder (solves GnomeBug:582507)
* capplet/Makefile.am
* capplet/vino-preferences.c
(vino_preferences_dialog_setup_allowed_toggle),
(vino_preferences_dialog_setup_prompt_enabled_toggle),
(vino_preferences_dialog_setup_view_only_toggle),
(vino_preferences_dialog_setup_icon_visibility),
(vino_preferences_dialog_get_use_password),
(vino_preferences_dialog_setup_password_entry),
(vino_preferences_dialog_setup_use_upnp_toggle),
(vino_preferences_dialog_setup_message_box),
(vino_preferences_start_listening),
(vino_preferences_dialog_init),
(vino_preferences_dialog_finalize)
* capplet/vino-preferences.glade: removed
* capplet/vino-preferences.ui: new ui file
* configure.in
* po/POTFILES.in
* server/Makefile.am
* server/vino-prompt.c
(vino_prompt_handle_dialog_response),
(vino_prompt_setup_icons)
* server/vino-prompt.glade: removed
* server/vino-prompt.ui: new ui file
capplet/Makefile.am | 8 +-
capplet/vino-preferences.c | 63 +++++---
...{vino-preferences.glade => vino-preferences.ui} | 168 ++++++++++----------
configure.in | 4 +-
po/POTFILES.in | 4 +-
server/Makefile.am | 8 +-
server/vino-prompt.c | 46 +++---
server/{vino-prompt.glade => vino-prompt.ui} | 63 ++++----
8 files changed, 190 insertions(+), 174 deletions(-)
---
diff --git a/capplet/Makefile.am b/capplet/Makefile.am
index cd7c4f5..066a53d 100644
--- a/capplet/Makefile.am
+++ b/capplet/Makefile.am
@@ -2,7 +2,7 @@ NULL =
INCLUDES = \
-DVINO_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
- -DVINO_GLADEDIR=\""$(datadir)/vino"\" \
+ -DVINO_UIDIR=\""$(datadir)/vino"\" \
-DVINO_ICONDIR=\""$(datadir)/pixmaps\"" \
$(VINO_CAPPLET_CFLAGS) \
$(VINO_KEYRING_CFLAGS) \
@@ -27,8 +27,8 @@ vino_preferences_LDADD = \
$(X_LIBS) \
$(NULL)
-gladedir = $(datadir)/vino
-glade_DATA = vino-preferences.glade webservices
+uidir = $(datadir)/vino
+ui_DATA = vino-preferences.ui webservices
desktopdir = $(datadir)/applications
desktop_in_files = vino-preferences.desktop.in
@@ -41,7 +41,7 @@ CLEANFILES = \
$(NULL)
EXTRA_DIST = \
- vino-preferences.glade \
+ vino-preferences.ui \
vino-preferences.desktop.in \
webservices \
$(NULL)
diff --git a/capplet/vino-preferences.c b/capplet/vino-preferences.c
index 6bd89e0..c217687 100644
--- a/capplet/vino-preferences.c
+++ b/capplet/vino-preferences.c
@@ -25,7 +25,6 @@
#include <config.h>
#include <string.h>
#include <gtk/gtk.h>
-#include <glade/glade.h>
#include <gconf/gconf-client.h>
#include <dbus/dbus-glib.h>
#include <glib/gi18n.h>
@@ -56,7 +55,7 @@
#define VINO_DBUS_INTERFACE "org.gnome.VinoScreen"
typedef struct {
- GladeXML *xml;
+ GtkBuilder *builder;
GConfClient *client;
GtkWidget *dialog;
@@ -233,7 +232,8 @@ vino_preferences_dialog_setup_allowed_toggle (VinoPreferencesDialog *dialog)
{
gboolean allowed;
- dialog->allowed_toggle = glade_xml_get_widget (dialog->xml, "allowed_toggle");
+ dialog->allowed_toggle = GTK_WIDGET (gtk_builder_get_object (dialog->builder,
+ "allowed_toggle"));
g_assert (dialog->allowed_toggle != NULL);
allowed = gconf_client_get_bool (dialog->client, VINO_PREFS_ENABLED, NULL);
@@ -293,7 +293,8 @@ vino_preferences_dialog_setup_prompt_enabled_toggle (VinoPreferencesDialog *dial
{
gboolean prompt_enabled;
- dialog->prompt_enabled_toggle = glade_xml_get_widget (dialog->xml, "prompt_enabled_toggle");
+ dialog->prompt_enabled_toggle = GTK_WIDGET (gtk_builder_get_object (dialog->builder,
+ "prompt_enabled_toggle"));
g_assert (dialog->prompt_enabled_toggle != NULL);
prompt_enabled = gconf_client_get_bool (dialog->client, VINO_PREFS_PROMPT_ENABLED, NULL);
@@ -351,7 +352,8 @@ vino_preferences_dialog_setup_view_only_toggle (VinoPreferencesDialog *dialog)
{
gboolean view_only;
- dialog->view_only_toggle = glade_xml_get_widget (dialog->xml, "view_only_toggle");
+ dialog->view_only_toggle = GTK_WIDGET (gtk_builder_get_object (dialog->builder,
+ "view_only_toggle"));
g_assert (dialog->view_only_toggle != NULL);
view_only = gconf_client_get_bool (dialog->client, VINO_PREFS_VIEW_ONLY, NULL);
@@ -418,11 +420,14 @@ vino_preferences_dialog_setup_icon_visibility (VinoPreferencesDialog *dialog)
{
gchar *value;
- dialog->icon_always_radio = glade_xml_get_widget (dialog->xml, "icon_always_radio");
+ dialog->icon_always_radio = GTK_WIDGET (gtk_builder_get_object (dialog->builder,
+ "icon_always_radio"));
g_assert (dialog->icon_always_radio != NULL);
- dialog->icon_client_radio = glade_xml_get_widget (dialog->xml, "icon_client_radio");
+ dialog->icon_client_radio = GTK_WIDGET (gtk_builder_get_object (dialog->builder,
+ "icon_client_radio"));
g_assert (dialog->icon_client_radio != NULL);
- dialog->icon_never_radio = glade_xml_get_widget (dialog->xml, "icon_never_radio");
+ dialog->icon_never_radio = GTK_WIDGET (gtk_builder_get_object (dialog->builder,
+ "icon_never_radio"));
g_assert (dialog->icon_never_radio != NULL);
value = gconf_client_get_string (dialog->client, VINO_PREFS_ICON_VISIBILITY, NULL);
@@ -542,7 +547,8 @@ vino_preferences_dialog_get_use_password (VinoPreferencesDialog *dialog)
static void
vino_preferences_dialog_setup_password_toggle (VinoPreferencesDialog *dialog)
{
- dialog->password_toggle = glade_xml_get_widget (dialog->xml, "password_toggle");
+ dialog->password_toggle = GTK_WIDGET (gtk_builder_get_object (dialog->builder,
+ "password_toggle"));
g_assert (dialog->password_toggle != NULL);
dialog->use_password = vino_preferences_dialog_get_use_password (dialog);
@@ -646,7 +652,8 @@ vino_preferences_dialog_setup_password_entry (VinoPreferencesDialog *dialog)
char *password;
gboolean password_in_keyring;
- dialog->password_entry = glade_xml_get_widget (dialog->xml, "password_entry");
+ dialog->password_entry = GTK_WIDGET (gtk_builder_get_object (dialog->builder,
+ "password_entry"));
g_assert (dialog->password_entry != NULL);
password_in_keyring = TRUE;
@@ -742,7 +749,8 @@ vino_preferences_dialog_setup_use_upnp_toggle (VinoPreferencesDialog *dialog)
{
gboolean use_upnp;
- dialog->use_upnp_toggle = glade_xml_get_widget (dialog->xml, "use_upnp_toggle");
+ dialog->use_upnp_toggle = GTK_WIDGET (gtk_builder_get_object (dialog->builder,
+ "use_upnp_toggle"));
g_assert (dialog->use_upnp_toggle != NULL);
use_upnp = gconf_client_get_bool (dialog->client, VINO_PREFS_USE_UPNP, NULL);
@@ -1017,7 +1025,7 @@ vino_preferences_dialog_setup_message_box (VinoPreferencesDialog *dialog)
{
GtkWidget *event_box;
- event_box = glade_xml_get_widget (dialog->xml, "event_box");
+ event_box = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "event_box"));
g_assert (event_box != NULL);
dialog->message = vino_message_box_new ();
@@ -1059,27 +1067,28 @@ vino_preferences_start_listening (VinoPreferencesDialog *dialog)
static gboolean
vino_preferences_dialog_init (VinoPreferencesDialog *dialog)
{
-#define VINO_GLADE_FILE "vino-preferences.glade"
+#define VINO_UI_FILE "vino-preferences.ui"
- const char *glade_file;
+ const char *ui_file;
gboolean allowed;
GError *error = NULL;
dialog->expected_listeners = N_LISTENERS;
- if (g_file_test (VINO_GLADE_FILE, G_FILE_TEST_EXISTS))
- glade_file = VINO_GLADE_FILE;
+ if (g_file_test (VINO_UI_FILE, G_FILE_TEST_EXISTS))
+ ui_file = VINO_UI_FILE;
else
- glade_file = VINO_GLADEDIR "/" VINO_GLADE_FILE;
+ ui_file = VINO_UIDIR "/" VINO_UI_FILE;
- dialog->xml = glade_xml_new (glade_file, "vino_dialog", NULL);
- if (!dialog->xml)
+ dialog->builder = gtk_builder_new ();
+ if (!gtk_builder_add_from_file (dialog->builder, ui_file, &error))
{
- g_warning ("Unable to locate glade file '%s'", glade_file);
+ g_warning ("Unable to locate ui file '%s'", ui_file);
+ g_error_free (error);
return FALSE;
}
- dialog->dialog = glade_xml_get_widget (dialog->xml, "vino_dialog");
+ dialog->dialog = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "vino_dialog"));
g_assert (dialog->dialog != NULL);
g_signal_connect (dialog->dialog, "response",
@@ -1091,7 +1100,8 @@ vino_preferences_dialog_init (VinoPreferencesDialog *dialog)
dialog->client = gconf_client_get_default ();
gconf_client_add_dir (dialog->client, VINO_PREFS_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
- dialog->writability_warning = glade_xml_get_widget (dialog->xml, "writability_warning");
+ dialog->writability_warning = GTK_WIDGET (gtk_builder_get_object (dialog->builder,
+ "writability_warning"));
g_assert (dialog->writability_warning != NULL);
gtk_widget_hide (dialog->writability_warning);
@@ -1108,6 +1118,7 @@ vino_preferences_dialog_init (VinoPreferencesDialog *dialog)
vino_preferences_dialog_update_for_allowed (dialog, allowed);
+ error = NULL;
dialog->connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
if (!dialog->connection)
{
@@ -1128,7 +1139,7 @@ vino_preferences_dialog_init (VinoPreferencesDialog *dialog)
return TRUE;
-#undef VINO_GLADE_FILE
+#undef VINO_UI_FILE
}
static void
@@ -1156,9 +1167,9 @@ vino_preferences_dialog_finalize (VinoPreferencesDialog *dialog)
dialog->client = NULL;
}
- if (dialog->xml)
- g_object_unref (dialog->xml);
- dialog->xml = NULL;
+ if (dialog->builder)
+ g_object_unref (dialog->builder);
+ dialog->builder = NULL;
#ifdef VINO_ENABLE_LIBUNIQUE
if (dialog->app)
diff --git a/capplet/vino-preferences.glade b/capplet/vino-preferences.ui
similarity index 80%
rename from capplet/vino-preferences.glade
rename to capplet/vino-preferences.ui
index 76dec6d..3533c27 100644
--- a/capplet/vino-preferences.glade
+++ b/capplet/vino-preferences.ui
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
-<glade-interface>
+<interface>
<!-- interface-requires gtk+ 2.16 -->
<!-- interface-naming-policy toplevel-contextual -->
- <widget class="GtkDialog" id="vino_dialog">
+ <object class="GtkDialog" id="vino_dialog">
<property name="border_width">5</property>
<property name="title" translatable="yes">Remote Desktop Preferences</property>
<property name="resizable">False</property>
@@ -11,39 +11,39 @@
<property name="type_hint">dialog</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="spacing">2</property>
<child>
- <widget class="GtkVBox" id="vbox1">
+ <object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="border_width">6</property>
<property name="spacing">18</property>
<child>
- <widget class="GtkVBox" id="sharing_box">
+ <object class="GtkVBox" id="sharing_box">
<property name="visible">True</property>
<property name="spacing">3</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>Sharing</b></property>
<property name="use_markup">True</property>
- </widget>
+ </object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="writability_warning">
+ <object class="GtkHBox" id="writability_warning">
<property name="no_show_all">True</property>
<property name="border_width">3</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label6">
+ <object class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="label"> </property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
@@ -51,40 +51,40 @@
</packing>
</child>
<child>
- <widget class="GtkImage" id="image1">
+ <object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="stock">gtk-dialog-warning</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label8">
+ <object class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="label" translatable="yes"><i>Some of these preferences are locked down</i></property>
<property name="use_markup">True</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox1">
+ <object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<child>
- <widget class="GtkLabel" id="label2">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="label"> </property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
@@ -92,33 +92,33 @@
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="allowed_toggle">
+ <object class="GtkCheckButton" id="allowed_toggle">
<property name="label" translatable="yes">Allow other users to _view your desktop</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="has_tooltip">True</property>
- <property name="tooltip" translatable="yes">Your desktop will be shared</property>
+ <property name="tooltip-text" translatable="yes">Your desktop will be shared</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox2">
+ <object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<child>
- <widget class="GtkLabel" id="label3">
+ <object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="label"> </property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
@@ -126,33 +126,33 @@
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="view_only_toggle">
+ <object class="GtkCheckButton" id="view_only_toggle">
<property name="label" translatable="yes">_Allow other users to control your desktop</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="has_tooltip">True</property>
- <property name="tooltip" translatable="yes">Remote users are able to control your mouse and keyboard</property>
+ <property name="tooltip-text" translatable="yes">Remote users are able to control your mouse and keyboard</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="message_box">
+ <object class="GtkHBox" id="message_box">
<property name="visible">True</property>
<child>
- <widget class="GtkLabel" id="label14">
+ <object class="GtkLabel" id="label14">
<property name="visible">True</property>
<property name="label"> </property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
@@ -160,77 +160,77 @@
</packing>
</child>
<child>
- <widget class="GtkEventBox" id="event_box">
+ <object class="GtkEventBox" id="event_box">
<property name="visible">True</property>
<child>
<placeholder/>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">4</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkVBox" id="security_box">
+ <object class="GtkVBox" id="security_box">
<property name="visible">True</property>
<property name="spacing">3</property>
<child>
- <widget class="GtkLabel" id="label4">
+ <object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes"><b>Security</b></property>
<property name="use_markup">True</property>
- </widget>
+ </object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox3">
+ <object class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<child>
- <widget class="GtkCheckButton" id="prompt_enabled_toggle">
+ <object class="GtkCheckButton" id="prompt_enabled_toggle">
<property name="label" translatable="yes">_You must confirm each access to this machine</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="has_tooltip">True</property>
- <property name="tooltip" translatable="yes">You will be queried to allow or to refuse every incoming connection</property>
+ <property name="tooltip-text" translatable="yes">You will be queried to allow or to refuse every incoming connection</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
- </widget>
+ </object>
<packing>
<property name="padding">12</property>
<property name="position">0</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox4">
+ <object class="GtkHBox" id="hbox4">
<property name="visible">True</property>
<child>
- <widget class="GtkCheckButton" id="password_toggle">
+ <object class="GtkCheckButton" id="password_toggle">
<property name="label" translatable="yes">_Require the user to enter this password:</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="padding">12</property>
@@ -238,76 +238,76 @@
</packing>
</child>
<child>
- <widget class="GtkEntry" id="password_entry">
+ <object class="GtkEntry" id="password_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_tooltip">True</property>
- <property name="tooltip" translatable="yes">Maximum size: 8 characters</property>
+ <property name="tooltip-text" translatable="yes">Maximum size: 8 characters</property>
<property name="max_length">8</property>
<property name="visibility">False</property>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox7">
+ <object class="GtkHBox" id="hbox7">
<property name="visible">True</property>
<child>
- <widget class="GtkCheckButton" id="use_upnp_toggle">
+ <object class="GtkCheckButton" id="use_upnp_toggle">
<property name="label" translatable="yes">_Configure network automatically to accept connections</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="has_tooltip">True</property>
- <property name="tooltip" translatable="yes">The router must have the UPnP feature enabled</property>
+ <property name="tooltip-text" translatable="yes">The router must have the UPnP feature enabled</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
- </widget>
+ </object>
<packing>
<property name="padding">12</property>
<property name="position">0</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">3</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkVBox" id="notification_box">
+ <object class="GtkVBox" id="notification_box">
<property name="visible">True</property>
<property name="spacing">3</property>
<child>
- <widget class="GtkLabel" id="label12">
+ <object class="GtkLabel" id="label12">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes"><b>Notification Area</b></property>
<property name="use_markup">True</property>
- </widget>
+ </object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox8">
+ <object class="GtkHBox" id="hbox8">
<property name="visible">True</property>
<child>
- <widget class="GtkVBox" id="vbox2">
+ <object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="spacing">3</property>
<child>
- <widget class="GtkRadioButton" id="icon_always_radio">
+ <object class="GtkRadioButton" id="icon_always_radio">
<property name="label" translatable="yes">Al_ways display an icon</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -315,13 +315,13 @@
<property name="use_underline">True</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
- </widget>
+ </object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkRadioButton" id="icon_client_radio">
+ <object class="GtkRadioButton" id="icon_client_radio">
<property name="label" translatable="yes">_Only display an icon when there is someone connected</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -330,13 +330,13 @@
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">icon_always_radio</property>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkRadioButton" id="icon_never_radio">
+ <object class="GtkRadioButton" id="icon_never_radio">
<property name="label" translatable="yes">_Never display an icon</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -345,69 +345,71 @@
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">icon_always_radio</property>
- </widget>
+ </object>
<packing>
<property name="position">2</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="padding">12</property>
<property name="position">0</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<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_area1">
+ <object class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<child>
- <widget class="GtkButton" id="button1">
+ <object class="GtkButton" id="button1">
<property name="label">gtk-help</property>
- <property name="response_id">-11</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
- </widget>
+ </object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="button2">
+ <object class="GtkButton" id="button2">
<property name="label">gtk-close</property>
- <property name="response_id">-7</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="expand">False</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">button1</action-widget>
+ <action-widget response="-7">button2</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/configure.in b/configure.in
index a2b53ea..46deabb 100644
--- a/configure.in
+++ b/configure.in
@@ -49,9 +49,9 @@ SOUP_VERSION=2.24.0
TELEPATHY_GLIB_VERSION=0.7.31
NETWORKMANAGER_VERSION=0.7
-PKG_CHECK_MODULES(VINO_SERVER, glib-2.0 >= $GLIB_VERSION gtk+-x11-2.0 >= $GTK_VERSION gconf-2.0 libglade-2.0 dbus-1 >= $DBUS_VERSION dbus-glib-1)
+PKG_CHECK_MODULES(VINO_SERVER, glib-2.0 >= $GLIB_VERSION gtk+-x11-2.0 >= $GTK_VERSION gconf-2.0 dbus-1 >= $DBUS_VERSION dbus-glib-1)
-PKG_CHECK_MODULES(VINO_CAPPLET, glib-2.0 >= $GLIB_VERSION gtk+-2.0 >= $GTK_VERSION gconf-2.0 libglade-2.0 dbus-1 >= $DBUS_VERSION dbus-glib-1 libsoup-2.4 >= $SOUP_VERSION)
+PKG_CHECK_MODULES(VINO_CAPPLET, glib-2.0 >= $GLIB_VERSION gtk+-2.0 >= $GTK_VERSION gconf-2.0 dbus-1 >= $DBUS_VERSION dbus-glib-1 libsoup-2.4 >= $SOUP_VERSION)
PKG_CHECK_MODULES(VINO_TOOLS, glib-2.0 >= $GLIB_VERSION gconf-2.0 gobject-2.0 >= $GLIB_VERSION gnome-keyring-1)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 04028d6..51fafa0 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -4,13 +4,13 @@ capplet/sexy-url-label.c
capplet/vino-message-box.c
capplet/vino-preferences.c
capplet/vino-preferences.desktop.in.in
-capplet/vino-preferences.glade
+[type: gettext/glade]capplet/vino-preferences.ui
server/vino-dbus-listener.c
server/vino-main.c
server/vino-mdns.c
server/vino-prefs.c
server/vino-prompt.c
-server/vino-prompt.glade
+[type: gettext/glade]server/vino-prompt.ui
server/vino-server.c
server/vino-server.desktop.in.in
server/vino-server.schemas.in
diff --git a/server/Makefile.am b/server/Makefile.am
index 43774bf..e85fd71 100644
--- a/server/Makefile.am
+++ b/server/Makefile.am
@@ -19,7 +19,7 @@ INCLUDES = \
-DVINO_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-DVINO_ICONDIR=\""$(datadir)/pixmaps\"" \
-DVINO_CLIENTDIR=\""$(datadir)/vino"\" \
- -DVINO_GLADEDIR=\""$(datadir)/vino"\" \
+ -DVINO_UIDIR=\""$(datadir)/vino"\" \
$(NULL)
libexec_PROGRAMS = vino-server
@@ -167,11 +167,11 @@ else
install-data-local:
endif
-gladedir = $(datadir)/vino
-glade_DATA = vino-prompt.glade
+uidir = $(datadir)/vino
+ui_DATA = vino-prompt.ui
EXTRA_DIST = \
- vino-prompt.glade \
+ vino-prompt.ui \
vino-server.schemas.in \
vino-marshal.list \
vino-server.desktop.in.in \
diff --git a/server/vino-prompt.c b/server/vino-prompt.c
index d449e35..c531ef3 100644
--- a/server/vino-prompt.c
+++ b/server/vino-prompt.c
@@ -25,7 +25,6 @@
#include "vino-prompt.h"
#include <gtk/gtk.h>
-#include <glade/glade.h>
#include "vino-util.h"
#include "vino-enums.h"
#include "vino-marshal.h"
@@ -264,11 +263,12 @@ vino_prompt_handle_dialog_response (VinoPrompt *prompt,
static void
vino_prompt_setup_icons (VinoPrompt *prompt,
- GladeXML *xml)
+ GtkBuilder *builder)
{
#define ICON_SIZE_STANDARD 48
- prompt->priv->sharing_icon = glade_xml_get_widget (xml, "sharing_icon");
+ prompt->priv->sharing_icon = GTK_WIDGET (gtk_builder_get_object (builder,
+ "sharing_icon"));
g_assert (prompt->priv->sharing_icon != NULL);
gtk_window_set_icon_name (GTK_WINDOW (prompt->priv->dialog),
@@ -282,44 +282,46 @@ vino_prompt_setup_icons (VinoPrompt *prompt,
static gboolean
vino_prompt_setup_dialog (VinoPrompt *prompt)
{
-#define VINO_GLADE_FILE "vino-prompt.glade"
+#define VINO_UI_FILE "vino-prompt.ui"
- GladeXML *xml;
- const char *glade_file;
+ GtkBuilder *builder;
+ const char *ui_file;
GtkWidget *help_button;
-
- if (g_file_test (VINO_GLADE_FILE, G_FILE_TEST_EXISTS))
- glade_file = VINO_GLADE_FILE;
+ GError *error = NULL;
+
+ if (g_file_test (VINO_UI_FILE, G_FILE_TEST_EXISTS))
+ ui_file = VINO_UI_FILE;
else
- glade_file = VINO_GLADEDIR "/" VINO_GLADE_FILE;
+ ui_file = VINO_UIDIR "/" VINO_UI_FILE;
- xml = glade_xml_new (glade_file, "vino_dialog", NULL);
- if (!xml)
- {
- g_warning ("Unable to locate glade file '%s'", glade_file);
- return FALSE;
- }
+ builder = gtk_builder_new ();
+ if (!gtk_builder_add_from_file (builder, ui_file, &error))
+ {
+ g_warning ("Unable to locate ui file '%s'", ui_file);
+ g_error_free (error);
+ return FALSE;
+ }
- prompt->priv->dialog = glade_xml_get_widget (xml, "vino_dialog");
+ prompt->priv->dialog = GTK_WIDGET (gtk_builder_get_object (builder, "vino_dialog"));
g_assert (prompt->priv->dialog != NULL);
g_signal_connect_swapped (prompt->priv->dialog, "response",
G_CALLBACK (vino_prompt_handle_dialog_response), prompt);
- vino_prompt_setup_icons (prompt, xml);
+ vino_prompt_setup_icons (prompt, builder);
- prompt->priv->host_label = glade_xml_get_widget (xml, "host_label");
+ prompt->priv->host_label = GTK_WIDGET (gtk_builder_get_object (builder, "host_label"));
g_assert (prompt->priv->host_label != NULL);
- help_button = glade_xml_get_widget (xml, "help_button");
+ help_button = GTK_WIDGET (gtk_builder_get_object (builder, "help_button"));
g_assert (help_button != NULL);
gtk_widget_hide (help_button);
- g_object_unref (xml);
+ g_object_unref (builder);
return TRUE;
-#undef VINO_GLADE_FILE
+#undef VINO_UI_FILE
}
static gboolean
diff --git a/server/vino-prompt.glade b/server/vino-prompt.ui
similarity index 78%
rename from server/vino-prompt.glade
rename to server/vino-prompt.ui
index 6fb74b7..ca8becc 100644
--- a/server/vino-prompt.glade
+++ b/server/vino-prompt.ui
@@ -1,52 +1,51 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<?xml version="1.0"?>
<!--*- mode: xml -*-->
-<glade-interface>
- <widget class="GtkDialog" id="vino_dialog">
+<interface>
+ <object class="GtkDialog" id="vino_dialog">
<property name="border_width">5</property>
<property name="title" translatable="yes">Question</property>
<property name="resizable">False</property>
<property name="type_hint">GDK_WINDOW_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>
<child>
- <widget class="GtkHBox" id="hbox30">
+ <object class="GtkHBox" id="hbox30">
<property name="visible">True</property>
<property name="border_width">12</property>
<property name="spacing">12</property>
<child>
- <widget class="GtkImage" id="sharing_icon">
+ <object class="GtkImage" id="sharing_icon">
<property name="visible">True</property>
<property name="yalign">0</property>
<property name="stock">gtk-missing-image</property>
- </widget>
+ </object>
</child>
<child>
- <widget class="GtkVBox" id="vbox34">
+ <object class="GtkVBox" id="vbox34">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="warning_label">
+ <object class="GtkLabel" id="warning_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes"><big><b>Another user is trying to view your desktop.</b></big></property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="host_label">
+ <object class="GtkLabel" id="host_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">A user on another computer is trying to remotely view or control your desktop.</property>
<property name="wrap">True</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
@@ -54,44 +53,43 @@
</packing>
</child>
<child>
- <widget class="GtkLabel" id="question_label">
+ <object class="GtkLabel" id="question_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Do you want to allow them to do so?</property>
<property name="wrap">True</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</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="hbuttonbox1">
+ <object class="GtkHButtonBox" id="hbuttonbox1">
<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="can_focus">True</property>
<property name="can_default">True</property>
<property name="no_show_all">True</property>
<property name="label">gtk-help</property>
<property name="use_stock">True</property>
- <property name="response_id">-11</property>
- </widget>
+ </object>
</child>
<child>
- <widget class="GtkButton" id="refuse_button">
+ <object class="GtkButton" id="refuse_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
@@ -99,32 +97,35 @@
<property name="has_default">True</property>
<property name="label" translatable="yes">_Refuse</property>
<property name="use_underline">True</property>
- <property name="response_id">-2</property>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="allow_button">
+ <object class="GtkButton" id="allow_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="label" translatable="yes">_Allow</property>
<property name="use_underline">True</property>
- <property name="response_id">-3</property>
- </widget>
+ </object>
<packing>
<property name="position">2</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
- </widget>
+ </object>
</child>
- </widget>
-</glade-interface>
+ <action-widgets>
+ <action-widget response="-11">help_button</action-widget>
+ <action-widget response="-2">refuse_button</action-widget>
+ <action-widget response="-3">allow_button</action-widget>
+ </action-widgets>
+ </object>
+</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]