[evolution] Add EShellView to E{Calendar,MemoList,TaskList}Selector
- From: Fabiano Fidêncio <ffidencio src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Add EShellView to E{Calendar,MemoList,TaskList}Selector
- Date: Thu, 5 Sep 2013 13:01:15 +0000 (UTC)
commit 96c6e7bc26132d31c87e05a6ef702b008a47ac85
Author: Fabiano Fidêncio <fidencio redhat com>
Date: Tue Sep 3 01:31:28 2013 +0200
Add EShellView to E{Calendar,MemoList,TaskList}Selector
https://bugzilla.gnome.org/show_bug.cgi?id=657808
calendar/gui/e-calendar-selector.c | 95 ++++++++++++++++++++++++++++++-
calendar/gui/e-calendar-selector.h | 6 ++-
calendar/gui/e-memo-list-selector.c | 92 +++++++++++++++++++++++++++++-
calendar/gui/e-memo-list-selector.h | 6 ++-
calendar/gui/e-task-list-selector.c | 92 +++++++++++++++++++++++++++++-
calendar/gui/e-task-list-selector.h | 6 ++-
modules/calendar/e-cal-shell-sidebar.c | 2 +-
modules/calendar/e-memo-shell-sidebar.c | 2 +-
modules/calendar/e-task-shell-sidebar.c | 2 +-
9 files changed, 290 insertions(+), 13 deletions(-)
---
diff --git a/calendar/gui/e-calendar-selector.c b/calendar/gui/e-calendar-selector.c
index 4ced766..1b0ee91 100644
--- a/calendar/gui/e-calendar-selector.c
+++ b/calendar/gui/e-calendar-selector.c
@@ -29,7 +29,7 @@
((obj), E_TYPE_CALENDAR_SELECTOR, ECalendarSelectorPrivate))
struct _ECalendarSelectorPrivate {
- gint dummy_value;
+ EShellView *shell_view;
};
G_DEFINE_TYPE (
@@ -37,6 +37,11 @@ G_DEFINE_TYPE (
e_calendar_selector,
E_TYPE_CLIENT_SELECTOR)
+enum {
+ PROP_0,
+ PROP_SHELL_VIEW,
+};
+
static gboolean
calendar_selector_update_single_object (ECalClient *client,
icalcomponent *icalcomp)
@@ -207,6 +212,71 @@ exit:
return success;
}
+EShellView *
+e_calendar_selector_get_shell_view (ECalendarSelector *calendar_selector)
+{
+ g_return_val_if_fail (E_IS_CALENDAR_SELECTOR (calendar_selector), NULL);
+
+ return calendar_selector->priv->shell_view;
+}
+
+static void
+e_calendar_selector_set_shell_view (ECalendarSelector *calendar_selector,
+ EShellView *shell_view)
+{
+ g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
+ g_return_if_fail (calendar_selector->priv->shell_view == NULL);
+
+ calendar_selector->priv->shell_view = g_object_ref (shell_view);
+}
+
+static void
+calendar_selector_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_SHELL_VIEW:
+ e_calendar_selector_set_shell_view (
+ E_CALENDAR_SELECTOR (object),
+ g_value_get_object (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+calendar_selector_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_SHELL_VIEW:
+ g_value_set_object (
+ value,
+ e_calendar_selector_get_shell_view (E_CALENDAR_SELECTOR (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+calendar_selector_dispose (GObject *object)
+{
+ ECalendarSelectorPrivate *priv;
+
+ priv = E_CALENDAR_SELECTOR_GET_PRIVATE (object);
+
+ g_clear_object (&priv->shell_view);
+
+ /* Chain up to the parent' s dispose() method. */
+ G_OBJECT_CLASS (e_calendar_selector_parent_class)->dispose (object);
+}
+
static void
e_calendar_selector_class_init (ECalendarSelectorClass *class)
{
@@ -217,9 +287,24 @@ e_calendar_selector_class_init (ECalendarSelectorClass *class)
object_class = G_OBJECT_CLASS (class);
object_class->constructed = calendar_selector_constructed;
+ object_class->set_property = calendar_selector_set_property;
+ object_class->get_property = calendar_selector_get_property;
+ object_class->dispose = calendar_selector_dispose;
source_selector_class = E_SOURCE_SELECTOR_CLASS (class);
source_selector_class->data_dropped = calendar_selector_data_dropped;
+
+ g_object_class_install_property (
+ object_class,
+ PROP_SHELL_VIEW,
+ g_param_spec_object (
+ "shell-view",
+ NULL,
+ NULL,
+ E_TYPE_SHELL_VIEW,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
}
static void
@@ -235,12 +320,14 @@ e_calendar_selector_init (ECalendarSelector *selector)
}
GtkWidget *
-e_calendar_selector_new (EClientCache *client_cache)
+e_calendar_selector_new (EClientCache *client_cache,
+ EShellView *shell_view)
{
ESourceRegistry *registry;
GtkWidget *widget;
g_return_val_if_fail (E_IS_CLIENT_CACHE (client_cache), NULL);
+ g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
registry = e_client_cache_ref_registry (client_cache);
@@ -248,7 +335,9 @@ e_calendar_selector_new (EClientCache *client_cache)
E_TYPE_CALENDAR_SELECTOR,
"client-cache", client_cache,
"extension-name", E_SOURCE_EXTENSION_CALENDAR,
- "registry", registry, NULL);
+ "registry", registry,
+ "shell-view", shell_view,
+ NULL);
g_object_unref (registry);
diff --git a/calendar/gui/e-calendar-selector.h b/calendar/gui/e-calendar-selector.h
index 13d1689..2e39c4b 100644
--- a/calendar/gui/e-calendar-selector.h
+++ b/calendar/gui/e-calendar-selector.h
@@ -22,6 +22,7 @@
#define E_CALENDAR_SELECTOR_H
#include <e-util/e-util.h>
+#include <shell/e-shell-view.h>
/* Standard GObject macros */
#define E_TYPE_CALENDAR_SELECTOR \
@@ -58,7 +59,10 @@ struct _ECalendarSelectorClass {
};
GType e_calendar_selector_get_type (void);
-GtkWidget * e_calendar_selector_new (EClientCache *client_cache);
+GtkWidget * e_calendar_selector_new (EClientCache *client_cache,
+ EShellView *shell_backend);
+EShellView * e_calendar_selector_get_shell_view
+ (ECalendarSelector *calendar_selector);
G_END_DECLS
diff --git a/calendar/gui/e-memo-list-selector.c b/calendar/gui/e-memo-list-selector.c
index f52a2a6..a1cc8a7 100644
--- a/calendar/gui/e-memo-list-selector.c
+++ b/calendar/gui/e-memo-list-selector.c
@@ -32,7 +32,7 @@
((obj), E_TYPE_MEMO_LIST_SELECTOR, EMemoListSelectorPrivate))
struct _EMemoListSelectorPrivate {
- gint dummy_value;
+ EShellView *shell_view;
};
G_DEFINE_TYPE (
@@ -40,6 +40,11 @@ G_DEFINE_TYPE (
e_memo_list_selector,
E_TYPE_CLIENT_SELECTOR)
+enum {
+ PROP_0,
+ PROP_SHELL_VIEW
+};
+
static gboolean
memo_list_selector_update_single_object (ECalClient *client,
icalcomponent *icalcomp)
@@ -323,6 +328,71 @@ memo_list_selector_data_dropped (ESourceSelector *selector,
return TRUE;
}
+EShellView *
+e_memo_list_selector_get_shell_view (EMemoListSelector *memo_list_selector)
+{
+ g_return_val_if_fail (E_IS_MEMO_LIST_SELECTOR (memo_list_selector), NULL);
+
+ return memo_list_selector->priv->shell_view;
+}
+
+static void
+e_memo_list_selector_set_shell_view (EMemoListSelector *memo_list_selector,
+ EShellView *shell_view)
+{
+ g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
+ g_return_if_fail (memo_list_selector->priv->shell_view == NULL);
+
+ memo_list_selector->priv->shell_view = g_object_ref (shell_view);
+}
+
+static void
+memo_list_selector_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_SHELL_VIEW:
+ e_memo_list_selector_set_shell_view (
+ E_MEMO_LIST_SELECTOR (object),
+ g_value_get_object (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+memo_list_selector_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_SHELL_VIEW:
+ g_value_set_object (
+ value,
+ e_memo_list_selector_get_shell_view (E_MEMO_LIST_SELECTOR (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+memo_list_selector_dispose (GObject *object)
+{
+ EMemoListSelectorPrivate *priv;
+
+ priv = E_MEMO_LIST_SELECTOR_GET_PRIVATE (object);
+
+ g_clear_object (&priv->shell_view);
+
+ /* Chain up to the parent' s dispose() method. */
+ G_OBJECT_CLASS (e_memo_list_selector_parent_class)->dispose (object);
+}
+
static void
e_memo_list_selector_class_init (EMemoListSelectorClass *class)
{
@@ -333,9 +403,24 @@ e_memo_list_selector_class_init (EMemoListSelectorClass *class)
object_class = G_OBJECT_CLASS (class);
object_class->constructed = memo_list_selector_constructed;
+ object_class->set_property = memo_list_selector_set_property;
+ object_class->get_property = memo_list_selector_get_property;
+ object_class->dispose = memo_list_selector_dispose;
source_selector_class = E_SOURCE_SELECTOR_CLASS (class);
source_selector_class->data_dropped = memo_list_selector_data_dropped;
+
+ g_object_class_install_property (
+ object_class,
+ PROP_SHELL_VIEW,
+ g_param_spec_object (
+ "shell-view",
+ NULL,
+ NULL,
+ E_TYPE_SHELL_VIEW,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
}
static void
@@ -351,12 +436,14 @@ e_memo_list_selector_init (EMemoListSelector *selector)
}
GtkWidget *
-e_memo_list_selector_new (EClientCache *client_cache)
+e_memo_list_selector_new (EClientCache *client_cache,
+ EShellView *shell_view)
{
ESourceRegistry *registry;
GtkWidget *widget;
g_return_val_if_fail (E_IS_CLIENT_CACHE (client_cache), NULL);
+ g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
registry = e_client_cache_ref_registry (client_cache);
@@ -364,6 +451,7 @@ e_memo_list_selector_new (EClientCache *client_cache)
E_TYPE_MEMO_LIST_SELECTOR,
"client-cache", client_cache,
"extension-name", E_SOURCE_EXTENSION_MEMO_LIST,
+ "shell-view", shell_view,
"registry", registry, NULL);
g_object_unref (registry);
diff --git a/calendar/gui/e-memo-list-selector.h b/calendar/gui/e-memo-list-selector.h
index e29bfb3..0a68a76 100644
--- a/calendar/gui/e-memo-list-selector.h
+++ b/calendar/gui/e-memo-list-selector.h
@@ -27,6 +27,7 @@
#define E_MEMO_LIST_SELECTOR_H
#include <e-util/e-util.h>
+#include <shell/e-shell-view.h>
/* Standard GObject macros */
#define E_TYPE_MEMO_LIST_SELECTOR \
@@ -63,7 +64,10 @@ struct _EMemoListSelectorClass {
};
GType e_memo_list_selector_get_type (void);
-GtkWidget * e_memo_list_selector_new (EClientCache *client_cache);
+GtkWidget * e_memo_list_selector_new (EClientCache *client_cache,
+ EShellView *shell_view);
+EShellView * e_memo_list_selector_get_shell_view
+ (EMemoListSelector *memo_list_selector);
G_END_DECLS
diff --git a/calendar/gui/e-task-list-selector.c b/calendar/gui/e-task-list-selector.c
index e48b962..dc1340e 100644
--- a/calendar/gui/e-task-list-selector.c
+++ b/calendar/gui/e-task-list-selector.c
@@ -32,7 +32,7 @@
((obj), E_TYPE_TASK_LIST_SELECTOR, ETaskListSelectorPrivate))
struct _ETaskListSelectorPrivate {
- gint dummy_value;
+ EShellView *shell_view;
};
G_DEFINE_TYPE (
@@ -40,6 +40,11 @@ G_DEFINE_TYPE (
e_task_list_selector,
E_TYPE_CLIENT_SELECTOR)
+enum {
+ PROP_0,
+ PROP_SHELL_VIEW
+};
+
static gboolean
task_list_selector_update_single_object (ECalClient *client,
icalcomponent *icalcomp)
@@ -325,6 +330,71 @@ task_list_selector_data_dropped (ESourceSelector *selector,
return TRUE;
}
+EShellView *
+e_task_list_selector_get_shell_view (ETaskListSelector *task_list_selector)
+{
+ g_return_val_if_fail (E_IS_TASK_LIST_SELECTOR (task_list_selector), NULL);
+
+ return task_list_selector->priv->shell_view;
+}
+
+static void
+e_task_list_selector_set_shell_view (ETaskListSelector *task_list_selector,
+ EShellView *shell_view)
+{
+ g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
+ g_return_if_fail (task_list_selector->priv->shell_view == NULL);
+
+ task_list_selector->priv->shell_view = g_object_ref (shell_view);
+}
+
+static void
+task_list_selector_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_SHELL_VIEW:
+ e_task_list_selector_set_shell_view (
+ E_TASK_LIST_SELECTOR (object),
+ g_value_get_object (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+task_list_selector_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_SHELL_VIEW:
+ g_value_set_object (
+ value,
+ e_task_list_selector_get_shell_view (E_TASK_LIST_SELECTOR (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+task_list_selector_dispose (GObject *object)
+{
+ ETaskListSelectorPrivate *priv;
+
+ priv = E_TASK_LIST_SELECTOR_GET_PRIVATE (object);
+
+ g_clear_object (&priv->shell_view);
+
+ /* Chain up to the parent' s dispose() method. */
+ G_OBJECT_CLASS (e_task_list_selector_parent_class)->dispose (object);
+}
+
static void
e_task_list_selector_class_init (ETaskListSelectorClass *class)
{
@@ -335,9 +405,24 @@ e_task_list_selector_class_init (ETaskListSelectorClass *class)
object_class = G_OBJECT_CLASS (class);
object_class->constructed = task_list_selector_constructed;
+ object_class->set_property = task_list_selector_set_property;
+ object_class->get_property = task_list_selector_get_property;
+ object_class->dispose = task_list_selector_dispose;
source_selector_class = E_SOURCE_SELECTOR_CLASS (class);
source_selector_class->data_dropped = task_list_selector_data_dropped;
+
+ g_object_class_install_property (
+ object_class,
+ PROP_SHELL_VIEW,
+ g_param_spec_object (
+ "shell-view",
+ NULL,
+ NULL,
+ E_TYPE_SHELL_VIEW,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
}
static void
@@ -353,12 +438,14 @@ e_task_list_selector_init (ETaskListSelector *selector)
}
GtkWidget *
-e_task_list_selector_new (EClientCache *client_cache)
+e_task_list_selector_new (EClientCache *client_cache,
+ EShellView *shell_view)
{
ESourceRegistry *registry;
GtkWidget *widget;
g_return_val_if_fail (E_IS_CLIENT_CACHE (client_cache), NULL);
+ g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
registry = e_client_cache_ref_registry (client_cache);
@@ -366,6 +453,7 @@ e_task_list_selector_new (EClientCache *client_cache)
E_TYPE_TASK_LIST_SELECTOR,
"client-cache", client_cache,
"extension-name", E_SOURCE_EXTENSION_TASK_LIST,
+ "shell-view", shell_view,
"registry", registry, NULL);
g_object_unref (registry);
diff --git a/calendar/gui/e-task-list-selector.h b/calendar/gui/e-task-list-selector.h
index 1c0ba17..c296d7d 100644
--- a/calendar/gui/e-task-list-selector.h
+++ b/calendar/gui/e-task-list-selector.h
@@ -27,6 +27,7 @@
#define E_TASK_LIST_SELECTOR_H
#include <e-util/e-util.h>
+#include <shell/e-shell-view.h>
/* Standard GObject macros */
#define E_TYPE_TASK_LIST_SELECTOR \
@@ -63,7 +64,10 @@ struct _ETaskListSelectorClass {
};
GType e_task_list_selector_get_type (void);
-GtkWidget * e_task_list_selector_new (EClientCache *client_cache);
+GtkWidget * e_task_list_selector_new (EClientCache *client_cache,
+ EShellView *shell_view);
+EShellView * e_task_list_selector_get_shell_view
+ (ETaskListSelector *task_list_selector);
G_END_DECLS
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index f8d982a..295b6de 100644
--- a/modules/calendar/e-cal-shell-sidebar.c
+++ b/modules/calendar/e-cal-shell-sidebar.c
@@ -590,7 +590,7 @@ cal_shell_sidebar_constructed (GObject *object)
container = widget;
client_cache = e_shell_get_client_cache (shell);
- widget = e_calendar_selector_new (client_cache);
+ widget = e_calendar_selector_new (client_cache, shell_view);
e_source_selector_set_select_new (E_SOURCE_SELECTOR (widget), TRUE);
gtk_container_add (GTK_CONTAINER (container), widget);
a11y = gtk_widget_get_accessible (widget);
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c
index a3ae507..1654e10 100644
--- a/modules/calendar/e-memo-shell-sidebar.c
+++ b/modules/calendar/e-memo-shell-sidebar.c
@@ -546,7 +546,7 @@ memo_shell_sidebar_constructed (GObject *object)
container = GTK_CONTAINER (widget);
client_cache = e_shell_get_client_cache (shell);
- widget = e_memo_list_selector_new (client_cache);
+ widget = e_memo_list_selector_new (client_cache, shell_view);
e_source_selector_set_select_new (E_SOURCE_SELECTOR (widget), TRUE);
gtk_container_add (container, widget);
a11y = gtk_widget_get_accessible (widget);
diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c
index c12bef7..8dc20d4 100644
--- a/modules/calendar/e-task-shell-sidebar.c
+++ b/modules/calendar/e-task-shell-sidebar.c
@@ -546,7 +546,7 @@ task_shell_sidebar_constructed (GObject *object)
container = GTK_CONTAINER (widget);
client_cache = e_shell_get_client_cache (shell);
- widget = e_task_list_selector_new (client_cache);
+ widget = e_task_list_selector_new (client_cache, shell_view);
e_source_selector_set_select_new (E_SOURCE_SELECTOR (widget), TRUE);
gtk_container_add (container, widget);
a11y = gtk_widget_get_accessible (widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]