diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2009-02-16 08:44:40 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2009-02-16 08:44:40 +0800 |
commit | 03d8740213e324efaf7b774b0c7497ced2fa626b (patch) | |
tree | 590073927ce64831efba1b4039404e7f5a5a49df /widgets/misc/e-signature-tree-view.c | |
parent | f7e298665b02f72890c6681e6d21ef5601beccbb (diff) | |
download | gsoc2013-evolution-03d8740213e324efaf7b774b0c7497ced2fa626b.tar.gz gsoc2013-evolution-03d8740213e324efaf7b774b0c7497ced2fa626b.tar.zst gsoc2013-evolution-03d8740213e324efaf7b774b0c7497ced2fa626b.zip |
Move signature script execution to e-util/e-signature-utils.s so the
composer can invoke it. Composer no longer needs mail-config.h.
Split signature preview into a new widget: ESignaturePreview.
svn path=/branches/kill-bonobo/; revision=37272
Diffstat (limited to 'widgets/misc/e-signature-tree-view.c')
-rw-r--r-- | widgets/misc/e-signature-tree-view.c | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/widgets/misc/e-signature-tree-view.c b/widgets/misc/e-signature-tree-view.c index ef1cc36b14..1f6d75b5b5 100644 --- a/widgets/misc/e-signature-tree-view.c +++ b/widgets/misc/e-signature-tree-view.c @@ -32,6 +32,7 @@ enum { enum { PROP_0, + PROP_SELECTED, PROP_SIGNATURE_LIST }; @@ -46,7 +47,7 @@ struct _ESignatureTreeViewPrivate { }; static gpointer parent_class; -static guint signal_ids[LAST_SIGNAL]; +static guint signals[LAST_SIGNAL]; static void signature_tree_view_refresh_cb (ESignatureList *signature_list, @@ -117,7 +118,13 @@ skip: if (signature != NULL) g_object_unref (signature); - g_signal_emit (tree_view, signal_ids[REFRESHED], 0); + g_signal_emit (tree_view, signals[REFRESHED], 0); +} + +static void +signature_tree_view_selection_changed_cb (ESignatureTreeView *tree_view) +{ + g_object_notify (G_OBJECT (tree_view), "selected"); } static GObject * @@ -154,6 +161,12 @@ signature_tree_view_set_property (GObject *object, GParamSpec *pspec) { switch (property_id) { + case PROP_SELECTED: + e_signature_tree_view_set_selected ( + E_SIGNATURE_TREE_VIEW (object), + g_value_get_object (value)); + return; + case PROP_SIGNATURE_LIST: e_signature_tree_view_set_signature_list ( E_SIGNATURE_TREE_VIEW (object), @@ -171,6 +184,13 @@ signature_tree_view_get_property (GObject *object, GParamSpec *pspec) { switch (property_id) { + case PROP_SELECTED: + g_value_set_object ( + value, + e_signature_tree_view_get_selected ( + E_SIGNATURE_TREE_VIEW (object))); + return; + case PROP_SIGNATURE_LIST: g_value_set_object ( value, @@ -233,6 +253,16 @@ signature_tree_view_class_init (ESignatureTreeViewClass *class) g_object_class_install_property ( object_class, + PROP_SELECTED, + g_param_spec_object ( + "selected", + "Selected Signature", + NULL, + E_TYPE_SIGNATURE, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, PROP_SIGNATURE_LIST, g_param_spec_object ( "signature-list", @@ -242,7 +272,7 @@ signature_tree_view_class_init (ESignatureTreeViewClass *class) G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); - signal_ids[REFRESHED] = g_signal_new ( + signals[REFRESHED] = g_signal_new ( "refreshed", G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST, @@ -255,6 +285,7 @@ static void signature_tree_view_init (ESignatureTreeView *tree_view) { GHashTable *index; + GtkTreeSelection *selection; /* Reverse-lookup index */ index = g_hash_table_new_full ( @@ -264,6 +295,13 @@ signature_tree_view_init (ESignatureTreeView *tree_view) tree_view->priv = E_SIGNATURE_TREE_VIEW_GET_PRIVATE (tree_view); tree_view->priv->index = index; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)); + + g_signal_connect_swapped ( + selection, "changed", + G_CALLBACK (signature_tree_view_selection_changed_cb), + tree_view); } GType @@ -401,5 +439,7 @@ e_signature_tree_view_set_selected (ESignatureTreeView *tree_view, gtk_tree_selection_select_path (selection, path); gtk_tree_path_free (path); + g_object_notify (G_OBJECT (tree_view), "selected"); + return TRUE; } |