2007-11-21 [colin] 3.1.0cvs14
authorColin Leroy <colin@colino.net>
Wed, 21 Nov 2007 18:58:18 +0000 (18:58 +0000)
committerColin Leroy <colin@colino.net>
Wed, 21 Nov 2007 18:58:18 +0000 (18:58 +0000)
* src/compose.c
* src/crash.c
* src/exphtmldlg.c
* src/mainwindow.c
* src/manual.c
* src/mimeview.c
* src/prefs_account.c
* src/prefs_common.c
* src/prefs_common.h
* src/prefs_ext_prog.c
* src/textview.c
* src/uri_opener.c
* src/gtk/about.c
* src/gtk/gtkutils.c
Use xdg-open as a way to find default browser,
when available

17 files changed:
ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/crash.c
src/exphtmldlg.c
src/gtk/about.c
src/gtk/gtkutils.c
src/mainwindow.c
src/manual.c
src/mimeview.c
src/prefs_account.c
src/prefs_common.c
src/prefs_common.h
src/prefs_ext_prog.c
src/textview.c
src/uri_opener.c

index 5b8c86f1c36501e81c672f28f7f69902228f9432..364bd771cec572b6aac38e882dde5a16b819086a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2007-11-21 [colin]     3.1.0cvs14
+
+       * src/compose.c
+       * src/crash.c
+       * src/exphtmldlg.c
+       * src/mainwindow.c
+       * src/manual.c
+       * src/mimeview.c
+       * src/prefs_account.c
+       * src/prefs_common.c
+       * src/prefs_common.h
+       * src/prefs_ext_prog.c
+       * src/textview.c
+       * src/uri_opener.c
+       * src/gtk/about.c
+       * src/gtk/gtkutils.c
+               Use xdg-open as a way to find default browser,
+               when available
+
 2007-11-21 [colin]     3.1.0cvs13
 
        * src/messageview.c
index a41aa753fffc2bf586bb866b96cb08ff496c399f..465eaf5e3f18b8194885f3ac2adc1027e0769259 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.207.2.187 -r 1.207.2.188 src/folderview.c;  cvs diff -u -r 1.115.2.176 -r 1.115.2.177 src/main.c;  cvs diff -u -r 1.274.2.220 -r 1.274.2.221 src/mainwindow.c;  ) > 3.1.0cvs11.patchset
 ( cvs diff -u -r 1.1.2.10 -r 1.1.2.11 src/printing.c;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/printing.h;  ) > 3.1.0cvs12.patchset
 ( cvs diff -u -r 1.94.2.163 -r 1.94.2.164 src/messageview.c;  cvs diff -u -r 1.49.2.102 -r 1.49.2.103 src/procmime.c;  cvs diff -u -r 1.60.2.49 -r 1.60.2.50 src/procmsg.h;  ) > 3.1.0cvs13.patchset
+( cvs diff -u -r 1.382.2.425 -r 1.382.2.426 src/compose.c;  cvs diff -u -r 1.23.2.27 -r 1.23.2.28 src/crash.c;  cvs diff -u -r 1.3.2.22 -r 1.3.2.23 src/exphtmldlg.c;  cvs diff -u -r 1.274.2.221 -r 1.274.2.222 src/mainwindow.c;  cvs diff -u -r 1.11.2.13 -r 1.11.2.14 src/manual.c;  cvs diff -u -r 1.83.2.123 -r 1.83.2.124 src/mimeview.c;  cvs diff -u -r 1.105.2.116 -r 1.105.2.117 src/prefs_account.c;  cvs diff -u -r 1.204.2.152 -r 1.204.2.153 src/prefs_common.c;  cvs diff -u -r 1.103.2.98 -r 1.103.2.99 src/prefs_common.h;  cvs diff -u -r 1.3.2.18 -r 1.3.2.19 src/prefs_ext_prog.c;  cvs diff -u -r 1.96.2.192 -r 1.96.2.193 src/textview.c;  cvs diff -u -r 1.1.2.5 -r 1.1.2.6 src/uri_opener.c;  cvs diff -u -r 1.4.2.56 -r 1.4.2.57 src/gtk/about.c;  cvs diff -u -r 1.5.2.72 -r 1.5.2.73 src/gtk/gtkutils.c;  ) > 3.1.0cvs14.patchset
index 8573b1d684e111c00d0261a77d5487c71cedc550..7a180b816e2bb30c7e2de85e38e86edde92290c1 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=1
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=13
+EXTRA_VERSION=14
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 6e89e971780d72b8e5ba3f11fe745777eae93c53..e22707eeb3a5c5197b038ba14eb554648dde9e02 100644 (file)
@@ -8103,14 +8103,14 @@ static gint compose_exec_ext_editor_real(const gchar *file)
        if (setpgid(0, getppid()))
                perror("setpgid");
 
