aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-memo-list-selector.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/e-memo-list-selector.c')
-rw-r--r--calendar/gui/e-memo-list-selector.c92
1 files changed, 90 insertions, 2 deletions
diff --git a/calendar/gui/e-memo-list-selector.c b/calendar/gui/e-memo-list-selector.c
index f52a2a6bcf..a1cc8a7e30 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);