[gthumb] Allow reporting of local_path non-existence to a pop-up dialog
- From: Michael J. Chudobiak <mjc src gnome org>
- To: svn-commits-list gnome org
- Subject: [gthumb] Allow reporting of local_path non-existence to a pop-up dialog
- Date: Thu, 7 May 2009 08:32:17 -0400 (EDT)
commit 7d1a821d3df443356ff4ec913d7bd3c01df51faa
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date: Thu May 7 08:31:41 2009 -0400
Allow reporting of local_path non-existence to a pop-up dialog
---
libgthumb/file-data.c | 13 ++++++++++---
libgthumb/file-data.h | 4 +++-
libgthumb/gth-exif-utils.c | 6 +++---
src/dlg-photo-importer.c | 5 +++--
4 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/libgthumb/file-data.c b/libgthumb/file-data.c
index 7772feb..9e261f2 100644
--- a/libgthumb/file-data.c
+++ b/libgthumb/file-data.c
@@ -28,7 +28,7 @@
#include "gfile-utils.h"
#include "comments.h"
#include "gth-exif-utils.h"
-
+#include "gtk-utils.h"
#define MAX_COMMENT_LEN 60
@@ -359,11 +359,18 @@ file_data_list_find_path (GList *list,
gboolean
-file_data_has_local_path (FileData *fd)
+file_data_has_local_path (FileData *fd,
+ GtkWindow *window)
{
/* TODO: this is where we could trying mounting unmounted remote URIs */
if (fd->local_path == NULL) {
- g_warning ("%s has not been mounted, or the gvfs daemon has not provided a local mount point in ~/.gvfs/. gThumb can not access this remote file directly.", fd->utf8_path);
+ char *message;
+ message = g_strdup_printf ("%s has not been mounted, or the gvfs daemon has not provided a local mount point in ~/.gvfs/. gThumb can not access this remote file directly.", fd->utf8_path);
+ if (window == NULL)
+ g_warning ("%s has not been mounted, or the gvfs daemon has not provided a local mount point in ~/.gvfs/. gThumb can not access this remote file directly.", fd->utf8_path);
+ else
+ _gtk_error_dialog_run (window, message);
+ g_free (message);
return FALSE;
} else {
return TRUE;
diff --git a/libgthumb/file-data.h b/libgthumb/file-data.h
index 3901563..aa9fe28 100644
--- a/libgthumb/file-data.h
+++ b/libgthumb/file-data.h
@@ -25,6 +25,7 @@
#include <glib.h>
#include <glib-object.h>
+#include <gtk/gtk.h>
#include <time.h>
#include <sys/stat.h>
#include "comments.h"
@@ -83,6 +84,7 @@ GList* file_data_list_dup (GList *list);
void file_data_list_free (GList *list);
GList* file_data_list_find_path (GList *list,
const char *path);
-gboolean file_data_has_local_path (FileData *fd);
+gboolean file_data_has_local_path (FileData *fd,
+ GtkWindow *window);
#endif /* FILE_DATA_H */
diff --git a/libgthumb/gth-exif-utils.c b/libgthumb/gth-exif-utils.c
index fc5dcd8..d1704b4 100644
--- a/libgthumb/gth-exif-utils.c
+++ b/libgthumb/gth-exif-utils.c
@@ -434,8 +434,8 @@ update_and_save_metadata (const char *uri_src,
from_fd = file_data_new (uri_src);
to_fd = file_data_new (uri_dest);
- if (!file_data_has_local_path (from_fd) ||
- !file_data_has_local_path (to_fd)) {
+ if (!file_data_has_local_path (from_fd, NULL) ||
+ !file_data_has_local_path (to_fd, NULL)) {
file_data_unref (from_fd);
file_data_unref (to_fd);
return;
@@ -514,7 +514,7 @@ update_metadata (FileData *fd)
if (fd->exif_data_loaded == TRUE)
return;
- if (!file_data_has_local_path (fd))
+ if (!file_data_has_local_path (fd, NULL))
return;
if (fd->mime_type == NULL)
diff --git a/src/dlg-photo-importer.c b/src/dlg-photo-importer.c
index 38921ac..107a941 100644
--- a/src/dlg-photo-importer.c
+++ b/src/dlg-photo-importer.c
@@ -1292,7 +1292,7 @@ save_image (DialogData *data,
folder_fd = file_data_new (local_folder);
- if (!file_data_has_local_path (folder_fd)) {
+ if (!file_data_has_local_path (folder_fd, GTK_WINDOW (data->dialog))) {
error_found = TRUE;
} else {
/* When grouping by exif date, we need a temporary directory to upload the
@@ -1765,7 +1765,8 @@ ok_clicked_cb (GtkButton *button,
}
folder_fd = file_data_new (data->local_folder);
- if (!file_data_has_local_path (folder_fd) || !ensure_dir_exists (folder_fd->local_path, 0755)) {
+ if (!file_data_has_local_path (folder_fd, GTK_WINDOW (data->dialog)) ||
+ !ensure_dir_exists (folder_fd->local_path, 0755)) {
char *msg;
msg = g_strdup_printf (_("Could not create the folder \"%s\": %s"),
folder_fd->utf8_name,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]