#include <modest-ui-constants.h>
#include <modest-icon-names.h>
#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)
{
- ConnectAndWaitData *data = NULL;
gboolean device_online;
TnyDevice *device;
TnyConnectionStatus conn_status;
const gchar *animation_name,
const gchar *text)
{
- return;
+ return NULL;
}
typedef struct
{
/* GTK_RESPONSE_HELP means we need to show the certificate */
if (response_id == GTK_RESPONSE_APPLY) {
- GtkWidget *note;
gchar *msg;
/* Do not close the dialog */
g_signal_stop_emission_by_name (dialog, "response");
msg = g_strdup_printf (_("mcen_ni_view_unknown_certificate"), cert);
- note = modest_platform_information_banner (NULL, NULL, msg);
- gtk_dialog_run (GTK_DIALOG(note));
- gtk_widget_destroy (note);
+ modest_platform_run_information_dialog (NULL, msg, TRUE);
}
}
_HL("wdgt_bd_no"), GTK_RESPONSE_CANCEL,
NULL, NULL);
- modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
- (GtkWindow *) note, (GtkWindow *) win);
-
g_signal_connect (G_OBJECT(note), "response",
G_CALLBACK(on_cert_dialog_response),
(gpointer) certificate);
gboolean retval = TRUE;
if (is_question) {
+ GtkWidget *dialog;
/* The Tinymail documentation says that we should show Yes and No buttons,
* when it is a question.
* Obviously, we need tinymail to use more specific error codes instead,
on_destroy_dialog (dialog);
} else {
/* Just show the error text and use the default response: */
- modest_platform_run_information_dialog (GTK_WINDOW (top_win),
+ modest_platform_run_information_dialog (NULL,
prompt, FALSE);
}
return retval;
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
GtkWidget *dialog;
/* Create dialog */
- dialog = modest_hildon2_details_dialog_new_with_folder (parent_window, folder);
+ dialog = modest_toolkit_factory_create_details_dialog_with_folder (modest_runtime_get_toolkit_factory (),
+ parent_window, folder);
/* Run dialog */
modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
GtkWidget *dialog;
/* Create dialog */
- dialog = modest_hildon2_details_dialog_new_with_header (parent_window, header, !async_get_size);
+ dialog = modest_toolkit_factory_create_details_dialog_with_header (modest_runtime_get_toolkit_factory (),
+ parent_window, header, !async_get_size);
if (async_get_size && msg && TNY_IS_MSG (msg)) {
HeaderDetailsGetSizeInfo *info;
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"