File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*
22 This file is part of darktable,
3- Copyright (C) 2009-2025 darktable developers.
3+ Copyright (C) 2009-2026 darktable developers.
44
55 darktable is free software: you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
@@ -175,6 +175,11 @@ const char *name(dt_lib_module_t *self)
175175 return _ ("export" );
176176}
177177
178+ gboolean has_preset_label (dt_lib_module_t * self )
179+ {
180+ return TRUE;
181+ }
182+
178183const char * description (dt_lib_module_t * self )
179184{
180185 return _ ("create new files for the\n"
Original file line number Diff line number Diff line change 1919#include "bauhaus/bauhaus.h"
2020#include "common/collection.h"
2121#include "common/darktable.h"
22+ #include "common/metadata.h"
2223#include "control/conf.h"
2324#include "control/control.h"
25+ #include "control/jobs.h"
2426#include "dtgtk/button.h"
2527#include "dtgtk/range.h"
2628#include "gui/accelerators.h"
Original file line number Diff line number Diff line change 11/*
22 This file is part of darktable,
3- Copyright (C) 2011-2025 darktable developers.
3+ Copyright (C) 2011-2026 darktable developers.
44
55 darktable is free software: you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
@@ -185,6 +185,10 @@ const char *name(dt_lib_module_t *self)
185185 return _ ("import" );
186186}
187187
188+ gboolean has_preset_label (dt_lib_module_t * self )
189+ {
190+ return TRUE;
191+ }
188192
189193dt_view_type_flags_t views (dt_lib_module_t * self )
190194{
Original file line number Diff line number Diff line change 11/*
22 This file is part of darktable,
3- Copyright (C) 2009-2025 darktable developers.
3+ Copyright (C) 2009-2026 darktable developers.
44
55 darktable is free software: you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
@@ -130,7 +130,7 @@ static dt_lib_module_info_t *_get_module_info_for_module(dt_lib_module_t *module
130130static void _set_module_preset_label (dt_lib_module_t * module ,
131131 const gchar * preset_name )
132132{
133- if (!module -> expander ) return ;
133+ if (!module -> expander || ! module -> has_preset_label ( module ) ) return ;
134134
135135 gchar * preset_label_text = (* preset_name == '\0' )? g_strdup ("" )
136136 : g_strdup_printf ("• %s" , preset_name );
@@ -667,6 +667,12 @@ uint32_t dt_lib_get_container(dt_lib_module_t *module)
667667 return container ;
668668}
669669
670+ /* default has_preset_label implementation */
671+ static gboolean default_has_preset_label (dt_lib_module_t * self )
672+ {
673+ return FALSE;
674+ }
675+
670676/* default expandable implementation */
671677static gboolean default_expandable (dt_lib_module_t * self )
672678{
Original file line number Diff line number Diff line change 11/*
22 This file is part of darktable,
3- Copyright (C) 2009-2025 darktable developers.
3+ Copyright (C) 2009-2026 darktable developers.
44
55 darktable is free software: you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
Original file line number Diff line number Diff line change 11/*
22 This file is part of darktable,
3- Copyright (C) 2016-2024 darktable developers.
3+ Copyright (C) 2016-2026 darktable developers.
44
55 darktable is free software: you can redistribute it and/or modify
66 it under the terms of the GNU Lesser General Public License as published by
@@ -41,6 +41,9 @@ struct dt_view_t;
4141/** get name of the module, to be translated. */
4242REQUIRED (const char * , name , struct dt_lib_module_t * self );
4343
44+ /** does the module support a preset label? */
45+ DEFAULT (gboolean , has_preset_label , struct dt_lib_module_t * self );
46+
4447/** get the views which the module should be loaded in. */
4548REQUIRED (enum dt_view_type_flags_t , views , struct dt_lib_module_t * self );
4649/** get the container which the module should be placed in */
You can’t perform that action at this time.
0 commit comments