[gnome-photos/wip/rishi/collection: 11/23] application: Add an import action
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/collection: 11/23] application: Add an import action
- Date: Tue, 16 Jan 2018 18:27:57 +0000 (UTC)
commit f7d8547a423a65296ef3e6c82c9e4f0204eb1d3a
Author: Petr Štětka <stetka peta gmail com>
Date: Mon Sep 4 00:21:53 2017 +0200
application: Add an import action
https://bugzilla.gnome.org/show_bug.cgi?id=751212
src/photos-application.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
---
diff --git a/src/photos-application.c b/src/photos-application.c
index d9fb9405..afcc632a 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -94,6 +94,7 @@ struct _PhotosApplication
GSimpleAction *edit_revert_action;
GSimpleAction *fs_action;
GSimpleAction *gear_action;
+ GSimpleAction *import_action;
GSimpleAction *insta_action;
GSimpleAction *load_next_action;
GSimpleAction *load_previous_action;
@@ -905,6 +906,20 @@ photos_application_get_state (PhotosSearchContext *context)
}
+static void
+photos_application_import (PhotosApplication *self, GVariant *parameter)
+{
+ PhotosSource *source;
+ const gchar *id;
+
+ id = g_variant_get_string (parameter, NULL);
+ g_return_if_fail (id != NULL && id[0] != '\0');
+
+ source = PHOTOS_SOURCE (photos_base_manager_get_object_by_id (self->state->src_mngr, id));
+ g_return_if_fail (PHOTOS_IS_SOURCE (source));
+}
+
+
static void
photos_application_items_changed (PhotosApplication *self)
{
@@ -1951,6 +1966,10 @@ photos_application_startup (GApplication *application)
self->gear_action = g_simple_action_new_stateful ("gear-menu", NULL, state);
g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (self->gear_action));
+ self->import_action = g_simple_action_new ("import", G_VARIANT_TYPE_STRING);
+ g_signal_connect_swapped (self->import_action, "activate", G_CALLBACK (photos_application_import), self);
+ g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (self->import_action));
+
self->insta_action = g_simple_action_new ("insta-current", G_VARIANT_TYPE_INT16);
g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (self->insta_action));
@@ -2176,6 +2195,7 @@ photos_application_dispose (GObject *object)
g_clear_object (&self->edit_revert_action);
g_clear_object (&self->fs_action);
g_clear_object (&self->gear_action);
+ g_clear_object (&self->import_action);
g_clear_object (&self->insta_action);
g_clear_object (&self->load_next_action);
g_clear_object (&self->load_previous_action);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]