horizontal arrangement, as we have both types.
* Reworked the alignments of captioneds and pickers to fit specs
easier.
* Renamed modest_maemo_utils_create_picker_layout to
modest_maemo_utils_set_hbutton_layout, and added
the vbutton counterpart. These are used for properly setting
the layout we need in HildonButton with horizontal or vertical
arrangement.
* Lots of missing sizegroup unrefs.
* Now signature edition button is a dialog action.
* Better default size for signature dialog.
* Set the default signature to the one in specs.
* Replaced signature editor scrolled window with pannable.
* Now check buttons are aligned to the left.
pmo-trunk-r6196
/* Create a size group to be used by all captions.
* Note that HildonCaption does not create a default size group if we do not specify one.
* We use GTK_SIZE_GROUP_HORIZONTAL, so that the widths are the same. */
- GtkSizeGroup *sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ GtkSizeGroup *title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ GtkSizeGroup *value_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
/* The outgoing server widgets: */
if (!priv->entry_outgoingserver)
g_signal_connect(G_OBJECT(priv->entry_outgoingserver), "changed", G_CALLBACK(on_change), self);
GtkWidget *captioned =
- modest_maemo_utils_create_captioned (sizegroup,
+ modest_maemo_utils_create_captioned (title_sizegroup, value_sizegroup,
_("mcen_li_emailsetup_smtp"),
priv->entry_outgoingserver);
gtk_widget_show (priv->entry_outgoingserver);
if (!priv->outgoing_auth_picker) {
priv->outgoing_auth_picker =
GTK_WIDGET (modest_secureauth_picker_new (MODEST_EDITABLE_SIZE,
- MODEST_EDITABLE_ARRANGEMENT));
+ HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
}
- modest_maemo_utils_create_picker_layout (sizegroup,
- _("mcen_li_emailsetup_secure_authentication"),
- priv->outgoing_auth_picker);
+ modest_maemo_utils_set_hbutton_layout (title_sizegroup, value_sizegroup,
+ _("mcen_li_emailsetup_secure_authentication"),
+ priv->outgoing_auth_picker);
g_signal_connect (G_OBJECT (priv->outgoing_auth_picker), "value-changed", G_CALLBACK(on_change), self);
gtk_widget_show (priv->outgoing_auth_picker);
gtk_box_pack_start (GTK_BOX (vbox), priv->outgoing_auth_picker, FALSE, FALSE, MODEST_MARGIN_HALF);
priv->entry_user_username = GTK_WIDGET (modest_validating_entry_new ());
/* 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 (sizegroup, _("mail_fi_username"),
+ captioned = modest_maemo_utils_create_captioned (title_sizegroup, value_sizegroup,
+ _("mail_fi_username"),
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);
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), '*'); */
- captioned = modest_maemo_utils_create_captioned (sizegroup,
+ captioned = modest_maemo_utils_create_captioned (title_sizegroup, value_sizegroup,
_("mail_fi_password"), 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);
if (!priv->outgoing_security_picker)
priv->outgoing_security_picker =
GTK_WIDGET (modest_serversecurity_picker_new (MODEST_EDITABLE_SIZE,
- MODEST_EDITABLE_ARRANGEMENT));
+ HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
modest_serversecurity_picker_fill (
MODEST_SERVERSECURITY_PICKER (priv->outgoing_security_picker), MODEST_PROTOCOLS_TRANSPORT_SMTP);
modest_serversecurity_picker_set_active_serversecurity (
MODEST_SERVERSECURITY_PICKER (priv->outgoing_security_picker), MODEST_PROTOCOLS_CONNECTION_NONE);
- modest_maemo_utils_create_picker_layout (sizegroup, _("mcen_li_emailsetup_secure_connection"), priv->outgoing_security_picker);
+ modest_maemo_utils_set_hbutton_layout (title_sizegroup, value_sizegroup,
+ _("mcen_li_emailsetup_secure_connection"),
+ priv->outgoing_security_picker);
gtk_widget_show (priv->outgoing_security_picker);
gtk_box_pack_start (GTK_BOX (vbox), priv->outgoing_security_picker, FALSE, FALSE, MODEST_MARGIN_HALF);
/* The port number widgets: */
if (!priv->entry_port)
priv->entry_port = GTK_WIDGET (hildon_number_editor_new (PORT_RANGE_MIN, PORT_RANGE_MAX));
- captioned = modest_maemo_utils_create_captioned (sizegroup,
- _("mcen_fi_emailsetup_port"), priv->entry_port);
+ captioned = modest_maemo_utils_create_captioned (title_sizegroup, value_sizegroup,
+ _("mcen_fi_emailsetup_port"), priv->entry_port);
gtk_widget_add_events(GTK_WIDGET(priv->entry_port), GDK_FOCUS_CHANGE_MASK);
g_signal_connect(G_OBJECT(priv->entry_port), "range-error", G_CALLBACK(on_range_error), self);
g_signal_connect(G_OBJECT(priv->entry_port), "notify::value", G_CALLBACK(on_value_changed), self);
gtk_widget_show_all (dialog_box);
gtk_window_set_default_size (GTK_WINDOW (self), -1, 220);
-
+
+ g_object_unref (title_sizegroup);
+ g_object_unref (value_sizegroup);
/* When this window is shown, hibernation should not be possible,
* because there is no sensible way to save the state: */
static GtkWidget*
create_captioned (ModestDefaultAccountSettingsDialog *self,
- GtkSizeGroup *group,
+ GtkSizeGroup *title_sizegroup,
+ GtkSizeGroup *value_sizegroup,
const gchar *label_text,
GtkWidget *control)
{
GtkWidget *result;
- result = modest_maemo_utils_create_captioned (group, label_text, control);
+ result = modest_maemo_utils_create_captioned (title_sizegroup, value_sizegroup,
+ label_text, control);
/* Connect to the appropriate changed signal for the widget,
* so we can ask for the prev/next buttons to be enabled/disabled appropriately:
{
ModestDefaultAccountSettingsDialogPrivate *priv;
GtkWidget *box;
- GtkSizeGroup* sizegroup;
+ GtkSizeGroup* title_sizegroup;
+ GtkSizeGroup* value_sizegroup;
+ GtkWidget *hbox;
priv = MODEST_DEFAULT_ACCOUNT_SETTINGS_DIALOG_GET_PRIVATE (self);
box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE);
- sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ value_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
/* The description widgets: */
priv->entry_account_title = GTK_WIDGET (modest_validating_entry_new ());
/* Do use auto-capitalization: */
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, sizegroup, _("mcen_fi_account_title"),
+ GtkWidget *caption = create_captioned (self, title_sizegroup, value_sizegroup,
+ _("mcen_fi_account_title"),
priv->entry_account_title);
gtk_widget_show (priv->entry_account_title);
connect_for_modified (self, priv->entry_account_title);
gtk_entry_set_max_length (GTK_ENTRY (priv->entry_account_title), 64);
modest_validating_entry_set_max_func (MODEST_VALIDATING_ENTRY (priv->entry_account_title),
on_entry_max, self);
-
+
+ hbox = gtk_hbox_new (TRUE, 0);
/* The retrieve picker: */
priv->retrieve_picker = GTK_WIDGET (modest_retrieve_picker_new (MODEST_EDITABLE_SIZE,
- MODEST_EDITABLE_ARRANGEMENT));
- modest_maemo_utils_create_picker_layout (sizegroup, _("mcen_fi_advsetup_retrievetype"), priv->retrieve_picker);
+ HILDON_BUTTON_ARRANGEMENT_VERTICAL));
+ modest_maemo_utils_set_vbutton_layout (title_sizegroup,
+ _("mcen_fi_advsetup_retrievetype"), priv->retrieve_picker);
gtk_widget_show (priv->retrieve_picker);
connect_for_modified (self, priv->retrieve_picker);
- gtk_box_pack_start (GTK_BOX (box), priv->retrieve_picker, FALSE, FALSE, MODEST_MARGIN_HALF);
+ gtk_box_pack_start (GTK_BOX (hbox), priv->retrieve_picker, TRUE, TRUE, MODEST_MARGIN_HALF);
/* The limit-retrieve picker: */
priv->limit_retrieve_picker = GTK_WIDGET (modest_limit_retrieve_picker_new (MODEST_EDITABLE_SIZE,
- MODEST_EDITABLE_ARRANGEMENT));
- modest_maemo_utils_create_picker_layout (sizegroup, _("mcen_fi_advsetup_limit_retrieve"), priv->limit_retrieve_picker);
+ HILDON_BUTTON_ARRANGEMENT_VERTICAL));
+ modest_maemo_utils_set_vbutton_layout (value_sizegroup,
+ _("mcen_fi_advsetup_limit_retrieve"),
+ priv->limit_retrieve_picker);
gtk_widget_show (priv->limit_retrieve_picker);
connect_for_modified (self, priv->limit_retrieve_picker);
- gtk_box_pack_start (GTK_BOX (box), priv->limit_retrieve_picker, FALSE, FALSE, MODEST_MARGIN_HALF);
+ gtk_box_pack_start (GTK_BOX (hbox), priv->limit_retrieve_picker, TRUE, TRUE, MODEST_MARGIN_HALF);
+ gtk_box_pack_start (GTK_BOX (box), hbox, FALSE, FALSE, MODEST_MARGIN_HALF);
+ gtk_widget_show (hbox);
/* The leave-messages widgets: */
if(!priv->checkbox_leave_messages) {
hildon_check_button_new (HILDON_SIZE_FINGER_HEIGHT);
gtk_button_set_label (GTK_BUTTON (priv->checkbox_leave_messages),
_("mcen_fi_advsetup_leave_on_server"));
- gtk_size_group_add_widget (sizegroup, priv->checkbox_leave_messages);
+ gtk_button_set_alignment (GTK_BUTTON (priv->checkbox_leave_messages), 0.0, 0.5);
}
connect_for_modified (self, priv->checkbox_leave_messages);
gtk_box_pack_start (GTK_BOX (box), priv->checkbox_leave_messages, FALSE, FALSE, MODEST_MARGIN_HALF);
gtk_widget_show (priv->checkbox_leave_messages);
- g_object_unref (sizegroup);
+ g_object_unref (title_sizegroup);
+ g_object_unref (value_sizegroup);
gtk_widget_show (GTK_WIDGET (box));
{
ModestDefaultAccountSettingsDialogPrivate *priv;
GtkWidget *box;
- GtkSizeGroup* sizegroup;
+ GtkSizeGroup* title_sizegroup;
+ GtkSizeGroup* value_sizegroup;
priv = MODEST_DEFAULT_ACCOUNT_SETTINGS_DIALOG_GET_PRIVATE (self);
box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE);
- sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ value_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
/* The name widgets: */
priv->entry_user_name = GTK_WIDGET (modest_validating_entry_new ());
modest_validating_entry_set_max_func (MODEST_VALIDATING_ENTRY (priv->entry_user_name),
on_entry_max, self);
GtkWidget *caption =
- create_captioned (self, sizegroup,
+ create_captioned (self, title_sizegroup, value_sizegroup,
_("mcen_li_emailsetup_name"), priv->entry_user_name);
gtk_widget_show (priv->entry_user_name);
connect_for_modified (self, priv->entry_user_name);
priv->entry_user_username = GTK_WIDGET (modest_validating_entry_new ());
/* 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, sizegroup, _("mail_fi_username"),
+ caption = create_captioned (self, title_sizegroup, value_sizegroup,
+ _("mail_fi_username"),
priv->entry_user_username);
gtk_widget_show (priv->entry_user_username);
connect_for_modified (self, priv->entry_user_username);
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 = create_captioned (self, sizegroup,
+ caption = create_captioned (self, title_sizegroup, value_sizegroup,
_("mail_fi_password"), priv->entry_user_password);
gtk_widget_show (priv->entry_user_password);
connect_for_modified (self, priv->entry_user_password);
priv->entry_user_email = GTK_WIDGET (modest_validating_entry_new ());
/* 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, sizegroup,
+ caption = create_captioned (self, title_sizegroup, value_sizegroup,
_("mcen_li_emailsetup_email_address"), 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);
/* Signature button: */
if (!priv->button_signature)
- priv->button_signature = gtk_button_new_with_label (_("mcen_bd_edit"));
- caption = create_captioned (self, sizegroup, _("mcen_fi_email_signature"), priv->button_signature);
+ priv->button_signature = gtk_button_new_with_label (_("mcen_fi_email_signature"));
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (self)->action_area), priv->button_signature,
+ FALSE, FALSE, 0);
gtk_widget_show (priv->button_signature);
- gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
- gtk_widget_show (caption);
- g_object_unref (sizegroup);
+ g_object_unref (title_sizegroup);
+ g_object_unref (value_sizegroup);
g_signal_connect (G_OBJECT (priv->button_signature), "clicked",
G_CALLBACK (on_button_signature), self);
{
ModestDefaultAccountSettingsDialogPrivate *priv;
GtkWidget *box;
- GtkSizeGroup *sizegroup;
+ GtkSizeGroup *title_sizegroup;
+ GtkSizeGroup *value_sizegroup;
priv = MODEST_DEFAULT_ACCOUNT_SETTINGS_DIALOG_GET_PRIVATE (self);
/* Create a size group to be used by all captions.
* Note that HildonCaption does not create a default size group if we do not specify one.
* We use GTK_SIZE_GROUP_HORIZONTAL, so that the widths are the same. */
- sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ value_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
/* The incoming server widgets: */
if(!priv->entry_incomingserver)
/* The caption title will be updated in update_incoming_server_title().
* so this default text will never be seen: */
/* (Note: Changing the title seems pointless. murrayc) */
- priv->caption_incoming = create_captioned (self, sizegroup,
+ priv->caption_incoming = create_captioned (self, title_sizegroup, value_sizegroup,
"Incoming Server", priv->entry_incomingserver);
gtk_widget_show (priv->entry_incomingserver);
connect_for_modified (self, priv->entry_incomingserver);
/* Incoming security widgets */
priv->incoming_security =
modest_maemo_security_options_view_new (MODEST_SECURITY_OPTIONS_INCOMING,
- TRUE, sizegroup);
+ TRUE, title_sizegroup, value_sizegroup);
gtk_box_pack_start (GTK_BOX (box), priv->incoming_security,
FALSE, FALSE, MODEST_MARGIN_HALF);
gtk_widget_show (priv->incoming_security);
- g_object_unref (sizegroup);
+ g_object_unref (title_sizegroup);
+ g_object_unref (value_sizegroup);
gtk_widget_show (GTK_WIDGET (box));
return GTK_WIDGET (box);
/* Create a size group to be used by all captions.
* Note that HildonCaption does not create a default size group if we do not specify one.
* We use GTK_SIZE_GROUP_HORIZONTAL, so that the widths are the same. */
- GtkSizeGroup *sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ GtkSizeGroup *title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ GtkSizeGroup *value_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
/* The outgoing server widgets: */
if (!priv->entry_outgoingserver)
hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
/* 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, sizegroup,
+ GtkWidget *caption = create_captioned (self, title_sizegroup, value_sizegroup,
_("mcen_li_emailsetup_smtp"), priv->entry_outgoingserver);
gtk_widget_show (priv->entry_outgoingserver);
connect_for_modified (self, priv->entry_outgoingserver);
/* Outgoing security widgets */
priv->outgoing_security =
modest_maemo_security_options_view_new (MODEST_SECURITY_OPTIONS_OUTGOING,
- TRUE, sizegroup);
+ TRUE, title_sizegroup, value_sizegroup);
gtk_box_pack_start (GTK_BOX (box), priv->outgoing_security,
FALSE, FALSE, MODEST_MARGIN_HALF);
gtk_widget_show (priv->outgoing_security);
priv->checkbox_outgoing_smtp_specific = hildon_check_button_new (MODEST_EDITABLE_SIZE);
hildon_check_button_set_active (HILDON_CHECK_BUTTON (priv->checkbox_outgoing_smtp_specific),
FALSE);
+ gtk_button_set_label (GTK_BUTTON (priv->checkbox_outgoing_smtp_specific),
+ _("mcen_fi_advsetup_connection_smtp"));
+ gtk_button_set_alignment (GTK_BUTTON (priv->checkbox_outgoing_smtp_specific), 0.0, 0.5);
}
- caption = create_captioned (self, sizegroup, _("mcen_fi_advsetup_connection_smtp"),
- priv->checkbox_outgoing_smtp_specific);
gtk_widget_show (priv->checkbox_outgoing_smtp_specific);
- gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
- gtk_widget_show (caption);
+ gtk_box_pack_start (GTK_BOX (box), priv->checkbox_outgoing_smtp_specific,
+ FALSE, FALSE, MODEST_MARGIN_HALF);
connect_for_modified (self, priv->checkbox_outgoing_smtp_specific);
/* Connection-specific SMTP-Severs Edit button: */
if (!priv->button_outgoing_smtp_servers)
- priv->button_outgoing_smtp_servers = gtk_button_new_with_label (_("mcen_bd_edit"));
- caption = create_captioned (self, sizegroup, _("mcen_fi_advsetup_optional_smtp"),
- priv->button_outgoing_smtp_servers);
+ priv->button_outgoing_smtp_servers = gtk_button_new_with_label (_("mcen_fi_advsetup_optional_smtp"));
+ hildon_gtk_widget_set_theme_size (priv->button_outgoing_smtp_servers,
+ HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
gtk_widget_show (priv->button_outgoing_smtp_servers);
- gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
- gtk_widget_show (caption);
+ gtk_box_pack_start (GTK_BOX (box), priv->button_outgoing_smtp_servers, FALSE, FALSE, MODEST_MARGIN_HALF);
/* Only enable the button when the checkbox is checked: */
enable_widget_for_checkbutton (priv->button_outgoing_smtp_servers,
GTK_BUTTON (priv->checkbox_outgoing_smtp_specific));
- g_object_unref (sizegroup);
+ g_object_unref (title_sizegroup);
+ g_object_unref (value_sizegroup);
g_signal_connect (G_OBJECT (priv->button_outgoing_smtp_servers), "clicked",
G_CALLBACK (on_button_outgoing_smtp_servers), self);
{
ModestDefaultAccountSettingsDialogPrivate *priv;
GtkWidget *pannable;
+ GtkWidget *separator;
priv = MODEST_DEFAULT_ACCOUNT_SETTINGS_DIALOG_GET_PRIVATE(self);
/* Add the notebook pages: */
gtk_box_pack_start (GTK_BOX (priv->main_container),
- modest_maemo_utils_create_group_box (_("mcen_ti_account_settings_account"),
- priv->page_account_details),
+ priv->page_account_details,
FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (priv->main_container),
- modest_maemo_utils_create_group_box (_("mcen_ti_account_settings_userinfo"),
- priv->page_user_details),
+ priv->page_user_details,
FALSE, FALSE, 0);
+ separator = gtk_hseparator_new ();
+ gtk_box_pack_start (GTK_BOX (priv->main_container), separator,
+ FALSE, FALSE, 0);
+ gtk_widget_show (separator);
gtk_box_pack_start (GTK_BOX (priv->main_container),
- modest_maemo_utils_create_group_box (_("mcen_ti_advsetup_retrieval"),
- priv->page_incoming),
+ priv->page_incoming,
+ FALSE, FALSE, 0);
+ separator = gtk_hseparator_new ();
+ gtk_box_pack_start (GTK_BOX (priv->main_container), separator,
FALSE, FALSE, 0);
+ gtk_widget_show (separator);
gtk_box_pack_start (GTK_BOX (priv->main_container),
- modest_maemo_utils_create_group_box (_("mcen_ti_advsetup_sending"),
- priv->page_outgoing),
+ priv->page_outgoing,
FALSE, FALSE, 0);
GtkDialog *dialog = GTK_DIALOG (self);
gtk_widget_show (GTK_WIDGET (pannable));
/* Add the buttons: */
- gtk_dialog_add_button (GTK_DIALOG(self), _("mcen_bd_dialog_ok"), GTK_RESPONSE_OK);
+ gtk_dialog_add_button (GTK_DIALOG(self), _HL("wdgt_bd_save"), GTK_RESPONSE_OK);
gtk_window_set_default_size (GTK_WINDOW (self), -1, 340);
*/
static GtkWidget*
create_captioned (ModestEasysetupWizardDialog *self,
- GtkSizeGroup *group,
+ GtkSizeGroup *title_size_group,
+ GtkSizeGroup *value_size_group,
const gchar *value,
GtkWidget *control)
{
GtkWidget *result;
- result = modest_maemo_utils_create_captioned (group, value, control);
+ result = modest_maemo_utils_create_captioned (title_size_group, value_size_group,
+ value, control);
/* Connect to the appropriate changed signal for the widget,
* so we can ask for the prev/next buttons to be enabled/disabled appropriately:
/* Create a size group to be used by all captions.
* Note that HildonCaption does not create a default size group if we do not specify one.
* We use GTK_SIZE_GROUP_HORIZONTAL, so that the widths are the same. */
- GtkSizeGroup* sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ GtkSizeGroup* title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ GtkSizeGroup* value_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
/* The country widgets: */
priv->account_country_picker = GTK_WIDGET (modest_country_picker_new (MODEST_EDITABLE_SIZE,
- MODEST_EDITABLE_ARRANGEMENT));
- hildon_button_set_title (HILDON_BUTTON (priv->account_country_picker), _("mcen_fi_country"));
+ HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
+ modest_maemo_utils_set_hbutton_layout (title_sizegroup, value_sizegroup,
+ _("mcen_fi_country"), priv->account_country_picker);
g_signal_connect (G_OBJECT (priv->account_country_picker), "value-changed",
G_CALLBACK (on_picker_button_value_changed), self);
gtk_box_pack_start (GTK_BOX (box), priv->account_country_picker, FALSE, FALSE, MODEST_MARGIN_HALF);
/* The service provider widgets: */
priv->account_serviceprovider_picker = GTK_WIDGET (modest_provider_picker_new (MODEST_EDITABLE_SIZE,
- MODEST_EDITABLE_ARRANGEMENT));
- hildon_button_set_title (HILDON_BUTTON (priv->account_serviceprovider_picker), _("mcen_fi_serviceprovider"));
+ HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
+ modest_maemo_utils_set_hbutton_layout (title_sizegroup, value_sizegroup,
+ _("mcen_fi_serviceprovider"),
+ priv->account_serviceprovider_picker);
g_signal_connect (G_OBJECT (priv->account_serviceprovider_picker), "value-changed",
G_CALLBACK (on_picker_button_value_changed), self);
gtk_box_pack_start (GTK_BOX (box), priv->account_serviceprovider_picker, FALSE, FALSE, MODEST_MARGIN_HALF);
g_free (default_account_name);
default_account_name = NULL;
- caption = create_captioned (self, sizegroup, _("mcen_fi_account_title"),
+ caption = create_captioned (self, title_sizegroup, value_sizegroup, _("mcen_fi_account_title"),
priv->entry_account_title);
gtk_widget_show (priv->entry_account_title);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
on_entry_max, self);
gtk_widget_show (GTK_WIDGET (box));
+
+ g_object_unref (title_sizegroup);
+ g_object_unref (value_sizegroup);
return GTK_WIDGET (box);
}
static GtkWidget*
create_page_user_details (ModestEasysetupWizardDialog *self)
{
- GtkSizeGroup* sizegroup;
+ GtkSizeGroup* title_sizegroup;
+ GtkSizeGroup* value_sizegroup;
GtkWidget *box;
ModestEasysetupWizardDialogPrivate *priv;
* Note that HildonCaption does not create a default size group if we do not specify one.
* We use GTK_SIZE_GROUP_HORIZONTAL, so that the widths are the same. */
box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE);
- sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ value_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
/* The name widgets: (use auto cap) */
priv->entry_user_name = GTK_WIDGET (modest_validating_entry_new ());
gtk_entry_set_max_length (GTK_ENTRY (priv->entry_user_name), 64);
modest_validating_entry_set_max_func (MODEST_VALIDATING_ENTRY (priv->entry_user_name),
on_entry_max, self);
- GtkWidget *caption = create_captioned (self, sizegroup,
+ GtkWidget *caption = create_captioned (self, title_sizegroup, value_sizegroup,
_("mcen_li_emailsetup_name"), priv->entry_user_name);
g_signal_connect(G_OBJECT(priv->entry_user_name), "changed",
G_CALLBACK(on_easysetup_changed), 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, sizegroup, _("mail_fi_username"),
+ caption = create_captioned (self, title_sizegroup, value_sizegroup, _("mail_fi_username"),
priv->entry_user_username);
gtk_widget_show (priv->entry_user_username);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
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 = create_captioned (self, sizegroup,
+ caption = create_captioned (self, title_sizegroup, value_sizegroup,
_("mail_fi_password"), priv->entry_user_password);
g_signal_connect(G_OBJECT(priv->entry_user_password), "changed",
G_CALLBACK(on_easysetup_changed), self);
priv->entry_user_email = GTK_WIDGET (modest_validating_entry_new ());
/* 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, sizegroup,
+ caption = create_captioned (self, title_sizegroup, value_sizegroup,
_("mcen_li_emailsetup_email_address"), priv->entry_user_email);
update_user_email_from_provider (self);
gtk_widget_show (priv->entry_user_email);
gtk_widget_show (GTK_WIDGET (box));
+ g_object_unref (title_sizegroup);
+ g_object_unref (value_sizegroup);
return GTK_WIDGET (box);
}
GtkWidget *box;
GtkWidget *scrolled_window;
GtkWidget *label;
- GtkSizeGroup *sizegroup;
+ GtkSizeGroup *title_sizegroup;
+ GtkSizeGroup *value_sizegroup;
priv = MODEST_EASYSETUP_WIZARD_DIALOG_GET_PRIVATE(self);
protocol_registry = modest_runtime_get_protocol_registry ();
/* Create a size group to be used by all captions.
* Note that HildonCaption does not create a default size group if we do not specify one.
* We use GTK_SIZE_GROUP_HORIZONTAL, so that the widths are the same. */
- sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ value_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
/* The incoming server widgets: */
priv->incoming_servertype_picker = GTK_WIDGET (modest_servertype_picker_new (MODEST_EDITABLE_SIZE,
- MODEST_EDITABLE_ARRANGEMENT,
+ HILDON_BUTTON_ARRANGEMENT_HORIZONTAL,
TRUE));
hildon_button_set_title (HILDON_BUTTON (priv->incoming_servertype_picker), _("mcen_li_emailsetup_type"));
g_signal_connect (G_OBJECT (priv->incoming_servertype_picker), "value-changed",
/* The caption title will be updated in update_incoming_server_title().
* so this default text will never be seen: */
/* (Note: Changing the title seems pointless. murrayc) */
- priv->caption_incoming = create_captioned (self, sizegroup,
+ priv->caption_incoming = create_captioned (self, title_sizegroup, value_sizegroup,
"Incoming Server",
priv->entry_incomingserver);
update_incoming_server_title (self);
protocols with security */
priv->incoming_security =
modest_maemo_security_options_view_new (MODEST_SECURITY_OPTIONS_INCOMING,
- FALSE, sizegroup);
+ FALSE, title_sizegroup, value_sizegroup);
gtk_box_pack_start (GTK_BOX (box), priv->incoming_security,
FALSE, FALSE, MODEST_MARGIN_HALF);
gtk_widget_show_all (priv->incoming_security);
gtk_widget_show (GTK_WIDGET (box));
gtk_widget_show (scrolled_window);
+ g_object_unref (title_sizegroup);
+ g_object_unref (value_sizegroup);
+
return GTK_WIDGET (scrolled_window);
}
/* Create a size group to be used by all captions.
* Note that HildonCaption does not create a default size group if we do not specify one.
* We use GTK_SIZE_GROUP_HORIZONTAL, so that the widths are the same. */
- GtkSizeGroup *sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ GtkSizeGroup *title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ GtkSizeGroup *value_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
/* The outgoing server widgets: */
priv = MODEST_EASYSETUP_WIZARD_DIALOG_GET_PRIVATE (self);
G_CALLBACK (on_easysetup_changed), 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, sizegroup,
+ GtkWidget *caption = create_captioned (self, title_sizegroup, value_sizegroup,
_("mcen_li_emailsetup_smtp"), priv->entry_outgoingserver);
gtk_widget_show (priv->entry_outgoingserver);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
protocols with security */
priv->outgoing_security =
modest_maemo_security_options_view_new (MODEST_SECURITY_OPTIONS_OUTGOING,
- FALSE, sizegroup);
+ FALSE, title_sizegroup, value_sizegroup);
gtk_box_pack_start (GTK_BOX (box), priv->outgoing_security,
FALSE, FALSE, MODEST_MARGIN_HALF);
gtk_widget_show (priv->outgoing_security);
g_signal_connect (G_OBJECT (priv->checkbox_outgoing_smtp_specific), "toggled",
G_CALLBACK (on_easysetup_changed), self);
- caption = modest_maemo_utils_create_captioned (sizegroup, _("mcen_fi_advsetup_connection_smtp"),
+ caption = modest_maemo_utils_create_captioned (title_sizegroup, value_sizegroup,
+ _("mcen_fi_advsetup_connection_smtp"),
priv->checkbox_outgoing_smtp_specific);
gtk_widget_show (priv->checkbox_outgoing_smtp_specific);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
/* Connection-specific SMTP-Severs Edit button: */
priv->button_outgoing_smtp_servers = gtk_button_new_with_label (_("mcen_bd_edit"));
- caption = modest_maemo_utils_create_captioned (sizegroup, _("mcen_fi_advsetup_optional_smtp"),
+ caption = modest_maemo_utils_create_captioned (title_sizegroup, value_sizegroup,
+ _("mcen_fi_advsetup_optional_smtp"),
priv->button_outgoing_smtp_servers);
gtk_widget_show (priv->button_outgoing_smtp_servers);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
gtk_widget_show (GTK_WIDGET (box));
+
+ g_object_unref (title_sizegroup);
+ g_object_unref (value_sizegroup);
return GTK_WIDGET (box);
}
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
gtk_widget_show (label);
- GtkWidget *caption = modest_maemo_utils_create_captioned (NULL, _("mcen_fi_advanced_settings"),
+ GtkWidget *caption = modest_maemo_utils_create_captioned (NULL, NULL,
+ _("mcen_fi_advanced_settings"),
button_edit);
gtk_widget_show (button_edit);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, MODEST_MARGIN_HALF);
create_updating_page (ModestMaemoGlobalSettingsDialog *self)
{
GtkWidget *vbox, *vbox_update, *vbox_limit, *label, *hbox;
- GtkSizeGroup *size_group;
+ GtkSizeGroup *title_size_group;
+ GtkSizeGroup *value_size_group;
ModestGlobalSettingsDialogPrivate *ppriv;
GtkWidget *pannable;
vbox = gtk_vbox_new (FALSE, MODEST_MARGIN_DEFAULT);
vbox_update = gtk_vbox_new (FALSE, MODEST_MARGIN_DEFAULT);
- size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+ title_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+ value_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
/* Auto update */
ppriv->auto_update = hildon_check_button_new (MODEST_EDITABLE_SIZE);
gtk_button_set_label (GTK_BUTTON (ppriv->auto_update), _("mcen_fi_options_autoupdate"));
+ gtk_button_set_alignment (GTK_BUTTON (ppriv->auto_update), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (vbox_update), ppriv->auto_update, FALSE, FALSE, MODEST_MARGIN_HALF);
g_signal_connect (ppriv->auto_update, "clicked", G_CALLBACK (on_auto_update_clicked), self);
* so it can't know how to manage its memory. */
ppriv->connect_via_list = _modest_global_settings_dialog_get_connected_via ();
ppriv->connect_via = modest_selector_picker_new (MODEST_EDITABLE_SIZE,
- MODEST_EDITABLE_ARRANGEMENT,
+ HILDON_BUTTON_ARRANGEMENT_VERTICAL,
ppriv->connect_via_list, g_int_equal);
- modest_maemo_utils_create_picker_layout (size_group, _("mcen_fi_options_connectiontype"),
- ppriv->connect_via);
+ modest_maemo_utils_set_vbutton_layout (title_size_group,
+ _("mcen_fi_options_connectiontype"),
+ ppriv->connect_via);
gtk_box_pack_start (GTK_BOX (vbox_update), ppriv->connect_via, FALSE, FALSE, MODEST_MARGIN_HALF);
/* Update interval */
* so it can't know how to manage its memory. */
ppriv->update_interval_list = _modest_global_settings_dialog_get_update_interval ();
ppriv->update_interval = modest_selector_picker_new (MODEST_EDITABLE_SIZE,
- MODEST_EDITABLE_ARRANGEMENT,
+ HILDON_BUTTON_ARRANGEMENT_VERTICAL,
ppriv->update_interval_list, g_int_equal);
- modest_maemo_utils_create_picker_layout (size_group, _("mcen_fi_options_updateinterval"),
- ppriv->update_interval);
+ modest_maemo_utils_set_vbutton_layout (title_size_group,
+ _("mcen_fi_options_updateinterval"),
+ ppriv->update_interval);
gtk_box_pack_start (GTK_BOX (vbox_update), ppriv->update_interval, FALSE, FALSE, MODEST_MARGIN_HALF);
/* Add to vbox */
/* Separator */
gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, MODEST_MARGIN_HALF);
+ g_object_unref (title_size_group);
+ g_object_unref (value_size_group);
+
/* Limits */
vbox_limit = gtk_vbox_new (FALSE, MODEST_MARGIN_DEFAULT);
- size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+ title_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+ value_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
/* Size limit */
ppriv->size_limit = hildon_number_editor_new (MSG_SIZE_MIN_VAL, MSG_SIZE_MAX_VAL);
* so it can't know how to manage its memory. */
ppriv->msg_format_list = _modest_global_settings_dialog_get_msg_formats ();
ppriv->msg_format = modest_selector_picker_new (MODEST_EDITABLE_SIZE,
- MODEST_EDITABLE_ARRANGEMENT,
+ HILDON_BUTTON_ARRANGEMENT_VERTICAL,
ppriv->msg_format_list, g_int_equal);
- modest_maemo_utils_create_picker_layout (size_group, _("mcen_fi_options_messageformat"),
- ppriv->msg_format);
+ modest_maemo_utils_set_vbutton_layout (title_size_group,
+ _("mcen_fi_options_messageformat"),
+ ppriv->msg_format);
gtk_box_pack_start (GTK_BOX (vbox), ppriv->msg_format, FALSE, FALSE, MODEST_MARGIN_HALF);
gtk_widget_show (vbox);
gtk_widget_show (pannable);
+ g_object_unref (title_size_group);
+ g_object_unref (value_size_group);
+
return pannable;
}
static void
create_incoming_security (ModestSecurityOptionsView* self,
- GtkSizeGroup *size_group)
+ GtkSizeGroup *title_size_group,
+ GtkSizeGroup *value_size_group)
{
ModestSecurityOptionsViewPrivate *ppriv;
GtkWidget *entry_caption = NULL;
/* Create widgets for incoming security */
ppriv->security_view = GTK_WIDGET (modest_serversecurity_picker_new (MODEST_EDITABLE_SIZE,
- MODEST_EDITABLE_ARRANGEMENT));
+ HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
modest_serversecurity_picker_fill (MODEST_SERVERSECURITY_PICKER (ppriv->security_view),
modest_protocol_registry_get_pop_type_id ());
- modest_maemo_utils_create_picker_layout (size_group,
- _("mcen_li_emailsetup_secure_connection"),
- ppriv->security_view);
+ modest_maemo_utils_set_hbutton_layout (title_size_group,
+ value_size_group,
+ _("mcen_li_emailsetup_secure_connection"),
+ ppriv->security_view);
if (ppriv->full) {
ppriv->port_view = GTK_WIDGET (hildon_number_editor_new (PORT_MIN, PORT_MAX));
- entry_caption = modest_maemo_utils_create_captioned (size_group, _("mcen_fi_emailsetup_port"),
+ entry_caption = modest_maemo_utils_create_captioned (title_size_group,
+ value_size_group,
+ _("mcen_fi_emailsetup_port"),
ppriv->port_view);
}
ppriv->auth_view = hildon_check_button_new (MODEST_EDITABLE_SIZE);
gtk_button_set_label (GTK_BUTTON (ppriv->auth_view), _("mcen_li_emailsetup_secure_authentication"));
- gtk_size_group_add_widget (size_group, ppriv->auth_view);
+ gtk_button_set_alignment (GTK_BUTTON (ppriv->auth_view), 0.0, 0.5);
/* Track changes in UI */
g_signal_connect (G_OBJECT (ppriv->security_view), "value-changed",
static void
create_outgoing_security (ModestSecurityOptionsView* self,
- GtkSizeGroup *size_group)
+ GtkSizeGroup *title_size_group,
+ GtkSizeGroup *value_size_group)
{
ModestSecurityOptionsViewPrivate *ppriv;
GtkWidget *user_caption = NULL;
/* The secure connection widgets */
ppriv->security_view = GTK_WIDGET (modest_serversecurity_picker_new (MODEST_EDITABLE_SIZE,
- MODEST_EDITABLE_ARRANGEMENT));
+ HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
modest_serversecurity_picker_fill (MODEST_SERVERSECURITY_PICKER (ppriv->security_view),
MODEST_PROTOCOLS_TRANSPORT_SMTP);
- modest_maemo_utils_create_picker_layout (size_group, _("mcen_li_emailsetup_secure_connection"),
- ppriv->security_view);
+ modest_maemo_utils_set_hbutton_layout (title_size_group,
+ value_size_group,
+ _("mcen_li_emailsetup_secure_connection"),
+ ppriv->security_view);
/* The secure authentication widgets */
ppriv->auth_view = GTK_WIDGET (modest_secureauth_picker_new (MODEST_EDITABLE_SIZE,
- MODEST_EDITABLE_ARRANGEMENT));
- modest_maemo_utils_create_picker_layout (size_group, _("mcen_li_emailsetup_secure_authentication"),
- ppriv->auth_view);
+ HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
+ modest_maemo_utils_set_hbutton_layout (title_size_group,
+ value_size_group,
+ _("mcen_li_emailsetup_secure_authentication"),
+ ppriv->auth_view);
if (ppriv->full) {
gchar *user_label;
HILDON_GTK_INPUT_MODE_FULL);
user_label = g_strdup_printf("%s*", _("mail_fi_username"));
- user_caption = modest_maemo_utils_create_captioned (size_group, user_label,
+ user_caption = modest_maemo_utils_create_captioned (title_size_group,
+ value_size_group,
+ user_label,
ppriv->user_entry);
g_free (user_label);
HILDON_GTK_INPUT_MODE_INVISIBLE);
gtk_entry_set_visibility (GTK_ENTRY (ppriv->pwd_entry), FALSE);
- pwd_caption = modest_maemo_utils_create_captioned (size_group, _("mail_fi_password"),
+ pwd_caption = modest_maemo_utils_create_captioned (title_size_group,
+ value_size_group,
+ _("mail_fi_password"),
ppriv->pwd_entry);
ppriv->port_view = GTK_WIDGET (hildon_number_editor_new (PORT_MIN, PORT_MAX));
- port_caption = modest_maemo_utils_create_captioned (size_group, _("mcen_fi_emailsetup_port"),
+ port_caption = modest_maemo_utils_create_captioned (title_size_group,
+ value_size_group,
+ _("mcen_fi_emailsetup_port"),
ppriv->port_view);
}
GtkWidget *
modest_maemo_security_options_view_new (ModestSecurityOptionsType type,
gboolean full,
- GtkSizeGroup *size_group)
+ GtkSizeGroup *title_size_group,
+ GtkSizeGroup *value_size_group)
{
ModestSecurityOptionsView* self;
ModestSecurityOptionsViewPrivate *ppriv;
ppriv->full = full;
self->type = type;
if (self->type == MODEST_SECURITY_OPTIONS_INCOMING)
- create_incoming_security (self, size_group);
+ create_incoming_security (self, title_size_group, value_size_group);
else
- create_outgoing_security (self, size_group);
+ create_outgoing_security (self, title_size_group, value_size_group);
return (GtkWidget *) self;
}
GtkWidget* modest_maemo_security_options_view_new (ModestSecurityOptionsType type,
gboolean full,
- GtkSizeGroup *size_group);
+ GtkSizeGroup *title_size_group,
+ GtkSizeGroup *value_size_group);
G_END_DECLS
return new_menu;
}
+/**
+ * modest_maemo_utils_create_captioned:
+ * @title_size_group: a #GtkSizeGroup
+ * @value_size_group: a #GtkSizeGroup
+ * @title: a string
+ * @control: a #GtkWidget
+ *
+ * this creates a widget (a #GtkHBox) with a control, and a label
+ * (@string) captioning it. It also uses the proper size groups for title
+ * and control.
+ *
+ * Returns: a widget containing the control and a proper label.
+ */
GtkWidget *
-modest_maemo_utils_create_captioned (GtkSizeGroup *group,
- const gchar *label_text,
+modest_maemo_utils_create_captioned (GtkSizeGroup *title_size_group,
+ GtkSizeGroup *value_size_group,
+ const gchar *title,
GtkWidget *control)
{
GtkWidget *label;
GtkWidget *box;
- label = gtk_label_new (label_text);
+ label = gtk_label_new (title);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_widget_show (label);
- box = gtk_hbox_new (FALSE, MODEST_MARGIN_NONE);
- gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, MODEST_MARGIN_HALF);
+ box = gtk_hbox_new (TRUE, MODEST_MARGIN_HALF);
+ gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, MODEST_MARGIN_HALF);
gtk_box_pack_start (GTK_BOX (box), control, TRUE, TRUE, MODEST_MARGIN_HALF);
- if (group)
- gtk_size_group_add_widget (group, label);
+ if (title_size_group)
+ gtk_size_group_add_widget (title_size_group, label);
+ if (value_size_group)
+ gtk_size_group_add_widget (value_size_group, control);
hildon_gtk_widget_set_theme_size (control, HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
return box;
}
+/**
+ * modest_maemo_utils_set_hbutton_layout:
+ * @title_sizegroup: a #GtkSizeGroup, or %NULL
+ * @value_sizegroup: a #GtkSizeGroup, or %NULL
+ * @title: a string
+ * @button: a #HildonButton
+ *
+ * Configures the alignment and layout of @button. If @title_sizegroup is provided,
+ * the title will be aligned to the left using it. If @value_sizegroup is provided,
+ * the value will be aligned to the left using it. It also sets the title
+ * of the button.
+ *
+ * The alignment is left for the title and for the value.
+ */
+void
+modest_maemo_utils_set_hbutton_layout (GtkSizeGroup *title_sizegroup,
+ GtkSizeGroup *value_sizegroup,
+ const gchar *title,
+ GtkWidget *button)
+{
+ hildon_button_set_title (HILDON_BUTTON (button), title);
+ if (title_sizegroup)
+ hildon_button_add_title_size_group (HILDON_BUTTON (button), title_sizegroup);
+ if (value_sizegroup)
+ hildon_button_add_title_size_group (HILDON_BUTTON (button), value_sizegroup);
+ hildon_button_set_alignment (HILDON_BUTTON (button), 0.0, 0.5, 1.0, 0.0);
+ hildon_button_set_title_alignment (HILDON_BUTTON (button), 0.0, 0.5);
+ hildon_button_set_value_alignment (HILDON_BUTTON (button), 0.0, 0.5);
+}
+
void
-modest_maemo_utils_create_picker_layout (GtkSizeGroup *sizegroup,
- const gchar *label,
- GtkWidget *picker)
+modest_maemo_utils_set_vbutton_layout (GtkSizeGroup *sizegroup,
+ const gchar *title,
+ GtkWidget *button)
{
- hildon_button_set_title (HILDON_BUTTON (picker), label);
- if (sizegroup)
- hildon_button_add_title_size_group (HILDON_BUTTON (picker), sizegroup);
- hildon_button_set_alignment (HILDON_BUTTON (picker), 0.0, 0.5, 1.0, 0.0);
- hildon_button_set_title_alignment (HILDON_BUTTON (picker), 0.0, 0.5);
- hildon_button_set_value_alignment (HILDON_BUTTON (picker), 0.0, 0.5);
+ hildon_button_set_title (HILDON_BUTTON (button), title);
+ if (sizegroup) {
+ hildon_button_add_title_size_group (HILDON_BUTTON (button), sizegroup);
+ hildon_button_add_value_size_group (HILDON_BUTTON (button), sizegroup);
+ }
+ hildon_button_set_alignment (HILDON_BUTTON (button), 0.0, 0.5, 1.0, 0.0);
+ hildon_button_set_title_alignment (HILDON_BUTTON (button), 0.0, 0.5);
+ hildon_button_set_value_alignment (HILDON_BUTTON (button), 0.0, 0.5);
}
GtkWidget *
*/
GtkWidget *modest_maemo_utils_get_manager_menubar_as_menu (GtkUIManager *manager, const gchar *item_name);
-GtkWidget *modest_maemo_utils_create_captioned (GtkSizeGroup *group,
- const gchar *label_text,
+GtkWidget *modest_maemo_utils_create_captioned (GtkSizeGroup *title_size_group,
+ GtkSizeGroup *value_size_group,
+ const gchar *title,
GtkWidget *control);
-void
-modest_maemo_utils_create_picker_layout (GtkSizeGroup *sizegroup,
- const gchar *label,
- GtkWidget *picker);
+void modest_maemo_utils_set_hbutton_layout (GtkSizeGroup *title_sizegroup,
+ GtkSizeGroup *value_sizegroup,
+ const gchar *title,
+ GtkWidget *button);
+void modest_maemo_utils_set_vbutton_layout (GtkSizeGroup *sizegroup,
+ const gchar *title,
+ GtkWidget *button);
GtkWidget *modest_maemo_utils_create_group_box (const gchar *label, GtkWidget *contents);
GdkPixbuf *window_icon = NULL;
GError *error = NULL;
- GtkSizeGroup *size_group;
+ GtkSizeGroup *title_size_group;
+ GtkSizeGroup *value_size_group;
GtkWidget *subject_box;
GtkWidget *attachment_icon;
GtkWidget *window_box;
parent_priv->menubar = NULL;
- size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+ title_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+ value_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
/* Note: This ModestPairList* must exist for as long as the picker
* that uses it, because the ModestSelectorPicker uses the ID opaquely,
* so it can't know how to manage its memory. */
priv->from_field = modest_selector_picker_new (MODEST_EDITABLE_SIZE,
- MODEST_EDITABLE_ARRANGEMENT,
+ HILDON_BUTTON_ARRANGEMENT_HORIZONTAL,
NULL, g_str_equal);
- hildon_button_set_alignment (HILDON_BUTTON (priv->from_field), 0.0, 0.5, 1.0, 0.0);
- hildon_button_set_title_alignment (HILDON_BUTTON (priv->from_field), 0.0, 0.5);
- hildon_button_set_value_alignment (HILDON_BUTTON (priv->from_field), 0.0, 0.5);
+ modest_maemo_utils_set_hbutton_layout (title_size_group, value_size_group,
+ _("mail_va_from"), priv->from_field);
priv->to_field = modest_recpt_editor_new ();
priv->cc_field = modest_recpt_editor_new ();
priv->header_box = gtk_vbox_new (FALSE, 0);
- hildon_button_add_title_size_group (HILDON_BUTTON (priv->from_field), size_group);
- to_caption = modest_maemo_utils_create_captioned (size_group, _("mail_va_to"), priv->to_field);
- priv->cc_caption = modest_maemo_utils_create_captioned (size_group, _("mail_va_cc"), priv->cc_field);
- priv->bcc_caption = modest_maemo_utils_create_captioned (size_group, _("mail_va_hotfix1"), priv->bcc_field);
- subject_caption = modest_maemo_utils_create_captioned (size_group, _("mail_va_subject"), subject_box);
- priv->attachments_caption = modest_maemo_utils_create_captioned (size_group, _("mail_va_attachment"), priv->attachments_view);
- g_object_unref (size_group);
-
- size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- hildon_button_add_value_size_group (HILDON_BUTTON (priv->from_field), size_group);
- modest_recpt_editor_set_field_size_group (MODEST_RECPT_EDITOR (priv->to_field), size_group);
- modest_recpt_editor_set_field_size_group (MODEST_RECPT_EDITOR (priv->cc_field), size_group);
- modest_recpt_editor_set_field_size_group (MODEST_RECPT_EDITOR (priv->bcc_field), size_group);
- gtk_size_group_add_widget (size_group, priv->subject_field);
- gtk_size_group_add_widget (size_group, priv->attachments_view);
- g_object_unref (size_group);
+ to_caption = modest_maemo_utils_create_captioned (title_size_group, value_size_group,
+ _("mail_va_to"), priv->to_field);
+ priv->cc_caption = modest_maemo_utils_create_captioned (title_size_group, value_size_group,
+ _("mail_va_cc"), priv->cc_field);
+ priv->bcc_caption = modest_maemo_utils_create_captioned (title_size_group, value_size_group,
+ _("mail_va_hotfix1"), priv->bcc_field);
+ subject_caption = modest_maemo_utils_create_captioned (title_size_group, value_size_group,
+ _("mail_va_subject"), subject_box);
+ priv->attachments_caption = modest_maemo_utils_create_captioned (title_size_group, value_size_group,
+ _("mail_va_attachment"),
+ priv->attachments_view);
+ /* modest_recpt_editor_set_field_size_group (MODEST_RECPT_EDITOR (priv->to_field), value_size_group); */
+ /* modest_recpt_editor_set_field_size_group (MODEST_RECPT_EDITOR (priv->cc_field), value_size_group); */
+ /* modest_recpt_editor_set_field_size_group (MODEST_RECPT_EDITOR (priv->bcc_field), value_size_group); */
+ g_object_unref (title_size_group);
+ g_object_unref (value_size_group);
gtk_box_pack_start (GTK_BOX (priv->header_box), priv->from_field, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (priv->header_box), to_caption, FALSE, FALSE, 0);
#include <gtk/gtkvbox.h>
#include <gtk/gtktextview.h>
#include <gtk/gtklabel.h>
-#include <gtk/gtkscrolledwindow.h>
+#include <hildon/hildon-pannable-area.h>
#include <gtk/gtkstock.h>
#include <glib/gi18n.h>
#include <modest-maemo-utils.h>
{
GtkWidget *checkbox_use;
GtkWidget *label;
- GtkWidget *scrolledwindow;
+ GtkWidget *pannable;
GtkWidget *textview;
};
const gboolean enable = hildon_check_button_get_active (HILDON_CHECK_BUTTON (priv->checkbox_use));
gtk_widget_set_sensitive (priv->label, enable);
- gtk_widget_set_sensitive (priv->scrolledwindow, enable);
+ gtk_widget_set_sensitive (priv->pannable, enable);
gtk_text_view_set_editable (GTK_TEXT_VIEW (priv->textview), enable);
}
priv->checkbox_use = hildon_check_button_new (HILDON_SIZE_FINGER_HEIGHT);
gtk_button_set_label (GTK_BUTTON (priv->checkbox_use),
_("mcen_fi_email_signatures_use_signature"));
+ gtk_button_set_alignment (GTK_BUTTON (priv->checkbox_use), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (box), priv->checkbox_use, FALSE, FALSE, MODEST_MARGIN_HALF);
gtk_widget_show (priv->checkbox_use);
G_CALLBACK (on_toggle_button_changed), self);
priv->label = gtk_label_new (""); /* Set in modest_signature_editor_dialog_set_settings(). */
+ gtk_misc_set_alignment (GTK_MISC (priv->label), 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (box), priv->label, FALSE, FALSE, MODEST_MARGIN_HALF);
gtk_widget_show (priv->label);
- priv->scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
- gtk_container_set_border_width (GTK_CONTAINER (priv->scrolledwindow), MODEST_MARGIN_DEFAULT);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->scrolledwindow),
- GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (priv->scrolledwindow), GTK_SHADOW_IN);
- gtk_box_pack_start (GTK_BOX (box), priv->scrolledwindow, FALSE, FALSE, MODEST_MARGIN_HALF);
- gtk_widget_show (priv->scrolledwindow);
+ priv->pannable = hildon_pannable_area_new ();
+ gtk_box_pack_start (GTK_BOX (box), priv->pannable, TRUE, TRUE, MODEST_MARGIN_HALF);
+ gtk_widget_show (priv->pannable);
priv->textview = gtk_text_view_new ();
- gtk_container_add (GTK_CONTAINER (priv->scrolledwindow), priv->textview);
+ gtk_container_add (GTK_CONTAINER (priv->pannable), priv->textview);
gtk_widget_show (priv->textview);
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->textview));
- gtk_text_buffer_set_text (buffer, "--\n", -1); /* Default, as per the UI spec. */
+ gtk_text_buffer_set_text (buffer, _("mcen_va_default_signature_tablet"), -1); /* Default, as per the UI spec. */
/* Add the buttons: */
gtk_dialog_add_button (GTK_DIALOG (self), _HL("wdgt_bd_save"), GTK_RESPONSE_OK);
gtk_widget_show (box);
- gtk_widget_set_size_request (GTK_WIDGET (self), 480, -1);
+ gtk_widget_set_size_request (GTK_WIDGET (self), -1, 320);
/* When this window is shown, hibernation should not be possible,
* because there is no sensible way to save the state: */
hildon_check_button_set_active (HILDON_CHECK_BUTTON (priv->checkbox_use), use_signature);
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->textview));
- if (signature)
+ if (signature && signature[0] != '\0')
gtk_text_buffer_set_text (buffer, signature, -1);
else
- gtk_text_buffer_set_text (buffer, "--\n", -1); /* Default, as per the UI spec. */
+ gtk_text_buffer_set_text (buffer, _("mcen_va_default_signature_tablet"), -1); /* Default, as per the UI spec. */
enable_widgets (window);
}
#define MODEST_DIALOG_WINDOW_MIN_WIDTH 172
#ifdef MODEST_TOOLKIT_HILDON2
#define MODEST_EDITABLE_SIZE (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH)
-#define MODEST_EDITABLE_ARRANGEMENT (HILDON_BUTTON_ARRANGEMENT_HORIZONTAL)
#endif
#else /* MODEST_TOOLKIT_GTK */
/* TODO: review this values with GNOME HIG */