[nautilus-actions] nact_export_ask_user: do not export the item if the operation is cancelled by the user
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] nact_export_ask_user: do not export the item if the operation is cancelled by the user
- Date: Mon, 28 Nov 2011 22:33:37 +0000 (UTC)
commit 7f2151da374a6fad34af093e6e75b63b6a77fa89
Author: Pierre Wieser <pwieser trychlos org>
Date: Mon Nov 28 07:53:58 2011 +0100
nact_export_ask_user: do not export the item if the operation is cancelled by the user
ChangeLog | 3 +++
src/nact/nact-export-ask.c | 15 ++++++++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e37b65f..5146f14 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2011-11-28 Pierre Wieser <pwieser trychlos org>
+ * src/nact/nact-export-ask.c (nact_export_ask_user):
+ Actually do not export the item if the user cancels the operation.
+
* src/io-desktop/nadp-desktop-file.c (nadp_desktop_file_new_from_uri):
Only display debug messages (try to minimize warnings on import).
diff --git a/src/nact/nact-export-ask.c b/src/nact/nact-export-ask.c
index f450e21..938ffe2 100644
--- a/src/nact/nact-export-ask.c
+++ b/src/nact/nact-export-ask.c
@@ -230,6 +230,7 @@ nact_export_ask_user( BaseWindow *parent, NAObjectItem *item, gboolean first )
NactExportAsk *editor;
gboolean are_locked, mandatory;
gboolean keep, keep_mandatory;
+ int code;
GQuark format = g_quark_from_static_string( NA_IPREFS_DEFAULT_EXPORT_FORMAT );
@@ -254,15 +255,23 @@ nact_export_ask_user( BaseWindow *parent, NAObjectItem *item, gboolean first )
editor->private->format_mandatory = mandatory;
editor->private->keep_last_choice = keep;
editor->private->keep_last_choice_mandatory = keep_mandatory;
-
editor->private->parent = parent;
editor->private->item = item;
are_locked = na_settings_get_boolean( NA_IPREFS_ADMIN_PREFERENCES_LOCKED, NULL, &mandatory );
editor->private->preferences_locked = are_locked && mandatory;
- if( base_window_run( BASE_WINDOW( editor )) == GTK_RESPONSE_OK ){
- format = get_export_format( editor );
+ code = base_window_run( BASE_WINDOW( editor ));
+ switch( code ){
+ case GTK_RESPONSE_OK:
+ format = get_export_format( editor );
+ break;
+
+ case GTK_RESPONSE_CANCEL:
+ /* base_dialog::do_run only returns OK or CANCEL */
+ default:
+ format = IPREFS_EXPORT_NO_EXPORT;
+ break;
}
g_object_unref( editor );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]