aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-01-11 07:28:15 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-01-11 07:28:15 +0800
commit18b44d230e3a9a687d1f581aa00ebd52c0a4d69a (patch)
treedf598de4f81c97ebc24b8c82138423f327caa8c6
parent17bdb9c55fc2f204ec25757cce7937dc03b89dc2 (diff)
downloadgsoc2013-evolution-18b44d230e3a9a687d1f581aa00ebd52c0a4d69a.tar.gz
gsoc2013-evolution-18b44d230e3a9a687d1f581aa00ebd52c0a4d69a.tar.zst
gsoc2013-evolution-18b44d230e3a9a687d1f581aa00ebd52c0a4d69a.zip
We also need to call message_list_set_hidedeleted() here so that any
2003-01-10 Jeffrey Stedfast <fejj@ximian.com> * folder-browser-ui.c (folder_browser_ui_add_list): We also need to call message_list_set_hidedeleted() here so that any deactivated folder controls will change to the currently set state when re-activated. (folder_browser_ui_add_global): Same for show_preview. * folder-browser.c (hide_deleted_changed): Don't call message_list_set_hidedeleted() here. (folder_browser_toggle_hide_deleted): Instead, call it here. This way we get a faster "response time". Also, this will make it so that not all folder controls will regen their message-list at the same time. (folder_browser_toggle_preview): Same idea as the hide-deleted changes. (show_preview_changed): See above. * mail-config-druid.c (make_account): Default the new account to enabled. (wizard_finish_cb): Don't set enabled here. svn path=/trunk/; revision=19417
-rw-r--r--mail/ChangeLog31
-rw-r--r--mail/folder-browser-ui.c19
-rw-r--r--mail/folder-browser.c70
-rw-r--r--mail/folder-browser.h1
-rw-r--r--mail/mail-accounts.c6
-rw-r--r--mail/mail-config-druid.c5
6 files changed, 90 insertions, 42 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index e80c32700d..f750a6960f 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,36 @@
2003-01-10 Jeffrey Stedfast <fejj@ximian.com>
+ * folder-browser-ui.c (folder_browser_ui_add_list): We also need
+ to call message_list_set_hidedeleted() here so that any
+ deactivated folder controls will change to the currently set state
+ when re-activated.
+ (folder_browser_ui_add_global): Same for show_preview.
+
+ * folder-browser.c (hide_deleted_changed): Don't call
+ message_list_set_hidedeleted() here.
+ (folder_browser_toggle_hide_deleted): Instead, call it here. This
+ way we get a faster "response time". Also, this will make it so
+ that not all folder controls will regen their message-list at the
+ same time.
+ (folder_browser_toggle_preview): Same idea as the hide-deleted
+ changes.
+ (show_preview_changed): See above.
+
+ * mail-config-druid.c (make_account): Default the new account to
+ enabled.
+ (wizard_finish_cb): Don't set enabled here.
+
+2003-01-10 Jeffrey Stedfast <fejj@ximian.com>
+
+ * folder-browser.c (hide_deleted_changed): New callback for when
+ the HideDeleted state changes.
+ (folder_browser_gui_init): Listen for changes to hide_deleted so
+ we can update the menu state.
+ (folder_browser_destroy): Remove the hide_deleted notify handler.
+ (folder_browser_toggle_hide_deleted): When saving the setting,
+ remember that it is !atoi (state) rather than atoi (state) because
+ show vs hide. yea.
+
* mail-session.c (main_get_filter_driver): notify-type is a int,
not a bool. Duh.
diff --git a/mail/folder-browser-ui.c b/mail/folder-browser-ui.c
index 22f305df25..cf5a689304 100644
--- a/mail/folder-browser-ui.c
+++ b/mail/folder-browser-ui.c
@@ -558,25 +558,20 @@ folder_browser_ui_add_list (FolderBrowser *fb)
gconf = gconf_client_get_default ();
if (fb->sensitise_state) {
- g_hash_table_destroy(fb->sensitise_state);
+ g_hash_table_destroy (fb->sensitise_state);
fb->sensitise_state = NULL;
}
ui_add (fb, "list", list_verbs, list_pixcache);
/* Hide Deleted */
- if (fb->folder && (fb->folder->folder_flags & CAMEL_FOLDER_IS_TRASH)) {
- fbui_sensitise_item (fb, "HideDeleted", FALSE);
- state = FALSE;
- } else {
- state = !gconf_client_get_bool (gconf, "/apps/evolution/mail/display/show_deleted", NULL);
- }
-
+ state = !gconf_client_get_bool (gconf, "/apps/evolution/mail/display/show_deleted", NULL);
bonobo_ui_component_set_prop (uic, "/commands/HideDeleted", "state", state ? "1" : "0", NULL);
bonobo_ui_component_add_listener (uic, "HideDeleted", folder_browser_toggle_hide_deleted, fb);
- /* FIXME: this kind of bypasses bonobo but seems the only way when we change components */
- folder_browser_toggle_hide_deleted (uic, "", Bonobo_UIComponent_STATE_CHANGED,
- state ? "1" : "0", fb);
+ if (!(fb->folder && (fb->folder->folder_flags & CAMEL_FOLDER_IS_TRASH)))
+ message_list_set_hidedeleted (fb->message_list, state);
+ else
+ fbui_sensitise_item (fb, "HideDeleted", FALSE);
/* Threaded toggle */
state = mail_config_get_thread_list (FOLDER_BROWSER (fb)->uri);
@@ -621,10 +616,10 @@ folder_browser_ui_add_global (FolderBrowser *fb)
/* (Pre)view toggle */
show_preview = gconf_client_get_bool (gconf, "/apps/evolution/mail/display/show_preview", NULL);
bonobo_ui_component_set_prop (uic, "/commands/ViewPreview", "state", show_preview ? "1" : "0", NULL);
+ folder_browser_set_message_preview (fb, show_preview);
/* listen for user-changes */
bonobo_ui_component_add_listener (uic, "ViewPreview", folder_browser_toggle_preview, fb);
- folder_browser_set_message_preview (fb, show_preview);
/* Stop button */
/* TODO: Go through cache, but we can't becaus eof mail-mt.c:set_stop at the moment */
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index 2bc5bc12f3..074bdd5f6e 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -208,6 +208,11 @@ folder_browser_destroy (GtkObject *object)
folder_browser->show_preview_notify_id = 0;
}
+ if (folder_browser->hide_deleted_notify_id != 0) {
+ gconf_client_notify_remove (gconf, folder_browser->hide_deleted_notify_id);
+ folder_browser->hide_deleted_notify_id = 0;
+ }
+
/* wait for all outstanding async events against us */
mail_async_event_destroy (folder_browser->async_event);
@@ -1281,6 +1286,7 @@ folder_browser_toggle_preview (BonoboUIComponent *component,
gconf = gconf_client_get_default ();
gconf_client_set_bool (gconf, "/apps/evolution/mail/display/show_preview", atoi (state), NULL);
+ folder_browser_set_message_preview (fb, atoi (state));
}
void
@@ -1315,19 +1321,15 @@ folder_browser_toggle_hide_deleted (BonoboUIComponent *component,
FolderBrowser *fb = user_data;
GConfClient *gconf;
- if (type != Bonobo_UIComponent_STATE_CHANGED
- || fb->message_list == NULL)
+ if (type != Bonobo_UIComponent_STATE_CHANGED || fb->message_list == NULL)
return;
gconf = gconf_client_get_default ();
+ gconf_client_set_bool (gconf, "/apps/evolution/mail/display/show_deleted",
+ !atoi (state), NULL);
- /* FIXME: we should listen for changes to this, so when it changes for one folder all folders get updated */
- if (!(fb->folder && (fb->folder->folder_flags & CAMEL_FOLDER_IS_TRASH))) {
- gconf_client_set_bool (gconf, "/apps/evolution/mail/display/show_deleted",
- atoi (state), NULL);
- }
-
- message_list_set_hidedeleted (fb->message_list, atoi (state));
+ if (!(fb->folder && (fb->folder->folder_flags & CAMEL_FOLDER_IS_TRASH)))
+ message_list_set_hidedeleted (fb->message_list, !atoi (state));
}
void
@@ -2361,9 +2363,24 @@ show_preview_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpo
FolderBrowser *fb = user_data;
gboolean show_preview;
- show_preview = gconf_client_get_bool (client, "/apps/evolution/mail/display/show_preview", NULL);
- bonobo_ui_component_set_prop (fb->uicomp, "/commands/ViewPreview", "state", show_preview ? "1" : "0", NULL);
- folder_browser_set_message_preview (fb, show_preview);
+ if (fb->uicomp) {
+ show_preview = gconf_client_get_bool (client, "/apps/evolution/mail/display/show_preview", NULL);
+ bonobo_ui_component_set_prop (fb->uicomp, "/commands/ViewPreview", "state",
+ show_preview ? "1" : "0", NULL);
+ }
+}
+
+static void
+hide_deleted_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
+{
+ FolderBrowser *fb = user_data;
+ gboolean hide_deleted;
+
+ if (fb->uicomp) {
+ hide_deleted = !gconf_client_get_bool (client, "/apps/evolution/mail/display/show_deleted", NULL);
+ bonobo_ui_component_set_prop (fb->uicomp, "/commands/HideDeleted", "state",
+ hide_deleted ? "1" : "0", NULL);
+ }
}
static void
@@ -2422,23 +2439,28 @@ folder_browser_gui_init (FolderBrowser *fb)
gconf = gconf_client_get_default ();
- /* paned size */
- gconf_client_add_dir (gconf, "/apps/evolution/mail/display/paned_size",
+ /* hide deleted */
+ gconf_client_add_dir (gconf, "/apps/evolution/mail/display/show_deleted",
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
- fb->paned_size_notify_id = gconf_client_notify_add (gconf, "/apps/evolution/mail/display/paned_size",
- paned_size_changed, fb, NULL, NULL);
-
- paned_size = gconf_client_get_int (gconf, "/apps/evolution/mail/display/paned_size", NULL);
+ fb->hide_deleted_notify_id = gconf_client_notify_add (gconf, "/apps/evolution/mail/display/show_deleted",
+ hide_deleted_changed, fb, NULL, NULL);
/* show preview-pane */
gconf_client_add_dir (gconf, "/apps/evolution/mail/display/show_preview",
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
- /* listen for changed events to the show_preview setting */
fb->show_preview_notify_id = gconf_client_notify_add (gconf, "/apps/evolution/mail/display/show_preview",
show_preview_changed, fb, NULL, NULL);
+ /* paned size */
+ gconf_client_add_dir (gconf, "/apps/evolution/mail/display/paned_size",
+ GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+
+ fb->paned_size_notify_id = gconf_client_notify_add (gconf, "/apps/evolution/mail/display/paned_size",
+ paned_size_changed, fb, NULL, NULL);
+
+ paned_size = gconf_client_get_int (gconf, "/apps/evolution/mail/display/paned_size", NULL);
e_paned_add2 (E_PANED (fb->vpaned), GTK_WIDGET (fb->mail_display));
e_paned_set_position (E_PANED (fb->vpaned), paned_size);
gtk_widget_show (GTK_WIDGET (fb->mail_display));
@@ -2559,7 +2581,7 @@ on_message_list_focus_in (GtkWidget *widget, GdkEventFocus *event, gpointer user
{
FolderBrowser *fb = (FolderBrowser *) user_data;
- printf ("got focus!\n");
+ d(printf ("got focus!\n"));
folder_browser_ui_message_list_focus (fb);
return FALSE;
@@ -2570,7 +2592,7 @@ on_message_list_focus_out (GtkWidget *widget, GdkEventFocus *event, gpointer use
{
FolderBrowser *fb = (FolderBrowser *) user_data;
- printf ("got unfocus!\n");
+ d(printf ("got unfocus!\n"));
folder_browser_ui_message_list_unfocus (fb);
return FALSE;
@@ -2645,9 +2667,9 @@ my_folder_browser_init (FolderBrowser *fb)
/* cut, copy & paste */
fb->invisible = gtk_invisible_new ();
- g_object_ref(fb->invisible);
- gtk_object_sink((GtkObject *)fb->invisible);
-
+ g_object_ref (fb->invisible);
+ gtk_object_sink ((GtkObject *) fb->invisible);
+
for (i = 0; i < num_paste_types; i++)
gtk_selection_add_target (fb->invisible, clipboard_atom,
paste_types[i].target,
diff --git a/mail/folder-browser.h b/mail/folder-browser.h
index 4758937c90..f9d0f1df3e 100644
--- a/mail/folder-browser.h
+++ b/mail/folder-browser.h
@@ -63,6 +63,7 @@ struct _FolderBrowser {
guint paned_size_notify_id;
guint show_preview_notify_id;
+ guint hide_deleted_notify_id;
/* a folder we are expunging, dont use other than to compare the pointer value */
CamelFolder *expunging;
diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c
index e84b0b50ff..df3806da24 100644
--- a/mail/mail-accounts.c
+++ b/mail/mail-accounts.c
@@ -221,12 +221,12 @@ account_delete_clicked (GtkButton *button, gpointer user_data)
button = (GtkButton *) gtk_button_new_from_stock (GTK_STOCK_YES);
gtk_button_set_label (button, _("Delete"));
gtk_dialog_add_action_widget ((GtkDialog *) confirm, (GtkWidget *) button, GTK_RESPONSE_YES);
- gtk_widget_show (button);
-
+ gtk_widget_show ((GtkWidget *) button);
+
button = (GtkButton *) gtk_button_new_from_stock (GTK_STOCK_NO);
gtk_button_set_label (button, _("Don't delete"));
gtk_dialog_add_action_widget ((GtkDialog *) confirm, (GtkWidget *) button, GTK_RESPONSE_NO);
- gtk_widget_show (button);
+ gtk_widget_show ((GtkWidget *) button);
ans = gtk_dialog_run ((GtkDialog *) confirm);
gtk_widget_destroy (confirm);
diff --git a/mail/mail-config-druid.c b/mail/mail-config-druid.c
index 3ca9d05839..dda278cbc1 100644
--- a/mail/mail-config-druid.c
+++ b/mail/mail-config-druid.c
@@ -465,6 +465,7 @@ make_account (void)
struct utsname uts;
account = g_new0 (MailConfigAccount, 1);
+ account->enabled = TRUE;
account->id = g_new0 (MailConfigIdentity, 1);
name = g_get_real_name ();
@@ -769,7 +770,7 @@ get_fn (EvolutionWizard *wizard,
if (gui->gui == NULL) {
if (gui->account == NULL) {
gui->account = make_account ();
- g_object_set_data(G_OBJECT(wizard), "account-data", gui->account);
+ g_object_set_data ((GObject *) wizard, "account-data", gui->account);
}
gui->gui = mail_account_gui_new (gui->account, NULL);
@@ -938,8 +939,6 @@ wizard_finish_cb (EvolutionWizard *wizard,
MailConfigWizard *w)
{
MailAccountGui *gui = w->gui;
-
- gui->account->enabled = TRUE;
/* Save the settings for that account */
if (mail_account_gui_save (gui) == FALSE)