[gnome-photos] selection-toolbar: Implement print_clicked



commit e58f1fafaa63c0284b438d89f8b3e4b89028e4d2
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Aug 18 22:37:51 2012 +0200

    selection-toolbar: Implement print_clicked
    
    We can not print, yet, because photos_base_item_print is a dummy.

 src/photos-base-item.c         |    6 ++++++
 src/photos-base-item.h         |    3 +++
 src/photos-selection-toolbar.c |   15 +++++++++++++++
 3 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 6ca2d7f..8cfeac5 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -852,6 +852,12 @@ photos_base_item_load_finish (PhotosBaseItem *self, GAsyncResult *res, GError **
 
 
 void
+photos_base_item_print (PhotosBaseItem *self, GtkWidget *toplevel)
+{
+}
+
+
+void
 photos_base_item_refresh (PhotosBaseItem *self)
 {
   PhotosSingleItemJob *job;
diff --git a/src/photos-base-item.h b/src/photos-base-item.h
index 3a6454a..9e055ef 100644
--- a/src/photos-base-item.h
+++ b/src/photos-base-item.h
@@ -24,6 +24,7 @@
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <gio/gio.h>
 #include <glib-object.h>
+#include <gtk/gtk.h>
 
 G_BEGIN_DECLS
 
@@ -106,6 +107,8 @@ void                photos_base_item_load_async         (PhotosBaseItem *self,
 
 GdkPixbuf          *photos_base_item_load_finish        (PhotosBaseItem *self, GAsyncResult *res, GError **error);
 
+void                photos_base_item_print              (PhotosBaseItem *self, GtkWidget *toplevel);
+
 void                photos_base_item_refresh            (PhotosBaseItem *self);
 
 void                photos_base_item_set_default_app_name (PhotosBaseItem *self, const gchar *default_app_name);
diff --git a/src/photos-selection-toolbar.c b/src/photos-selection-toolbar.c
index 6df617d..20dffaf 100644
--- a/src/photos-selection-toolbar.c
+++ b/src/photos-selection-toolbar.c
@@ -193,6 +193,21 @@ photos_selection_toolbar_open_clicked (GtkButton *button, gpointer user_data)
 static void
 photos_selection_toolbar_print_clicked (GtkButton *button, gpointer user_data)
 {
+  PhotosSelectionToolbar *self = PHOTOS_SELECTION_TOOLBAR (user_data);
+  PhotosSelectionToolbarPrivate *priv = self->priv;
+  GList *selection;
+  GtkWidget *toplevel;
+  PhotosBaseItem *item;
+  const gchar *urn;
+
+  selection = photos_selection_controller_get_selection (priv->sel_cntrlr);
+  if (g_list_length (selection) != 1)
+    return;
+
+  urn = (gchar *) selection->data;
+  item = PHOTOS_BASE_ITEM (photos_base_manager_get_object_by_id (priv->item_mngr, urn));
+  toplevel = gtk_widget_get_toplevel (GTK_WIDGET (button));
+  photos_base_item_print (item, toplevel);
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]