[gnome-photos/wip/uajain/de_dup: 8/11] application: Enable Share action
- From: Umang Jain <uajain src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/uajain/de_dup: 8/11] application: Enable Share action
- Date: Wed, 27 Jul 2016 05:38:06 +0000 (UTC)
commit 015b66bde603c13020f5e1823a9077e3ad36180f
Author: Umang Jain <mailumangjain gmail com>
Date: Fri Jul 15 23:35:49 2016 +0530
application: Enable Share action
https://bugzilla.gnome.org/show_bug.cgi?id=751181
src/photos-application.c | 4 ++++
src/photos-base-item.c | 13 +++++++++++++
src/photos-base-item.h | 2 ++
3 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-application.c b/src/photos-application.c
index 6dfdfac..65e63e8 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -384,6 +384,10 @@ photos_application_actions_update (PhotosApplication *self)
can_open = TRUE;
}
+ enable = (((load_state == PHOTOS_LOAD_STATE_FINISHED && mode == PHOTOS_WINDOW_MODE_PREVIEW)
+ || (selection_mode && item != NULL)) && photos_base_item_can_share (item));
+ g_simple_action_set_enabled (self->share_action, enable);
+
enable = ((load_state == PHOTOS_LOAD_STATE_FINISHED
&& mode == PHOTOS_WINDOW_MODE_PREVIEW
&& photos_base_item_can_trash (item))
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index c838581..5505eea 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -46,6 +46,7 @@
#include "photos-debug.h"
#include "photos-delete-item-job.h"
#include "photos-filterable.h"
+#include "photos-google-item.h"
#include "photos-icons.h"
#include "photos-local-item.h"
#include "photos-pipeline.h"
@@ -1852,6 +1853,18 @@ photos_base_item_filterable_iface_init (PhotosFilterableInterface *iface)
gboolean
+photos_base_item_can_share (PhotosBaseItem *self)
+{
+ g_return_val_if_fail (PHOTOS_IS_BASE_ITEM (self), FALSE);
+
+ if (PHOTOS_IS_GOOGLE_ITEM (self))
+ return FALSE;
+ else
+ return TRUE;
+}
+
+
+gboolean
photos_base_item_can_edit (PhotosBaseItem *self)
{
PhotosBaseItemPrivate *priv;
diff --git a/src/photos-base-item.h b/src/photos-base-item.h
index b2c454f..2272c71 100644
--- a/src/photos-base-item.h
+++ b/src/photos-base-item.h
@@ -103,6 +103,8 @@ GType photos_base_item_get_type (void) G_GNUC_CONST
gboolean photos_base_item_can_edit (PhotosBaseItem *self);
+gboolean photos_base_item_can_share (PhotosBaseItem *self);
+
gboolean photos_base_item_can_trash (PhotosBaseItem *self);
cairo_surface_t *photos_base_item_create_preview (PhotosBaseItem *self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]