AC_DEFINE_UNQUOTED(MODEST_HAVE_EASYSETUP, 1, ["Whether we have the easysetup feature"])
fi
AM_CONDITIONAL(MODEST_HAVE_EASYSETUP,test "x$have_easysetup" == "xtrue")
+AM_CONDITIONAL(MODEST_IS_TOOLKIT_HILDON1, [test "x$with_toolkit" == "xhildon1"])
AC_SUBST(MODEST_TOOLKIT)
AC_SUBST(MODEST_TOOLKIT_DIR)
ModestWindow *main_win = NULL;
gdk_threads_enter ();
- main_win = modest_window_mgr_get_main_window (modest_runtime_get_window_mgr (), FALSE);
+ main_win = modest_window_mgr_get_current_top (modest_runtime_get_window_mgr ());
modest_platform_run_information_dialog (GTK_WINDOW (main_win),
dgettext("ke-recv","memr_ib_operation_disabled"),
TRUE);
GType window_type,
gboolean show_toolbars,
gboolean fullscreen);
-static ModestWindow* modest_hildon2_window_mgr_get_main_window (ModestWindowMgr *self, gboolean show);
static GtkWindow *modest_hildon2_window_mgr_get_modal (ModestWindowMgr *self);
static void modest_hildon2_window_mgr_set_modal (ModestWindowMgr *self,
GtkWindow *window,
mgr_class->set_fullscreen_mode = modest_hildon2_window_mgr_set_fullscreen_mode;
mgr_class->get_fullscreen_mode = modest_hildon2_window_mgr_get_fullscreen_mode;
mgr_class->show_toolbars = modest_hildon2_window_mgr_show_toolbars;
- mgr_class->get_main_window = modest_hildon2_window_mgr_get_main_window;
mgr_class->get_modal = modest_hildon2_window_mgr_get_modal;
mgr_class->set_modal = modest_hildon2_window_mgr_set_modal;
mgr_class->find_registered_header = modest_hildon2_window_mgr_find_registered_header;
}
g_mutex_free (priv->queue_lock);
- /* Do not unref priv->main_window because it does not hold a
- new reference */
-
G_OBJECT_CLASS(parent_class)->finalize (obj);
}
return;
}
-static ModestWindow*
-modest_hildon2_window_mgr_get_main_window (ModestWindowMgr *self, gboolean show)
-{
- return NULL;
-}
-
static gint
look_for_transient (gconstpointer a,
gconstpointer b)
/* Note that if the rename fails new_folder will be NULL */
if (new_folder) {
modest_folder_view_select_folder (folder_view, new_folder, FALSE);
+#ifndef MODEST_TOOLKIT_HILDON2
} else {
modest_folder_view_select_first_inbox_or_local (folder_view);
+#endif
}
gtk_widget_grab_focus (GTK_WIDGET (folder_view));
}
mail_op);
modest_mail_operation_remove_folder (mail_op, TNY_FOLDER (info->folder), info->move_to_trash);
+#ifndef MODEST_TOOLKIT_HILDON2
modest_folder_view_select_first_inbox_or_local (MODEST_FOLDER_VIEW (folder_view));
+#endif
g_object_unref (mail_op);
g_object_unref (info->folder);
gint attachments_sort_id;
gint priority_sort_id;
GtkTreeSortable *sortable;
-
+
/* Get header window */
+#ifndef MODEST_TOOLKIT_HILDON2
if (MODEST_IS_MAIN_WINDOW (parent_window)) {
header_view = MODEST_HEADER_VIEW(modest_main_window_get_child_widget (MODEST_MAIN_WINDOW(parent_window),
MODEST_MAIN_WINDOW_WIDGET_TYPE_HEADER_VIEW));
-#ifdef MODEST_TOOLKIT_HILDON2
- } else if (MODEST_IS_HEADER_WINDOW (parent_window)) {
+ }
+#else
+ if (MODEST_IS_HEADER_WINDOW (parent_window)) {
header_view = MODEST_HEADER_VIEW (modest_header_window_get_header_view (MODEST_HEADER_WINDOW (parent_window)));
-#endif
-
}
+#endif
if (!header_view)
return;
-
+
/* Add sorting keys */
cols = modest_header_view_get_columns (header_view);
if (cols == NULL)
modest_conf_set_int (conf, key, width, NULL);
g_free (key);
+#ifndef MODEST_TOOLKIT_HILDON2
/* Save also the main window style */
if (MODEST_IS_MAIN_WINDOW (win)) {
ModestMainWindowStyle style = modest_main_window_get_style (MODEST_MAIN_WINDOW (win));
modest_conf_set_int (conf, key, style, NULL);
g_free (key);
}
-
+#endif
return TRUE;
}
gtk_window_set_default_size (win, width, height);
#endif
+#ifndef MODEST_TOOLKIT_HILDON2
/* Restore also the main window style */
if (MODEST_IS_MAIN_WINDOW (win)) {
ModestMainWindowStyle style;
g_free (key);
}
}
+#endif
return TRUE;
}
modest-global-settings-dialog.h \
modest-gtkhtml-mime-part-view.c \
modest-gtkhtml-mime-part-view.h \
- modest-hildon1-window-mgr.c \
- modest-hildon1-window-mgr.h \
modest-hbox-cell-renderer.c \
modest-hbox-cell-renderer.h \
modest-vbox-cell-renderer.c \
modest-zoomable.h \
modest-zoomable.c
+if MODEST_IS_TOOLKIT_HILDON1
+libmodest_widgets_la_SOURCES+= \
+ modest-hildon1-window-mgr.c \
+ modest-hildon1-window-mgr.h
+endif
+
if BUILD_MOZEMBED
libmodest_widgets_la_SOURCES+= \
modest-mozembed-msg-view.c \
modest-mozembed-msg-view.h \
modest-mozembed-mime-part-view.cpp \
- modest-mozembed-mime-part-view.h
+ modest-mozembed-mime-part-view.h
endif
libmodest_widgets_la_includedir = $(includedir)/modest-plugin-1.0/widgets/
ModestConfNotificationId notification_id,
ModestFolderView *self);
+#ifndef MODEST_TOOLKIT_HILDON2
/* DnD functions */
static void on_drag_data_get (GtkWidget *widget,
GdkDragContext *context,
guint time,
gpointer user_data);
-static void expand_root_items (ModestFolderView *self);
+static void setup_drag_and_drop (GtkTreeView *self);
+
+static void on_row_inserted_maybe_select_folder (GtkTreeModel *tree_model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ ModestFolderView *self);
static gint expand_row_timeout (gpointer data);
+#endif
-static void setup_drag_and_drop (GtkTreeView *self);
+static void expand_root_items (ModestFolderView *self);
static gboolean _clipboard_set_selected_data (ModestFolderView *folder_view,
gboolean delete);
static void _clear_hidding_filter (ModestFolderView *folder_view);
-#ifndef MODEST_TOOLKIT_HILDON2
-static void on_row_inserted_maybe_select_folder (GtkTreeModel *tree_model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- ModestFolderView *self);
-#endif
-
static void on_display_name_changed (ModestAccountMgr *self,
const gchar *account,
gpointer user_data);
/* Build treeview */
add_columns (GTK_WIDGET (obj));
+#ifndef MODEST_TOOLKIT_HILDON2
/* Setup drag and drop */
setup_drag_and_drop (GTK_TREE_VIEW(obj));
+#endif
/* Connect signals */
g_signal_connect (G_OBJECT (obj),
modest_folder_view_update_model (MODEST_FOLDER_VIEW (self), account_store);
priv->reselect = FALSE;
+#ifndef MODEST_TOOLKIT_HILDON2
modest_folder_view_select_first_inbox_or_local (MODEST_FOLDER_VIEW (self));
+#endif
g_object_unref (G_OBJECT (device));
}
return same_account;
}
+#ifndef MODEST_TOOLKIT_HILDON2
/**
*
* Selects the first inbox or the local account in an idle
return FALSE;
}
+#endif
static void
on_account_changed (TnyAccountStore *account_store,
/* Refilter the model */
gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (filter_model));
+#ifndef MODEST_TOOLKIT_HILDON2
/* Select the first INBOX if the currently selected folder
belongs to the account that is being deleted */
if (same_account && !MODEST_IS_TNY_LOCAL_FOLDERS_ACCOUNT (tny_account))
g_idle_add (on_idle_select_first_inbox_or_local, self);
+#endif
}
static void
/* Refilter the model */
gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (filter_model));
+#ifndef MODEST_TOOLKIT_HILDON2
/* Select the first INBOX if the currently selected folder
belongs to the account that is being deleted */
if (same_account)
g_idle_add (on_idle_select_first_inbox_or_local, self);
+#endif
}
void
deathlock situation */
/* TODO: check if this is still the case */
priv->reselect = FALSE;
+#ifndef MODEST_TOOLKIT_HILDON2
modest_folder_view_select_first_inbox_or_local (self);
+#endif
/* Notify the display name observers */
g_signal_emit (G_OBJECT(self),
signals[FOLDER_DISPLAY_NAME_CHANGED_SIGNAL], 0,
return cmp;
}
+#ifndef MODEST_TOOLKIT_HILDON2
/*****************************************************************************/
/* DRAG and DROP stuff */
/*****************************************************************************/
return folder;
}
-
/*
* This function is used by drag_data_received_cb to manage drag and
* drop of a header, i.e, and drag from the header view to the folder
/* Set up the folder view as a dnd destination. Set only the
highlight flag, otherwise gtk will have a different
behaviour */
-#ifdef MODEST_TOOLKIT_HILDON2
- return;
-#endif
gtk_drag_dest_set (GTK_WIDGET (self),
GTK_DEST_DEFAULT_HIGHLIGHT,
folder_view_drag_types,
G_CALLBACK (drag_drop_cb),
NULL);
}
+#endif
/*
* This function manages the navigation through the folders using the
return FALSE;
}
-
-
-
+#ifndef MODEST_TOOLKIT_HILDON2
void
modest_folder_view_select_first_inbox_or_local (ModestFolderView *self)
{
-#ifndef MODEST_TOOLKIT_HILDON2
GtkTreeModel *model;
GtkTreeIter iter, inbox_iter;
GtkTreeSelection *sel;
/* set focus */
gtk_widget_grab_focus (GTK_WIDGET(self));
-#endif
}
-
+#endif
/* recursive */
static gboolean
GType window_type,
gboolean show_toolbars,
gboolean fullscreen);
+#ifndef MODEST_TOOLKIT_HILDON2
static ModestWindow* modest_window_mgr_get_main_window_default (ModestWindowMgr *self, gboolean show);
+#endif
static GtkWindow *modest_window_mgr_get_modal_default (ModestWindowMgr *self);
static void modest_window_mgr_set_modal_default (ModestWindowMgr *self,
GtkWindow *window,
struct _ModestWindowMgrPrivate {
guint banner_counter;
+#ifndef MODEST_TOOLKIT_HILDON2
ModestWindow *main_window;
-
+#endif
GSList *windows_that_prevent_hibernation;
GSList *preregistered_uids;
-
+
guint closing_time;
GtkWidget *cached_view;
mgr_class->set_fullscreen_mode = modest_window_mgr_set_fullscreen_mode_default;
mgr_class->get_fullscreen_mode = modest_window_mgr_get_fullscreen_mode_default;
mgr_class->show_toolbars = modest_window_mgr_show_toolbars_default;
+#ifndef MODEST_TOOLKIT_HILDON2
mgr_class->get_main_window = modest_window_mgr_get_main_window_default;
+#endif
mgr_class->get_modal = modest_window_mgr_get_modal_default;
mgr_class->set_modal = modest_window_mgr_set_modal_default;
mgr_class->close_all_windows = modest_window_mgr_close_all_windows_default;
priv = MODEST_WINDOW_MGR_GET_PRIVATE(obj);
priv->banner_counter = 0;
+#ifndef MODEST_TOOLKIT_HILDON2
priv->main_window = NULL;
-
+#endif
priv->preregistered_uids = NULL;
priv->closing_time = 0;
self);
}
+#ifndef MODEST_TOOLKIT_HILDON2
/* Check that it's not a second main window */
if (MODEST_IS_MAIN_WINDOW (window)) {
if (priv->main_window) {
priv->main_window = window;
}
}
+#endif
/* remove from the list of pre-registered uids */
if (MODEST_IS_MSG_VIEW_WINDOW(window)) {
(MODEST_MSG_VIEW_WINDOW (window));
MODEST_DEBUG_BLOCK(g_debug ("registering window for %s", uid ? uid : "<none>"););
-
+
if (has_uid (priv->preregistered_uids, uid)) {
priv->preregistered_uids =
remove_uid (priv->preregistered_uids,
} else if (MODEST_IS_MSG_EDIT_WINDOW(window)) {
const gchar *uid = modest_msg_edit_window_get_message_uid
(MODEST_MSG_EDIT_WINDOW (window));
-
+
MODEST_DEBUG_BLOCK(g_debug ("registering window for %s", uid););
priv->preregistered_uids =
return FALSE;
}
-void
+void
modest_window_mgr_show_toolbars (ModestWindowMgr *self,
GType window_type,
gboolean show_toolbars,
return MODEST_WINDOW_MGR_GET_CLASS (self)->show_toolbars (self, window_type, show_toolbars, fullscreen);
}
-static void
+static void
modest_window_mgr_show_toolbars_default (ModestWindowMgr *self,
GType window_type,
gboolean show_toolbars,
return;
}
+#ifndef MODEST_TOOLKIT_HILDON2
void
modest_window_mgr_set_main_window (ModestWindowMgr *self, ModestWindow *win)
{
ModestWindowMgrPrivate *priv;
-
+
g_return_if_fail (MODEST_IS_WINDOW_MGR (self));
priv = MODEST_WINDOW_MGR_GET_PRIVATE (self);
priv->main_window = win;
}
-ModestWindow*
+ModestWindow*
modest_window_mgr_get_main_window (ModestWindowMgr *self, gboolean show)
{
return MODEST_WINDOW_MGR_GET_CLASS (self)->get_main_window (self, show);
}
-static ModestWindow*
+static ModestWindow*
modest_window_mgr_get_main_window_default (ModestWindowMgr *self, gboolean show)
{
ModestWindowMgrPrivate *priv;
-
+
g_return_val_if_fail (MODEST_IS_WINDOW_MGR (self), NULL);
priv = MODEST_WINDOW_MGR_GET_PRIVATE (self);
if (priv->main_window)
return priv->main_window;
- if (show)
+ if (show)
return modest_main_window_new ();
else return NULL;
}
modest_window_mgr_main_window_exists (ModestWindowMgr *self)
{
ModestWindowMgrPrivate *priv;
-
+
g_return_val_if_fail (MODEST_IS_WINDOW_MGR (self), FALSE);
priv = MODEST_WINDOW_MGR_GET_PRIVATE (self);
return priv->main_window != NULL;
}
-
+#endif
GtkWindow *
modest_window_mgr_get_modal (ModestWindowMgr *self)
g_list_free (window_list);
}
+#ifndef MODEST_TOOLKIT_HILDON2
/* Do not take into account the main window if it was hidden */
if (num_windows && priv->main_window && !GTK_WIDGET_VISIBLE (priv->main_window))
num_windows--;
+#endif
return num_windows + priv->banner_counter;
}
static ModestWindow *
modest_window_mgr_show_initial_window_default (ModestWindowMgr *self)
{
+#ifndef MODEST_TOOLKIT_HILDON2
/* By default it returns the main window creating it if
needed */
return modest_window_mgr_get_main_window (self, TRUE);
+#else
+ return NULL;
+#endif
}
GType window_type,
gboolean show_toolbars,
gboolean fullscreen);
+#ifndef MODEST_TOOLKIT_HILDON2
ModestWindow * (*get_main_window) (ModestWindowMgr *self,
gboolean show);
+#endif
gboolean (*close_all_windows) (ModestWindowMgr *self);
GtkWindow * (*get_modal) (ModestWindowMgr *self);
void (*set_modal) (ModestWindowMgr *self,
GType window_type,
gboolean show_toolbars,
gboolean fullscreen);
+#ifndef MODEST_TOOLKIT_HILDON2
/**
* modest_window_mgr_get_main_window:
* @self: a #ModestWindowMgr
* Returns: TRUE if there's a main window, FALSE otherwise
**/
gboolean modest_window_mgr_main_window_exists (ModestWindowMgr *self);
-
-
+#endif
/**
* modest_window_mgr_get_modal: