From 24b2eb419085862837a250949d584e7e0f6dab70 Mon Sep 17 00:00:00 2001 From: Jorn Baayen Date: Sat, 19 May 2007 20:50:03 +0000 Subject: [PATCH] 2007-05-19 Jorn Baayen * tools/gssdp-device-sniffer.glade: Fix about box closing. 2007-05-19 Zeeshan Ali * tools/gssdp-device-sniffer.c: (init_ui): device-sniffer should test of the existance of the glade file itself, to avoid warning messages from libglade. git-svn-id: https://svn.o-hand.com/repos/gupnp/trunk/gssdp@216 d8cb91d7-bff9-0310-92b9-80b65e4482b2 --- ChangeLog | 13 +++++++++++++ tools/gssdp-device-sniffer.c | 23 ++++++++++++++++------- tools/gssdp-device-sniffer.glade | 2 +- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6c8095f..f6e7d09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2007-05-19 Jorn Baayen + + * tools/gssdp-device-sniffer.glade: + + Fix about box closing. + +2007-05-19 Zeeshan Ali + + * tools/gssdp-device-sniffer.c: (init_ui): + + device-sniffer should test of the existance of the glade file itself, + to avoid warning messages from libglade. + 2007-05-16 Zeeshan Ali * tools/gssdp-device-sniffer.c: (append_device), diff --git a/tools/gssdp-device-sniffer.c b/tools/gssdp-device-sniffer.c index da19462..d3d9fb8 100644 --- a/tools/gssdp-device-sniffer.c +++ b/tools/gssdp-device-sniffer.c @@ -557,20 +557,29 @@ init_ui (gint *argc, gchar **argv[]) { GtkWidget *main_window; gint window_width, window_height; + gchar *glade_path = NULL; gtk_init (argc, argv); glade_init (); /* Try to fetch the glade file from the CWD first */ - glade_xml = glade_xml_new (GLADE_FILE, NULL, NULL); - if (glade_xml == NULL) { + glade_path = GLADE_FILE; + if (!g_file_test (glade_path, G_FILE_TEST_EXISTS)) { /* Then Try to fetch it from the system path */ - glade_xml = glade_xml_new (UI_DIR "/" GLADE_FILE, NULL, NULL); - if (glade_xml == NULL) { - g_error ("Unable to load the GUI file %s", GLADE_FILE); - return FALSE; - } + glade_path = UI_DIR "/" GLADE_FILE; + + if (!g_file_test (glade_path, G_FILE_TEST_EXISTS)) + glade_path = NULL; } + + if (glade_path == NULL) { + g_critical ("Unable to load the GUI file %s", GLADE_FILE); + return FALSE; + } + + glade_xml = glade_xml_new (glade_path, NULL, NULL); + if (glade_xml == NULL) + return FALSE; main_window = glade_xml_get_widget (glade_xml, "main-window"); g_assert (main_window != NULL); diff --git a/tools/gssdp-device-sniffer.glade b/tools/gssdp-device-sniffer.glade index 72d12da..50ad413 100644 --- a/tools/gssdp-device-sniffer.glade +++ b/tools/gssdp-device-sniffer.glade @@ -279,7 +279,7 @@ Inspired by Intel Tools for UPnP. False Zeeshan Ali <zeenix@gstreamer.net> translator-credits - + -- 2.7.4