* Now we provide compatibility with old and new hildon check button api.
* Now we properly update the sensitivity in settings dialog so the
auto update check button doesn't get changed badly (fixes NB#89464).
* Now play sound check doesn't break the changes check in settings
dialog (fixes NB#89704).
pmo-trunk-r5986
GtkWidget *widget = GTK_WIDGET (user_data);
/* Enable the widget only if the check button is active: */
GtkWidget *widget = GTK_WIDGET (user_data);
/* Enable the widget only if the check button is active: */
- const gboolean enable = hildon_check_button_get_active (button);
+ const gboolean enable = hildon_check_button_get_active (HILDON_CHECK_BUTTON (button));
gtk_widget_set_sensitive (widget, enable);
}
gtk_widget_set_sensitive (widget, enable);
}
/* connection-specific checkbox: */
if (!priv->checkbox_outgoing_smtp_specific) {
priv->checkbox_outgoing_smtp_specific = hildon_check_button_new (MODEST_EDITABLE_SIZE);
/* connection-specific checkbox: */
if (!priv->checkbox_outgoing_smtp_specific) {
priv->checkbox_outgoing_smtp_specific = hildon_check_button_new (MODEST_EDITABLE_SIZE);
- hildon_check_button_set_active (GTK_BUTTON (priv->checkbox_outgoing_smtp_specific),
+ hildon_check_button_set_active (HILDON_CHECK_BUTTON (priv->checkbox_outgoing_smtp_specific),
FALSE);
}
caption = create_captioned (self, sizegroup, _("mcen_fi_advsetup_connection_smtp"),
FALSE);
}
caption = create_captioned (self, sizegroup, _("mcen_fi_advsetup_connection_smtp"),
modest_account_settings_get_retrieve_limit (settings));
modest_account_settings_get_retrieve_limit (settings));
- hildon_check_button_set_active (GTK_BUTTON (priv->checkbox_leave_messages),
+ hildon_check_button_set_active (HILDON_CHECK_BUTTON (priv->checkbox_leave_messages),
modest_account_settings_get_leave_messages_on_server (settings));
modest_account_settings_get_leave_messages_on_server (settings));
const gboolean has_specific =
modest_account_settings_get_use_connection_specific_smtp (settings);
hildon_check_button_set_active (
const gboolean has_specific =
modest_account_settings_get_use_connection_specific_smtp (settings);
hildon_check_button_set_active (
- GTK_BUTTON (priv->checkbox_outgoing_smtp_specific),
+ HILDON_CHECK_BUTTON (priv->checkbox_outgoing_smtp_specific),
has_specific);
g_object_unref (outgoing_account);
}
has_specific);
g_object_unref (outgoing_account);
}
MODEST_LIMIT_RETRIEVE_PICKER (priv->limit_retrieve_picker));
modest_account_settings_set_retrieve_limit (priv->settings, retrieve_limit);
MODEST_LIMIT_RETRIEVE_PICKER (priv->limit_retrieve_picker));
modest_account_settings_set_retrieve_limit (priv->settings, retrieve_limit);
- leave_on_server = hildon_check_button_get_active (GTK_BUTTON (priv->checkbox_leave_messages));
+ leave_on_server = hildon_check_button_get_active (HILDON_CHECK_BUTTON (priv->checkbox_leave_messages));
modest_account_settings_set_leave_messages_on_server (priv->settings, leave_on_server);
store_settings = modest_account_settings_get_store_settings (priv->settings);
modest_account_settings_set_leave_messages_on_server (priv->settings, leave_on_server);
store_settings = modest_account_settings_get_store_settings (priv->settings);
/* Save connection-specific SMTP server accounts: */
modest_account_settings_set_use_connection_specific_smtp
(priv->settings,
/* Save connection-specific SMTP server accounts: */
modest_account_settings_set_use_connection_specific_smtp
(priv->settings,
- hildon_check_button_get_active(GTK_BUTTON(priv->checkbox_outgoing_smtp_specific)));
+ hildon_check_button_get_active(HILDON_CHECK_BUTTON(priv->checkbox_outgoing_smtp_specific)));
/* this configuration is not persistent, we should not save */
if (account_name != NULL)
/* this configuration is not persistent, we should not save */
if (account_name != NULL)
#endif /*MODEST_HAVE_HILDON_HELP*/
#endif /*MODEST_HAVE_OSSO_HELP*/
#endif /*MODEST_HAVE_HILDON_HELP*/
#endif /*MODEST_HAVE_OSSO_HELP*/
+#ifndef HILDON_CHECK_BUTTON
+#define HILDON_CHECK_BUTTON GTK_BUTTON
+#endif
+
/* some extra #defines, so it will compile with the 'normal' gtk */
#ifndef MODEST_HAVE_HILDON_GTK
#define hildon_gtk_entry_set_input_mode(a,b) \
/* some extra #defines, so it will compile with the 'normal' gtk */
#ifndef MODEST_HAVE_HILDON_GTK
#define hildon_gtk_entry_set_input_mode(a,b) \
#include "modest-runtime.h"
#include "widgets/modest-global-settings-dialog-priv.h"
#include "modest-selector-picker.h"
#include "modest-runtime.h"
#include "widgets/modest-global-settings-dialog-priv.h"
#include "modest-selector-picker.h"
-#include "hildon/hildon-check-button.h"
#include "hildon/hildon-pannable-area.h"
#include "modest-maemo-global-settings-dialog.h"
#include "widgets/modest-ui-constants.h"
#include "hildon/hildon-pannable-area.h"
#include "modest-maemo-global-settings-dialog.h"
#include "widgets/modest-ui-constants.h"
static void on_auto_update_clicked (GtkButton *button,
gpointer user_data);
static void on_auto_update_clicked (GtkButton *button,
gpointer user_data);
+static void update_sensitive (ModestGlobalSettingsDialog *dialog);
typedef struct _ModestMaemoGlobalSettingsDialogPrivate ModestMaemoGlobalSettingsDialogPrivate;
struct _ModestMaemoGlobalSettingsDialogPrivate {
typedef struct _ModestMaemoGlobalSettingsDialogPrivate ModestMaemoGlobalSettingsDialogPrivate;
struct _ModestMaemoGlobalSettingsDialogPrivate {
/* Load current config */
_modest_global_settings_dialog_load_conf (MODEST_GLOBAL_SETTINGS_DIALOG (self));
/* Load current config */
_modest_global_settings_dialog_load_conf (MODEST_GLOBAL_SETTINGS_DIALOG (self));
+ /* force update of sensitiveness */
+ update_sensitive (MODEST_GLOBAL_SETTINGS_DIALOG (self));
/* Set first page */
hildon_help_dialog_help_enable (GTK_DIALOG(self), "applications_email_options_dialog",
/* Set first page */
hildon_help_dialog_help_enable (GTK_DIALOG(self), "applications_email_options_dialog",
-on_auto_update_clicked (GtkButton *button,
- gpointer user_data)
+update_sensitive (ModestGlobalSettingsDialog *dialog)
{
ModestGlobalSettingsDialogPrivate *ppriv;
{
ModestGlobalSettingsDialogPrivate *ppriv;
- ppriv = MODEST_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE (user_data);
+ g_return_if_fail (MODEST_IS_GLOBAL_SETTINGS_DIALOG (dialog));
+ ppriv = MODEST_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE (dialog);
- if (hildon_check_button_get_active (button)) {
+ if (hildon_check_button_get_active (HILDON_CHECK_BUTTON (ppriv->auto_update))) {
gtk_widget_set_sensitive (ppriv->connect_via, TRUE);
gtk_widget_set_sensitive (ppriv->update_interval, TRUE);
} else {
gtk_widget_set_sensitive (ppriv->connect_via, TRUE);
gtk_widget_set_sensitive (ppriv->update_interval, TRUE);
} else {
+static void
+on_auto_update_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ g_return_if_fail (MODEST_IS_GLOBAL_SETTINGS_DIALOG (user_data));
+ update_sensitive ((ModestGlobalSettingsDialog *) user_data);
+}
static gboolean
on_range_error (HildonNumberEditor *editor,
HildonNumberEditorErrorType type,
static gboolean
on_range_error (HildonNumberEditor *editor,
HildonNumberEditorErrorType type,
#include "modest-maemo-utils.h"
#include <hildon/hildon-number-editor.h>
#include <hildon/hildon-check-button.h>
#include "modest-maemo-utils.h"
#include <hildon/hildon-number-editor.h>
#include <hildon/hildon-check-button.h>
+#include "modest-hildon-includes.h"
#define PORT_MIN 1
#define PORT_MAX 65535
#define PORT_MIN 1
#define PORT_MAX 65535
if (MODEST_SECURITY_OPTIONS_VIEW (self)->type == MODEST_SECURITY_OPTIONS_INCOMING) {
/* Activate and dim checkbutton if it's secure */
if (MODEST_SECURITY_OPTIONS_VIEW (self)->type == MODEST_SECURITY_OPTIONS_INCOMING) {
/* Activate and dim checkbutton if it's secure */
- hildon_check_button_set_active (GTK_BUTTON (ppriv->auth_view),
+ hildon_check_button_set_active (HILDON_CHECK_BUTTON (ppriv->auth_view),
is_secure);
gtk_widget_set_sensitive (ppriv->auth_view, !is_secure);
} else {
is_secure);
gtk_widget_set_sensitive (ppriv->auth_view, !is_secure);
} else {
#include "modest-platform.h"
#ifdef MODEST_TOOLKIT_HILDON2
#include "hildon2/modest-selector-picker.h"
#include "modest-platform.h"
#ifdef MODEST_TOOLKIT_HILDON2
#include "hildon2/modest-selector-picker.h"
-#include "hildon/hildon-check-button.h"
+#include "modest-hildon-includes.h"
#else
#include "widgets/modest-combo-box.h"
#endif
#else
#include "widgets/modest-combo-box.h"
#endif
checked = FALSE;
}
#ifdef MODEST_TOOLKIT_HILDON2
checked = FALSE;
}
#ifdef MODEST_TOOLKIT_HILDON2
- hildon_check_button_set_active (GTK_BUTTON (priv->auto_update), checked);
+ hildon_check_button_set_active (HILDON_CHECK_BUTTON (priv->auto_update), checked);
#else
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->auto_update), checked);
#endif
#else
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->auto_update), checked);
#endif
priv->initial_state.connect_via = combo_id;
/* Emit toggled to update the visibility of connect_by caption */
priv->initial_state.connect_via = combo_id;
/* Emit toggled to update the visibility of connect_by caption */
-#ifdef MODEST_TOOLKIT_HILDON2
- gtk_button_clicked (GTK_BUTTON (priv->auto_update));
-#else
+#ifndef MODEST_TOOLKIT_HILDON2
gtk_toggle_button_toggled (GTK_TOGGLE_BUTTON (priv->auto_update));
#endif
gtk_toggle_button_toggled (GTK_TOGGLE_BUTTON (priv->auto_update));
#endif
/* Get values from UI */
#ifdef MODEST_TOOLKIT_HILDON2
id = modest_selector_picker_get_active_id (MODEST_SELECTOR_PICKER (priv->connect_via));
/* Get values from UI */
#ifdef MODEST_TOOLKIT_HILDON2
id = modest_selector_picker_get_active_id (MODEST_SELECTOR_PICKER (priv->connect_via));
- state->auto_update = hildon_check_button_get_active (GTK_BUTTON (priv->auto_update));
+ state->auto_update = hildon_check_button_get_active (HILDON_CHECK_BUTTON (priv->auto_update));
#else
id = modest_combo_box_get_active_id (MODEST_COMBO_BOX (priv->connect_via));
state->auto_update = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->auto_update));
#else
id = modest_combo_box_get_active_id (MODEST_COMBO_BOX (priv->connect_via));
state->auto_update = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->auto_update));
state->update_interval = *id;
#ifdef MODEST_TOOLKIT_HILDON2
id = modest_selector_picker_get_active_id (MODEST_SELECTOR_PICKER (priv->msg_format));
state->update_interval = *id;
#ifdef MODEST_TOOLKIT_HILDON2
id = modest_selector_picker_get_active_id (MODEST_SELECTOR_PICKER (priv->msg_format));
+ state->play_sound = priv->initial_state.play_sound;
#else
state->play_sound = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->play_sound));
id = modest_combo_box_get_active_id (MODEST_COMBO_BOX (priv->msg_format));
#else
state->play_sound = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->play_sound));
id = modest_combo_box_get_active_id (MODEST_COMBO_BOX (priv->msg_format));
#ifdef MODEST_TOOLKIT_HILDON2
#include "modest-serversecurity-picker.h"
#include "modest-secureauth-picker.h"
#ifdef MODEST_TOOLKIT_HILDON2
#include "modest-serversecurity-picker.h"
#include "modest-secureauth-picker.h"
-#include <hildon/hildon-check-button.h>
+#include <modest-hildon-includes.h>
#else
#include "widgets/modest-serversecurity-combo-box.h"
#include "widgets/modest-secureauth-combo-box.h"
#else
#include "widgets/modest-serversecurity-combo-box.h"
#include "widgets/modest-secureauth-combo-box.h"
if (modest_protocol_registry_protocol_type_is_secure (modest_runtime_get_protocol_registry (),
secure_auth))
#ifdef MODEST_TOOLKIT_HILDON2
if (modest_protocol_registry_protocol_type_is_secure (modest_runtime_get_protocol_registry (),
secure_auth))
#ifdef MODEST_TOOLKIT_HILDON2
- hildon_check_button_set_active (GTK_BUTTON (priv->auth_view),
+ hildon_check_button_set_active (HILDON_CHECK_BUTTON (priv->auth_view),
TRUE);
#else
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->auth_view),
TRUE);
#else
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->auth_view),
if (self->type == MODEST_SECURITY_OPTIONS_INCOMING) {
#ifdef MODEST_TOOLKIT_HILDON2
if (self->type == MODEST_SECURITY_OPTIONS_INCOMING) {
#ifdef MODEST_TOOLKIT_HILDON2
- if (hildon_check_button_get_active (GTK_BUTTON (priv->auth_view))) {
+ if (hildon_check_button_get_active (HILDON_CHECK_BUTTON (priv->auth_view))) {
#else
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->auth_view))) {
#endif
#else
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->auth_view))) {
#endif
}
} else {
#ifdef MODEST_TOOLKIT_HILDON2
}
} else {
#ifdef MODEST_TOOLKIT_HILDON2
- if (hildon_check_button_get_active (GTK_BUTTON (priv->auth_view)))
+ if (hildon_check_button_get_active (HILDON_CHECK_BUTTON (priv->auth_view)))
#else
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->auth_view)))
#endif
#else
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->auth_view)))
#endif
#ifdef MODEST_TOOLKIT_HILDON2
auth_active =
#ifdef MODEST_TOOLKIT_HILDON2
auth_active =
- hildon_check_button_get_active (GTK_BUTTON (priv->auth_view));
+ hildon_check_button_get_active (HILDON_CHECK_BUTTON (priv->auth_view));
#else
auth_active =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->auth_view));
#else
auth_active =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->auth_view));