Commit a9914556 authored by Umang Jain's avatar Umang Jain Committed by Debarshi Ray

Add notifications when photos are exported

https://bugzilla.gnome.org/show_bug.cgi?id=762371
parent 1807ea78
......@@ -85,7 +85,7 @@ PKG_CHECK_MODULES(GEGL, [gegl-0.3 >= $GEGL_MIN_VERSION])
PKG_CHECK_MODULES(GEXIV2, [gexiv2])
PKG_CHECK_MODULES(GDK_PIXBUF, [gdk-pixbuf-2.0])
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= $GLIB_MIN_VERSION])
PKG_CHECK_MODULES(GIO, [gio-2.0])
PKG_CHECK_MODULES(GIO, [gio-2.0 gio-unix-2.0])
PKG_CHECK_MODULES(GNOME_DESKTOP, [gnome-desktop-3.0])
AC_DEFINE([GNOME_DESKTOP_USE_UNSTABLE_API], [], [We are aware that GNOME_DESKTOP's API can change])
......
......@@ -11,6 +11,7 @@ src/photos-embed.c
src/photos-empty-results-box.c
[type: gettext/glade]src/photos-export-dialog.ui
src/photos-export-dialog.c
src/photos-export-notification.c
src/photos-facebook-item.c
src/photos-fetch-metas-job.c
src/photos-flickr-item.c
......
......@@ -64,6 +64,8 @@ gnome_photos_SOURCES = \
photos-dropdown.h \
photos-export-dialog.c \
photos-export-dialog.h \
photos-export-notification.c \
photos-export-notification.h \
photos-edit-palette.c \
photos-edit-palette.h \
photos-edit-palette-row.c \
......
......@@ -40,6 +40,7 @@
#include "photos-camera-cache.h"
#include "photos-dlna-renderers-dialog.h"
#include "photos-export-dialog.h"
#include "photos-export-notification.h"
#include "photos-filterable.h"
#include "photos-gom-miner.h"
#include "photos-item-manager.h"
......@@ -993,19 +994,25 @@ photos_application_save_save (GObject *source_object, GAsyncResult *res, gpointe
PhotosBaseItem *item = PHOTOS_BASE_ITEM (source_object);
GError *error = NULL;
GFile *file = NULL;
GList *items = NULL;
file = photos_base_item_save_finish (item, res, &error);
if (error != NULL)
{
g_warning ("Unable to save: %s", error->message);
photos_export_notification_new_with_error (error);
g_error_free (error);
goto out;
}
items = g_list_prepend (items, g_object_ref (item));
photos_export_notification_new (items, file);
out:
photos_selection_controller_set_selection_mode (self->priv->sel_cntrlr, FALSE);
g_application_release (G_APPLICATION (self));
g_clear_object (&file);
g_list_free_full (items, g_object_unref);
}
......@@ -1036,6 +1043,7 @@ photos_application_save_response (GtkDialog *dialog, gint response_id, gpointer
if (!photos_utils_make_directory_with_parents (export, NULL, &error))
{
g_warning ("Unable to create %s: %s", export_path, error->message);
photos_export_notification_new_with_error (error);
g_error_free (error);
goto out;
}
......@@ -1047,6 +1055,7 @@ photos_application_save_response (GtkDialog *dialog, gint response_id, gpointer
if (error != NULL)
{
g_warning ("Unable to get a child for %s: %s", export_dir_name, error->message);
photos_export_notification_new_with_error (error);
g_error_free (error);
goto out;
}
......@@ -1058,6 +1067,7 @@ photos_application_save_response (GtkDialog *dialog, gint response_id, gpointer
if (!photos_utils_make_directory_with_parents (export, NULL, &error))
{
g_warning ("Unable to create %s: %s", export_path, error->message);
photos_export_notification_new_with_error (error);
g_error_free (error);
goto out;
}
......
This diff is collapsed.
/*
* Photos - access, organize and share your photos on GNOME
* Copyright © 2016 Umang Jain
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
#ifndef PHOTOS_EXPORT_NOTIFICATION_H
#define PHOTOS_EXPORT_NOTIFICATION_H
#include <gio/gio.h>
#include <glib.h>
G_BEGIN_DECLS
#define PHOTOS_TYPE_EXPORT_NOTIFICATION (photos_export_notification_get_type ())
#define PHOTOS_EXPORT_NOTIFICATION(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
PHOTOS_TYPE_EXPORT_NOTIFICATION, PhotosExportNotification))
#define PHOTOS_IS_EXPORT_NOTIFICATION(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
PHOTOS_TYPE_EXPORT_NOTIFICATION))
typedef struct _PhotosExportNotification PhotosExportNotification;
typedef struct _PhotosExportNotificationClass PhotosExportNotificationClass;
GType photos_export_notification_get_type (void) G_GNUC_CONST;
void photos_export_notification_new (GList *items, GFile *file);
void photos_export_notification_new_with_error (GError *error);
G_END_DECLS
#endif /* PHOTOS_EXPORT_NOTIFICATION_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment