#include <modest-count-stream.h>
#include <modest-gtk-details-dialog.h>
#include <math.h>
-
+#include "widgets/modest-toolkit-utils.h"
#define HILDON_OSSO_URI_ACTION "uri-action"
#define URI_ACTION_COPY "copy:"
#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,
static gboolean
check_required_files (void)
{
+#if 0
FILE *mcc_file = modest_utils_open_mcc_mapping_file ();
if (!mcc_file) {
g_printerr ("modest: cannot find providers data\n");
return FALSE;
}
-
+#endif
return TRUE;
}
GdkPixbuf*
modest_platform_get_icon (const gchar *name, guint icon_size)
{
- g_warning ("Not implemented %s", __FUNCTION__);
-
- return NULL;
+ return gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
+ name,
+ icon_size,
+ 0,
+ NULL);
}
const gchar*
}
gint
-modest_platform_run_rename_folder_dialog (GtkWindow *parent_window,
+modest_platform_run_rename_folder_dialog (ModestWindow *parent_window,
TnyFolderStore *parent_folder,
const gchar *suggested_name,
gchar **folder_name)
{
g_return_val_if_fail (TNY_IS_FOLDER_STORE (parent_folder), GTK_RESPONSE_REJECT);
- return modest_platform_run_folder_common_dialog (parent_window,
+ return modest_platform_run_folder_common_dialog (gtk_widget_get_toplevel (GTK_WIDGET (parent_window)),
parent_folder,
_HL("ckdg_ti_rename_folder"),
_HL("ckdg_fi_rename_name"),
} 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"