diff options
author | Fabiano FidĂȘncio <fidencio@redhat.com> | 2013-09-03 07:31:28 +0800 |
---|---|---|
committer | Fabiano FidĂȘncio <fidencio@redhat.com> | 2013-09-05 21:00:59 +0800 |
commit | 96c6e7bc26132d31c87e05a6ef702b008a47ac85 (patch) | |
tree | 4efa9ec983e9a7f4e3a12b8c7b700a63d9cf2a44 /calendar/gui/e-memo-list-selector.c | |
parent | a9d4764be5833cd5499039303926991caff41c2b (diff) | |
download | gsoc2013-evolution-96c6e7bc26132d31c87e05a6ef702b008a47ac85.tar gsoc2013-evolution-96c6e7bc26132d31c87e05a6ef702b008a47ac85.tar.gz gsoc2013-evolution-96c6e7bc26132d31c87e05a6ef702b008a47ac85.tar.bz2 gsoc2013-evolution-96c6e7bc26132d31c87e05a6ef702b008a47ac85.tar.lz gsoc2013-evolution-96c6e7bc26132d31c87e05a6ef702b008a47ac85.tar.xz gsoc2013-evolution-96c6e7bc26132d31c87e05a6ef702b008a47ac85.tar.zst gsoc2013-evolution-96c6e7bc26132d31c87e05a6ef702b008a47ac85.zip |
Add EShellView to E{Calendar,MemoList,TaskList}Selector
https://bugzilla.gnome.org/show_bug.cgi?id=657808
Diffstat (limited to 'calendar/gui/e-memo-list-selector.c')
-rw-r--r-- | calendar/gui/e-memo-list-selector.c | 92 |
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); |