diff options
author | Iain Holmes <iain@src.gnome.org> | 2001-03-14 02:54:15 +0800 |
---|---|---|
committer | Iain Holmes <iain@src.gnome.org> | 2001-03-14 02:54:15 +0800 |
commit | b4269e1f42c26ad7e02759d46e61542d1119adcc (patch) | |
tree | e9e723b668c78af16984e7247ea1b77fc3a61981 /shell/importer | |
parent | 7edf4916019dd2535be5b08fce63d579001577d6 (diff) | |
download | gsoc2013-evolution-b4269e1f42c26ad7e02759d46e61542d1119adcc.tar.gz gsoc2013-evolution-b4269e1f42c26ad7e02759d46e61542d1119adcc.tar.zst gsoc2013-evolution-b4269e1f42c26ad7e02759d46e61542d1119adcc.zip |
Have a "Do not ask me again" box for the importers.
svn path=/trunk/; revision=8676
Diffstat (limited to 'shell/importer')
-rw-r--r-- | shell/importer/intelligent.c | 62 |
1 files changed, 50 insertions, 12 deletions
diff --git a/shell/importer/intelligent.c b/shell/importer/intelligent.c index e3f0f4b03b..d874dd3cdd 100644 --- a/shell/importer/intelligent.c +++ b/shell/importer/intelligent.c @@ -42,12 +42,24 @@ start_importer (const char *iid) CORBA_char *message; CORBA_boolean can_run; - GtkWidget *dialog, *label; - char *str; + GtkWidget *dialog, *label, *ask; + gboolean dontaskagain; + char *str, *prefix; if (iid == NULL || *iid == '\0') return; + /* Check if we want to show this one again */ + prefix = g_strdup_printf ("=%s/evolution/config/Shell=/intelligent-importers/", gnome_util_user_home ()); + gnome_config_push_prefix (prefix); + g_free (prefix); + + dontaskagain = gnome_config_get_bool (iid); + gnome_config_pop_prefix (); + + if (dontaskagain) + return; + CORBA_exception_init (&ev); importer = oaf_activate_from_id ((char *) iid, 0, NULL, &ev); if (ev._major != CORBA_NO_EXCEPTION) { @@ -103,19 +115,32 @@ start_importer (const char *iid) label = gtk_label_new (message); CORBA_free (message); - gtk_box_pack_start (GNOME_DIALOG (dialog)->vbox, label, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label, + FALSE, FALSE, 0); gtk_widget_show (label); - switch (gnome_dialog_run_and_close (GNOME_DIALOG (dialog))) { + + ask = gtk_check_button_new_with_label (_("Don't ask me again")); + gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), ask, + FALSE, FALSE, 0); + gtk_widget_show (ask); + + switch (gnome_dialog_run (GNOME_DIALOG (dialog))) { case 0: /* Yes */ -#if 0 - /* This sucks */ - dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL); - label = gtk_label_new ("Importing"); - gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); - gtk_container_add (GTK_CONTAINER (dialog), label); - gtk_widget_show_all (dialog); -#endif + dontaskagain = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (ask)); + prefix = g_strdup_printf ("=%s/evolution/config/Shell=/intelligent-importers/", gnome_util_user_home ()); + gnome_config_push_prefix (prefix); + g_free (prefix); + + gnome_config_set_bool (iid, dontaskagain); + gnome_config_sync (); + gnome_config_drop_all (); + + gnome_config_pop_prefix (); + + gtk_object_destroy (GTK_OBJECT (dialog)); + while (gtk_events_pending ()) + gtk_main_iteration (); GNOME_Evolution_IntelligentImporter_importData (importer, &ev); break; @@ -123,6 +148,19 @@ start_importer (const char *iid) case -1: default: /* No */ + dontaskagain = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (ask)); + prefix = g_strdup_printf ("=%s/evolution/config/Shell=/intelligent-importers/", gnome_util_user_home ()); + gnome_config_push_prefix (prefix); + g_free (prefix); + + gnome_config_set_bool (iid, dontaskagain); + gnome_config_sync (); + gnome_config_drop_all (); + + gnome_config_pop_prefix (); + + gtk_object_destroy (GTK_OBJECT (dialog)); + break; } |