Bugzilla – Attachment 99083 Details for
Bug 144322
"Save Screenshot" handles fopen failure poorly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
work in progress patch
gnome-screenshot-wip.patch (text/plain), 3.29 KB, created by
Joe Shaw
on 2006-09-19 15:30:21 UTC
(
hide
)
Description:
work in progress patch
Filename:
MIME Type:
Creator:
Joe Shaw
Created:
2006-09-19 15:30:21 UTC
Size:
3.29 KB
patch
obsolete
>? gnome-screenshot/screen-shot-error-dlg.diff >Index: gnome-screenshot/screenshot-xfer.c >=================================================================== >RCS file: /cvs/gnome/gnome-utils/gnome-screenshot/screenshot-xfer.c,v >retrieving revision 1.3 >diff -u -p -u -r1.3 screenshot-xfer.c >--- gnome-screenshot/screenshot-xfer.c 10 Nov 2004 06:20:32 -0000 1.3 >+++ gnome-screenshot/screenshot-xfer.c 19 Sep 2006 15:27:35 -0000 >@@ -18,6 +18,8 @@ typedef struct > gboolean delete_target; > guint timeout_id; > gboolean canceled; >+ gint vfs_status; >+ gchar *target_dir; > } TransferInfo; > > static gboolean show_dialog_timeout (TransferInfo *transfer_info); >@@ -148,6 +150,30 @@ handle_transfer_ok (const GnomeVFSXferPr > } > > static gint >+handle_access_error (GnomeVFSXferProgressInfo *progress_info, >+ TransferInfo *transfer_info) >+{ >+ GtkWidget *dialog; >+ remove_timeout (transfer_info); >+ dialog = gtk_message_dialog_new (GTK_WINDOW (transfer_info_get_parent (transfer_info)), >+ GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, >+ GTK_MESSAGE_ERROR, >+ GTK_BUTTONS_OK, >+ _("Insufficient permissions to save the file in:\n%s"), >+ transfer_info->target_dir); >+ >+ gtk_dialog_run (GTK_DIALOG (dialog)); >+ gtk_widget_destroy (dialog); >+ if (transfer_info->progress_dialog) >+ { >+ gtk_widget_destroy (transfer_info->progress_dialog); >+ transfer_info->progress_dialog = NULL; >+ } >+ gtk_main_quit (); >+ return 1; >+} >+ >+static gint > handle_transfer_vfs_error (GnomeVFSXferProgressInfo *progress_info, > TransferInfo *transfer_info) > { >@@ -216,6 +242,8 @@ screenshot_async_xfer_progress (GnomeVFS > { > TransferInfo *transfer_info = data; > >+ transfer_info->vfs_status = progress_info->vfs_status; >+ > switch (progress_info->status) > { > case GNOME_VFS_XFER_PROGRESS_STATUS_OK: >@@ -233,6 +261,22 @@ screenshot_async_xfer_progress (GnomeVFS > } > } > >+static gint >+screenshot_async_xfer_sync (GnomeVFSXferProgressInfo *progress_info, >+ gpointer data) >+{ >+ TransferInfo *transfer_info = data; >+ >+ g_print ("xfer_sync: %d\n", progress_info->vfs_status); >+ >+ transfer_info->vfs_status = progress_info->vfs_status; >+ >+ if (progress_info->vfs_status == GNOME_VFS_ERROR_ACCESS_DENIED) >+ return handle_access_error (progress_info, transfer_info); >+ else >+ return GNOME_VFS_OK; >+} >+ > static gboolean > show_dialog_timeout (TransferInfo *transfer_info) > { >@@ -259,6 +303,7 @@ screenshot_xfer_uri (GnomeVFSURI *source > > transfer_info = g_new0 (TransferInfo, 1); > transfer_info->parent_dialog = parent; >+ transfer_info->target_dir = g_strdup (gnome_vfs_uri_extract_dirname (target_uri)); > add_timeout (transfer_info); > > result = gnome_vfs_async_xfer (&transfer_info->handle, >@@ -268,7 +313,7 @@ screenshot_xfer_uri (GnomeVFSURI *source > GNOME_VFS_XFER_OVERWRITE_MODE_QUERY, > GNOME_VFS_PRIORITY_DEFAULT, > screenshot_async_xfer_progress, transfer_info, >- NULL, NULL); >+ screenshot_async_xfer_sync, transfer_info); > gtk_main (); > remove_timeout (transfer_info); > g_list_free (source_uri_list); >@@ -277,6 +322,6 @@ screenshot_xfer_uri (GnomeVFSURI *source > if (transfer_info->delete_target) > ;/* try to delete the target, iff it started writing */ > >- return GNOME_VFS_OK; >+ return transfer_info->vfs_status; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 144322
: 99083