#define FOLDER_PICKER_CURRENT_FOLDER "current-folder"
#define FOLDER_PICKER_ORIGINAL_ACCOUNT "original-account"
-static gboolean ca_con_opened = FALSE;
-
-
-static void modest_platform_play_email_tone (void);
-
-
static void
on_modest_conf_update_interval_changed (ModestConf* self,
const gchar *key,
} ConnectAndWaitData;
-static void
-quit_wait_loop (TnyAccount *account,
- ConnectAndWaitData *data)
-{
- /* Set the has_callback to TRUE (means that the callback was
- executed and wake up every code waiting for cond to be
- TRUE */
- g_mutex_lock (data->mutex);
- data->has_callback = TRUE;
- if (data->wait_loop)
- g_main_loop_quit (data->wait_loop);
- g_mutex_unlock (data->mutex);
-}
-
-static void
-on_connection_status_changed (TnyAccount *account,
- TnyConnectionStatus status,
- gpointer user_data)
-{
- TnyConnectionStatus conn_status;
- ConnectAndWaitData *data;
-
- /* Ignore if reconnecting or disconnected */
- conn_status = tny_account_get_connection_status (account);
- if (conn_status == TNY_CONNECTION_STATUS_RECONNECTING ||
- conn_status == TNY_CONNECTION_STATUS_DISCONNECTED)
- return;
-
- /* Remove the handler */
- data = (ConnectAndWaitData *) user_data;
- g_signal_handler_disconnect (account, data->handler);
-
- /* Quit from wait loop */
- quit_wait_loop (account, (ConnectAndWaitData *) user_data);
-}
-
-static void
-on_tny_camel_account_set_online_cb (TnyCamelAccount *account,
- gboolean canceled,
- GError *err,
- gpointer user_data)
-{
- /* Quit from wait loop */
- quit_wait_loop (TNY_ACCOUNT (account), (ConnectAndWaitData *) user_data);
-}
-
gboolean
modest_platform_connect_and_wait (GtkWindow *parent_window,
TnyAccount *account)
gboolean device_online;
TnyDevice *device;
TnyConnectionStatus conn_status;
- OnWentOnlineInfo *info;
device = modest_runtime_get_device();
device_online = tny_device_is_online (device);
conn_status = tny_account_get_connection_status (account);
if (device_online && conn_status == TNY_CONNECTION_STATUS_CONNECTED) {
-
+
/* We promise to instantly perform the callback, so ... */
if (callback) {
callback (FALSE, NULL, parent_window, account, user_data);
}
-
+
return;
}
-
- if (device_online) {
- } else {
-
+
+ if (!device_online) {
+ OnWentOnlineInfo *info = NULL;
+
+ info = g_slice_new0 (OnWentOnlineInfo);
+
+ info->device = NULL;
+ info->iap = NULL;
+ info->account = TNY_ACCOUNT (g_object_ref (account));
+
+ if (parent_window)
+ info->parent_window = (GtkWindow *) g_object_ref (parent_window);
+ else
+ info->parent_window = NULL;
+
+ /* So we'll put the callback away for later ... */
+ info->user_data = user_data;
+ info->callback = callback;
+
/* If the device is online, we'll just connect the account */
-
- tny_camel_account_set_online (TNY_CAMEL_ACCOUNT (account), TRUE,
+ tny_camel_account_set_online (TNY_CAMEL_ACCOUNT (account), TRUE,
on_account_went_online, info);
}
-
+
/* The info gets freed by on_account_went_online or on_conic_device_went_online
* in both situations, go look if you don't believe me! */
-
- return;
}
void
dialog);
}
-static void
-modest_platform_play_email_tone (void)
-{
- return;
-}
-
#define MOVE_TO_DIALOG_FOLDER_VIEW "folder-view"
#define MOVE_TO_DIALOG_BACK_BUTTON "back-button"
#define MOVE_TO_DIALOG_ACTION_BUTTON "action-button"
static void reply_forward (ReplyForwardAction action, ModestWindow *win);
-#ifndef MODEST_TOOLKIT_HILDON2
-static void folder_refreshed_cb (ModestMailOperation *mail_op,
- TnyFolder *folder,
- gpointer user_data);
-
-static void on_send_receive_finished (ModestMailOperation *mail_op,
- gpointer user_data);
-#endif
-
static gint header_list_count_uncached_msgs (TnyList *header_list);
static gboolean connect_to_get_msg (ModestWindow *win,
}
}
-#ifndef MODEST_TOOLKIT_HILDON2
-static GtkTreeRowReference *
-get_next_after_selected_headers (ModestHeaderView *header_view)
-{
- GtkTreeSelection *sel;
- GList *selected_rows, *node;
- GtkTreePath *path;
- GtkTreeRowReference *result;
- GtkTreeModel *model;
-
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (header_view));
- sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (header_view));
- selected_rows = gtk_tree_selection_get_selected_rows (sel, NULL);
-
- if (selected_rows == NULL)
- return NULL;
-
- node = g_list_last (selected_rows);
- path = gtk_tree_path_copy ((GtkTreePath *) node->data);
- gtk_tree_path_next (path);
-
- result = gtk_tree_row_reference_new (model, path);
-
- gtk_tree_path_free (path);
- g_list_foreach (selected_rows, (GFunc) gtk_tree_path_free, NULL);
- g_list_free (selected_rows);
-
- return result;
-}
-#endif
-
static void
headers_action_mark_as_read (TnyHeader *header,
ModestWindow *win,
gboolean
modest_ui_dimming_rules_on_add_to_contacts (ModestWindow *win, gpointer user_data)
{
- GSList *recipients;
+ GSList *recipients = NULL;
gboolean has_recipients_to_add;
g_return_val_if_fail (MODEST_IS_DIMMING_RULE (user_data), FALSE);
}
static void
-on_account_settings_dialog_response (GtkDialog *dialog,
- gint response,
- gpointer user_data)
-{
- TnyAccount *store_account = NULL;
- gchar* account_name = NULL;
- ModestAccountViewWindowPrivate *priv = NULL;
-
- priv = MODEST_ACCOUNT_VIEW_WINDOW_GET_PRIVATE (user_data);
- account_name = modest_account_view_get_selected_account (priv->account_view);
- store_account = modest_tny_account_store_get_server_account (modest_runtime_get_account_store (),
- account_name,
- TNY_ACCOUNT_TYPE_STORE);
- if (store_account) {
- /* Reconnect the store account, no need to reconnect the
- transport account because it will connect when needed */
- if (tny_account_get_connection_status (store_account) ==
- TNY_CONNECTION_STATUS_DISCONNECTED)
- tny_camel_account_set_online (TNY_CAMEL_ACCOUNT (store_account),
- TRUE, NULL, NULL);
- g_object_unref (store_account);
- }
- /* Disconnect this handler */
- g_signal_handlers_disconnect_by_func (dialog, on_account_settings_dialog_response, user_data);
-
- /* Free */
- g_free (account_name);
-}
-
-static void
on_account_activated (GtkTreeView *account_view,
GtkTreePath *path,
GtkTreeViewColumn *column,
priv->modified = modified;
}
+#ifdef MODEST_TOOLKIT_HILDON2
static void
on_modified_picker_changed (GtkWidget *widget, gpointer user_data)
{
set_modified (MODEST_DEFAULT_ACCOUNT_SETTINGS_DIALOG (user_data), TRUE);
}
+#endif
static void
on_modified_entry_changed (GtkEditable *editable, gpointer user_data)
g_object_unref (self);
}
+#ifdef MODEST_TOOLKIT_HILDON2
static void
on_check_support_cancel (GtkDialog *cancel_note,
gint response,
priv->check_support_cancel_note = NULL;
priv->check_support_progress = NULL;
}
+#endif
static void
check_support_of_protocols (ModestEasysetupWizardDialog *self)
return (const gchar *) priv->visible_account_id;
}
-static gboolean
-find_inbox_iter (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *inbox_iter)
-{
- do {
- GtkTreeIter child;
- TnyFolderType type = TNY_FOLDER_TYPE_UNKNOWN;
-
- gtk_tree_model_get (model, iter,
- TYPE_COLUMN,
- &type, -1);
-
- gboolean result = FALSE;
- if (type == TNY_FOLDER_TYPE_INBOX) {
- result = TRUE;
- }
- if (result) {
- *inbox_iter = *iter;
- return TRUE;
- }
-
- if (gtk_tree_model_iter_children (model, &child, iter)) {
- if (find_inbox_iter (model, &child, inbox_iter))
- return TRUE;
- }
-
- } while (gtk_tree_model_iter_next (model, iter));
-
- return FALSE;
-}
-
/* recursive */
static gboolean
find_folder_iter (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *folder_iter,
gint *id;
/* Get values from UI */
- state->notifications = modest_togglable_get_active (HILDON_CHECK_BUTTON (priv->notifications));
- state->add_to_contacts = modest_togglabale_get_active (HILDON_CHECK_BUTTON (priv->add_to_contacts));
+ state->notifications = modest_togglable_get_active (priv->notifications);
+ state->add_to_contacts = modest_togglable_get_active (priv->add_to_contacts);
state->auto_update = modest_togglable_get_active (priv->auto_update);
id = modest_selector_get_active_id (priv->connect_via);
state->default_account = modest_selector_get_active_id (priv->default_account_selector);
GtkToggleButton *current_format;
} MessageSettingsHelper;
+#ifdef MODEST_TOOLKIT_HILDON2
static void
on_priority_toggle (GtkToggleButton *button,
MessageSettingsHelper *helper)
}
}
+#endif
static void
modest_msg_edit_window_show_msg_settings_dialog (ModestMsgEditWindow *window)
modest_msg_edit_window_show_msg_settings_dialog (window);
}
+#ifdef MODEST_TOOLKIT_HILDON2
static void
on_cc_button_toggled (GtkWidget *button,
ModestMsgEditWindow *window)
modest_msg_edit_window_show_bcc (MODEST_MSG_EDIT_WINDOW (window),
modest_togglable_get_active (button));
}
+#endif
-static void
+static void
setup_menu (ModestMsgEditWindow *self)
{
ModestMsgEditWindowPrivate *priv = NULL;
return box;
}
+#ifdef MODEST_TOOLKIT_HILDON2
static gboolean match_all (TnyList *list, GObject *item, gpointer match_data)
{
return TRUE;
}
+#endif
gboolean
modest_toolkit_utils_select_attachments (GtkWindow *window, TnyList *att_list, gboolean include_msgs)