Skip to content

Commit 3e9cbf8

Browse files
committed
make module preset label opional
1 parent 0f5c6b6 commit 3e9cbf8

6 files changed

Lines changed: 26 additions & 6 deletions

File tree

src/libs/export.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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+
178183
const char *description(dt_lib_module_t *self)
179184
{
180185
return _("create new files for the\n"

src/libs/filtering.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
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"

src/libs/import.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

189193
dt_view_type_flags_t views(dt_lib_module_t *self)
190194
{

src/libs/lib.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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
130130
static 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 */
671677
static gboolean default_expandable(dt_lib_module_t *self)
672678
{

src/libs/lib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

src/libs/lib_api.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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. */
4242
REQUIRED(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. */
4548
REQUIRED(enum dt_view_type_flags_t, views, struct dt_lib_module_t *self);
4649
/** get the container which the module should be placed in */

0 commit comments

Comments
 (0)