2
* Copyright (c) 2008-2011 Mike Massonnet <mmassonnet@xfce.org>
2
* Copyright (c) 2008-2012 Mike Massonnet <mmassonnet@xfce.org>
4
4
* This program is free software; you can redistribute it and/or modify
5
5
* it under the terms of the GNU General Public License as published by
185
188
cb_clear_history (ClipmanMenu *menu)
187
192
GtkClipboard *clipboard;
189
if (!xfce_dialog_confirm (NULL, GTK_STOCK_YES, NULL, _("Are you sure you want to clear the history?"), NULL))
194
if (!menu->priv->never_confirm_history_clear)
196
dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
197
GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
198
_("Are you sure you want to clear the history?"));
202
#if GTK_CHECK_VERSION(2, 22, 0)
203
GtkWidget *content_area = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (dialog));
205
GtkWidget *content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
207
GtkWidget *checkbox = gtk_check_button_new_with_label (_("Don't ask again"));
208
exo_binding_new (G_OBJECT (checkbox), "active", G_OBJECT (menu), "never-confirm-history-clear");
209
gtk_widget_show (checkbox);
210
gtk_container_add (GTK_CONTAINER (content_area), checkbox);
212
res = gtk_dialog_run (GTK_DIALOG (dialog));
213
gtk_widget_destroy (dialog);
215
if (res != GTK_RESPONSE_YES)
217
g_object_set (menu, "never-confirm-history-clear", FALSE, NULL);
192
224
clipman_history_clear (menu->priv->history);
338
370
"Paste the content of a menu item when it is activated",
340
372
G_PARAM_CONSTRUCT|G_PARAM_READWRITE));
374
g_object_class_install_property (object_class, NEVER_CONFIRM_HISTORY_CLEAR,
375
g_param_spec_boolean ("never-confirm-history-clear",
376
"NeverConfirmHistoryClear",
377
"Set to FALSE to clear the history list with confirmation",
379
G_PARAM_CONSTRUCT|G_PARAM_READWRITE));