aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-09-13 12:02:09 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-09-13 12:02:09 +0800
commit7ee6ef65f1019389c172478a80b8f0aa73a1453e (patch)
treee50bcb96372f1fbbe5b53fc64b8200932ef7659d /addressbook
parentdf6a8262a141e0bec824149e7f65568d2187c5c2 (diff)
downloadgsoc2013-evolution-7ee6ef65f1019389c172478a80b8f0aa73a1453e.tar
gsoc2013-evolution-7ee6ef65f1019389c172478a80b8f0aa73a1453e.tar.gz
gsoc2013-evolution-7ee6ef65f1019389c172478a80b8f0aa73a1453e.tar.bz2
gsoc2013-evolution-7ee6ef65f1019389c172478a80b8f0aa73a1453e.tar.lz
gsoc2013-evolution-7ee6ef65f1019389c172478a80b8f0aa73a1453e.tar.xz
gsoc2013-evolution-7ee6ef65f1019389c172478a80b8f0aa73a1453e.tar.zst
gsoc2013-evolution-7ee6ef65f1019389c172478a80b8f0aa73a1453e.zip
Allow EShellContent, EShellSidebar, and EShellTaskbar to be subclassed,
and begin doing so for Calendars, Memos and Tasks. Makes the code cleaner. svn path=/branches/kill-bonobo/; revision=36317
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/gui/component/e-book-shell-view-actions.c2
-rw-r--r--addressbook/gui/component/e-book-shell-view-private.c3
-rw-r--r--addressbook/gui/component/e-book-shell-view-private.h5
-rw-r--r--addressbook/gui/component/e-book-shell-view.c2
-rw-r--r--addressbook/gui/widgets/e-addressbook-selector.c26
-rw-r--r--addressbook/gui/widgets/e-addressbook-selector.h6
6 files changed, 28 insertions, 16 deletions
diff --git a/addressbook/gui/component/e-book-shell-view-actions.c b/addressbook/gui/component/e-book-shell-view-actions.c
index 515531af88..d12f15e1f4 100644
--- a/addressbook/gui/component/e-book-shell-view-actions.c
+++ b/addressbook/gui/component/e-book-shell-view-actions.c
@@ -728,7 +728,7 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view)
}
void
-e_book_shell_view_update_actions (EBookShellView *book_shell_view,
+e_book_shell_view_actions_update (EBookShellView *book_shell_view,
EABView *view)
{
EShellView *shell_view;
diff --git a/addressbook/gui/component/e-book-shell-view-private.c b/addressbook/gui/component/e-book-shell-view-private.c
index 1ed66f8289..037ef035bf 100644
--- a/addressbook/gui/component/e-book-shell-view-private.c
+++ b/addressbook/gui/component/e-book-shell-view-private.c
@@ -190,7 +190,7 @@ book_shell_view_activate_selected_source (EBookShellView *book_shell_view)
g_signal_connect_swapped (
uid_view, "command-state-change",
- G_CALLBACK (e_book_shell_view_update_actions),
+ G_CALLBACK (e_book_shell_view_actions_update),
book_shell_view);
book = e_book_new (source, NULL);
@@ -396,7 +396,6 @@ e_book_shell_view_private_dispose (EBookShellView *book_shell_view)
DISPOSE (priv->contact_actions);
DISPOSE (priv->notebook);
- DISPOSE (priv->scrolled_window);
DISPOSE (priv->selector);
DISPOSE (priv->activity_handler);
diff --git a/addressbook/gui/component/e-book-shell-view-private.h b/addressbook/gui/component/e-book-shell-view-private.h
index 6fbff31c5d..ba805b0dc9 100644
--- a/addressbook/gui/component/e-book-shell-view-private.h
+++ b/addressbook/gui/component/e-book-shell-view-private.h
@@ -33,10 +33,10 @@
#include <shell/e-shell-content.h>
#include <shell/e-shell-sidebar.h>
+#include <shell/e-activity-handler.h>
#include <eab-menu.h>
#include <eab-gui-util.h>
-#include <e-activity-handler.h>
#include <e-addressbook-selector.h>
#include <e-addressbook-view.h>
#include <gal-view-collection.h>
@@ -92,7 +92,6 @@ struct _EBookShellViewPrivate {
/*** Other Stuff ***/
GtkWidget *notebook;
- GtkWidget *scrolled_window;
GtkWidget *selector;
EActivityHandler *activity_handler;
@@ -121,7 +120,7 @@ void e_book_shell_view_private_finalize
void e_book_shell_view_actions_init
(EBookShellView *book_shell_view);
-void e_book_shell_view_update_actions
+void e_book_shell_view_actions_update
(EBookShellView *book_shell_view,
EABView *view);
EABView * e_book_shell_view_get_current_view
diff --git a/addressbook/gui/component/e-book-shell-view.c b/addressbook/gui/component/e-book-shell-view.c
index ce0c8f2b55..262c7da616 100644
--- a/addressbook/gui/component/e-book-shell-view.c
+++ b/addressbook/gui/component/e-book-shell-view.c
@@ -151,7 +151,7 @@ book_shell_view_source_list_changed_cb (EBookShellView *book_shell_view,
#if 0
eab_view_setup_menus (view, bonobo_uic);
#endif
- e_book_shell_view_update_actions (book_shell_view, view);
+ e_book_shell_view_actions_update (book_shell_view, view);
}
}
diff --git a/addressbook/gui/widgets/e-addressbook-selector.c b/addressbook/gui/widgets/e-addressbook-selector.c
index e071e948f4..dfd0e32a7a 100644
--- a/addressbook/gui/widgets/e-addressbook-selector.c
+++ b/addressbook/gui/widgets/e-addressbook-selector.c
@@ -147,6 +147,9 @@ addressbook_selector_drag_leave (GtkWidget *widget,
GdkDragContext *context,
guint time_)
{
+ /* XXX This is exactly the same as in ECalendarSelector.
+ * Consider merging this callback into ESourceSelector. */
+
GtkTreeView *tree_view;
GtkTreeViewDropPosition pos;
@@ -163,6 +166,9 @@ addressbook_selector_drag_motion (GtkWidget *widget,
gint y,
guint time_)
{
+ /* XXX This is exactly the same as in ECalendarSelector.
+ * Consider merging this callback into ESourceSelector. */
+
GtkTreeView *tree_view;
GtkTreeModel *model;
GtkTreePath *path = NULL;
@@ -201,9 +207,9 @@ exit:
gtk_tree_path_free (path);
if (object != NULL)
- g_object_ref (object);
+ g_object_unref (object);
- gdk_drag_status (context, action, GDK_CURRENT_TIME);
+ gdk_drag_status (context, action, time_);
return TRUE;
}
@@ -215,6 +221,9 @@ addressbook_selector_drag_drop (GtkWidget *widget,
gint y,
guint time_)
{
+ /* XXX This is exactly the same as in ECalendarSelector.
+ * Consider merging this callback into ESourceSelector. */
+
GtkTreeView *tree_view;
GtkTreeModel *model;
GtkTreePath *path;
@@ -235,7 +244,7 @@ addressbook_selector_drag_drop (GtkWidget *widget,
g_return_val_if_fail (valid, FALSE);
gtk_tree_model_get (model, &iter, 0, &object, -1);
- drop_zone = !E_IS_SOURCE_GROUP (object);
+ drop_zone = E_IS_SOURCE (object);
g_object_unref (object);
return drop_zone;
@@ -250,6 +259,11 @@ addressbook_selector_drag_data_received (GtkWidget *widget,
guint info,
guint time_)
{
+ /* XXX This is NEARLY the same as in ECalendarSelector.
+ * Consider merging this callback into ESourceSelector.
+ * Use a callback to allow subclasses to handle the
+ * received selection data. */
+
MergeContext *merge_context;
GtkTreeView *tree_view;
GtkTreeModel *model;
@@ -266,7 +280,7 @@ addressbook_selector_drag_data_received (GtkWidget *widget,
tree_view = GTK_TREE_VIEW (widget);
model = gtk_tree_view_get_model (tree_view);
- string = (gchar *) selection_data->data;
+ string = (const gchar *) selection_data->data;
remove_from_source = (context->action == GDK_ACTION_MOVE);
if (!gtk_tree_view_get_dest_row_at_pos (tree_view, x, y, &path, NULL))
@@ -303,10 +317,10 @@ addressbook_selector_drag_data_received (GtkWidget *widget,
success = TRUE;
exit:
- if (path)
+ if (path != NULL)
gtk_tree_path_free (path);
- if (object)
+ if (object != NULL)
g_object_unref (object);
gtk_drag_finish (context, success, remove_from_source, time_);
diff --git a/addressbook/gui/widgets/e-addressbook-selector.h b/addressbook/gui/widgets/e-addressbook-selector.h
index f78442601d..67a2c8f6e5 100644
--- a/addressbook/gui/widgets/e-addressbook-selector.h
+++ b/addressbook/gui/widgets/e-addressbook-selector.h
@@ -34,13 +34,13 @@
(G_TYPE_CHECK_CLASS_CAST \
((cls), E_TYPE_ADDRESSBOOK_SELECTOR, EAddressbookSelectorClass))
#define E_IS_ADDRESSBOOK_SELECTOR(obj) \
- (E_TYPE_CHECK_INSTANCE_TYPE \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
((obj), E_TYPE_ADDRESSBOOK_SELECTOR))
#define E_IS_ADDRESSBOOK_SELECTOR_CLASS(cls) \
- (E_TYPE_CHECK_CLASS_TYPE \
+ (G_TYPE_CHECK_CLASS_TYPE \
((cls), E_TYPE_ADDRESSBOOK_SELECTOR))
#define E_ADDRESSBOOK_SELECTOR_GET_CLASS(obj) \
- (E_TYPE_INSTANCE_GET_CLASS \
+ (G_TYPE_INSTANCE_GET_CLASS \
((obj), E_TYPE_ADDRESSBOOK_SELECTOR, EAddressbookSelectorClass))
G_BEGIN_DECLS