diff options
author | John Bailey <rekkanoryo@rekkanoryo.org> | 2009-11-16 06:31:17 +0000 |
---|---|---|
committer | John Bailey <rekkanoryo@rekkanoryo.org> | 2009-11-16 06:31:17 +0000 |
commit | eca3d20a2e96f40def7e8ab1c31b35dd069321fe (patch) | |
tree | dd1a6353d6828bb84fc27d46be93c16eceee4261 | |
parent | 3382a2941db41bd508af9c9fe112e17908c80a38 (diff) | |
download | pidgin-eca3d20a2e96f40def7e8ab1c31b35dd069321fe.tar.gz |
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
applications can be found; otherwise show informational messages stating that
we couldn't find the applications.
-rw-r--r-- | pidgin/gtkprefs.c | 78 |
1 files changed, 34 insertions, 44 deletions
diff --git a/pidgin/gtkprefs.c b/pidgin/gtkprefs.c index e6c204b2f7..4151e0f885 100644 --- a/pidgin/gtkprefs.c +++ b/pidgin/gtkprefs.c @@ -2024,8 +2024,7 @@ browser_changed2_cb(const char *name, PurplePrefType type, static GtkWidget * browser_page(void) { - GtkWidget *ret, *vbox, *hbox, *label, *entry; - GtkWidget *browser_warning, *browser_button; + GtkWidget *ret, *vbox, *hbox, *label, *entry, *browser_button; GtkSizeGroup *sg; GList *browsers = NULL; @@ -2035,33 +2034,29 @@ browser_page(void) vbox = pidgin_make_frame (ret, _("Browser Selection")); if(purple_running_gnome()) { - browser_warning = hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); - gtk_container_add(GTK_CONTAINER(vbox), hbox); - - label = gtk_label_new(NULL); - gtk_label_set_markup(GTK_LABEL(label), - _("<b>Browser configuration program was not found.</b>")); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + gchar *path = g_find_program_in_path("gnome-default-applications-properties"); hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); - gtk_container_add(GTK_CONTAINER(vbox), hbox); - gtk_widget_show(hbox); - label = gtk_label_new(_("Browser preferences are configured in GNOME preferences")); + gtk_container_add(GTK_CONTAINER(vbox), hbox); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); - gtk_widget_show(label); hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); gtk_container_add(GTK_CONTAINER(vbox), hbox); - browser_button = gtk_button_new_with_mnemonic(_("Configure _Browser")); - g_signal_connect(G_OBJECT(browser_button), "clicked", - G_CALLBACK(browser_button_clicked_cb), NULL); - gtk_box_pack_start(GTK_BOX(hbox), browser_button, FALSE, FALSE, 0); - gtk_widget_show(browser_button); - gtk_widget_show(hbox); - - gtk_widget_show(vbox); - gtk_widget_show(ret); + + if(path == NULL) { + label = gtk_label_new(NULL); + gtk_label_set_markup(GTK_LABEL(label), + _("<b>Browser configuration program was not found.</b>")); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + } else { + browser_button = gtk_button_new_with_mnemonic(_("Configure _Browser")); + g_signal_connect(G_OBJECT(browser_button), "clicked", + G_CALLBACK(browser_button_clicked_cb), NULL); + gtk_box_pack_start(GTK_BOX(hbox), browser_button, FALSE, FALSE, 0); + } + + gtk_widget_show_all(ret); } else { sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); @@ -2115,8 +2110,7 @@ static GtkWidget * proxy_page(void) { GtkWidget *ret = NULL, *vbox = NULL, *hbox = NULL; - GtkWidget *table = NULL, *entry = NULL, *label = NULL; - GtkWidget *proxy_warning = NULL, *proxy_button = NULL; + GtkWidget *table = NULL, *entry = NULL, *label = NULL, *proxy_button = NULL; PurpleProxyInfo *proxy_info; ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); @@ -2125,33 +2119,29 @@ proxy_page(void) prefs_proxy_frame = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); if(purple_running_gnome()) { - proxy_warning = hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); - gtk_container_add(GTK_CONTAINER(vbox), hbox); - - label = gtk_label_new(NULL); - gtk_label_set_markup(GTK_LABEL(label), - _("<b>Proxy configuration program was not found.</b>")); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + gchar *path = g_find_program_in_path("gnome-network-preferences"); hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); - gtk_container_add(GTK_CONTAINER(vbox), hbox); - label = gtk_label_new(_("Proxy preferences are configured in GNOME preferences")); + gtk_container_add(GTK_CONTAINER(vbox), hbox); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); - gtk_widget_show(label); - gtk_widget_show(hbox); hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); gtk_container_add(GTK_CONTAINER(vbox), hbox); - proxy_button = gtk_button_new_with_mnemonic(_("Configure _Proxy")); - g_signal_connect(G_OBJECT(proxy_button), "clicked", - G_CALLBACK(proxy_button_clicked_cb), NULL); - gtk_box_pack_start(GTK_BOX(hbox), proxy_button, FALSE, FALSE, 0); - gtk_widget_show(proxy_button); - gtk_widget_show(hbox); - - gtk_widget_show(vbox); - gtk_widget_show(ret); + + if(path == NULL) { + label = gtk_label_new(NULL); + gtk_label_set_markup(GTK_LABEL(label), + _("<b>Proxy configuration program was not found.</b>")); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + } else { + proxy_button = gtk_button_new_with_mnemonic(_("Configure _Proxy")); + g_signal_connect(G_OBJECT(proxy_button), "clicked", + G_CALLBACK(proxy_button_clicked_cb), NULL); + gtk_box_pack_start(GTK_BOX(hbox), proxy_button, FALSE, FALSE, 0); + } + + gtk_widget_show_all(ret); } else { prefs_proxy_subframe = gtk_vbox_new(FALSE, 0); |