-       if (prefs_common.ext_editor_cmd &&
-           (p = strchr(prefs_common.ext_editor_cmd, '%')) &&
+       if (prefs_common_get_ext_editor_cmd() &&
+           (p = strchr(prefs_common_get_ext_editor_cmd(), '%')) &&
            *(p + 1) == 's' && !strchr(p + 2, '%')) {
-               g_snprintf(buf, sizeof(buf), prefs_common.ext_editor_cmd, file);
+               g_snprintf(buf, sizeof(buf), prefs_common_get_ext_editor_cmd(), file);
        } else {
-               if (prefs_common.ext_editor_cmd)
+               if (prefs_common_get_ext_editor_cmd())
                        g_warning("External editor command line is invalid: '%s'\n",
-                                 prefs_common.ext_editor_cmd);
+                                 prefs_common_get_ext_editor_cmd());
                g_snprintf(buf, sizeof(buf), DEFAULT_EDITOR_CMD, file);
        }
 
index 46e0ab6844adaa9f984ab8f1559807bfd97f0709..dffe9182bf703fbbbb8a79c0373bf16df824c164 100644 (file)
@@ -317,7 +317,7 @@ static void crash_save_crash_log(GtkButton *button, const gchar *text)
  */
 static void crash_create_bug_report(GtkButton *button, const gchar *data)
 {
-       open_uri(BUGZILLA_URI, prefs_common.uri_cmd);
+       open_uri(BUGZILLA_URI, prefs_common_get_uri_cmd());
 }
 
 /*!
index c73dd424f0c499372e9e2d4b562c50a2085172e0..fb8d00e02b2742750eec16a4c1edeb803bfbba51 100644 (file)
@@ -311,7 +311,7 @@ static void export_html_browse( GtkWidget *widget, gpointer data ) {
        gchar *uri;
 
        uri = g_strconcat( "file://", _exportCtl_->path, NULL );
-       open_uri( uri, prefs_common.uri_cmd );
+       open_uri( uri, prefs_common_get_uri_cmd() );
        g_free( uri );
 }
 
index d6fc6e032b7c80d060fbf5cbb2340febf9f9d590..3c87462b6471ee8f8e53b3d632a75d8739753593 100644 (file)
@@ -848,7 +848,7 @@ static gboolean about_textview_uri_clicked(GtkTextTag *tag, GObject *obj,
                }
                /* open link and do *not* return TRUE so that
                   further gtk processing of the signal is done */
-               open_uri(link, prefs_common.uri_cmd);
+               open_uri(link, prefs_common_get_uri_cmd());
 
        } else {
                if (bevent->button == 3 && event->type == GDK_BUTTON_PRESS) {
@@ -884,7 +884,7 @@ static void about_open_link_cb(GtkWidget *widget, guint action, void *data)
                return;
        }
 
-       open_uri(link, prefs_common.uri_cmd);
+       open_uri(link, prefs_common_get_uri_cmd());
        g_object_set_data(G_OBJECT(link_popupmenu), "menu_button",
                          NULL);
 }
index 5008eebc1550ddd32165983ba438efb915f8db74..bef9b0e152fcbc4ca8c7f37bc212f99c6a49deea 100644 (file)
@@ -1172,7 +1172,7 @@ static void link_btn_clicked(GtkButton *button, gpointer data)
        gchar *url = (gchar *)data;
        gtk_button_set_relief(button, GTK_RELIEF_NONE);
        gtk_widget_set_state(GTK_WIDGET(button), GTK_STATE_NORMAL);
-       open_uri(url, prefs_common.uri_cmd);
+       open_uri(url, prefs_common_get_uri_cmd());
 }
 
 static void link_btn_unrealize(GtkButton *button, gpointer data)
index eb2338063914b525fefbad2a9b878f239077495a..1ed494213cc95f44d447eb8803579d41af652eb2 100644 (file)
@@ -3013,7 +3013,7 @@ static void mailing_list_compose (GtkWidget *w, gpointer *data)
        gchar *mailto;
  
        gtk_label_get (GTK_LABEL (GTK_BIN (w)->child), (gchar **) &mailto);
