aboutsummaryrefslogtreecommitdiffstats
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
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
-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
-rw-r--r--libempathy/empathy-utils.c19
-rw-r--r--libempathy/empathy-utils.h3
-rw-r--r--src/empathy-call-window.c5
-rw-r--r--src/empathy-chat-window.c5
-rw-r--r--src/empathy-chatrooms-window.c5
-rw-r--r--src/empathy-main-window.c5
-rw-r--r--src/empathy-new-chatroom-dialog.c5
-rw-r--r--src/empathy-preferences.c8
-rw-r--r--src/empathy-status-icon.c5
22 files changed, 143 insertions, 36 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);
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index 25e0860d2..07cd6802e 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -587,3 +587,22 @@ empathy_presence_from_str (const gchar *str)
return MC_PRESENCE_AVAILABLE;
}
+gchar *
+empathy_file_lookup (const gchar *filename, const gchar *subdir)
+{
+ gchar *path;
+
+ if (!subdir) {
+ subdir = ".";
+ }
+
+ path = g_build_filename (g_getenv ("EMPATHY_SRCDIR"), subdir, filename, NULL);
+ if (!g_file_test (path, G_FILE_TEST_EXISTS)) {
+ g_free (path);
+ path = g_build_filename (DATADIR, "empathy", filename, NULL);
+ }
+
+ return path;
+}
+
+
diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h
index cafc3db10..834935ef2 100644
--- a/libempathy/empathy-utils.h
+++ b/libempathy/empathy-utils.h
@@ -97,7 +97,8 @@ void empathy_chat_with_contact_id (McAccount *account,
const gchar * empathy_presence_get_default_message (McPresence presence);
const gchar * empathy_presence_to_str (McPresence presence);
McPresence empathy_presence_from_str (const gchar *str);
-
+gchar * empathy_file_lookup (const gchar *filename,
+ const gchar *subdir);
G_END_DECLS
#endif /* __EMPATHY_UTILS_H__ */
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index c7f202ee3..70bcb3e5f 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -450,13 +450,15 @@ empathy_call_window_new (EmpathyTpCall *call)
EmpathyCallWindow *window;
GladeXML *glade;
guint status;
+ gchar *filename;
g_return_val_if_fail (EMPATHY_IS_TP_CALL (call), NULL);
window = g_slice_new0 (EmpathyCallWindow);
window->call = g_object_ref (call);
- glade = empathy_glade_get_file ("empathy-call-window.glade",
+ filename = empathy_file_lookup ("empathy-call-window.glade", "src");
+ glade = empathy_glade_get_file (filename,
"window",
NULL,
"window", &window->window,
@@ -471,6 +473,7 @@ empathy_call_window_new (EmpathyTpCall *call)
"output_video_frame", &window->output_video_frame,
"video_button", &window->video_button,
NULL);
+ g_free (filename);
empathy_glade_connect (glade,
window,
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 33be0ea82..65a706c17 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -280,10 +280,12 @@ empathy_chat_window_init (EmpathyChatWindow *window)
GtkWidget *menu;
gint i;
GtkWidget *chat_vbox;
+ gchar *filename;
priv = GET_PRIV (window);
- glade = empathy_glade_get_file ("empathy-chat.glade",
+ filename = empathy_file_lookup ("empathy-chat.glade", "libempathy-gtk");
+ glade = empathy_glade_get_file (filename,
"chat_window",
NULL,
"chat_window", &priv->dialog,
@@ -315,6 +317,7 @@ empathy_chat_window_init (EmpathyChatWindow *window)
"menu_help_contents", &priv->menu_help_contents,
"menu_help_about", &priv->menu_help_about,
NULL);
+ g_free (filename);
empathy_glade_connect (glade,
window,
diff --git a/src/empathy-chatrooms-window.c b/src/empathy-chatrooms-window.c
index 0511098c3..474a3ef10 100644
--- a/src/empathy-chatrooms-window.c
+++ b/src/empathy-chatrooms-window.c
@@ -108,6 +108,7 @@ empathy_chatrooms_window_show (GtkWindow *parent)
{
static EmpathyChatroomsWindow *window = NULL;
GladeXML *glade;
+ gchar *filename;
if (window) {
gtk_window_present (GTK_WINDOW (window->window));
@@ -116,7 +117,8 @@ empathy_chatrooms_window_show (GtkWindow *parent)
window = g_new0 (EmpathyChatroomsWindow, 1);
- glade = empathy_glade_get_file ("empathy-chatrooms-window.glade",
+ filename = empathy_file_lookup ("empathy-chatrooms-window.glade", "src");
+ glade = empathy_glade_get_file (filename,
"chatrooms_window",
NULL,
"chatrooms_window", &window->window,
@@ -127,6 +129,7 @@ empathy_chatrooms_window_show (GtkWindow *parent)
"button_remove", &window->button_remove,
"button_close", &window->button_close,
NULL);
+ g_free (filename);
empathy_glade_connect (glade,
window,
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 6f3ad5481..79fb1d392 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -186,6 +186,7 @@ empathy_main_window_show (void)
gboolean show_avatars;
gboolean compact_contact_list;
gint x, y, w, h;
+ gchar *filename;
if (window) {
empathy_window_present (GTK_WINDOW (window->window), TRUE);
@@ -195,7 +196,8 @@ empathy_main_window_show (void)
window = g_new0 (EmpathyMainWindow, 1);
/* Set up interface */
- glade = empathy_glade_get_file ("empathy-main-window.glade",
+ filename = empathy_file_lookup ("empathy-main-window.glade", "src");
+ glade = empathy_glade_get_file (filename,
"main_window",
NULL,
"main_window", &window->window,
@@ -210,6 +212,7 @@ empathy_main_window_show (void)
"presence_toolbar", &window->presence_toolbar,
"roster_scrolledwindow", &sw,
NULL);
+ g_free (filename);
empathy_glade_connect (glade,
window,
diff --git a/src/empathy-new-chatroom-dialog.c b/src/empathy-new-chatroom-dialog.c
index b8be23add..1b1dd653f 100644
--- a/src/empathy-new-chatroom-dialog.c
+++ b/src/empathy-new-chatroom-dialog.c
@@ -122,6 +122,7 @@ empathy_new_chatroom_dialog_show (GtkWindow *parent)
EmpathyNewChatroomDialog *dialog;
GladeXML *glade;
GtkSizeGroup *size_group;
+ gchar *filename;
if (dialog_p) {
gtk_window_present (GTK_WINDOW (dialog_p->window));
@@ -130,7 +131,8 @@ empathy_new_chatroom_dialog_show (GtkWindow *parent)
dialog_p = dialog = g_new0 (EmpathyNewChatroomDialog, 1);
- glade = empathy_glade_get_file ("empathy-new-chatroom-dialog.glade",
+ filename = empathy_file_lookup ("empathy-new-chatroom-dialog.glade", "src");
+ glade = empathy_glade_get_file (filename,
"new_chatroom_dialog",
NULL,
"new_chatroom_dialog", &dialog->window,
@@ -148,6 +150,7 @@ empathy_new_chatroom_dialog_show (GtkWindow *parent)
"treeview", &dialog->treeview,
"button_join", &dialog->button_join,
NULL);
+ g_free (filename);
empathy_glade_connect (glade,
dialog,
diff --git a/src/empathy-preferences.c b/src/empathy-preferences.c
index 1304c58ef..4d3fe1784 100644
--- a/src/empathy-preferences.c
+++ b/src/empathy-preferences.c
@@ -30,6 +30,8 @@
#include <glade/glade.h>
#include <glib/gi18n.h>
+#include <libempathy/empathy-utils.h>
+
#include <libempathy-gtk/empathy-conf.h>
#include <libempathy-gtk/empathy-ui-utils.h>
#include <libempathy-gtk/empathy-theme-manager.h>
@@ -951,6 +953,7 @@ empathy_preferences_show (GtkWindow *parent)
{
static EmpathyPreferences *preferences;
GladeXML *glade;
+ gchar *filename;
if (preferences) {
gtk_window_present (GTK_WINDOW (preferences->dialog));
@@ -959,8 +962,8 @@ empathy_preferences_show (GtkWindow *parent)
preferences = g_new0 (EmpathyPreferences, 1);
- glade = empathy_glade_get_file (
- "empathy-preferences.glade",
+ filename = empathy_file_lookup ("empathy-preferences.glade", "src");
+ glade = empathy_glade_get_file (filename,
"preferences_dialog",
NULL,
"preferences_dialog", &preferences->dialog,
@@ -980,6 +983,7 @@ empathy_preferences_show (GtkWindow *parent)
"checkbutton_popups_when_available", &preferences->checkbutton_popups_when_available,
"treeview_spell_checker", &preferences->treeview_spell_checker,
NULL);
+ g_free (filename);
empathy_glade_connect (glade,
preferences,
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index 07224b06c..7cd623b45 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -651,10 +651,12 @@ status_icon_create_menu (EmpathyStatusIcon *icon)
{
EmpathyStatusIconPriv *priv;
GladeXML *glade;
+ gchar *filename;
priv = GET_PRIV (icon);
- glade = empathy_glade_get_file ("empathy-status-icon.glade",
+ filename = empathy_file_lookup ("empathy-status-icon.glade", "src");
+ glade = empathy_glade_get_file (filename,
"tray_menu",
NULL,
"tray_menu", &priv->popup_menu,
@@ -662,6 +664,7 @@ status_icon_create_menu (EmpathyStatusIcon *icon)
"tray_new_message", &priv->message_item,
"tray_status", &priv->status_item,
NULL);
+ g_free (filename);
empathy_glade_connect (glade,
icon,