[Pkg-privacy-commits] [nautilus-wipe] 21/224: Factorize menu_gsd_cb
Ulrike Uhlig
u-guest at moszumanska.debian.org
Thu Jul 7 19:45:30 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 50fbf77a2504e835754d8b30fc47860bac281d69
Author: Colomban Wendling <ban at herbesfolles.org>
Date: Sun Feb 14 15:09:48 2010 +0100
Factorize menu_gsd_cb
---
nautilus-srm/nautilus-srm.c | 34 +++++++++++++++++++++++++---------
1 file changed, 25 insertions(+), 9 deletions(-)
diff --git a/nautilus-srm/nautilus-srm.c b/nautilus-srm/nautilus-srm.c
index e79fab8..93b5d2f 100644
--- a/nautilus-srm/nautilus-srm.c
+++ b/nautilus-srm/nautilus-srm.c
@@ -403,8 +403,10 @@ file_list_to_string (GList *files_list)
}
static void
-menu_srm_cb (NautilusMenuItem *menu,
- NautilusSrm *srm)
+menu_gsd_cb (NautilusMenuItem *menu,
+ NautilusSrm *srm,
+ gchar *confirmation_message,
+ GCallback *confirm_dialog_cb)
{
NautilusSrmPrivate *priv = GET_PRIVATE (srm);
GtkWidget *dialog;
@@ -419,9 +421,7 @@ menu_srm_cb (NautilusMenuItem *menu,
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_NONE,
- g_dngettext(NULL, "Are you sure you want delete the following file and to override its content?",
- "Are you sure you want delete the following files and to override their content?",
- g_list_length(priv->files)));
+ confirmation_message);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
"%s", files_names_str);
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
@@ -429,13 +429,25 @@ menu_srm_cb (NautilusMenuItem *menu,
GTK_STOCK_DELETE, GTK_RESPONSE_YES,
NULL);
/* Ask the user (asynchronously) */
- g_signal_connect (dialog, "response", G_CALLBACK (confirm_dialog_srm_cb), srm);
+ g_signal_connect (dialog, "response", G_CALLBACK (confirm_dialog_cb), srm);
gtk_widget_show (GTK_WIDGET (dialog));
/* Cleanup */
g_free (files_names_str);
}
+static void
+menu_srm_cb (NautilusMenuItem *menu,
+ NautilusSrm *srm)
+{
+ menu_gsd_cb (menu, srm,
+ g_dngettext(NULL, "Are you sure you want delete the following file and to override its content?",
+ "Are you sure you want delete the following files and to override their content?",
+ g_list_length(priv->files)),
+ G_CALLBACK (confirm_dialog_srm_cb),);
+}
+
+
/*
* get_underlying_mountpoint:
* @file: the file to study
@@ -564,6 +576,12 @@ static void
menu_sfill_cb (NautilusMenuItem *menu,
NautilusSrm *srm)
{
+ menu_gsd_cb (menu, srm,
+ _("Are you sure you want to override "
+ "free space on the device(s) containing "
+ "the following files?"),
+ G_CALLBACK (confirm_dialog_sfill_cb));
+
NautilusSrmPrivate *priv = GET_PRIVATE (srm);
GList* devices_to_fill;
gchar* files_names_str;
@@ -576,9 +594,7 @@ menu_sfill_cb (NautilusMenuItem *menu,
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_NONE,
- _("Are you sure you want to override "
- "free space on the device(s) containing "
- "the following files?"));
+ );
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
"%s", files_names_str);
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
--
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