[Pkg-privacy-commits] [nautilus-wipe] 90/224: Improve confirm dialog confirmation button
Ulrike Uhlig
u-guest at moszumanska.debian.org
Thu Jul 7 19:45:37 UTC 2016
This is an automated email from the git hooks/post-receive script.
u-guest pushed a commit to branch master
in repository nautilus-wipe.
commit 3ffc25b1586ac98614cc22db2294183a0c351eea
Author: Colomban Wendling <ban at herbesfolles.org>
Date: Wed Mar 31 15:23:58 2010 +0200
Improve confirm dialog confirmation button
Allow for custom label and icon without stock item to easily set icons
on custom labels.
This commit also make use of this new functionality.
---
nautilus-srm/nautilus-srm.c | 4 +++-
nautilus-srm/operation-manager.c | 22 +++++++++++++++++-----
nautilus-srm/operation-manager.h | 1 +
3 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/nautilus-srm/nautilus-srm.c b/nautilus-srm/nautilus-srm.c
index f1480e1..6bb7bc4 100644
--- a/nautilus-srm/nautilus-srm.c
+++ b/nautilus-srm/nautilus-srm.c
@@ -509,7 +509,8 @@ run_delete_operation (GtkWindow *parent,
/* confirm dialog */
confirm_primary_text,
_("If you wipe an item, it will not be recoverable."),
- GTK_STOCK_DELETE,
+ _("_Wipe"),
+ gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_BUTTON),
/* progress dialog */
_("Wiping files..."),
/* operation launcher */
@@ -585,6 +586,7 @@ run_fill_operation (GtkWindow *parent,
confirm_primary_text,
_("This operation may take a while."),
_("_Wipe available diskspace"),
+ gtk_image_new_from_stock (GTK_STOCK_CLEAR, GTK_ICON_SIZE_BUTTON),
/* progress dialog */
_("Wiping available diskspace..."),
/* operation launcher */
diff --git a/nautilus-srm/operation-manager.c b/nautilus-srm/operation-manager.c
index 9cda1d9..cc6809c 100644
--- a/nautilus-srm/operation-manager.c
+++ b/nautilus-srm/operation-manager.c
@@ -283,6 +283,9 @@ pref_enum_combo_changed_handler (GtkComboBox *combo,
* @secondary_text: Dialog's secondary text
* @confirm_button_text: Text of the button to hit in order to confirm (can be a
* stock item)
+ * @confirm_button_icon: A #GtkWidget to use as the confirmation button's icon,
+ * or %NULL for none or the default (e.g. if
+ * @confirm_button_text is a stock item that have an icon)
* @fast: return location for the Gsd.SecureDeleteOperation:fast setting, or
* %NULL
* @delete_mode: return location for the Gsd.SecureDeleteOperation:mode setting,
@@ -295,11 +298,13 @@ operation_confirm_dialog (GtkWindow *parent,
const gchar *primary_text,
const gchar *secondary_text,
const gchar *confirm_button_text,
+ GtkWidget *confirm_button_icon,
gboolean *fast,
GsdSecureDeleteOperationMode *delete_mode,
gboolean *zeroise)
{
GtkResponseType response = GTK_RESPONSE_NONE;
+ GtkWidget *button;
GtkWidget *dialog;
dialog = gtk_message_dialog_new (parent,
@@ -310,10 +315,13 @@ operation_confirm_dialog (GtkWindow *parent,
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
"%s", secondary_text);
}
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
- confirm_button_text, GTK_RESPONSE_ACCEPT,
- NULL);
+ gtk_dialog_add_button (GTK_DIALOG (dialog),
+ GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT);
+ button = gtk_dialog_add_button (GTK_DIALOG (dialog),
+ confirm_button_text, GTK_RESPONSE_ACCEPT);
+ if (confirm_button_icon) {
+ gtk_button_set_image (GTK_BUTTON (button), confirm_button_icon);
+ }
/* if we have settings to choose */
if (fast || delete_mode || zeroise) {
GtkWidget *content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
@@ -448,6 +456,9 @@ progress_dialog_response_handler (GtkDialog *dialog,
* @confirm_secondary_text: Secondary text for the confirmation dialog
* @confirm_button_text: Text for the confirm button of the confirmation dialog.
* It may be a GTK stock item.
+ * @confirm_button_icon: A #GtkWidget to use as the confirmation button's icon,
+ * or %NULL for none or the default (e.g. if
+ * @confirm_button_text is a stock item that have an icon)
* @progress_dialog_text: Text for the progress dialog
* @operation_launcher_func: the function that will be launched to do the operation
* @failed_primary_text: Primary text of the dialog displayed if operation failed.
@@ -463,6 +474,7 @@ nautilus_srm_operation_manager_run (GtkWindow *parent,
const gchar *confirm_primary_text,
const gchar *confirm_secondary_text,
const gchar *confirm_button_text,
+ GtkWidget *confirm_button_icon,
const gchar *progress_dialog_text,
NautilusSrmOperationFunc operation_launcher_func,
const gchar *failed_primary_text,
@@ -476,7 +488,7 @@ nautilus_srm_operation_manager_run (GtkWindow *parent,
if (operation_confirm_dialog (parent,
confirm_primary_text, confirm_secondary_text,
- confirm_button_text,
+ confirm_button_text, confirm_button_icon,
&fast, &delete_mode, &zeroise)) {
GError *err = NULL;
struct NautilusSrmOperationData *opdata;
diff --git a/nautilus-srm/operation-manager.h b/nautilus-srm/operation-manager.h
index 8bd8878..b4dbb7b 100644
--- a/nautilus-srm/operation-manager.h
+++ b/nautilus-srm/operation-manager.h
@@ -60,6 +60,7 @@ void nautilus_srm_operation_manager_run (GtkWindow *parent,
const gchar *confirm_primary_text,
const gchar *confirm_secondary_text,
const gchar *confirm_button_text,
+ GtkWidget *confirm_button_icon,
const gchar *progress_dialog_text,
NautilusSrmOperationFunc operation_launcher_func,
const gchar *failed_primary_text,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/nautilus-wipe.git
More information about the Pkg-privacy-commits
mailing list