From 207303df9e2464c379d3b6e63f388d58332a428a Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 30 Jan 2002 23:46:32 +0000 Subject: Pass the parent window to mail_account_editor_new(). 2002-01-30 Jeffrey Stedfast * mail-accounts.c (mail_edit): Pass the parent window to mail_account_editor_new(). * mail-account-editor.c (mail_account_editor_new): Set the parent window here because construct() inadvertantly gtk_widget_show_all's the editor. * mail-account-gui.c (mail_account_gui_save): Use g_basename() rather than strrchr for '/' especially since the strrchr code wasn't doing any NULL checks. svn path=/trunk/; revision=15533 --- mail/ChangeLog | 13 +++++++++++++ mail/mail-account-editor.c | 13 +++++++------ mail/mail-account-editor.h | 3 ++- mail/mail-account-gui.c | 4 ++-- mail/mail-accounts.c | 3 +-- mail/mail-callbacks.c | 6 +++--- 6 files changed, 28 insertions(+), 14 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index b8f2c02556..9d03ad328e 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,16 @@ +2002-01-30 Jeffrey Stedfast + + * mail-accounts.c (mail_edit): Pass the parent window to + mail_account_editor_new(). + + * mail-account-editor.c (mail_account_editor_new): Set the parent + window here because construct() inadvertantly + gtk_widget_show_all's the editor. + + * mail-account-gui.c (mail_account_gui_save): Use g_basename() + rather than strrchr for '/' especially since the strrchr code + wasn't doing any NULL checks. + 2002-01-30 Radek Doulik * mail-format.c (handle_text_plain_flowed): print quoted text in diff --git a/mail/mail-account-editor.c b/mail/mail-account-editor.c index 893cdd7426..166c3f1df9 100644 --- a/mail/mail-account-editor.c +++ b/mail/mail-account-editor.c @@ -48,7 +48,7 @@ GtkType mail_account_editor_get_type () { static GtkType type = 0; - + if (!type) { GtkTypeInfo type_info = { "MailAccountEditor", @@ -59,10 +59,10 @@ mail_account_editor_get_type () (GtkArgSetFunc) NULL, (GtkArgGetFunc) NULL }; - + type = gtk_type_unique (gnome_dialog_get_type (), &type_info); } - + return type; } @@ -132,7 +132,7 @@ static void ok_clicked (GtkWidget *widget, gpointer data) { MailAccountEditor *editor = data; - + if (apply_changes (editor)) gtk_widget_destroy (GTK_WIDGET (editor)); } @@ -141,7 +141,7 @@ static void cancel_clicked (GtkWidget *widget, gpointer data) { MailAccountEditor *editor = data; - + gtk_widget_destroy (GTK_WIDGET (editor)); } @@ -182,11 +182,12 @@ construct (MailAccountEditor *editor, MailConfigAccount *account) } MailAccountEditor * -mail_account_editor_new (MailConfigAccount *account) +mail_account_editor_new (MailConfigAccount *account, GtkWindow *parent) { MailAccountEditor *new; new = (MailAccountEditor *) gtk_type_new (mail_account_editor_get_type ()); + gnome_dialog_set_parent (GNOME_DIALOG (new), parent); construct (new, account); return new; diff --git a/mail/mail-account-editor.h b/mail/mail-account-editor.h index 71be3b14d5..22e4158b95 100644 --- a/mail/mail-account-editor.h +++ b/mail/mail-account-editor.h @@ -28,6 +28,7 @@ extern "C" { #pragma } #endif /* __cplusplus */ +#include #include #include #include "mail-account-gui.h" @@ -56,7 +57,7 @@ typedef struct { GtkType mail_account_editor_get_type (void); -MailAccountEditor *mail_account_editor_new (MailConfigAccount *account); +MailAccountEditor *mail_account_editor_new (MailConfigAccount *account, GtkWindow *parent); #ifdef __cplusplus } diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c index f28ee8eb7e..0eb381a708 100644 --- a/mail/mail-account-gui.c +++ b/mail/mail-account-gui.c @@ -1709,7 +1709,7 @@ mail_account_gui_save (MailAccountGui *gui) } else { /* assign defaults - the uri is unknown to us (probably pointed to an old source url) */ g_free (account->drafts_folder_name); - account->drafts_folder_name = g_strdup (strrchr (default_drafts_folder_uri, '/') + 1); + account->drafts_folder_name = g_strdup (g_basename (default_drafts_folder_uri)); g_free (account->drafts_folder_uri); account->drafts_folder_uri = g_strdup (default_drafts_folder_uri); } @@ -1728,7 +1728,7 @@ mail_account_gui_save (MailAccountGui *gui) } else { /* assign defaults - the uri is unknown to us (probably pointed to an old source url) */ g_free (account->sent_folder_name); - account->sent_folder_name = g_strdup (strrchr (default_sent_folder_uri, '/') + 1); + account->sent_folder_name = g_strdup (g_basename (default_sent_folder_uri)); g_free (account->sent_folder_uri); account->sent_folder_uri = g_strdup (default_sent_folder_uri); } diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c index db8a09a481..79f7b49a79 100644 --- a/mail/mail-accounts.c +++ b/mail/mail-accounts.c @@ -259,8 +259,7 @@ mail_edit (GtkButton *button, gpointer data) MailConfigAccount *account; account = gtk_clist_get_row_data (dialog->mail_accounts, dialog->accounts_row); - editor = mail_account_editor_new (account); - gnome_dialog_set_parent (GNOME_DIALOG (editor), GTK_WINDOW (dialog)); + editor = mail_account_editor_new (account, GTK_WINDOW (dialog)); gtk_signal_connect (GTK_OBJECT (editor), "destroy", GTK_SIGNAL_FUNC (mail_editor_destroyed), dialog); diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index bd1a243a22..463c435369 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -696,8 +696,8 @@ composer_save_draft_cb (EMsgComposer *composer, int quit, gpointer data) static GtkWidget * create_msg_composer (const MailConfigAccount *account, const char *url) { - gboolean send_html; EMsgComposer *composer; + gboolean send_html; /* Make sure that we've actually been passed in an account. If one has * not been passed in, grab the default account. @@ -722,7 +722,7 @@ create_msg_composer (const MailConfigAccount *account, const char *url) void compose_msg (GtkWidget *widget, gpointer user_data) { - MailConfigAccount *account; + const MailConfigAccount *account; FolderBrowser *fb = FOLDER_BROWSER (user_data); GtkWidget *composer; @@ -1624,7 +1624,7 @@ thread_select_foreach (ETreePath path, gpointer user_data) thread_select_info_t *tsi = (thread_select_info_t *) user_data; ETreeModel *tm = tsi->ml->model; ETreePath node; - + /* @path part of the initial selection. If it has children, * we select them as well. If it doesn't, we select its siblings and * their children (ie, the current node must be inside the thread -- cgit v1.2.3