From: Murray Cumming Date: Thu, 10 May 2007 15:08:38 +0000 (+0000) Subject: 2007-05-10 Murray Cumming X-Git-Tag: git_migration_finished~3644 X-Git-Url: http://git.maemo.org/git/?a=commitdiff_plain;h=b1d9c6d8aa1d7ba37f5969ca2c37b9fd3e9a6b6a;p=modest 2007-05-10 Murray Cumming * src/maemo/modest-main-window.c: (on_account_update): Check that account_name is not NULL, to prevent a crash at startup that I am seeing on the N800. I do wonder why it is NULL. * src/maemo/easysetup/modest-easysetup-wizard.c: (create_page_user_details): * src/maemo/modest-account-settings-dialog.c: (create_page_user_details), (create_page_outgoing): * src/maemo/modest-connection-specific-smtp-edit-window.c: (modest_connection_specific_smtp_edit_window_init): * src/modest-ui-actions.c: (modest_ui_actions_on_password_requested): Use HILDON_GTK_INPUT_MODE_INVISIBLE with password entries, which might do something useful with the on-screen keyboard. pmo-trunk-r1824 --- diff --git a/ChangeLog2 b/ChangeLog2 index ff4c4dd..166f489 100644 --- a/ChangeLog2 +++ b/ChangeLog2 @@ -1,5 +1,22 @@ 2007-05-10 Murray Cumming + * src/maemo/modest-main-window.c: (on_account_update): Check that + account_name is not NULL, to prevent a crash at startup that I am + seeing on the N800. I do wonder why it is NULL. + + * src/maemo/easysetup/modest-easysetup-wizard.c: + (create_page_user_details): + * src/maemo/modest-account-settings-dialog.c: + (create_page_user_details), (create_page_outgoing): + * src/maemo/modest-connection-specific-smtp-edit-window.c: + (modest_connection_specific_smtp_edit_window_init): + * src/modest-ui-actions.c: + (modest_ui_actions_on_password_requested): + Use HILDON_GTK_INPUT_MODE_INVISIBLE with password entries, which + might do something useful with the on-screen keyboard. + +2007-05-10 Murray Cumming + * src/maemo/modest-main-window.c: (on_account_update): Avoid adding a menu item to priv->accounts_popup if accounts_popup is NULL, to avoid lots of warnings. However, it probably should not be NULL. diff --git a/src/maemo/easysetup/modest-easysetup-wizard.c b/src/maemo/easysetup/modest-easysetup-wizard.c index 4a7d9b0..c4e86a6 100644 --- a/src/maemo/easysetup/modest-easysetup-wizard.c +++ b/src/maemo/easysetup/modest-easysetup-wizard.c @@ -438,7 +438,8 @@ create_page_user_details (ModestEasysetupWizardDialog *self) /* The password widgets: */ self->entry_user_password = gtk_entry_new (); /* Auto-capitalization is the default, so let's turn it off: */ - hildon_gtk_entry_set_input_mode (GTK_ENTRY (self->entry_user_password), HILDON_GTK_INPUT_MODE_FULL); + hildon_gtk_entry_set_input_mode (GTK_ENTRY (self->entry_user_password), + HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE); gtk_entry_set_visibility (GTK_ENTRY (self->entry_user_password), FALSE); /* gtk_entry_set_invisible_char (GTK_ENTRY (self->entry_user_password), '*'); */ caption = create_caption_new_with_asterix (self, sizegroup, diff --git a/src/maemo/modest-account-settings-dialog.c b/src/maemo/modest-account-settings-dialog.c index cf1d812..4e54e0d 100644 --- a/src/maemo/modest-account-settings-dialog.c +++ b/src/maemo/modest-account-settings-dialog.c @@ -402,7 +402,8 @@ create_page_user_details (ModestAccountSettingsDialog *self) /* The password widgets: */ self->entry_user_password = gtk_entry_new (); /* Auto-capitalization is the default, so let's turn it off: */ - hildon_gtk_entry_set_input_mode (GTK_ENTRY (self->entry_user_password), HILDON_GTK_INPUT_MODE_FULL); + hildon_gtk_entry_set_input_mode (GTK_ENTRY (self->entry_user_password), + HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE); gtk_entry_set_visibility (GTK_ENTRY (self->entry_user_password), FALSE); /* gtk_entry_set_invisible_char (GTK_ENTRY (self->entry_user_password), '*'); */ caption = create_caption_new_with_asterix (self, sizegroup, @@ -692,7 +693,8 @@ static GtkWidget* create_page_outgoing (ModestAccountSettingsDialog *self) /* The password widgets: */ self->entry_outgoing_password = gtk_entry_new (); /* Auto-capitalization is the default, so let's turn it off: */ - hildon_gtk_entry_set_input_mode (GTK_ENTRY (self->entry_outgoing_password), HILDON_GTK_INPUT_MODE_FULL); + hildon_gtk_entry_set_input_mode (GTK_ENTRY (self->entry_outgoing_password), + HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE); gtk_entry_set_visibility (GTK_ENTRY (self->entry_outgoing_password), FALSE); /* gtk_entry_set_invisible_char (GTK_ENTRY (self->entry_outgoing_password), '*'); */ self->caption_outgoing_password = create_caption_new_with_asterix (self, sizegroup, diff --git a/src/maemo/modest-connection-specific-smtp-edit-window.c b/src/maemo/modest-connection-specific-smtp-edit-window.c index cc66446..e62d477 100644 --- a/src/maemo/modest-connection-specific-smtp-edit-window.c +++ b/src/maemo/modest-connection-specific-smtp-edit-window.c @@ -167,7 +167,8 @@ modest_connection_specific_smtp_edit_window_init (ModestConnectionSpecificSmtpEd /* The password widgets: */ priv->entry_user_password = gtk_entry_new (); /* Auto-capitalization is the default, so let's turn it off: */ - hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_user_password), HILDON_GTK_INPUT_MODE_FULL); + hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_user_password), + HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE); gtk_entry_set_visibility (GTK_ENTRY (priv->entry_user_password), FALSE); /* gtk_entry_set_invisible_char (GTK_ENTRY (priv->entry_user_password), '*'); */ caption = hildon_caption_new (sizegroup, diff --git a/src/maemo/modest-main-window.c b/src/maemo/modest-main-window.c index 0d70150..5b59233 100644 --- a/src/maemo/modest-main-window.c +++ b/src/maemo/modest-main-window.c @@ -949,63 +949,68 @@ on_account_update (TnyAccountStore *account_store, default_account = modest_account_mgr_get_default_account (mgr); action_group = gtk_action_group_new (MODEST_MAIN_WINDOW_ACTION_GROUP_ADDITIONS); for (i = 0; i < num_accounts; i++) { - GtkAction *new_action; - gchar* item_name, *display_name; - guint8 merge_id; - + GtkAction *new_action = NULL; + gchar *display_name = NULL; + account_data = (ModestAccountData *) g_slist_nth_data (accounts, i); /* Create display name. The default account is shown differently */ - if (default_account && !(strcmp (default_account, account_data->account_name) == 0)) + if (default_account && account_data->account_name && + !(strcmp (default_account, account_data->account_name) == 0)) { display_name = g_strdup_printf (_("mcen_me_toolbar_sendreceive_default"), account_data->display_name); - else + } + else { display_name = g_strdup_printf (_("mcen_me_toolbar_sendreceive_mailbox_n"), account_data->display_name); + } /* Create action and add it to the action group. The action name must be the account name, this way we could know in the handlers the account to show */ - new_action = gtk_action_new (account_data->account_name, display_name, NULL, NULL); - gtk_action_group_add_action (action_group, new_action); - - /* Add ui from account data. We allow 2^9-1 account - changes in a single execution because we're - downcasting the guint to a guint8 in order to use a - GByteArray, it should be enough */ - item_name = g_strconcat (account_data->account_name, "Menu"); - merge_id = (guint8) gtk_ui_manager_new_merge_id (parent_priv->ui_manager); - priv->merge_ids = g_byte_array_append (priv->merge_ids, &merge_id, 1); - gtk_ui_manager_add_ui (parent_priv->ui_manager, - merge_id, - "/MenuBar/ViewMenu/ViewMenuAdditions", - item_name, - account_data->account_name, - GTK_UI_MANAGER_MENUITEM, - FALSE); - - /* Connect the action signal "activate" */ - g_signal_connect (G_OBJECT (new_action), - "activate", - G_CALLBACK (on_show_account_action_activated), - self); - - /* Create item and add it to the send&receive CSM */ - /* TODO: Why is this sometimes NULL? murrayc */ - if (priv->accounts_popup) { - item = gtk_menu_item_new_with_label (display_name); - gtk_menu_shell_append (GTK_MENU_SHELL (priv->accounts_popup), GTK_WIDGET (item)); - g_signal_connect_data (G_OBJECT (item), - "activate", - G_CALLBACK (on_send_receive_csm_activated), - g_strdup (account_data->account_name), - (GClosureNotify) g_free, - 0); + if(account_data->account_name) { + new_action = gtk_action_new (account_data->account_name, display_name, NULL, NULL); + gtk_action_group_add_action (action_group, new_action); + + /* Add ui from account data. We allow 2^9-1 account + changes in a single execution because we're + downcasting the guint to a guint8 in order to use a + GByteArray, it should be enough */ + gchar* item_name = g_strconcat (account_data->account_name, "Menu"); + guint8 merge_id = (guint8) gtk_ui_manager_new_merge_id (parent_priv->ui_manager); + priv->merge_ids = g_byte_array_append (priv->merge_ids, &merge_id, 1); + gtk_ui_manager_add_ui (parent_priv->ui_manager, + merge_id, + "/MenuBar/ViewMenu/ViewMenuAdditions", + item_name, + account_data->account_name, + GTK_UI_MANAGER_MENUITEM, + FALSE); + + /* Connect the action signal "activate" */ + g_signal_connect (G_OBJECT (new_action), + "activate", + G_CALLBACK (on_show_account_action_activated), + self); + + /* Create item and add it to the send&receive CSM */ + /* TODO: Why is this sometimes NULL? murrayc */ + if (priv->accounts_popup) { + item = gtk_menu_item_new_with_label (display_name); + gtk_menu_shell_append (GTK_MENU_SHELL (priv->accounts_popup), GTK_WIDGET (item)); + g_signal_connect_data (G_OBJECT (item), + "activate", + G_CALLBACK (on_send_receive_csm_activated), + g_strdup (account_data->account_name), + (GClosureNotify) g_free, + 0); + } + + g_free (item_name); } /* Frees */ g_free (display_name); - g_free (item_name); modest_account_mgr_free_account_data (mgr, account_data); } gtk_ui_manager_insert_action_group (parent_priv->ui_manager, action_group, 1); diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index d35242c..ccc4c83 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -1660,11 +1660,12 @@ modest_ui_actions_on_password_requested (TnyAccountStore *account_store, /* password: */ GtkWidget *entry_password = gtk_entry_new (); gtk_entry_set_visibility (GTK_ENTRY(entry_password), FALSE); - gtk_entry_set_invisible_char (GTK_ENTRY(entry_password), 0x2022); /* bullet unichar */ + /* gtk_entry_set_invisible_char (GTK_ENTRY(entry_password), "*"); */ #ifdef MODEST_PLATFORM_MAEMO /* Auto-capitalization is the default, so let's turn it off: */ - hildon_gtk_entry_set_input_mode (GTK_ENTRY (entry_password), HILDON_GTK_INPUT_MODE_FULL); + hildon_gtk_entry_set_input_mode (GTK_ENTRY (entry_password), + HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE); caption = hildon_caption_new (sizegroup, _("mail_fi_password"), entry_password, NULL, HILDON_CAPTION_MANDATORY);