aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-03-17 06:10:34 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-03-17 06:10:34 +0800
commitf369aa1633fd6d1c02680e97006bc53e4b8e44eb (patch)
treec78ac2dceb543b6d989f96f693c861c5a612ec41 /libempathy-gtk
parent841b4512d41749ea2229f1ceb6ec7b77f9c78e81 (diff)
downloadgsoc2013-empathy-f369aa1633fd6d1c02680e97006bc53e4b8e44eb.tar
gsoc2013-empathy-f369aa1633fd6d1c02680e97006bc53e4b8e44eb.tar.gz
gsoc2013-empathy-f369aa1633fd6d1c02680e97006bc53e4b8e44eb.tar.bz2
gsoc2013-empathy-f369aa1633fd6d1c02680e97006bc53e4b8e44eb.tar.lz
gsoc2013-empathy-f369aa1633fd6d1c02680e97006bc53e4b8e44eb.tar.xz
gsoc2013-empathy-f369aa1633fd6d1c02680e97006bc53e4b8e44eb.tar.zst
gsoc2013-empathy-f369aa1633fd6d1c02680e97006bc53e4b8e44eb.zip
Use empathy_file_lookup for glade files since some are in libempathy-gtk/ and others in src/
svn path=/trunk/; revision=813
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-account-widget-irc.c6
-rw-r--r--libempathy-gtk/empathy-account-widget.c37
-rw-r--r--libempathy-gtk/empathy-accounts-dialog.c6
-rw-r--r--libempathy-gtk/empathy-contact-dialogs.c6
-rw-r--r--libempathy-gtk/empathy-contact-widget.c6
-rw-r--r--libempathy-gtk/empathy-group-chat.c6
-rw-r--r--libempathy-gtk/empathy-irc-network-dialog.c6
-rw-r--r--libempathy-gtk/empathy-log-window.c7
-rw-r--r--libempathy-gtk/empathy-new-message-dialog.c6
-rw-r--r--libempathy-gtk/empathy-presence-chooser.c8
-rw-r--r--libempathy-gtk/empathy-private-chat.c5
-rw-r--r--libempathy-gtk/empathy-spell-dialog.c8
-rw-r--r--libempathy-gtk/empathy-ui-utils.c12
13 files changed, 92 insertions, 27 deletions
diff --git a/libempathy-gtk/empathy-account-widget-irc.c b/libempathy-gtk/empathy-account-widget-irc.c
index 5c74e0958..64325f970 100644
--- a/libempathy-gtk/empathy-account-widget-irc.c
+++ b/libempathy-gtk/empathy-account-widget-irc.c
@@ -433,6 +433,7 @@ empathy_account_widget_irc_new (McAccount *account)
GladeXML *glade;
GtkListStore *store;
GtkCellRenderer *renderer;
+ gchar *filename;
settings = g_slice_new0 (EmpathyAccountWidgetIrc);
settings->account = g_object_ref (account);
@@ -458,7 +459,9 @@ empathy_account_widget_irc_new (McAccount *account)
g_free (global_file_with_path);
g_free (user_file_with_path);
- glade = empathy_glade_get_file ("empathy-account-widget-irc.glade",
+ filename = empathy_file_lookup ("empathy-account-widget-irc.glade",
+ "libempathy-gtk");
+ glade = empathy_glade_get_file (filename,
"vbox_irc_settings",
NULL,
"vbox_irc_settings", &settings->vbox_settings,
@@ -467,6 +470,7 @@ empathy_account_widget_irc_new (McAccount *account)
"button_add_network", &settings->button_add_network,
"button_remove", &settings->button_remove,
NULL);
+ g_free (filename);
/* Fill the networks combobox */
store = gtk_list_store_new (2, G_TYPE_OBJECT, G_TYPE_STRING);
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index a8373cb66..1519a2f5a 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -33,6 +33,7 @@
#include <libmissioncontrol/mc-protocol.h>
#include <libempathy/empathy-debug.h>
+#include <libempathy/empathy-utils.h>
#include "empathy-account-widget.h"
#include "empathy-ui-utils.h"
@@ -446,16 +447,20 @@ empathy_account_widget_generic_new (McAccount *account)
GtkWidget *widget;
GtkWidget *table_common_settings;
GtkWidget *table_advanced_settings;
+ gchar *filename;
g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
- glade = empathy_glade_get_file ("empathy-account-widget-generic.glade",
+ filename = empathy_file_lookup ("empathy-account-widget-generic.glade",
+ "libempathy-gtk");
+ glade = empathy_glade_get_file (filename,
"vbox_generic_settings",
NULL,
"vbox_generic_settings", &widget,
"table_common_settings", &table_common_settings,
"table_advanced_settings", &table_advanced_settings,
NULL);
+ g_free (filename);
accounts_widget_generic_setup (account, table_common_settings, table_advanced_settings);
@@ -471,12 +476,16 @@ empathy_account_widget_salut_new (McAccount *account)
{
GladeXML *glade;
GtkWidget *widget;
+ gchar *filename;
- glade = empathy_glade_get_file ("empathy-account-widget-salut.glade",
+ filename = empathy_file_lookup ("empathy-account-widget-salut.glade",
+ "libempathy-gtk");
+ glade = empathy_glade_get_file (filename,
"vbox_salut_settings",
NULL,
"vbox_salut_settings", &widget,
NULL);
+ g_free (filename);
empathy_account_widget_handle_params (account, glade,
"entry_published", "published-name",
@@ -499,12 +508,16 @@ empathy_account_widget_msn_new (McAccount *account)
{
GladeXML *glade;
GtkWidget *widget;
+ gchar *filename;
- glade = empathy_glade_get_file ("empathy-account-widget-msn.glade",
+ filename = empathy_file_lookup ("empathy-account-widget-msn.glade",
+ "libempathy-gtk");
+ glade = empathy_glade_get_file (filename,
"vbox_msn_settings",
NULL,
"vbox_msn_settings", &widget,
NULL);
+ g_free (filename);
empathy_account_widget_handle_params (account, glade,
"entry_id", "account",
@@ -531,14 +544,18 @@ empathy_account_widget_jabber_new (McAccount *account)
GtkWidget *widget;
GtkWidget *spinbutton_port;
GtkWidget *checkbutton_ssl;
+ gchar *filename;
- glade = empathy_glade_get_file ("empathy-account-widget-jabber.glade",
+ filename = empathy_file_lookup ("empathy-account-widget-jabber.glade",
+ "libempathy-gtk");
+ glade = empathy_glade_get_file (filename,
"vbox_jabber_settings",
NULL,
"vbox_jabber_settings", &widget,
"spinbutton_port", &spinbutton_port,
"checkbutton_ssl", &checkbutton_ssl,
NULL);
+ g_free (filename);
empathy_account_widget_handle_params (account, glade,
"entry_id", "account",
@@ -573,13 +590,17 @@ empathy_account_widget_icq_new (McAccount *account)
GladeXML *glade;
GtkWidget *widget;
GtkWidget *spinbutton_port;
+ gchar *filename;
- glade = empathy_glade_get_file ("empathy-account-widget-icq.glade",
+ filename = empathy_file_lookup ("empathy-account-widget-icq.glade",
+ "libempathy-gtk");
+ glade = empathy_glade_get_file (filename,
"vbox_icq_settings",
NULL,
"vbox_icq_settings", &widget,
"spinbutton_port", &spinbutton_port,
NULL);
+ g_free (filename);
empathy_account_widget_handle_params (account, glade,
"entry_uin", "account",
@@ -605,12 +626,16 @@ empathy_account_widget_yahoo_new (McAccount *account)
{
GladeXML *glade;
GtkWidget *widget;
+ gchar *filename;
- glade = empathy_glade_get_file ("empathy-account-widget-yahoo.glade",
+ filename = empathy_file_lookup ("empathy-account-widget-yahoo.glade",
+ "libempathy-gtk");
+ glade = empathy_glade_get_file (filename,
"vbox_yahoo_settings",
NULL,
"vbox_yahoo_settings", &widget,
NULL);
+ g_free (filename);
empathy_account_widget_handle_params (account, glade,
"entry_id", "account",
diff --git a/libempathy-gtk/empathy-accounts-dialog.c b/libempathy-gtk/empathy-accounts-dialog.c
index 151c172ca..dc2c13622 100644
--- a/libempathy-gtk/empathy-accounts-dialog.c
+++ b/libempathy-gtk/empathy-accounts-dialog.c
@@ -986,6 +986,7 @@ empathy_accounts_dialog_show (GtkWindow *parent)
{
static EmpathyAccountsDialog *dialog = NULL;
GladeXML *glade;
+ gchar *filename;
GtkWidget *bbox;
GtkWidget *button_close;
@@ -996,7 +997,9 @@ empathy_accounts_dialog_show (GtkWindow *parent)
dialog = g_new0 (EmpathyAccountsDialog, 1);
- glade = empathy_glade_get_file ("empathy-accounts-dialog.glade",
+ filename = empathy_file_lookup ("empathy-accounts-dialog.glade",
+ "libempathy-gtk");
+ glade = empathy_glade_get_file (filename,
"accounts_dialog",
NULL,
"accounts_dialog", &dialog->window,
@@ -1017,6 +1020,7 @@ empathy_accounts_dialog_show (GtkWindow *parent)
"button_remove", &dialog->button_remove,
"button_close", &button_close,
NULL);
+ g_free (filename);
empathy_glade_connect (glade,
dialog,
diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c
index 1805213a6..fd4ad9635 100644
--- a/libempathy-gtk/empathy-contact-dialogs.c
+++ b/libempathy-gtk/empathy-contact-dialogs.c
@@ -93,6 +93,7 @@ empathy_subscription_dialog_show (EmpathyContact *contact,
GtkWidget *hbox_subscription;
GtkWidget *contact_widget;
GList *l;
+ gchar *filename;
g_return_if_fail (EMPATHY_IS_CONTACT (contact));
@@ -104,12 +105,15 @@ empathy_subscription_dialog_show (EmpathyContact *contact,
return;
}
- empathy_glade_get_file_simple ("empathy-contact-dialogs.glade",
+ filename = empathy_file_lookup ("empathy-contact-dialogs.glade",
+ "libempathy-gtk");
+ empathy_glade_get_file_simple (filename,
"subscription_request_dialog",
NULL,
"subscription_request_dialog", &dialog,
"hbox_subscription", &hbox_subscription,
NULL);
+ g_free (filename);
contact_widget = empathy_contact_widget_new (contact,
EMPATHY_CONTACT_WIDGET_EDIT_ALIAS |
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index c0b4596de..b80cef2e9 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -153,12 +153,15 @@ empathy_contact_widget_new (EmpathyContact *contact,
{
EmpathyContactWidget *information;
GladeXML *glade;
+ gchar *filename;
information = g_slice_new0 (EmpathyContactWidget);
information->flags = flags;
information->factory = empathy_contact_factory_new ();
- glade = empathy_glade_get_file ("empathy-contact-widget.glade",
+ filename = empathy_file_lookup ("empathy-contact-widget.glade",
+ "libempathy-gtk");
+ glade = empathy_glade_get_file (filename,
"vbox_contact_widget",
NULL,
"vbox_contact_widget", &information->vbox_contact_widget,
@@ -180,6 +183,7 @@ empathy_contact_widget_new (EmpathyContact *contact,
"table_client", &information->table_client,
"hbox_client_requested", &information->hbow_client_requested,
NULL);
+ g_free (filename);
empathy_glade_connect (glade,
information,
diff --git a/libempathy-gtk/empathy-group-chat.c b/libempathy-gtk/empathy-group-chat.c
index 909e23162..5d10da68d 100644
--- a/libempathy-gtk/empathy-group-chat.c
+++ b/libempathy-gtk/empathy-group-chat.c
@@ -306,10 +306,13 @@ group_chat_create_ui (EmpathyGroupChat *chat)
EmpathyGroupChatPriv *priv;
GladeXML *glade;
GList *list = NULL;
+ gchar *filename;
priv = GET_PRIV (chat);
- glade = empathy_glade_get_file ("empathy-group-chat.glade",
+ filename = empathy_file_lookup ("empathy-group-chat.glade",
+ "libempathy-gtk");
+ glade = empathy_glade_get_file (filename,
"group_chat_widget",
NULL,
"group_chat_widget", &priv->widget,
@@ -321,6 +324,7 @@ group_chat_create_ui (EmpathyGroupChat *chat)
"label_topic", &priv->label_topic,
"scrolled_window_contacts", &priv->scrolled_window_contacts,
NULL);
+ g_free (filename);
empathy_glade_connect (glade,
chat,
diff --git a/libempathy-gtk/empathy-irc-network-dialog.c b/libempathy-gtk/empathy-irc-network-dialog.c
index 9a42c649c..7f352f86d 100644
--- a/libempathy-gtk/empathy-irc-network-dialog.c
+++ b/libempathy-gtk/empathy-irc-network-dialog.c
@@ -466,6 +466,7 @@ empathy_irc_network_dialog_show (EmpathyIrcNetwork *network,
GtkAdjustment *adjustment;
GtkTreeSelection *selection;
GtkTreeViewColumn *column;
+ gchar *filename;
g_return_val_if_fail (network != NULL, NULL);
@@ -482,7 +483,9 @@ empathy_irc_network_dialog_show (EmpathyIrcNetwork *network,
dialog->network = network;
g_object_ref (dialog->network);
- glade = empathy_glade_get_file ("empathy-account-widget-irc.glade",
+ filename = empathy_file_lookup ("empathy-account-widget-irc.glade",
+ "libempathy-gtk");
+ glade = empathy_glade_get_file (filename,
"irc_network_dialog",
NULL,
"irc_network_dialog", &dialog->dialog,
@@ -495,6 +498,7 @@ empathy_irc_network_dialog_show (EmpathyIrcNetwork *network,
"button_up", &dialog->button_up,
"button_down", &dialog->button_down,
NULL);
+ g_free (filename);
store = gtk_list_store_new (4, G_TYPE_OBJECT, G_TYPE_STRING,
G_TYPE_UINT, G_TYPE_BOOLEAN);
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index c239ef5c3..150d1d31f 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -147,6 +147,7 @@ empathy_log_window_show (McAccount *account,
GList *accounts;
gint account_num;
GladeXML *glade;
+ gchar *filename;
if (window) {
gtk_window_present (GTK_WINDOW (window->window));
@@ -163,7 +164,9 @@ empathy_log_window_show (McAccount *account,
window = g_new0 (EmpathyLogWindow, 1);
window->log_manager = empathy_log_manager_new ();
- glade = empathy_glade_get_file ("empathy-log-window.glade",
+ filename = empathy_file_lookup ("empathy-log-window.glade",
+ "libempathy-gtk");
+ glade = empathy_glade_get_file (filename,
"log_window",
NULL,
"log_window", &window->window,
@@ -180,6 +183,8 @@ empathy_log_window_show (McAccount *account,
"treeview_chats", &window->treeview_chats,
"scrolledwindow_chats", &window->scrolledwindow_chats,
NULL);
+ g_free (filename);
+
empathy_glade_connect (glade,
window,
"log_window", "destroy", log_window_destroy_cb,
diff --git a/libempathy-gtk/empathy-new-message-dialog.c b/libempathy-gtk/empathy-new-message-dialog.c
index 6c588a660..b3faf3a01 100644
--- a/libempathy-gtk/empathy-new-message-dialog.c
+++ b/libempathy-gtk/empathy-new-message-dialog.c
@@ -106,6 +106,7 @@ empathy_new_message_dialog_show (GtkWindow *parent)
{
static EmpathyNewMessageDialog *dialog = NULL;
GladeXML *glade;
+ gchar *filename;
if (dialog) {
gtk_window_present (GTK_WINDOW (dialog->dialog));
@@ -114,7 +115,9 @@ empathy_new_message_dialog_show (GtkWindow *parent)
dialog = g_new0 (EmpathyNewMessageDialog, 1);
- glade = empathy_glade_get_file ("empathy-new-message-dialog.glade",
+ filename = empathy_file_lookup ("empathy-new-message-dialog.glade",
+ "libempathy-gtk");
+ glade = empathy_glade_get_file (filename,
"new_message_dialog",
NULL,
"new_message_dialog", &dialog->dialog,
@@ -123,6 +126,7 @@ empathy_new_message_dialog_show (GtkWindow *parent)
"button_chat", &dialog->button_chat,
"button_call",&dialog->button_call,
NULL);
+ g_free (filename);
empathy_glade_connect (glade,
dialog,
diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c
index dfed7bfc7..5d442bd36 100644
--- a/libempathy-gtk/empathy-presence-chooser.c
+++ b/libempathy-gtk/empathy-presence-chooser.c
@@ -930,6 +930,7 @@ static void
presence_chooser_dialog_show (void)
{
GladeXML *glade;
+ gchar *filename;
if (message_dialog) {
gtk_window_present (GTK_WINDOW (message_dialog->dialog));
@@ -937,7 +938,10 @@ presence_chooser_dialog_show (void)
}
message_dialog = g_new0 (CustomMessageDialog, 1);
- glade = empathy_glade_get_file ("empathy-presence-chooser.glade",
+
+ filename = empathy_file_lookup ("empathy-presence-chooser.glade",
+ "libempathy-gtk");
+ glade = empathy_glade_get_file (filename,
"custom_message_dialog",
NULL,
"custom_message_dialog", &message_dialog->dialog,
@@ -945,6 +949,8 @@ presence_chooser_dialog_show (void)
"comboboxentry_message", &message_dialog->comboboxentry_message,
"combobox_status", &message_dialog->combobox_status,
NULL);
+ g_free (filename);
+
empathy_glade_connect (glade,
message_dialog,
"custom_message_dialog", "destroy", presence_chooser_dialog_destroy_cb,
diff --git a/libempathy-gtk/empathy-private-chat.c b/libempathy-gtk/empathy-private-chat.c
index a9fe6357b..950f168a5 100644
--- a/libempathy-gtk/empathy-private-chat.c
+++ b/libempathy-gtk/empathy-private-chat.c
@@ -181,16 +181,19 @@ private_chat_create_ui (EmpathyPrivateChat *chat)
GladeXML *glade;
EmpathyPrivateChatPriv *priv;
GtkWidget *input_text_view_sw;
+ gchar *filename;
priv = GET_PRIV (chat);
- glade = empathy_glade_get_file ("empathy-chat.glade",
+ filename = empathy_file_lookup ("empathy-chat.glade", "libempathy-gtk");
+ glade = empathy_glade_get_file (filename,
"chat_widget",
NULL,
"chat_widget", &priv->widget,
"chat_view_sw", &priv->text_view_sw,
"input_text_view_sw", &input_text_view_sw,
NULL);
+ g_free (filename);
empathy_glade_connect (glade,
chat,
diff --git a/libempathy-gtk/empathy-spell-dialog.c b/libempathy-gtk/empathy-spell-dialog.c
index 7f4d75a13..59e5867b4 100644
--- a/libempathy-gtk/empathy-spell-dialog.c
+++ b/libempathy-gtk/empathy-spell-dialog.c
@@ -32,6 +32,8 @@
#include <gtk/gtksizegroup.h>
#include <glade/glade.h>
+#include <libempathy/empathy-utils.h>
+
#include "empathy-chat.h"
#include "empathy-spell-dialog.h"
#include "empathy-ui-utils.h"
@@ -224,6 +226,7 @@ empathy_spell_dialog_show (EmpathyChat *chat,
EmpathySpellDialog *dialog;
GladeXML *gui;
gchar *str;
+ gchar *filename;
g_return_if_fail (chat != NULL);
g_return_if_fail (word != NULL);
@@ -237,7 +240,9 @@ empathy_spell_dialog_show (EmpathyChat *chat,
dialog->start = start;
dialog->end = end;
- gui = empathy_glade_get_file ("empathy-spell-dialog.glade",
+ filename = empathy_file_lookup ("empathy-spell-dialog.glade",
+ "libempathy-gtk");
+ gui = empathy_glade_get_file (filename,
"spell_dialog",
NULL,
"spell_dialog", &dialog->window,
@@ -245,6 +250,7 @@ empathy_spell_dialog_show (EmpathyChat *chat,
"label_word", &dialog->label_word,
"treeview_words", &dialog->treeview_words,
NULL);
+ g_free (filename);
empathy_glade_connect (gui,
dialog,
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 1b7a5ce2c..6aa800bb0 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -61,20 +61,12 @@ get_glade_file (const gchar *filename,
va_list args)
{
GladeXML *gui;
- gchar *path;
const char *name;
GtkWidget **widget_ptr;
- path = g_build_filename (g_getenv ("EMPATHY_SRCDIR"), "libempathy-gtk",
- filename, NULL);
- if (!g_file_test (path, G_FILE_TEST_EXISTS)) {
- g_free (path);
- path = g_build_filename (DATADIR, "empathy", filename, NULL);
- }
- empathy_debug (DEBUG_DOMAIN, "Loading glade file %s", path);
+ empathy_debug (DEBUG_DOMAIN, "Loading glade file %s", filename);
- gui = glade_xml_new (path, root, domain);
- g_free (path);
+ gui = glade_xml_new (filename, root, domain);
if (!gui) {
g_warning ("Couldn't find necessary glade file '%s'", filename);