[gnome-photos] selection-toolbar: Implement open_clicked
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] selection-toolbar: Implement open_clicked
- Date: Sat, 18 Aug 2012 22:54:18 +0000 (UTC)
commit 9cea98883cf2c2ef9395822e467da48a0f62aa43
Author: Debarshi Ray <debarshir gnome org>
Date: Sat Aug 18 22:49:23 2012 +0200
selection-toolbar: Implement open_clicked
src/photos-base-item.c | 16 ++++++++++++++++
src/photos-base-item.h | 4 ++++
src/photos-selection-toolbar.c | 10 +++++++++-
3 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 8cfeac5..fd2c573 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -852,6 +852,22 @@ photos_base_item_load_finish (PhotosBaseItem *self, GAsyncResult *res, GError **
void
+photos_base_item_open (PhotosBaseItem *self, GdkScreen *screen, guint32 timestamp)
+{
+ PhotosBaseItemPrivate *priv = self->priv;
+ GError *error;
+
+ error = NULL;
+ gtk_show_uri (screen, self->priv->uri, timestamp, &error);
+ if (error != NULL)
+ {
+ g_warning ("Unable to show URI %s: %s", priv->uri, error->message);
+ g_error_free (error);
+ }
+}
+
+
+void
photos_base_item_print (PhotosBaseItem *self, GtkWidget *toplevel)
{
}
diff --git a/src/photos-base-item.h b/src/photos-base-item.h
index 9e055ef..fa10796 100644
--- a/src/photos-base-item.h
+++ b/src/photos-base-item.h
@@ -107,6 +107,10 @@ void photos_base_item_load_async (PhotosBaseItem *self,
GdkPixbuf *photos_base_item_load_finish (PhotosBaseItem *self, GAsyncResult *res, GError **error);
+void photos_base_item_open (PhotosBaseItem *self,
+ GdkScreen *screen,
+ guint32 timestamp);
+
void photos_base_item_print (PhotosBaseItem *self, GtkWidget *toplevel);
void photos_base_item_refresh (PhotosBaseItem *self);
diff --git a/src/photos-selection-toolbar.c b/src/photos-selection-toolbar.c
index 20dffaf..0d603a3 100644
--- a/src/photos-selection-toolbar.c
+++ b/src/photos-selection-toolbar.c
@@ -185,7 +185,15 @@ photos_selection_toolbar_open_clicked (GtkButton *button, gpointer user_data)
selection = photos_selection_controller_get_selection (priv->sel_cntrlr);
for (l = selection; l != NULL; l = l->next)
{
- /* TODO: trash the doc */
+ const gchar *urn = (gchar *) l->data;
+ GdkScreen *screen;
+ PhotosBaseItem *item;
+ guint32 time;
+
+ item = PHOTOS_BASE_ITEM (photos_base_manager_get_object_by_id (priv->item_mngr, urn));
+ screen = gtk_widget_get_screen (GTK_WIDGET (button));
+ time = gtk_get_current_event_time ();
+ photos_base_item_open (item, screen, time);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]