44#include <glib/gi18n.h>
47#ifdef GDK_WINDOWING_QUARTZ
74 if(
res != GTK_RESPONSE_OK)
83gboolean
delete_history_callback(GtkAccelGroup *group, GObject *acceleratable, guint keyval, GdkModifierType mods, gpointer user_data)
92 const int img_count = g_list_length(imgs);
94 GtkWidget *dialog = gtk_message_dialog_new(
95 GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
96 ngettext(
"Do you really want to clear history of %d image?",
97 "Do you really want to clear history of %d images?", img_count),
99#ifdef GDK_WINDOWING_QUARTZ
102 gtk_window_set_title(GTK_WINDOW(dialog), ngettext(
"Delete image's history?",
"Delete images' history?", img_count));
104 GtkWidget *message_area = gtk_message_dialog_get_message_area(GTK_MESSAGE_DIALOG(dialog));
105 GtkWidget *ask_check = gtk_check_button_new_with_label(_(
"Always ask"));
106 gtk_widget_set_tooltip_text(ask_check,
107 _(
"when unchecked, history will be deleted silently from now on without this confirmation.\n"
108 "you can turn it back on from preferences."));
109 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ask_check),
TRUE);
110 gtk_box_pack_start(GTK_BOX(message_area), ask_check,
FALSE,
FALSE, 6);
111 gtk_widget_show(ask_check);
113 const gint
res = gtk_dialog_run(GTK_DIALOG(dialog));
114 dt_conf_set_bool(
"ask_before_discard", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ask_check)));
115 gtk_widget_destroy(dialog);
117 if(
res != GTK_RESPONSE_YES)
128 if(is_darkroom_image_in_list)
135 if(is_darkroom_image_in_list)
GList * dt_act_on_get_images()
GtkWidget * dt_gui_main_window(void)
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
void dt_conf_set_bool(const char *name, int val)
int dt_conf_get_bool(const char *name)
void dt_control_queue_redraw_center()
Request a redraw of the centre view.
struct dt_develop_t * dt_dev_get_global(void)
void dt_apply_dev_history_update(dt_develop_t *dev)
Reload the current darkroom history and refresh every dependent GUI.
gboolean dt_dev_history_is_image_in_dev(GList *imgs)
Check whether any image of the list is the one currently loaded in the darkroom.
dt_atomic_set_uint64 & dev
void dt_dev_undo_start_record(dt_develop_t *dev)
void dt_dev_undo_end_record(dt_develop_t *dev)
void dt_gui_refocus_parent(GtkWindow *parent)
int dt_gui_hist_dialog_new(dt_history_copy_item_t *d, int32_t imgid, gboolean iscopy)
gboolean dt_history_copy(int32_t imgid)
dt_history_copy_item_t * dt_history_copy_paste_get(void)
The history clipboard: what "copy history" put there, for "paste" to read.
gboolean dt_history_delete_on_list(const GList *list, gboolean undo)
gboolean delete_history_callback(GtkAccelGroup *group, GObject *acceleratable, guint keyval, GdkModifierType mods, gpointer user_data)
gboolean dt_history_paste_parts_prepare(void)
gboolean dt_history_copy_parts(int32_t imgid)
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
void dt_osx_disallow_fullscreen(GtkWidget *widget)
Asking the interface to repaint itself.