Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
film_gui.c
Go to the documentation of this file.
1/*
2 * This file is part of darktable,
3 * Copyright (C) 2016 johannes hanika.
4 * Copyright (C) 2016, 2020 Tobias Ellinghaus.
5 * Copyright (C) 2020 Pascal Obry.
6 * Copyright (C) 2021 Sakari Kapanen.
7 * Copyright (C) 2022 Martin Baƙinka.
8 *
9 * darktable is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * darktable is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with darktable. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23
24#include "gui/common/film_gui.h"
25
26#include "common/film.h"
27#include "system/mem_alloc.h"
28#include "gui/application.h"
29
30#include <glib/gi18n.h>
31#include <gtk/gtk.h>
34
35#ifdef GDK_WINDOWING_QUARTZ
36#include "osx/osx.h"
37#endif
38
39/* Runs on the GUI thread via g_idle_add(): dt_film_remove_empty() is reached from worker
40 * threads, and gtk_dialog_run() must not be. Takes ownership of the list. */
41static gboolean _ask_and_delete(gpointer user_data)
42{
43 GList *empty_dirs = (GList *)user_data;
45
49 ngettext("do you want to remove this empty directory?",
50 "do you want to remove these empty directories?",
52#ifdef GDK_WINDOWING_QUARTZ
54#endif
55
57 ngettext("remove empty directory?", "remove empty directories?", n_empty_dirs));
58
60
63 dt_gui_add_class(scroll, "dt_recessed_scroll");
64
66
68 {
71 gtk_list_store_set(store, &iter, 0, list_iter->data, -1);
72 }
73
76 gtk_widget_set_name(GTK_WIDGET(tree), "delete-dialog");
78 "text", 0, NULL);
80
81 gtk_container_add(GTK_CONTAINER(scroll), tree);
84
86
87 gtk_widget_show_all(dialog); // needed for the content area!
88
89 const gint res = gtk_dialog_run(GTK_DIALOG(dialog));
90 gtk_widget_destroy(dialog);
91
92 // The deleting itself is the backend's job; this module only obtained consent.
94
97
98 return FALSE;
99}
100
102{
103 // defer to the GUI thread; ownership travels with the list
105}
106
111
112// clang-format off
113// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
114// vim: shiftwidth=2 expandtab tabstop=2 cindent
115// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
116// clang-format on
GtkWidget * dt_gui_main_window(void)
#define TRUE
Definition ashift_lsd.c:162
#define FALSE
Definition ashift_lsd.c:158
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
Definition colorspaces.h:98
int store(dt_imageio_module_storage_t *self, dt_imageio_module_data_t *sdata, const int32_t imgid, dt_imageio_module_format_t *format, dt_imageio_module_data_t *fdata, const int num, const int total, const gboolean high_quality, const gboolean export_masks, dt_colorspaces_color_profile_type_t icc_type, const gchar *icc_filename, dt_iop_color_intent_t icc_intent, dt_export_metadata_t *metadata)
Definition disk.c:250
void dt_film_remove_directories(const GList *dirs)
Definition film.c:238
void dt_film_set_confirm_rmdir_handler(dt_film_confirm_rmdir_handler_t handler)
Definition film.c:233
static void _confirm_rmdir(GList *empty_dirs)
Definition film_gui.c:101
static gboolean _ask_and_delete(gpointer user_data)
Definition film_gui.c:41
void dt_film_gui_register_handlers(void)
Definition film_gui.c:107
static void dt_free_gpointer(gpointer ptr)
Definition mem_alloc.h:104
void dt_osx_disallow_fullscreen(GtkWidget *widget)
Definition osx.mm:105
#define DT_PIXEL_APPLY_DPI(value)
void dt_gui_add_class(GtkWidget *widget, const gchar *class_name)