Commit 7c0c40f8 authored by Matthew Barnes's avatar Matthew Barnes

Reorder accounts by drag-and-drop.

This implements https://bugzilla.gnome.org/show_bug.cgi?id=663527#c3.

Account reordering is now done by drag-and-drop instead of up/down
buttons.

Turned out to be a wee bit more complicated than I initially thought.

This scraps EAccountManager and EAccountTreeView and replaces them with
new classes centered around EMailAccountStore, which EMailSession owns.

EMailAccountStore is the model behind the account list in Preferences.
The folder tree model now uses it to sort its own top-level rows using
gtk_tree_path_compare().  It also broadcasts account operations through
signals so we don't have to rely so heavily on EAccountList signals,
since EAccountList is going away soon.

Also as part of this work, the e-mail-local.h and e-mail-store.h APIs
have been merged into EMailSession and MailFolderCache.
parent 2f32e1cc
......@@ -40,7 +40,6 @@
#include <mail/em-composer-utils.h>
#include <mail/mail-config.h>
#include <mail/mail-mt.h>
#include <mail/e-mail-store.h>
#include <shell/e-shell.h>
......@@ -208,7 +207,6 @@ mail_capplet_shell_construct (MailCappletShell *shell,
GtkStyle *style = gtk_widget_get_default_style ();
EShell *eshell;
EMailSession *session;
gchar *custom_dir;
gtk_window_set_icon_name ((GtkWindow *)shell, "evolution");
gtk_window_set_title ((GtkWindow *)shell, _("Evolution account assistant"));
......@@ -277,9 +275,6 @@ mail_capplet_shell_construct (MailCappletShell *shell,
mail_config_init (session);
mail_msg_init ();
custom_dir = g_build_filename (e_get_user_data_dir (), "mail", NULL);
e_mail_store_init (session, custom_dir);
g_free (custom_dir);
if (just_druid) {
MailViewChild *mc;
......
......@@ -7,6 +7,7 @@ BOOLEAN:INT,POINTER,INT,BOXED
BOOLEAN:INT,POINTER,INT,OBJECT,INT,INT,UINT
BOOLEAN:NONE
BOOLEAN:OBJECT
BOOLEAN:OBJECT,OBJECT
BOOLEAN:OBJECT,DOUBLE,DOUBLE,BOOLEAN
BOOLEAN:POINTER
BOOLEAN:POINTER,BOOLEAN,POINTER
......
......@@ -46,6 +46,9 @@ libevolution_mail_la_CPPFLAGS = \
mailinclude_HEADERS = \
e-mail.h \
e-mail-account-manager.h \
e-mail-account-store.h \
e-mail-account-tree-view.h \
e-mail-attachment-bar.h \
e-mail-backend.h \
e-mail-browser.h \
......@@ -61,7 +64,6 @@ mailinclude_HEADERS = \
e-mail-label-list-store.h \
e-mail-label-manager.h \
e-mail-label-tree-view.h \
e-mail-local.h \
e-mail-message-pane.h \
e-mail-migrate.h \
e-mail-notebook-view.h \
......@@ -72,7 +74,6 @@ mailinclude_HEADERS = \
e-mail-session.h \
e-mail-sidebar.h \
e-mail-store-utils.h \
e-mail-store.h \
e-mail-tag-editor.h \
e-mail-view.h \
em-account-editor.h \
......@@ -121,6 +122,9 @@ mailinclude_HEADERS += \
endif
libevolution_mail_la_SOURCES = \
e-mail-account-manager.c \
e-mail-account-store.c \
e-mail-account-tree-view.c \
e-mail-attachment-bar.c \
e-mail-backend.c \
e-mail-browser.c \
......@@ -135,7 +139,6 @@ libevolution_mail_la_SOURCES = \
e-mail-label-list-store.c \
e-mail-label-manager.c \
e-mail-label-tree-view.c \
e-mail-local.c \
e-mail-message-pane.c \
e-mail-migrate.c \
e-mail-notebook-view.c \
......@@ -146,7 +149,6 @@ libevolution_mail_la_SOURCES = \
e-mail-session.c \
e-mail-sidebar.c \
e-mail-store-utils.c \
e-mail-store.c \
e-mail-tag-editor.c \
e-mail-view.c \
em-account-editor.c \
......
/*
* e-account-manager.h
* e-mail-account-manager.h
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -14,70 +14,65 @@
* You should have received a copy of the GNU Lesser General Public
* License along with the program; if not, see <http://www.gnu.org/licenses/>
*
*
* Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
*
*/
#ifndef E_ACCOUNT_MANAGER_H
#define E_ACCOUNT_MANAGER_H
#ifndef E_MAIL_ACCOUNT_MANAGER_H
#define E_MAIL_ACCOUNT_MANAGER_H
#include <gtk/gtk.h>
#include <libedataserver/e-account-list.h>
#include <misc/e-account-tree-view.h>
#include <e-util/e-account-utils.h>
#include <mail/e-mail-account-store.h>
/* Standard GObject macros */
#define E_TYPE_ACCOUNT_MANAGER \
(e_account_manager_get_type ())
#define E_ACCOUNT_MANAGER(obj) \
#define E_TYPE_MAIL_ACCOUNT_MANAGER \
(e_mail_account_manager_get_type ())
#define E_MAIL_ACCOUNT_MANAGER(obj) \
(G_TYPE_CHECK_INSTANCE_CAST \
((obj), E_TYPE_ACCOUNT_MANAGER, EAccountManager))
#define E_ACCOUNT_MANAGER_CLASS(cls) \
((obj), E_TYPE_MAIL_ACCOUNT_MANAGER, EMailAccountManager))
#define E_MAIL_ACCOUNT_MANAGER_CLASS(cls) \
(G_TYPE_CHECK_CLASS_CAST \
((cls), E_TYPE_ACCOUNT_MANAGER, EAccountManagerClass))
#define E_IS_ACCOUNT_MANAGER(obj) \
((cls), E_TYPE_MAIL_ACCOUNT_MANAGER, EMailAccountManagerClass))
#define E_IS_MAIL_ACCOUNT_MANAGER(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE \
((obj), E_TYPE_ACCOUNT_MANAGER))
#define E_IS_ACCOUNT_MANAGER_CLASS(cls) \
(G_TYPE_CHECK_CLASS_TYPE \
((cls), E_TYPE_ACCOUNT_MANAGER))
#define E_ACCOUNT_MANAGER_GET_CLASS(obj) \
((obj), E_TYPE_MAIL_ACCOUNT_MANAGER))
#define E_IS_MAIL_ACCOUNT_MANAGER_CLASS(cls) \
(G_TYPE_CHECK_INSTANCE_CLASS \
((cls), E_TYPE_MAIL_ACCOUNT_MANAGER))
#define E_MAIL_ACCOUNT_MANAGER_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS \
((obj), E_TYPE_ACCOUNT_MANAGER, EAccountManagerClass))
((obj), E_TYPE_MAIL_ACCOUNT_MANAGER, EMailAccountManagerClass))
G_BEGIN_DECLS
typedef struct _EAccountManager EAccountManager;
typedef struct _EAccountManagerClass EAccountManagerClass;
typedef struct _EAccountManagerPrivate EAccountManagerPrivate;
typedef struct _EMailAccountManager EMailAccountManager;
typedef struct _EMailAccountManagerClass EMailAccountManagerClass;
typedef struct _EMailAccountManagerPrivate EMailAccountManagerPrivate;
struct _EAccountManager {
struct _EMailAccountManager {
GtkTable parent;
EAccountManagerPrivate *priv;
EMailAccountManagerPrivate *priv;
};
struct _EAccountManagerClass {
struct _EMailAccountManagerClass {
GtkTableClass parent_class;
void (*add_account) (EAccountManager *manager);
void (*edit_account) (EAccountManager *manager);
void (*delete_account) (EAccountManager *manager);
/* Signals */
void (*add_account) (EMailAccountManager *manager);
void (*edit_account) (EMailAccountManager *manager,
EAccount *account);
};
GType e_account_manager_get_type (void);
GtkWidget * e_account_manager_new (EAccountList *account_list);
void e_account_manager_add_account (EAccountManager *manager);
void e_account_manager_edit_account (EAccountManager *manager);
void e_account_manager_delete_account
(EAccountManager *manager);
EAccountList * e_account_manager_get_account_list
(EAccountManager *manager);
void e_account_manager_set_account_list
(EAccountManager *manager,
EAccountList *account_list);
EAccountTreeView *
e_account_manager_get_tree_view (EAccountManager *manager);
GType e_mail_account_manager_get_type (void) G_GNUC_CONST;
GtkWidget * e_mail_account_manager_new (EMailAccountStore *store);
EMailAccountStore *
e_mail_account_manager_get_store
(EMailAccountManager *manager);
void e_mail_account_manager_add_account
(EMailAccountManager *manager);
void e_mail_account_manager_edit_account
(EMailAccountManager *manager,
EAccount *account);
G_END_DECLS
#endif /* E_ACCOUNT_MANAGER_H */
#endif /* E_MAIL_ACCOUNT_MANAGER_H */
This diff is collapsed.
/*
* e-mail-account-store.h
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with the program; if not, see <http://www.gnu.org/licenses/>
*
*/
#ifndef E_MAIL_ACCOUNT_STORE_H
#define E_MAIL_ACCOUNT_STORE_H
#include <gtk/gtk.h>
#include <camel/camel.h>
/* Standard GObject macros */
#define E_TYPE_MAIL_ACCOUNT_STORE \
(e_mail_account_store_get_type ())
#define E_MAIL_ACCOUNT_STORE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST \
((obj), E_TYPE_MAIL_ACCOUNT_STORE, EMailAccountStore))
#define E_MAIL_ACCOUNT_STORE_CLASS(cls) \
(G_TYPE_CHECK_CLASS_CAST \
((cls), E_TYPE_MAIL_ACCOUNT_STORE, EMailAccountStoreClass))
#define E_IS_MAIL_ACCOUNT_STORE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE \
((obj), E_TYPE_MAIL_ACCOUNT_STORE))
#define E_IS_MAIL_ACOCUNT_STORE_CLASS(cls) \
(G_TYPE_CHECK_CLASS_TYPE \
((cls), E_TYPE_MAIL_ACCOUNT_STORE))
#define E_MAIL_ACCOUNT_STORE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS \
((obj), E_TYPE_MAIL_ACCOUNT_STORE, EMailAccountStoreClass))
G_BEGIN_DECLS
/* Avoid a circular dependency. */
typedef struct _EMailSession EMailSession;
typedef enum {
E_MAIL_ACCOUNT_STORE_COLUMN_SERVICE,
E_MAIL_ACCOUNT_STORE_COLUMN_BUILTIN,
E_MAIL_ACCOUNT_STORE_COLUMN_ENABLED,
E_MAIL_ACCOUNT_STORE_COLUMN_DEFAULT,
E_MAIL_ACCOUNT_STORE_COLUMN_BACKEND_NAME,
E_MAIL_ACCOUNT_STORE_COLUMN_DISPLAY_NAME,
E_MAIL_ACCOUNT_STORE_NUM_COLUMNS
} EMailAccountStoreColumn;
typedef struct _EMailAccountStore EMailAccountStore;
typedef struct _EMailAccountStoreClass EMailAccountStoreClass;
typedef struct _EMailAccountStorePrivate EMailAccountStorePrivate;
struct _EMailAccountStore {
GtkListStore parent;
EMailAccountStorePrivate *priv;
};
struct _EMailAccountStoreClass {
GtkListStoreClass parent_class;
/* Signals */
void (*service_added) (EMailAccountStore *store,
CamelService *service);
void (*service_removed) (EMailAccountStore *store,
CamelService *service);
void (*service_enabled) (EMailAccountStore *store,
CamelService *service);
void (*service_disabled) (EMailAccountStore *store,
CamelService *service);
void (*services_reordered) (EMailAccountStore *store,
gboolean default_restored);
/* These signals are for confirmation dialogs.
* Signal handler should return FALSE to abort. */
gboolean (*remove_requested) (EMailAccountStore *store,
GtkWindow *parent_window,
CamelService *service);
gboolean (*enable_requested) (EMailAccountStore *store,
GtkWindow *parent_window,
CamelService *service);
gboolean (*disable_requested) (EMailAccountStore *store,
GtkWindow *parent_window,
CamelService *service);
};
GType e_mail_account_store_get_type (void) G_GNUC_CONST;
EMailAccountStore *
e_mail_account_store_new (EMailSession *session);
void e_mail_account_store_clear (EMailAccountStore *store);
gboolean e_mail_account_store_get_busy (EMailAccountStore *store);
EMailSession * e_mail_account_store_get_session
(EMailAccountStore *store);
CamelService * e_mail_account_store_get_default_service
(EMailAccountStore *store);
void e_mail_account_store_set_default_service
(EMailAccountStore *store,
CamelService *service);
gboolean e_mail_account_store_get_express_mode
(EMailAccountStore *store);
void e_mail_account_store_set_express_mode
(EMailAccountStore *store,
gboolean express_mode);
void e_mail_account_store_add_service
(EMailAccountStore *store,
CamelService *service);
void e_mail_account_store_remove_service
(EMailAccountStore *store,
GtkWindow *parent_window,
CamelService *service);
void e_mail_account_store_enable_service
(EMailAccountStore *store,
GtkWindow *parent_window,
CamelService *service);
void e_mail_account_store_disable_service
(EMailAccountStore *store,
GtkWindow *parent_window,
CamelService *service);
void e_mail_account_store_reorder_services
(EMailAccountStore *store,
GQueue *ordered_services);
gint e_mail_account_store_compare_services
(EMailAccountStore *store,
CamelService *service_a,
CamelService *service_b);
gboolean e_mail_account_store_load_sort_order
(EMailAccountStore *store,
GError **error);
gboolean e_mail_account_store_save_sort_order
(EMailAccountStore *store,
GError **error);
G_END_DECLS
#endif /* E_MAIL_ACCOUNT_STORE_H */
/*
* e-mail-account-tree-view.c
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with the program; if not, see <http://www.gnu.org/licenses/>
*
*/
#include "e-mail-account-tree-view.h"
#include <config.h>
#include <glib/gi18n-lib.h>
#define E_MAIL_ACCOUNT_TREE_VIEW_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_MAIL_ACCOUNT_TREE_VIEW, EMailAccountTreeViewPrivate))
struct _EMailAccountTreeViewPrivate {
gint placeholder;
};
enum {
ENABLE,
DISABLE,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL];
G_DEFINE_TYPE (
EMailAccountTreeView,
e_mail_account_tree_view,
GTK_TYPE_TREE_VIEW)
static void
mail_account_tree_view_enabled_toggled_cb (GtkCellRendererToggle *cell_renderer,
const gchar *path_string,
EMailAccountTreeView *tree_view)
{
GtkTreeSelection *selection;
GtkTreePath *path;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
/* Change the selection first so we act on the correct service. */
path = gtk_tree_path_new_from_string (path_string);
gtk_tree_selection_select_path (selection, path);
gtk_tree_path_free (path);
if (gtk_cell_renderer_toggle_get_active (cell_renderer))
g_signal_emit (tree_view, signals[DISABLE], 0);
else
g_signal_emit (tree_view, signals[ENABLE], 0);
}
static void
mail_account_tree_view_constructed (GObject *object)
{
GtkTreeView *tree_view;
GtkTreeViewColumn *column;
GtkCellRenderer *cell_renderer;
/* Chain up to parent's constructed() method. */
G_OBJECT_CLASS (e_mail_account_tree_view_parent_class)->
constructed (object);
tree_view = GTK_TREE_VIEW (object);
gtk_tree_view_set_reorderable (tree_view, TRUE);
/* Column: Enabled */
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_expand (column, FALSE);
gtk_tree_view_column_set_title (column, _("Enabled"));
cell_renderer = gtk_cell_renderer_toggle_new ();
gtk_tree_view_column_pack_start (column, cell_renderer, TRUE);
g_signal_connect (
cell_renderer, "toggled",
G_CALLBACK (mail_account_tree_view_enabled_toggled_cb),
tree_view);
gtk_tree_view_column_add_attribute (
column, cell_renderer, "active",
E_MAIL_ACCOUNT_STORE_COLUMN_ENABLED);
gtk_tree_view_append_column (tree_view, column);
/* Column: Account Name */
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_expand (column, TRUE);
gtk_tree_view_column_set_title (column, _("Account Name"));
cell_renderer = gtk_cell_renderer_text_new ();
g_object_set (cell_renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
gtk_tree_view_column_pack_start (column, cell_renderer, TRUE);
gtk_tree_view_column_add_attribute (
column, cell_renderer, "text",
E_MAIL_ACCOUNT_STORE_COLUMN_DISPLAY_NAME);
cell_renderer = gtk_cell_renderer_text_new ();
g_object_set (cell_renderer, "text", _("Default"), NULL);
gtk_tree_view_column_pack_end (column, cell_renderer, FALSE);
gtk_tree_view_column_add_attribute (
column, cell_renderer, "visible",
E_MAIL_ACCOUNT_STORE_COLUMN_DEFAULT);
cell_renderer = gtk_cell_renderer_pixbuf_new ();
g_object_set (
cell_renderer, "icon-name", "emblem-default",
"stock-size", GTK_ICON_SIZE_MENU, NULL);
gtk_tree_view_column_pack_end (column, cell_renderer, FALSE);
gtk_tree_view_column_add_attribute (
column, cell_renderer, "visible",
E_MAIL_ACCOUNT_STORE_COLUMN_DEFAULT);
gtk_tree_view_append_column (tree_view, column);
/* Column: Type */
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_expand (column, FALSE);
gtk_tree_view_column_set_title (column, _("Type"));
cell_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (column, cell_renderer, TRUE);
gtk_tree_view_column_add_attribute (
column, cell_renderer, "text",
E_MAIL_ACCOUNT_STORE_COLUMN_BACKEND_NAME);
gtk_tree_view_append_column (tree_view, column);
}
static void
mail_account_tree_view_drag_end (GtkWidget *widget,
GdkDragContext *context)
{
GtkTreeModel *tree_model;
/* Chain up to parent's drag_end() method. */
GTK_WIDGET_CLASS (e_mail_account_tree_view_parent_class)->
drag_end (widget, context);
tree_model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
g_return_if_fail (E_IS_MAIL_ACCOUNT_STORE (tree_model));
g_signal_emit_by_name (tree_model, "services-reordered", FALSE);
}
static void
e_mail_account_tree_view_class_init (EMailAccountTreeViewClass *class)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
g_type_class_add_private (class, sizeof (EMailAccountTreeViewPrivate));
object_class = G_OBJECT_CLASS (class);
object_class->constructed = mail_account_tree_view_constructed;
widget_class = GTK_WIDGET_CLASS (class);
widget_class->drag_end = mail_account_tree_view_drag_end;
signals[ENABLE] = g_signal_new (
"enable",
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EMailAccountTreeViewClass, enable),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
signals[DISABLE] = g_signal_new (
"disable",
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EMailAccountTreeViewClass, disable),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
}
static void
e_mail_account_tree_view_init (EMailAccountTreeView *tree_view)
{
tree_view->priv = E_MAIL_ACCOUNT_TREE_VIEW_GET_PRIVATE (tree_view);
}
GtkWidget *
e_mail_account_tree_view_new (EMailAccountStore *store)
{
g_return_val_if_fail (E_IS_MAIL_ACCOUNT_STORE (store), NULL);
return g_object_new (
E_TYPE_MAIL_ACCOUNT_TREE_VIEW,
"model", store, NULL);
}
CamelService *
e_mail_account_tree_view_get_selected_service (EMailAccountTreeView *tree_view)
{
GtkTreeSelection *selection;
GtkTreeModel *tree_model;
GtkTreeIter iter;
CamelService *service;
GValue value = G_VALUE_INIT;
gint column;
g_return_val_if_fail (E_IS_MAIL_ACCOUNT_TREE_VIEW (tree_view), NULL);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
if (!gtk_tree_selection_get_selected (selection, &tree_model, &iter))
return NULL;
/* By convention, "get" functions don't return a new object
* reference, so use gtk_tree_model_get_value() to avoid it.
* The caller can always reference the object if needed. */
column = E_MAIL_ACCOUNT_STORE_COLUMN_SERVICE;
gtk_tree_model_get_value (tree_model, &iter, column, &value);
service = g_value_get_object (&value);
g_value_unset (&value);
g_warn_if_fail (CAMEL_IS_SERVICE (service));
return service;
}
void
e_mail_account_tree_view_set_selected_service (EMailAccountTreeView *tree_view,
CamelService *service)
{
GtkTreeSelection *selection;
GtkTreeModel *tree_model;
GtkTreeIter iter;
gboolean iter_set;
g_return_if_fail (E_IS_MAIL_ACCOUNT_TREE_VIEW (tree_view));
g_return_if_fail (CAMEL_IS_SERVICE (service));
tree_model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view));
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
iter_set = gtk_tree_model_get_iter_first (tree_model, &iter);
while (iter_set) {
GValue value = G_VALUE_INIT;
CamelService *candidate;
gint column;
column = E_MAIL_ACCOUNT_STORE_COLUMN_SERVICE;
gtk_tree_model_get_value (tree_model, &iter, column, &value);
candidate = g_value_get_object (&value);
g_value_unset (&value);
g_warn_if_fail (CAMEL_IS_SERVICE (candidate));
if (service == candidate) {
gtk_tree_selection_select_iter (selection, &iter);
break;
}
iter_set = gtk_tree_model_iter_next (tree_model, &iter);
}
}
/*
* e-mail-account-tree-view.h
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with the program; if not, see <http://www.gnu.org/licenses/>
*
*/
#ifndef E_MAIL_ACCOUNT_TREE_VIEW_H
#define E_MAIL_ACCOUNT_TREE_VIEW_H
#include <gtk/gtk.h>
#include <mail/e-mail-account-store.h>
/* Standard GObject macros */
#define E_TYPE_MAIL_ACCOUNT_TREE_VIEW \
(e_mail_account_tree_view_get_type ())
#define E_MAIL_ACCOUNT_TREE_VIEW(obj) \
(G_TYPE_CHECK_INSTANCE_CAST \
((obj), E_TYPE_MAIL_ACCOUNT_TREE_VIEW, EMailAccountTreeView))
#define E_MAIL_ACCOUNT_TREE_VIEW_CLASS(cls) \
(G_TYPE_CHECK_CLASS_CAST \
((cls), E_TYPE_MAIL_ACCOUNT_TREE_VIEW, EMailAccountTreeViewClass))
#define E_IS_MAIL_ACCOUNT_TREE_VIEW(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE \
((obj), E_TYPE_MAIL_ACCOUNT_TREE_VIEW))
#define E_IS_MAIL_ACCOUNT_TREE_VIEW_CLASS(cls) \
(G_TYPE_CHECK_CLASS_TYPE \
((cls), E_TYPE_MAIL_ACCOUNT_TREE_VIEW))
#define E_MAIL_ACCOUNT_TREE_VIEW_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS \
((obj), E_TYPE_MAIL_ACCOUNT_TREE_VIEW, EMailAccountTreeViewClass))
G_BEGIN_DECLS
typedef struct _EMailAccountTreeView EMailAccountTreeView;
typedef struct _EMailAccountTreeViewClass EMailAccountTreeViewClass;
typedef struct _EMailAccountTreeViewPrivate EMailAccountTreeViewPrivate;
struct _EMailAccountTreeView {
GtkTreeView parent;
EMailAccountTreeViewPrivate *priv;
};
struct _EMailAccountTreeViewClass {
GtkTreeViewClass parent_class;
/* Signals */
void (*enable) (EMailAccountTreeView *tree_view);
void (*disable) (EMailAccountTreeView *tree_view);
};
GType e_mail_account_tree_view_get_type
(void) G_GNUC_CONST;
GtkWidget * e_mail_account_tree_view_new
(EMailAccountStore *store);
CamelService * e_mail_account_tree_view_get_selected_service
(EMailAccountTreeView *tree_view);
void e_mail_account_tree_view_set_selected_service
(EMailAccountTreeView *tree_view,
CamelService *service);
G_END_DECLS
#endif /* E_MAIL_ACCOUNT_TREE_VIEW_H */
......@@ -41,10 +41,8 @@
#include "shell/e-shell.h"
#include "mail/e-mail-folder-utils.h"
#include "mail/e-mail-local.h"
#include "mail/e-mail-migrate.h"
#include "mail/e-mail-session.h"
#include "mail/e-mail-store.h"
#include "mail/e-mail-store-utils.h"
#include "mail/em-event.h"
#include "mail/em-folder-tree-model.h"
......@@ -71,16 +69,9 @@ enum {
PROP_SESSION
};
enum {
ACCOUNT_SORT_ORDER_CHANGED,
LAST_SIGNAL
};
/* FIXME Kill this thing. It's a horrible hack. */
extern gint camel_application_is_exiting