comparison pidgin/gtkprefs.c @ 32716:4f8626d4ef63

propagate from branch 'im.pidgin.pidgin' (head deb06ab6aa118efb674f1a8434ff529e67b28809) to branch 'im.pidgin.cpw.qulogic.gtk3' (head 34c3103eabae4a4c23439048d383f73c94dfd23e)
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 23 Feb 2012 08:13:23 +0000
parents 7df79e0d1150 3f81e3c3064c
children e53eb11ff985
comparison
equal deleted inserted replaced
32715:4ae0c82b158d 32716:4f8626d4ef63
1857 g_error_free(err); 1857 g_error_free(err);
1858 } 1858 }
1859 1859
1860 #ifndef _WIN32 1860 #ifndef _WIN32
1861 static void 1861 static void
1862 browser_button_clicked_cb(GtkWidget *button, gpointer null) 1862 browser_button_clicked_cb(GtkWidget *button, gchar *path)
1863 { 1863 {
1864 GError *err = NULL; 1864 GError *err = NULL;
1865 1865
1866 if (g_spawn_command_line_async ("gnome-default-applications-properties", &err)) 1866 if (g_spawn_command_line_async(path, &err))
1867 return; 1867 return;
1868 1868
1869 purple_notify_error(NULL, NULL, _("Cannot start browser configuration program."), err->message); 1869 purple_notify_error(NULL, NULL, _("Cannot start browser configuration program."), err->message);
1870 g_error_free(err); 1870 g_error_free(err);
1871 } 1871 }
2132 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); 2132 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
2133 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); 2133 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
2134 2134
2135 vbox = pidgin_make_frame (ret, _("Browser Selection")); 2135 vbox = pidgin_make_frame (ret, _("Browser Selection"));
2136 2136
2137 if(purple_running_gnome()) { 2137 if (purple_running_gnome()) {
2138 gchar *path = g_find_program_in_path("gnome-default-applications-properties"); 2138 gchar *path;
2139 2139
2140 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); 2140 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
2141 label = gtk_label_new(_("Browser preferences are configured in GNOME preferences")); 2141 label = gtk_label_new(_("Browser preferences are configured in GNOME preferences"));
2142 gtk_container_add(GTK_CONTAINER(vbox), hbox); 2142 gtk_container_add(GTK_CONTAINER(vbox), hbox);
2143 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); 2143 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
2144 2144
2145 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); 2145 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
2146 gtk_container_add(GTK_CONTAINER(vbox), hbox); 2146 gtk_container_add(GTK_CONTAINER(vbox), hbox);
2147 2147
2148 if(path == NULL) { 2148 path = g_find_program_in_path("gnome-control-center");
2149 if (path != NULL) {
2150 gchar *tmp = g_strdup_printf("%s info", path);
2151 g_free(path);
2152 path = tmp;
2153 } else {
2154 path = g_find_program_in_path("gnome-default-applications-properties");
2155 }
2156
2157 if (path == NULL) {
2149 label = gtk_label_new(NULL); 2158 label = gtk_label_new(NULL);
2150 gtk_label_set_markup(GTK_LABEL(label), 2159 gtk_label_set_markup(GTK_LABEL(label),
2151 _("<b>Browser configuration program was not found.</b>")); 2160 _("<b>Browser configuration program was not found.</b>"));
2152 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); 2161 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
2153 } else { 2162 } else {
2154 browser_button = gtk_button_new_with_mnemonic(_("Configure _Browser")); 2163 browser_button = gtk_button_new_with_mnemonic(_("Configure _Browser"));
2155 g_signal_connect(G_OBJECT(browser_button), "clicked", 2164 g_signal_connect_data(G_OBJECT(browser_button), "clicked",
2156 G_CALLBACK(browser_button_clicked_cb), NULL); 2165 G_CALLBACK(browser_button_clicked_cb), path,
2166 (GClosureNotify)g_free, 0);
2157 gtk_box_pack_start(GTK_BOX(hbox), browser_button, FALSE, FALSE, 0); 2167 gtk_box_pack_start(GTK_BOX(hbox), browser_button, FALSE, FALSE, 0);
2158 } 2168 }
2159 2169
2160 g_free(path);
2161 gtk_widget_show_all(ret); 2170 gtk_widget_show_all(ret);
2162 } else { 2171 } else {
2163 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); 2172 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
2164 2173
2165 browsers = get_available_browsers(); 2174 browsers = get_available_browsers();