-       open_uri (mailto, prefs_common.uri_cmd);
+       open_uri (mailto, prefs_common_get_uri_cmd());
 } 
        
 void main_window_popup(MainWindow *mainwin)
index 690a5479eef872d619bb872a988cd171f06933f9..3ec1a92d8cf48241bdc09dc478582eeb38e69cdf 100644 (file)
@@ -140,7 +140,7 @@ void manual_open(ManualType type, gchar *url_anchor)
                default:
                        break;
        }
-       open_uri(uri, prefs_common.uri_cmd);
+       open_uri(uri, prefs_common_get_uri_cmd());
        g_free(uri);
 }
 
index f79315ec6104abd79f8b503522ec4c9538f5d42d..79ab62a34eaa4d76466c7f480c9cbafd7d6f1faf 100644 (file)
@@ -1837,15 +1837,15 @@ static void mimeview_open_part_with(MimeView *mimeview, MimeInfo *partinfo, gboo
 #endif
        
        if ((partinfo->type == MIMETYPE_TEXT && !strcmp(partinfo->subtype, "html"))
-       && prefs_common.uri_cmd && prefs_common.uri_cmd[0]) {
-               mime_command = g_strdup(prefs_common.uri_cmd);
+       && prefs_common_get_uri_cmd() && prefs_common.uri_cmd[0]) {
+               mime_command = g_strdup(prefs_common_get_uri_cmd());
                g_free(content_type);
                content_type = NULL;
-       } else if (partinfo->type != MIMETYPE_TEXT || !prefs_common.ext_editor_cmd
-       ||  !prefs_common.ext_editor_cmd[0]) {
+       } else if (partinfo->type != MIMETYPE_TEXT || !prefs_common_get_ext_editor_cmd()
+       ||  !prefs_common_get_ext_editor_cmd()[0]) {
                mime_command = mailcap_get_command_for_type(content_type, filename);
        } else {
-               mime_command = g_strdup(prefs_common.ext_editor_cmd);
+               mime_command = g_strdup(prefs_common_get_ext_editor_cmd());
                g_free(content_type);
                content_type = NULL;
        }
index c0ee3effe8405546c79b40f53e3c40c805fe5e6f..d23a817f98b1e5fec4a045b4d505c2c11d05764b 100644 (file)
@@ -3491,7 +3491,7 @@ static void prefs_account_signature_edit_cb(GtkWidget *widget, gpointer data)
        const gchar *sigpath = gtk_entry_get_text(GTK_ENTRY(data));
        if (!is_file_exist(sigpath))
                str_write_to_file(sigpath, "");
-       open_txt_editor(sigpath, prefs_common.ext_editor_cmd);
+       open_txt_editor(sigpath, prefs_common_get_ext_editor_cmd());
 }
 
 static void prefs_account_edit_custom_header(void)
index 06280932d89f4ff3a7b642e9e5c0badfd68130d9..bd7c5f054dd8b78d03185ea93376ba1871314286 100644 (file)
@@ -792,6 +792,8 @@ static PrefParam param[] = {
         &SPECIFIC_PREFS.print_cmd, P_STRING, NULL, NULL, NULL},
        {"ext_editor_command", DEFAULT_EDITOR_CMD,
         &SPECIFIC_PREFS.ext_editor_cmd, P_STRING, NULL, NULL, NULL},
+       {"cmds_use_system_default", "TRUE",
+        &prefs_common.cmds_use_system_default, P_BOOL, NULL, NULL, NULL},
        {"add_address_by_click", "FALSE", &prefs_common.add_address_by_click,
         P_BOOL, NULL, NULL, NULL},
        {"confirm_on_exit", "FALSE", &prefs_common.confirm_on_exit, P_BOOL,
@@ -1436,3 +1438,37 @@ const gchar *prefs_common_translated_header_name(const gchar *header_name)
 
        return prefs_common.trans_hdr ? gettext(header_name) : header_name;
 }
