[Xfce4-commits] <xfce4-panel:master> Add confirmation before creating launchers from dnd (bug #6926).
Nick Schermer
noreply at xfce.org
Sat Mar 10 21:12:01 CET 2012
Updating branch refs/heads/master
to fcf318f4598e23645a0d245843fe3570e60f0151 (commit)
from dcc851a3ff625af9617cc23027099bd1ae513354 (commit)
commit fcf318f4598e23645a0d245843fe3570e60f0151
Author: Nick Schermer <nick at xfce.org>
Date: Sat Mar 10 21:10:34 2012 +0100
Add confirmation before creating launchers from dnd (bug #6926).
panel/panel-application.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/panel/panel-application.c b/panel/panel-application.c
index 7506255..1f22002 100644
--- a/panel/panel-application.c
+++ b/panel/panel-application.c
@@ -848,6 +848,7 @@ panel_application_drag_data_received (PanelWindow *window,
gchar **uris;
guint i;
gboolean found;
+ gint n_items;
panel_return_if_fail (PANEL_IS_WINDOW (window));
panel_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
@@ -950,9 +951,20 @@ panel_application_drag_data_received (PanelWindow *window,
uris = gtk_selection_data_get_uris (selection_data);
if (G_LIKELY (uris != NULL))
{
- /* create a new item with a unique id */
- succeed = panel_application_plugin_insert (application, window, LAUNCHER_PLUGIN_NAME,
- -1, uris, application->drop_index);
+ n_items = g_strv_length (uris);
+ if (xfce_dialog_confirm (NULL, GTK_STOCK_ADD, _("Create _Launcher"),
+ _("This will create a new launcher plugin on the panel and inserts "
+ "the dropped files as menu items."),
+ ngettext ("Create new launcher from %d desktop file",
+ "Create new launcher from %d desktop files",
+ n_items),
+ n_items))
+ {
+ /* create a new item with a unique id */
+ succeed = panel_application_plugin_insert (application, window, LAUNCHER_PLUGIN_NAME,
+ -1, uris, application->drop_index);
+ }
+
g_strfreev (uris);
}
More information about the Xfce4-commits
mailing list