From 31cd8a2a77f1c87e3c46bf318dca752f1cec513f Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Mon, 19 Jan 2009 10:44:23 +0000 Subject: [PATCH] Now captioned in hildon2 accept markup strings pmo-trunk-r7170 --- .../modest-connection-specific-smtp-edit-window.c | 8 ++++---- .../modest-default-account-settings-dialog.c | 17 +++++++++-------- src/hildon2/modest-easysetup-wizard-dialog.c | 17 +++++++++-------- src/hildon2/modest-maemo-security-options-view.c | 6 +++++- src/hildon2/modest-maemo-utils.c | 11 ++++++++++- src/hildon2/modest-maemo-utils.h | 2 ++ src/hildon2/modest-msg-edit-window.c | 13 +++++++------ 7 files changed, 46 insertions(+), 28 deletions(-) diff --git a/src/hildon2/modest-connection-specific-smtp-edit-window.c b/src/hildon2/modest-connection-specific-smtp-edit-window.c index d2c0f4e..d37bc6d 100644 --- a/src/hildon2/modest-connection-specific-smtp-edit-window.c +++ b/src/hildon2/modest-connection-specific-smtp-edit-window.c @@ -347,7 +347,7 @@ modest_connection_specific_smtp_edit_window_init (ModestConnectionSpecificSmtpEd GtkWidget *captioned = modest_maemo_utils_create_captioned (title_sizegroup, value_sizegroup, - _("mcen_li_emailsetup_smtp"), + _("mcen_li_emailsetup_smtp"), FALSE, priv->entry_outgoingserver); gtk_widget_show (priv->entry_outgoingserver); gtk_box_pack_start (GTK_BOX (vbox), captioned, FALSE, FALSE, MODEST_MARGIN_HALF); @@ -370,7 +370,7 @@ modest_connection_specific_smtp_edit_window_init (ModestConnectionSpecificSmtpEd /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_user_username), HILDON_GTK_INPUT_MODE_FULL); captioned = modest_maemo_utils_create_captioned (title_sizegroup, value_sizegroup, - _("mail_fi_username"), + _("mail_fi_username"), FALSE, priv->entry_user_username); g_signal_connect(G_OBJECT(priv->entry_user_username), "changed", G_CALLBACK(on_change), self); gtk_widget_show (priv->entry_user_username); @@ -394,7 +394,7 @@ modest_connection_specific_smtp_edit_window_init (ModestConnectionSpecificSmtpEd gtk_entry_set_visibility (GTK_ENTRY (priv->entry_user_password), FALSE); /* gtk_entry_set_invisible_char (GTK_ENTRY (priv->entry_user_password), '*'); */ captioned = modest_maemo_utils_create_captioned (title_sizegroup, value_sizegroup, - _("mail_fi_password"), priv->entry_user_password); + _("mail_fi_password"), FALSE, priv->entry_user_password); g_signal_connect(G_OBJECT(priv->entry_user_password), "changed", G_CALLBACK(on_change), self); gtk_widget_show (priv->entry_user_password); gtk_box_pack_start (GTK_BOX (vbox), captioned, FALSE, FALSE, MODEST_MARGIN_HALF); @@ -419,7 +419,7 @@ modest_connection_specific_smtp_edit_window_init (ModestConnectionSpecificSmtpEd if (!priv->entry_port) priv->entry_port = GTK_WIDGET (modest_number_editor_new (PORT_RANGE_MIN, PORT_RANGE_MAX)); captioned = modest_maemo_utils_create_captioned (title_sizegroup, value_sizegroup, - _("mcen_fi_emailsetup_port"), priv->entry_port); + _("mcen_fi_emailsetup_port"), FALSE, priv->entry_port); gtk_widget_add_events(GTK_WIDGET(priv->entry_port), GDK_FOCUS_CHANGE_MASK); gtk_widget_show (priv->entry_port); gtk_box_pack_start (GTK_BOX (vbox), captioned, FALSE, FALSE, MODEST_MARGIN_HALF); diff --git a/src/hildon2/modest-default-account-settings-dialog.c b/src/hildon2/modest-default-account-settings-dialog.c index 048da3d..8bcab9c 100644 --- a/src/hildon2/modest-default-account-settings-dialog.c +++ b/src/hildon2/modest-default-account-settings-dialog.c @@ -262,13 +262,14 @@ create_captioned (ModestDefaultAccountSettingsDialog *self, GtkSizeGroup *title_sizegroup, GtkSizeGroup *value_sizegroup, const gchar *label_text, + gboolean use_markup, GtkWidget *control) { GtkWidget *result; result = modest_maemo_utils_create_captioned (title_sizegroup, value_sizegroup, - label_text, control); + label_text, use_markup, control); /* Connect to the appropriate changed signal for the widget, * so we can ask for the prev/next buttons to be enabled/disabled appropriately: @@ -338,7 +339,7 @@ create_page_account_details (ModestDefaultAccountSettingsDialog *self) hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_account_title), HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_AUTOCAP); GtkWidget *caption = create_captioned (self, title_sizegroup, value_sizegroup, - _("mcen_fi_account_title"), + _("mcen_fi_account_title"), FALSE, priv->entry_account_title); gtk_widget_show (priv->entry_account_title); connect_for_modified (self, priv->entry_account_title); @@ -533,7 +534,7 @@ create_page_user_details (ModestDefaultAccountSettingsDialog *self) on_entry_max, self); GtkWidget *caption = create_captioned (self, title_sizegroup, value_sizegroup, - _("mcen_li_emailsetup_name"), priv->entry_user_name); + _("mcen_li_emailsetup_name"), FALSE, priv->entry_user_name); gtk_widget_show (priv->entry_user_name); connect_for_modified (self, priv->entry_user_name); gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF); @@ -556,7 +557,7 @@ create_page_user_details (ModestDefaultAccountSettingsDialog *self) /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_user_username), HILDON_GTK_INPUT_MODE_FULL); caption = create_captioned (self, title_sizegroup, value_sizegroup, - _("mail_fi_username"), + _("mail_fi_username"), FALSE, priv->entry_user_username); gtk_widget_show (priv->entry_user_username); connect_for_modified (self, priv->entry_user_username); @@ -585,7 +586,7 @@ create_page_user_details (ModestDefaultAccountSettingsDialog *self) gtk_entry_set_visibility (GTK_ENTRY (priv->entry_user_password), FALSE); /* gtk_entry_set_invisible_char (GTK_ENTRY (priv->entry_user_password), '*'); */ caption = create_captioned (self, title_sizegroup, value_sizegroup, - _("mail_fi_password"), priv->entry_user_password); + _("mail_fi_password"), FALSE, priv->entry_user_password); gtk_widget_show (priv->entry_user_password); connect_for_modified (self, priv->entry_user_password); gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF); @@ -596,7 +597,7 @@ create_page_user_details (ModestDefaultAccountSettingsDialog *self) /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_user_email), HILDON_GTK_INPUT_MODE_FULL); caption = create_captioned (self, title_sizegroup, value_sizegroup, - _("mcen_li_emailsetup_email_address"), priv->entry_user_email); + _("mcen_li_emailsetup_email_address"), FALSE, priv->entry_user_email); gtk_entry_set_text (GTK_ENTRY (priv->entry_user_email), MODEST_EXAMPLE_EMAIL_ADDRESS); /* Default text. */ gtk_widget_show (priv->entry_user_email); connect_for_modified (self, priv->entry_user_email); @@ -695,7 +696,7 @@ create_page_incoming (ModestDefaultAccountSettingsDialog *self) * so this default text will never be seen: */ /* (Note: Changing the title seems pointless. murrayc) */ priv->caption_incoming = create_captioned (self, title_sizegroup, value_sizegroup, - "Incoming Server", priv->entry_incomingserver); + "Incoming Server", FALSE, priv->entry_incomingserver); gtk_widget_show (priv->entry_incomingserver); connect_for_modified (self, priv->entry_incomingserver); gtk_box_pack_start (GTK_BOX (box), priv->caption_incoming, FALSE, FALSE, MODEST_MARGIN_HALF); @@ -790,7 +791,7 @@ create_page_outgoing (ModestDefaultAccountSettingsDialog *self) /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_outgoingserver), HILDON_GTK_INPUT_MODE_FULL); GtkWidget *caption = create_captioned (self, title_sizegroup, value_sizegroup, - _("mcen_li_emailsetup_smtp"), priv->entry_outgoingserver); + _("mcen_li_emailsetup_smtp"), FALSE, priv->entry_outgoingserver); gtk_widget_show (priv->entry_outgoingserver); connect_for_modified (self, priv->entry_outgoingserver); gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF); diff --git a/src/hildon2/modest-easysetup-wizard-dialog.c b/src/hildon2/modest-easysetup-wizard-dialog.c index 529de6b..f84c648 100644 --- a/src/hildon2/modest-easysetup-wizard-dialog.c +++ b/src/hildon2/modest-easysetup-wizard-dialog.c @@ -265,12 +265,13 @@ create_captioned (ModestEasysetupWizardDialog *self, GtkSizeGroup *title_size_group, GtkSizeGroup *value_size_group, const gchar *value, + gboolean use_markup, GtkWidget *control) { GtkWidget *result; result = modest_maemo_utils_create_captioned (title_size_group, value_size_group, - value, control); + value, use_markup, control); /* Connect to the appropriate changed signal for the widget, * so we can ask for the prev/next buttons to be enabled/disabled appropriately: @@ -432,7 +433,7 @@ create_page_account_details (ModestEasysetupWizardDialog *self) g_free (default_account_name); default_account_name = NULL; - caption = create_captioned (self, title_sizegroup, value_sizegroup, _("mcen_fi_account_title"), + caption = create_captioned (self, title_sizegroup, value_sizegroup, _("mcen_fi_account_title"), FALSE, priv->entry_account_title); gtk_widget_show (priv->entry_account_title); gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF); @@ -501,7 +502,7 @@ create_page_user_details (ModestEasysetupWizardDialog *self) modest_validating_entry_set_max_func (MODEST_VALIDATING_ENTRY (priv->entry_user_name), on_entry_max, self); GtkWidget *caption = create_captioned (self, title_sizegroup, value_sizegroup, - _("mcen_li_emailsetup_name"), priv->entry_user_name); + _("mcen_li_emailsetup_name"), FALSE, priv->entry_user_name); g_signal_connect(G_OBJECT(priv->entry_user_name), "changed", G_CALLBACK(on_easysetup_changed), self); gtk_widget_show (priv->entry_user_name); @@ -524,7 +525,7 @@ create_page_user_details (ModestEasysetupWizardDialog *self) /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_user_username), HILDON_GTK_INPUT_MODE_FULL); - caption = create_captioned (self, title_sizegroup, value_sizegroup, _("mail_fi_username"), + caption = create_captioned (self, title_sizegroup, value_sizegroup, _("mail_fi_username"), FALSE, priv->entry_user_username); gtk_widget_show (priv->entry_user_username); gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF); @@ -553,7 +554,7 @@ create_page_user_details (ModestEasysetupWizardDialog *self) gtk_entry_set_visibility (GTK_ENTRY (priv->entry_user_password), FALSE); /* gtk_entry_set_invisible_char (GTK_ENTRY (priv->entry_user_password), '*'); */ caption = create_captioned (self, title_sizegroup, value_sizegroup, - _("mail_fi_password"), priv->entry_user_password); + _("mail_fi_password"), FALSE, priv->entry_user_password); g_signal_connect(G_OBJECT(priv->entry_user_password), "changed", G_CALLBACK(on_easysetup_changed), self); gtk_widget_show (priv->entry_user_password); @@ -565,7 +566,7 @@ create_page_user_details (ModestEasysetupWizardDialog *self) /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_user_email), HILDON_GTK_INPUT_MODE_FULL); caption = create_captioned (self, title_sizegroup, value_sizegroup, - _("mcen_li_emailsetup_email_address"), priv->entry_user_email); + _("mcen_li_emailsetup_email_address"), FALSE, priv->entry_user_email); update_user_email_from_provider (self); gtk_widget_show (priv->entry_user_email); gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF); @@ -765,7 +766,7 @@ create_page_custom_incoming (ModestEasysetupWizardDialog *self) * so this default text will never be seen: */ priv->caption_incoming = create_captioned (self, title_sizegroup, value_sizegroup, "This will be removed", - priv->entry_incomingserver); + FALSE, priv->entry_incomingserver); update_incoming_server_title (self); gtk_widget_show (priv->entry_incomingserver); gtk_box_pack_start (GTK_BOX (box), priv->caption_incoming, FALSE, FALSE, MODEST_MARGIN_HALF); @@ -877,7 +878,7 @@ create_page_custom_outgoing (ModestEasysetupWizardDialog *self) /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_outgoingserver), HILDON_GTK_INPUT_MODE_FULL); GtkWidget *caption = create_captioned (self, title_sizegroup, value_sizegroup, - _("mcen_li_emailsetup_smtp"), priv->entry_outgoingserver); + _("mcen_li_emailsetup_smtp"), FALSE, priv->entry_outgoingserver); gtk_widget_show (priv->entry_outgoingserver); gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF); gtk_widget_show (caption); diff --git a/src/hildon2/modest-maemo-security-options-view.c b/src/hildon2/modest-maemo-security-options-view.c index 7ef6dfb..62867f6 100644 --- a/src/hildon2/modest-maemo-security-options-view.c +++ b/src/hildon2/modest-maemo-security-options-view.c @@ -151,6 +151,7 @@ create_incoming_security (ModestSecurityOptionsView* self, entry_caption = modest_maemo_utils_create_captioned (title_size_group, value_size_group, _("mcen_fi_emailsetup_port"), + FALSE, ppriv->port_view); } @@ -268,7 +269,8 @@ create_outgoing_security (ModestSecurityOptionsView* self, user_label = g_strdup_printf("%s*", _("mail_fi_username")); user_caption = modest_maemo_utils_create_captioned (title_size_group, value_size_group, - user_label, + user_label, + FALSE, ppriv->user_entry); g_free (user_label); @@ -292,12 +294,14 @@ create_outgoing_security (ModestSecurityOptionsView* self, pwd_caption = modest_maemo_utils_create_captioned (title_size_group, value_size_group, _("mail_fi_password"), + FALSE, ppriv->pwd_entry); ppriv->port_view = GTK_WIDGET (modest_number_editor_new (PORT_MIN, PORT_MAX)); port_caption = modest_maemo_utils_create_captioned (title_size_group, value_size_group, _("mcen_fi_emailsetup_port"), + FALSE, ppriv->port_view); } diff --git a/src/hildon2/modest-maemo-utils.c b/src/hildon2/modest-maemo-utils.c index 0b5feee..00a3dbe 100644 --- a/src/hildon2/modest-maemo-utils.c +++ b/src/hildon2/modest-maemo-utils.c @@ -306,11 +306,13 @@ GtkWidget * modest_maemo_utils_create_captioned (GtkSizeGroup *title_size_group, GtkSizeGroup *value_size_group, const gchar *title, + gboolean use_markup, GtkWidget *control) { return modest_maemo_utils_create_captioned_with_size_type (title_size_group, value_size_group, title, + use_markup, control, HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH); } @@ -333,13 +335,20 @@ GtkWidget * modest_maemo_utils_create_captioned_with_size_type (GtkSizeGroup *title_size_group, GtkSizeGroup *value_size_group, const gchar *title, + gboolean use_markup, GtkWidget *control, HildonSizeType size_type) { GtkWidget *label; GtkWidget *box; - label = gtk_label_new (title); + if (use_markup) { + label = gtk_label_new (NULL); + gtk_label_set_markup (GTK_LABEL (label), title); + } else { + label = gtk_label_new (title); + } + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); hildon_gtk_widget_set_theme_size (label, HILDON_SIZE_FINGER_HEIGHT); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); diff --git a/src/hildon2/modest-maemo-utils.h b/src/hildon2/modest-maemo-utils.h index 48a2139..c5777a1 100644 --- a/src/hildon2/modest-maemo-utils.h +++ b/src/hildon2/modest-maemo-utils.h @@ -127,11 +127,13 @@ GtkWidget *modest_maemo_utils_get_manager_menubar_as_menu (GtkUIManager *manager GtkWidget *modest_maemo_utils_create_captioned (GtkSizeGroup *title_size_group, GtkSizeGroup *value_size_group, const gchar *title, + gboolean use_markup, GtkWidget *control); GtkWidget *modest_maemo_utils_create_captioned_with_size_type (GtkSizeGroup *title_size_group, GtkSizeGroup *value_size_group, const gchar *title, + gboolean use_markup, GtkWidget *control, HildonSizeType size_type); diff --git a/src/hildon2/modest-msg-edit-window.c b/src/hildon2/modest-msg-edit-window.c index d92363a..f1cddac 100644 --- a/src/hildon2/modest-msg-edit-window.c +++ b/src/hildon2/modest-msg-edit-window.c @@ -794,20 +794,21 @@ init_window (ModestMsgEditWindow *obj) to_caption = modest_maemo_utils_create_captioned_with_size_type (title_size_group, value_size_group, - _("mail_va_to"), priv->to_field, + _("mail_va_to"), FALSE, priv->to_field, HILDON_SIZE_AUTO_HEIGHT | HILDON_SIZE_AUTO_WIDTH); priv->cc_caption = modest_maemo_utils_create_captioned_with_size_type (title_size_group, value_size_group, - _("mail_va_cc"), priv->cc_field, + _("mail_va_cc"), FALSE, priv->cc_field, HILDON_SIZE_AUTO_HEIGHT | HILDON_SIZE_AUTO_WIDTH); priv->bcc_caption = modest_maemo_utils_create_captioned_with_size_type (title_size_group, value_size_group, - _("mail_va_hotfix1"), priv->bcc_field, + _("mail_va_hotfix1"), FALSE, priv->bcc_field, HILDON_SIZE_AUTO_HEIGHT | HILDON_SIZE_AUTO_WIDTH); subject_caption = modest_maemo_utils_create_captioned (title_size_group, value_size_group, - _("mail_va_subject"), subject_box); + _("mail_va_subject"), FALSE, subject_box); priv->attachments_caption = modest_maemo_utils_create_captioned_with_size_type (title_size_group, value_size_group, _("mail_va_attachment"), + FALSE, priv->attachments_view, HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_AUTO_HEIGHT); @@ -3752,7 +3753,7 @@ modest_msg_edit_window_show_msg_settings_dialog (ModestMsgEditWindow *window) gtk_box_pack_start (GTK_BOX (priority_hbox), high_toggle, TRUE, TRUE, 0); gtk_widget_show_all (priority_hbox); captioned = modest_maemo_utils_create_captioned (title_sizegroup, value_sizegroup, - _("mcen_me_editor_message_priority"), priority_hbox); + _("mcen_me_editor_message_priority"), FALSE, priority_hbox); gtk_widget_show (captioned); gtk_box_pack_start (GTK_BOX (vbox), captioned, FALSE, FALSE, 0); @@ -3772,7 +3773,7 @@ modest_msg_edit_window_show_msg_settings_dialog (ModestMsgEditWindow *window) gtk_box_pack_start (GTK_BOX (format_hbox), text_toggle, TRUE, TRUE, 0); gtk_widget_show_all (format_hbox); captioned = modest_maemo_utils_create_captioned (title_sizegroup, value_sizegroup, - _("mcen_me_editor_format"), format_hbox); + _("mcen_me_editor_format"), FALSE, format_hbox); gtk_widget_show (captioned); gtk_box_pack_start (GTK_BOX (vbox), captioned, FALSE, FALSE, 0); -- 1.7.9.5