+
+const gchar *prefs_common_get_uri_cmd(void)
+{
+       gchar *tmp = NULL;
+       
+       if (!prefs_common.cmds_use_system_default)
+               return prefs_common.uri_cmd;
+       
+       tmp = g_find_program_in_path("xdg-open");
+       if (!tmp) 
+               return prefs_common.uri_cmd;
+       
+       g_free(tmp);
+       return "xdg-open %s";
+}
+
+const gchar *prefs_common_get_ext_editor_cmd(void)
+{
+       return prefs_common.ext_editor_cmd;
+#if 0 /* we should do that, but it detaches the editor and breaks
+        compose.c's external composition. */
+       gchar *tmp = NULL;
+       
+       if (!prefs_common.cmds_use_system_default)
+               return prefs_common.ext_editor_cmd;
+       
+       tmp = g_find_program_in_path("xdg-open");
+       if (!tmp) 
+               return prefs_common.ext_editor_cmd;
+       
+       g_free(tmp);
+       return "xdg-open %s";
+#endif 
+}
index 4952c3b64df5575895cc684bc38a2af79a3fb090..a3b23cdddaf0c81eca3d137a3defcc8256fd4acc 100644 (file)
@@ -357,6 +357,7 @@ struct _PrefsCommon
        gchar *uri_cmd;
        gchar *print_cmd;
        gchar *ext_editor_cmd;
+       gboolean cmds_use_system_default;
 
        gboolean cliplog;
        guint loglength;
@@ -489,5 +490,6 @@ void pref_set_entry_from_pref(GtkEntry *entry, const gchar *txt);
 gchar *pref_get_pref_from_textview(GtkTextView *textview);
 gchar *pref_get_pref_from_entry(GtkEntry *entry);
 const gchar *prefs_common_translated_header_name(const gchar *header_name);
-
+const gchar *prefs_common_get_uri_cmd(void);
+const gchar *prefs_common_get_ext_editor_cmd(void);
 #endif /* __PREFS_COMMON_H__ */
index 28e02bd49a025113dbc691efa6e20d9be552a023..9692ffa1175cdb9ce8b17bc533dc9025ed5f2951 100644 (file)
@@ -47,6 +47,8 @@ typedef struct _ExtProgPage
 
        GtkWidget *window;              /* do not modify */
 
+       GtkWidget *cmds_use_system_default_checkbtn;
+
        GtkWidget *uri_label;
        GtkWidget *uri_combo;
        GtkWidget *uri_entry;
@@ -71,6 +73,7 @@ static void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *vbox;
        GtkWidget *hint_label;
        GtkWidget *table2;
+       GtkWidget *cmds_use_system_default_checkbtn;
        GtkWidget *uri_label;
        GtkWidget *uri_combo;
        GtkWidget *uri_entry;
@@ -82,7 +85,8 @@ static void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *printcmd_label;
        GtkWidget *printcmd_entry;
        GtkTooltips *tooltip;
-
+       int i = 0;
+       gchar *tmp;
        tooltip = gtk_tooltips_new();
 
        table = gtk_table_new(2, 1, FALSE);
@@ -93,7 +97,7 @@ static void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
 
        vbox = gtk_vbox_new(TRUE, 0);
        gtk_widget_show(vbox);
-       
+
        gtk_table_attach(GTK_TABLE (table), vbox, 0, 1, 0, 1,
                         (GtkAttachOptions) (GTK_SHRINK),
                         (GtkAttachOptions) (0), 0, 0);
@@ -105,7 +109,7 @@ static void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_box_pack_start(GTK_BOX (vbox),
                           hint_label, FALSE, FALSE, 4);
 
-       table2 = gtk_table_new(6, 2, FALSE);
+       table2 = gtk_table_new(7, 2, FALSE);
        gtk_widget_show(table2);
        gtk_container_set_border_width(GTK_CONTAINER(table2), 8);
        gtk_table_set_row_spacings(GTK_TABLE(table2), 4);
@@ -114,13 +118,40 @@ static void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_table_attach(GTK_TABLE (table), table2, 0, 1, 1, 2,
                         (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
-                        
+       
+       cmds_use_system_default_checkbtn = gtk_check_button_new_with_label(
+               _("Use system defaults when possible")); 
+       
+#ifndef MAEMO
+       gtk_widget_show(cmds_use_system_default_checkbtn);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cmds_use_system_default_checkbtn),
+                                       prefs_common.cmds_use_system_default);
+#else
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cmds_use_system_default_checkbtn),
+                                       TRUE);
+#endif
+       tmp = g_find_program_in_path("xdg-open");
+       if (!tmp) {
+               g_print("xdg-open not found\n");
+               gtk_widget_set_sensitive(cmds_use_system_default_checkbtn, FALSE);
+               gtk_widget_set_sensitive(cmds_use_system_default_checkbtn, FALSE);
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cmds_use_system_default_checkbtn),
+                                       FALSE);
+       } else
+               g_free(tmp);
+
+       
+       gtk_table_attach(GTK_TABLE (table2), cmds_use_system_default_checkbtn, 0, 2, i, i+1,
+                        (GtkAttachOptions) (GTK_FILL),
+                        (GtkAttachOptions) (0), 0, 2);
+       
        uri_label = gtk_label_new (_("Web browser"));
        gtk_widget_show(uri_label);
 #ifdef MAEMO
        gtk_widget_set_sensitive(uri_label, FALSE);
 #endif
