diff options
author | Claudio Saavedra <csaavedra@igalia.com> | 2012-05-25 16:48:54 +0800 |
---|---|---|
committer | Claudio Saavedra <csaavedra@igalia.com> | 2012-09-01 02:34:00 +0800 |
commit | 86808938842a9998ea0aa801cb1759739d751a18 (patch) | |
tree | 466c50b7bc894ec46691e3275ea327a79889c77b | |
parent | e0e656f9a0f6924f2c20195b80e87e102f9f950d (diff) | |
download | gsoc2013-epiphany-86808938842a9998ea0aa801cb1759739d751a18.tar.gz gsoc2013-epiphany-86808938842a9998ea0aa801cb1759739d751a18.tar.zst gsoc2013-epiphany-86808938842a9998ea0aa801cb1759739d751a18.zip |
gd-main-view-generic: add "delete-element-clicked" signal to the interface
Implementors of this interface may connect emit this signal to notify
the GdMainView when a user is requesting to delete one item from the
view.
-rw-r--r-- | lib/widgets/gd-main-view-generic.c | 23 | ||||
-rw-r--r-- | lib/widgets/gd-main-view-generic.h | 2 |
2 files changed, 24 insertions, 1 deletions
diff --git a/lib/widgets/gd-main-view-generic.c b/lib/widgets/gd-main-view-generic.c index df8d75685..100ffd334 100644 --- a/lib/widgets/gd-main-view-generic.c +++ b/lib/widgets/gd-main-view-generic.c @@ -25,10 +25,24 @@ typedef GdMainViewGenericIface GdMainViewGenericInterface; G_DEFINE_INTERFACE (GdMainViewGeneric, gd_main_view_generic, GTK_TYPE_WIDGET) +enum { + DELETE_ITEM_CLICKED, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + static void gd_main_view_generic_default_init (GdMainViewGenericInterface *iface) { - /* nothing */ + signals[DELETE_ITEM_CLICKED] = + g_signal_new ("delete-item-clicked", + GD_TYPE_MAIN_VIEW_GENERIC, + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, NULL, + G_TYPE_NONE, 1, + G_TYPE_STRING); } /** @@ -153,3 +167,10 @@ _gd_main_view_generic_dnd_common (GtkTreeModel *model, gtk_selection_data_set_uris (data, uris); g_strfreev (uris); } + +void +_gd_main_view_generic_item_delete_clicked (GdMainViewGeneric *self, + const gchar *path) +{ + g_signal_emit (self, signals[DELETE_ITEM_CLICKED], 0, path); +} diff --git a/lib/widgets/gd-main-view-generic.h b/lib/widgets/gd-main-view-generic.h index d47cd109f..efaf848a8 100644 --- a/lib/widgets/gd-main-view-generic.h +++ b/lib/widgets/gd-main-view-generic.h @@ -91,6 +91,8 @@ void _gd_main_view_generic_dnd_common (GtkTreeModel *model, gboolean selection_mode, GtkTreePath *path, GtkSelectionData *data); +void _gd_main_view_generic_item_delete_clicked (GdMainViewGeneric *self, + const gchar *path); G_END_DECLS |