comparison pidgin/gtkprefs.c @ 32738:fd4a16fdb7ae

*** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im): Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem to be a way to go directly to the Default Applications screen, but we'll have to settle for the System Information panel.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 23 Feb 2012 08:13:01 +0000
parents d8bf899c1532
children 8404c5b75e99
comparison
equal deleted inserted replaced
32534:9f580e02d1e7 32738:fd4a16fdb7ae
1658 g_error_free(err); 1658 g_error_free(err);
1659 } 1659 }
1660 1660
1661 #ifndef _WIN32 1661 #ifndef _WIN32
1662 static void 1662 static void
1663 browser_button_clicked_cb(GtkWidget *button, gpointer null) 1663 browser_button_clicked_cb(GtkWidget *button, gchar *path)
1664 { 1664 {
1665 GError *err = NULL; 1665 GError *err = NULL;
1666 1666
1667 if (g_spawn_command_line_async ("gnome-default-applications-properties", &err)) 1667 if (g_spawn_command_line_async(path, &err))
1668 return; 1668 return;
1669 1669
1670 purple_notify_error(NULL, NULL, _("Cannot start browser configuration program."), err->message); 1670 purple_notify_error(NULL, NULL, _("Cannot start browser configuration program."), err->message);
1671 g_error_free(err); 1671 g_error_free(err);
1672 } 1672 }
1933 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); 1933 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
1934 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); 1934 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
1935 1935
1936 vbox = pidgin_make_frame (ret, _("Browser Selection")); 1936 vbox = pidgin_make_frame (ret, _("Browser Selection"));
1937 1937
1938 if(purple_running_gnome()) { 1938 if (purple_running_gnome()) {
1939 gchar *path = g_find_program_in_path("gnome-default-applications-properties"); 1939 gchar *path;
1940 1940
1941 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); 1941 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
1942 label = gtk_label_new(_("Browser preferences are configured in GNOME preferences")); 1942 label = gtk_label_new(_("Browser preferences are configured in GNOME preferences"));
1943 gtk_container_add(GTK_CONTAINER(vbox), hbox); 1943 gtk_container_add(GTK_CONTAINER(vbox), hbox);
1944 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); 1944 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
1945 1945
1946 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); 1946 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
1947 gtk_container_add(GTK_CONTAINER(vbox), hbox); 1947 gtk_container_add(GTK_CONTAINER(vbox), hbox);
1948 1948
1949 if(path == NULL) { 1949 path = g_find_program_in_path("gnome-control-center");
1950 if (path != NULL) {
1951 gchar *tmp = g_strdup_printf("%s info", path);
1952 g_free(path);
1953 path = tmp;
1954 } else {
1955 path = g_find_program_in_path("gnome-default-applications-properties");
1956 }
1957
1958 if (path == NULL) {
1950 label = gtk_label_new(NULL); 1959 label = gtk_label_new(NULL);
1951 gtk_label_set_markup(GTK_LABEL(label), 1960 gtk_label_set_markup(GTK_LABEL(label),
1952 _("<b>Browser configuration program was not found.</b>")); 1961 _("<b>Browser configuration program was not found.</b>"));
1953 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); 1962 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
1954 } else { 1963 } else {
1955 browser_button = gtk_button_new_with_mnemonic(_("Configure _Browser")); 1964 browser_button = gtk_button_new_with_mnemonic(_("Configure _Browser"));
1956 g_signal_connect(G_OBJECT(browser_button), "clicked", 1965 g_signal_connect_data(G_OBJECT(browser_button), "clicked",
1957 G_CALLBACK(browser_button_clicked_cb), NULL); 1966 G_CALLBACK(browser_button_clicked_cb), path,
1967 (GClosureNotify)g_free, 0);
1958 gtk_box_pack_start(GTK_BOX(hbox), browser_button, FALSE, FALSE, 0); 1968 gtk_box_pack_start(GTK_BOX(hbox), browser_button, FALSE, FALSE, 0);
1959 } 1969 }
1960 1970
1961 g_free(path);
1962 gtk_widget_show_all(ret); 1971 gtk_widget_show_all(ret);
1963 } else { 1972 } else {
1964 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); 1973 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
1965 1974
1966 browsers = get_available_browsers(); 1975 browsers = get_available_browsers();