-       gtk_table_attach(GTK_TABLE (table2), uri_label, 0, 1, 0, 1,
+       i++;
+       gtk_table_attach(GTK_TABLE (table2), uri_label, 0, 1, i, i+1,
                         (GtkAttachOptions) (GTK_FILL),
                         (GtkAttachOptions) (0), 0, 2);
        gtk_label_set_justify(GTK_LABEL (uri_label), GTK_JUSTIFY_RIGHT);
@@ -142,7 +173,7 @@ static void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
 #ifdef MAEMO
        gtk_widget_set_sensitive(uri_combo, FALSE);
 #endif
-       gtk_table_attach (GTK_TABLE (table2), uri_combo, 1, 2, 0, 1,
+       gtk_table_attach (GTK_TABLE (table2), uri_combo, 1, 2, i, i+1,
                          GTK_EXPAND | GTK_FILL, 0, 0, 0);
 
        uri_entry = GTK_BIN (uri_combo)->child;
@@ -151,7 +182,8 @@ static void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
        exteditor_label = gtk_label_new (_("Text editor"));
        gtk_widget_show(exteditor_label);
 
-       gtk_table_attach(GTK_TABLE (table2), exteditor_label, 0, 1, 1, 2,
+       i++;
+       gtk_table_attach(GTK_TABLE (table2), exteditor_label, 0, 1, i, i+1,
                         (GtkAttachOptions) (GTK_FILL),
                         (GtkAttachOptions) (0), 0, 2);
        gtk_label_set_justify(GTK_LABEL (exteditor_label), GTK_JUSTIFY_RIGHT);
@@ -168,7 +200,7 @@ static void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
                                        "kterm -e jed %s",
                                        "kterm -e vi %s",
                                        NULL);
-       gtk_table_attach (GTK_TABLE (table2), exteditor_combo, 1, 2, 1, 2,
+       gtk_table_attach (GTK_TABLE (table2), exteditor_combo, 1, 2, i, i+1,
                          GTK_EXPAND | GTK_FILL, 0, 0, 0);
 
        exteditor_entry = GTK_BIN (exteditor_combo)->child;
@@ -178,7 +210,8 @@ static void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
        astextviewer_label = gtk_label_new(_("Command for 'Display as text'"));
        gtk_widget_show(astextviewer_label);
 
-       gtk_table_attach(GTK_TABLE (table2), astextviewer_label, 0, 1, 2, 3,
+       i++;
+       gtk_table_attach(GTK_TABLE (table2), astextviewer_label, 0, 1, i, i+1,
                         (GtkAttachOptions) (GTK_FILL),
                         (GtkAttachOptions) (0), 0, 2);
        gtk_label_set_justify(GTK_LABEL (astextviewer_label), GTK_JUSTIFY_RIGHT);
@@ -192,7 +225,7 @@ static void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
                               "contextual menu item"),
                             NULL);
        
-       gtk_table_attach(GTK_TABLE (table2), astextviewer_entry, 1, 2, 2, 3,
+       gtk_table_attach(GTK_TABLE (table2), astextviewer_entry, 1, 2, i, i+1,
                         (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
        gtk_entry_set_text(GTK_ENTRY(astextviewer_entry), 
@@ -202,7 +235,8 @@ static void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
 #if !defined(USE_GNOMEPRINT) && !GTK_CHECK_VERSION(2,10,0)
        gtk_widget_show(printcmd_label);
 #endif
-       gtk_table_attach(GTK_TABLE (table2), printcmd_label, 0, 1, 3, 4,
+       i++;
+       gtk_table_attach(GTK_TABLE (table2), printcmd_label, 0, 1, i, i+1,
                         (GtkAttachOptions) (GTK_FILL),
                         (GtkAttachOptions) (0), 0, 2);
        gtk_label_set_justify(GTK_LABEL (printcmd_label), GTK_JUSTIFY_RIGHT);
@@ -212,18 +246,25 @@ static void prefs_ext_prog_create_widget(PrefsPage *_page, GtkWindow *window,
 #if !defined(USE_GNOMEPRINT) && !GTK_CHECK_VERSION(2,10,0)
        gtk_widget_show(printcmd_entry);
 #endif
-       gtk_table_attach(GTK_TABLE (table2), printcmd_entry, 1, 2, 3, 4,
+       gtk_table_attach(GTK_TABLE (table2), printcmd_entry, 1, 2, i, i+1,
                         (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
        gtk_entry_set_text(GTK_ENTRY(printcmd_entry), prefs_common.print_cmd ? prefs_common.print_cmd : "");
 
+       SET_TOGGLE_SENSITIVITY_REVERSE (cmds_use_system_default_checkbtn, uri_label);
+       SET_TOGGLE_SENSITIVITY_REVERSE (cmds_use_system_default_checkbtn, uri_combo);
+#if 0 /* we should do that, but it detaches the editor and breaks
+        compose.c's external composition. */
+       SET_TOGGLE_SENSITIVITY_REVERSE (cmds_use_system_default_checkbtn, exteditor_label);
+       SET_TOGGLE_SENSITIVITY_REVERSE (cmds_use_system_default_checkbtn, exteditor_combo);
+#endif
 
        prefs_ext_prog->window                  = GTK_WIDGET(window);
        prefs_ext_prog->uri_entry               = uri_entry;
        prefs_ext_prog->exteditor_entry         = exteditor_entry;
        prefs_ext_prog->astextviewer_entry      = astextviewer_entry;
        prefs_ext_prog->printcmd_entry          = printcmd_entry;
-
+       prefs_ext_prog->cmds_use_system_default_checkbtn = cmds_use_system_default_checkbtn;
        prefs_ext_prog->page.widget = table;
 }
 
@@ -239,6 +280,8 @@ static void prefs_ext_prog_save(PrefsPage *_page)
                (GTK_EDITABLE(ext_prog->exteditor_entry), 0, -1);
        prefs_common.mime_textviewer = gtk_editable_get_chars
                (GTK_EDITABLE(ext_prog->astextviewer_entry), 0, -1);
+       prefs_common.cmds_use_system_default = gtk_toggle_button_get_active
+               (GTK_TOGGLE_BUTTON(ext_prog->cmds_use_system_default_checkbtn));
 }
 
 static void prefs_ext_prog_destroy_widget(PrefsPage *_page)
index 2d0c247405ea505016e30a9065a006fdede28e21..4cb919fae20cead4815019665d92a8e0e587a5b0 100644 (file)
@@ -2643,7 +2643,7 @@ static gboolean textview_uri_button_pressed(GtkTextTag *tag, GObject *obj,
                        if (bevent->button == 1 &&
                            textview_uri_security_check(textview, uri) == TRUE) 
                                        open_uri(uri->uri,
-                                                prefs_common.uri_cmd);
+                                                prefs_common_get_uri_cmd());
                        else if (bevent->button == 3 && !qlink) {
                                g_object_set_data(
                                        G_OBJECT(textview->link_popup_menu),
@@ -2771,7 +2771,7 @@ static void open_uri_cb (TextView *textview, guint action, void *data)
 
        if (textview_uri_security_check(textview, uri) == TRUE) 
                open_uri(uri->uri,
-                        prefs_common.uri_cmd);
+                        prefs_common_get_uri_cmd());
        g_object_set_data(G_OBJECT(textview->link_popup_menu), "menu_button",
                          NULL);
 }
index ac3741c63ab9c338cbb751a0114ed8f0644b70e7..a0f83259a704e98c1c3d9118eac8d3265087a9c0 100644 (file)
@@ -303,7 +303,7 @@ static void uri_opener_double_clicked(GtkTreeView           *list_view,
 
        if (textview_uri_security_check(opener.msgview->mimeview->textview, uri) == TRUE) 
                open_uri(uri->uri,
-                        prefs_common.uri_cmd);
+                        prefs_common_get_uri_cmd());
 }
 
 
@@ -331,7 +331,7 @@ static void uri_opener_open_cb(GtkWidget *widget,
 
                if (textview_uri_security_check(opener.msgview->mimeview->textview, uri) == TRUE) 
                        open_uri(uri->uri,
-                                prefs_common.uri_cmd);
+                                prefs_common_get_uri_cmd());
        } else {
                GSList *cur = opener.uris;
 
@@ -339,7 +339,7 @@ static void uri_opener_open_cb(GtkWidget *widget,
                        uri = (ClickableText *)cur->data;
                        if (textview_uri_security_check(opener.msgview->mimeview->textview, uri) == TRUE) 
                                open_uri(uri->uri,
-                                        prefs_common.uri_cmd);
+                                        prefs_common_get_uri_cmd());
                }
        }
 }