digiKam
Loading...
Searching...
No Matches
applicationsettings.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2003-16-10
7 * Description : application settings interface
8 *
9 * SPDX-FileCopyrightText: 2003-2004 by Renchi Raju <renchi dot raju at gmail dot com>
10 * SPDX-FileCopyrightText: 2003-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
11 * SPDX-FileCopyrightText: 2007 by Arnd Baecker <arnd dot baecker at web dot de>
12 * SPDX-FileCopyrightText: 2014-2015 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
13 * SPDX-FileCopyrightText: 2017 by Simon Frei <freisim93 at gmail dot com>
14 *
15 * SPDX-License-Identifier: GPL-2.0-or-later
16 *
17 * ============================================================ */
18
19#pragma once
20
21// Qt includes
22
23#include <QFont>
24#include <QHash>
25#include <QObject>
26#include <QString>
27#include <QStringList>
28
29// Local includes
30
31#include "digikam_config.h"
32#include "digikam_export.h"
33#include "digikam_globals.h"
34#include "facescansettings.h"
35#include "haariface.h"
36#include "sidebar.h"
37
38
39class KConfigGroup;
40
41namespace Digikam
42{
43
44class VersionManagerSettings;
45class DbEngineParameters;
46class PreviewSettings;
47
48class DIGIKAM_GUI_EXPORT ApplicationSettings : public QObject
49{
50 Q_OBJECT
51
52public:
53
55 {
56 ByFolder = 0,
58 ByDate
59 };
60
68
73 {
77 Natural = 0,
78
82 Normal
83 };
84
86 {
87 No = 0,
89 Ask
90 };
91
92 typedef QHash<OperationType, QString> OperationStrings;
93 typedef QHash<OperationType, ApplicationSettings::ApplyToEntireGroup> OperationModes;
94
95Q_SIGNALS:
96
100
101public:
102
103 static ApplicationSettings* instance();
104
105 void readSettings();
106 void saveSettings();
107 void emitSetupChanged();
108
109 QString generalConfigGroupName() const;
110
111 // -- MessageBox Notification ---------------------------------------------------
112
117 bool readMsgBoxShouldBeShown(const QString& dontShowAgainName);
118
124 void saveMsgBoxShouldBeShown(const QString& dontShowAgainName);
125
126 // -- Database Settings ---------------------------------------------------------
127
128 DbEngineParameters getDbEngineParameters() const;
129 void setDbEngineParameters(const DbEngineParameters& params);
130
131 void setSyncBalooToDigikam(bool val);
132 bool getSyncBalooToDigikam() const;
133
134 void setSyncDigikamToBaloo(bool val);
135 bool getSyncDigikamToBaloo() const;
136
137 // -- Albums Settings -------------------------------------------------------
138
139 void setTreeViewIconSize(int val);
140 int getTreeViewIconSize() const;
141
142 void setTreeViewFaceSize(int val);
143 int getTreeViewFaceSize() const;
144
145 void setTreeViewFont(const QFont& font);
146 QFont getTreeViewFont() const;
147
148 void setAlbumSortRole(const AlbumSortRole role);
149 AlbumSortRole getAlbumSortRole() const;
150
151 void setShowFolderTreeViewItemsCount(bool val);
152 bool getShowFolderTreeViewItemsCount() const;
153
154 void setAlbumMonitoring(bool val);
155 bool getAlbumMonitoring() const;
156
157 void setRecurseAlbums(bool val);
158 bool getRecurseAlbums() const;
159
160 void setRecurseTags(bool val);
161 bool getRecurseTags() const;
162
163 void setAllGroupsOpen(bool val);
164 bool getAllGroupsOpen() const;
165
166 void setAlbumCategoryNames(const QStringList& list);
167 QStringList getAlbumCategoryNames() const;
168
169 bool addAlbumCategoryName(const QString& name) const;
170 bool delAlbumCategoryName(const QString& name) const;
171
172 // -- Icon-View Settings -------------------------------------------------------
173
174 void setDefaultIconSize(int val);
175 int getDefaultIconSize() const;
176
177 void setIconViewFont(const QFont& font);
178 QFont getIconViewFont() const;
179
180 void setImageSortOrder(int order);
181 int getImageSortOrder() const;
182
186 void setImageSorting(int sorting);
187 int getImageSorting() const;
188
189 void setImageSeparationMode(int mode);
190 int getImageSeparationMode() const;
191
192 void setImageSeparationSortOrder(int order);
193 int getImageSeparationSortOrder() const;
194
195 void setItemLeftClickAction(int action);
196 int getItemLeftClickAction() const;
197
198 void setIconShowName(bool val);
199 bool getIconShowName() const;
200
201 void setIconShowSize(bool val);
202 bool getIconShowSize() const;
203
204 void setIconShowTitle(bool val);
205 bool getIconShowTitle() const;
206
207 void setIconShowComments(bool val);
208 bool getIconShowComments() const;
209
210 void setIconShowResolution(bool val);
211 bool getIconShowResolution() const;
212
213 void setIconShowAspectRatio(bool val);
214 bool getIconShowAspectRatio() const;
215
216 void setIconShowTags(bool val);
217 bool getIconShowTags() const;
218
219 void setIconShowDate(bool val);
220 bool getIconShowDate() const;
221
222 void setIconShowModDate(bool val);
223 bool getIconShowModDate() const;
224
225 void setIconShowRating(bool val);
226 bool getIconShowRating() const;
227
228 void setIconShowPickLabel(bool val);
229 bool getIconShowPickLabel() const;
230
231 void setIconShowColorLabel(bool val);
232 bool getIconShowColorLabel() const;
233
234 void setIconShowImageFormat(bool val);
235 bool getIconShowImageFormat() const;
236
237 void setIconShowCoordinates(bool val);
238 bool getIconShowCoordinates() const;
239
243 void setIconShowOverlays(bool val);
244
248 bool getIconShowOverlays() const;
249
250 void setIconShowFullscreen(bool val);
251 bool getIconShowFullscreen() const;
252
253 void setPreviewSettings(const PreviewSettings& settings);
254 PreviewSettings getPreviewSettings() const;
255
256 void setPreviewShowIcons(bool val);
257 bool getPreviewShowIcons() const;
258
259 void setScaleFitToWindow(bool val);
260 bool getScaleFitToWindow() const;
261
262 void setPreviewSmoothScaled(bool val);
263 bool getPreviewSmoothScaled() const;
264
265 // -- Mime-Types Settings -------------------------------------------------------
266
267 QString getImageFileFilter() const;
268 QString getMovieFileFilter() const;
269 QString getAudioFileFilter() const;
270 QString getRawFileFilter() const;
271 QString getAllFileFilter() const;
272
273 void addToImageFileFilter(const QString& extensions);
274
275 // -- Tool-Tips Settings -------------------------------------------------------
276
277 bool showToolTipsIsValid() const;
278 bool showAlbumToolTipsIsValid() const;
279
280 void setToolTipsFont(const QFont& font);
281 QFont getToolTipsFont() const;
282
283 void setShowToolTips(bool val);
284 bool getShowToolTips() const;
285
286 void setToolTipsShowFileName(bool val);
287 bool getToolTipsShowFileName() const;
288
289 void setToolTipsShowFileDate(bool val);
290 bool getToolTipsShowFileDate() const;
291
292 void setToolTipsShowFileSize(bool val);
293 bool getToolTipsShowFileSize() const;
294
295 void setToolTipsShowImageType(bool val);
296 bool getToolTipsShowImageType() const;
297
298 void setToolTipsShowImageDim(bool val);
299 bool getToolTipsShowImageDim() const;
300
301 void setToolTipsShowImageAR(bool val);
302 bool getToolTipsShowImageAR() const;
303
304 void setToolTipsShowPhotoMake(bool val);
305 bool getToolTipsShowPhotoMake() const;
306
307 void setToolTipsShowPhotoLens(bool val);
308 bool getToolTipsShowPhotoLens() const;
309
310 void setToolTipsShowPhotoDate(bool val);
311 bool getToolTipsShowPhotoDate() const;
312
313 void setToolTipsShowPhotoFocal(bool val);
314 bool getToolTipsShowPhotoFocal() const;
315
316 void setToolTipsShowPhotoExpo(bool val);
317 bool getToolTipsShowPhotoExpo() const;
318
319 void setToolTipsShowPhotoMode(bool val);
320 bool getToolTipsShowPhotoMode() const;
321
322 void setToolTipsShowPhotoFlash(bool val);
323 bool getToolTipsShowPhotoFlash() const;
324
325 void setToolTipsShowPhotoWB(bool val);
326 bool getToolTipsShowPhotoWB() const;
327
328 void setToolTipsShowAlbumName(bool val);
329 bool getToolTipsShowAlbumName() const;
330
331 void setToolTipsShowTitles(bool val);
332 bool getToolTipsShowTitles() const;
333
334 void setToolTipsShowComments(bool val);
335 bool getToolTipsShowComments() const;
336
337 void setToolTipsShowTags(bool val);
338 bool getToolTipsShowTags() const;
339
340 void setToolTipsShowLabelRating(bool val);
341 bool getToolTipsShowLabelRating() const;
342
343 void setShowAlbumToolTips(bool val);
344 bool getShowAlbumToolTips() const;
345
346 void setToolTipsShowAlbumTitle(bool val);
347 bool getToolTipsShowAlbumTitle() const;
348
349 void setToolTipsShowAlbumDate(bool val);
350 bool getToolTipsShowAlbumDate() const;
351
352 void setToolTipsShowAlbumCollection(bool val);
353 bool getToolTipsShowAlbumCollection() const;
354
355 void setToolTipsShowAlbumCategory(bool val);
356 bool getToolTipsShowAlbumCategory() const;
357
358 void setToolTipsShowAlbumCaption(bool val);
359 bool getToolTipsShowAlbumCaption() const;
360
361 void setToolTipsShowAlbumPreview(bool val);
362 bool getToolTipsShowAlbumPreview() const;
363
364 void setToolTipsShowVideoAspectRatio(bool val);
365 bool getToolTipsShowVideoAspectRatio() const;
366
367 void setToolTipsShowVideoAudioBitRate(bool val);
368 bool getToolTipsShowVideoAudioBitRate() const;
369
370 void setToolTipsShowVideoAudioChannelType(bool val);
371 bool getToolTipsShowVideoAudioChannelType() const;
372
373 void setToolTipsShowVideoAudioCodec(bool val);
374 bool getToolTipsShowVideoAudioCodec() const;
375
376 void setToolTipsShowVideoDuration(bool val);
377 bool getToolTipsShowVideoDuration() const;
378
379 void setToolTipsShowVideoFrameRate(bool val);
380 bool getToolTipsShowVideoFrameRate() const;
381
382 void setToolTipsShowVideoVideoCodec(bool val);
383 bool getToolTipsShowVideoVideoCodec() const;
384
385 // -- Miscs Settings -------------------------------------------------------
386
387 void setScanAtStart(bool val);
388 bool getScanAtStart() const;
389
390 void setCleanAtStart(bool val);
391 bool getCleanAtStart() const;
392
393 void setDatabaseDirSetAtCmd(bool val);
394 bool getDatabaseDirSetAtCmd() const;
395
396 void setUseTrash(bool val);
397 bool getUseTrash() const;
398
399 void setShowTrashDeleteDialog(bool val);
400 bool getShowTrashDeleteDialog() const;
401
402 void setShowPermanentDeleteDialog(bool val);
403 bool getShowPermanentDeleteDialog() const;
404
405 void setApplySidebarChangesDirectly(bool val);
406 bool getApplySidebarChangesDirectly() const;
407
408 void setUseNativeFileDialog(bool val);
409 bool getUseNativeFileDialog() const;
410
411 void setDrawFramesToGrouped(bool val);
412 bool getDrawFramesToGrouped() const;
413
414 void setSelectFirstAlbumItem(bool val);
415 bool getSelectFirstAlbumItem() const;
416
417 void setExpandNewCurrentItem(bool val);
418 bool getExpandNewCurrentItem() const;
419
420 void setScrollItemToCenter(bool val);
421 bool getScrollItemToCenter() const;
422
423 void setShowOnlyPersonTagsInPeopleSidebar(bool val);
424 bool showOnlyPersonTagsInPeopleSidebar() const;
425
426 void setDetectFacesInNewImages(bool val);
427 bool getDetectFacesInNewImages() const;
428
434 void setStringComparisonType(ApplicationSettings::StringComparisonType val);
435
441 StringComparisonType getStringComparisonType() const;
442
443 bool isStringTypeNatural() const;
444
445 void setApplicationStyle(const QString& style);
446 QString getApplicationStyle() const;
447
448 void setIconTheme(const QString& theme);
449 QString getIconTheme() const;
450
451 void setApplicationFont(const QFont& fnt);
452 QFont getApplicationFont() const;
453
454 void setShowSplashScreen(bool val);
455 bool getShowSplashScreen() const;
456
457 void setCurrentTheme(const QString& theme);
458 QString getCurrentTheme() const;
459
460 void setSidebarTitleStyle(DMultiTabBar::TextStyle style);
461 DMultiTabBar::TextStyle getSidebarTitleStyle() const;
462
463 int getUpdateType() const;
464 void setUpdateType(int type);
465
466 bool getUpdateWithDebug() const;
467 void setUpdateWithDebug(bool dbg);
468
469 void setVersionManagerSettings(const VersionManagerSettings& settings);
470 VersionManagerSettings getVersionManagerSettings() const;
471
472 int getFaceDetectionAccuracy() const;
473 void setFaceDetectionAccuracy(int value);
474
475 FaceScanSettings::FaceDetectionModel getFaceDetectionModel() const;
476 void setFaceDetectionModel(FaceScanSettings::FaceDetectionModel model);
477
478 FaceScanSettings::FaceDetectionSize getFaceDetectionSize() const;
479 void setFaceDetectionSize(FaceScanSettings::FaceDetectionSize size);
480
481 int getFaceRecognitionAccuracy() const;
482 void setFaceRecognitionAccuracy(int value);
483
484 FaceScanSettings::FaceRecognitionModel getFaceRecognitionModel() const;
485 void setFaceRecognitionModel(FaceScanSettings::FaceRecognitionModel model);
486
487 void setShowThumbbar(bool val);
488 bool getShowThumbbar() const;
489
490 void setRatingFilterCond(int val);
491 int getRatingFilterCond() const;
492
493 void setMinimumSimilarityBound(int val);
494 int getMinimumSimilarityBound() const;
495
496 void setDuplicatesSearchLastMinSimilarity(int val);
497 int getDuplicatesSearchLastMinSimilarity() const;
498
499 void setDuplicatesSearchLastMaxSimilarity(int val);
500 int getDuplicatesSearchLastMaxSimilarity() const;
501
509 void setGroupingOperateOnAll(OperationType type, ApplyToEntireGroup applyAll);
510
518 ApplyToEntireGroup getGroupingOperateOnAll(OperationType type) const;
519
527 bool askGroupingOperateOnAll(OperationType type);
528
535 static QString operationTypeTitle(OperationType type);
536
544 static QString operationTypeExplanation(OperationType type);
545
546 void setDuplicatesAlbumTagRelation(int val);
547 int getDuplicatesAlbumTagRelation() const;
548
549 void setDuplicatesReferenceImageSelectionMethod(HaarIface::RefImageSelMethod val);
550 HaarIface::RefImageSelMethod getDuplicatesRefImageSelMethod() const;
551
552 void setDuplicatesSearchRestrictions(int val);
553 int getDuplicatesSearchRestrictions() const;
554
555 void setHelpBoxNotificationSeen(bool val);
556 bool getHelpBoxNotificationSeen();
557
558private Q_SLOTS:
559
560 void applyBalooSettings();
561
562private:
563
564 // Disabled
566 explicit ApplicationSettings(QObject*) = delete;
567 ~ApplicationSettings() override;
568
569 KConfigGroup generalConfigGroup() const;
570
571private:
572
573 friend class ApplicationSettingsCreator;
574
575 class Private;
576 Private* const d = nullptr;
577};
578
579} // namespace Digikam
Definition applicationsettings_p.h:68
Definition applicationsettings.h:49
ApplyToEntireGroup
Definition applicationsettings.h:86
@ Yes
Definition applicationsettings.h:88
StringComparisonType
Definition applicationsettings.h:73
QHash< OperationType, QString > OperationStrings
Definition applicationsettings.h:92
AlbumSortRole
Definition applicationsettings.h:55
@ ByCategory
Definition applicationsettings.h:57
ItemLeftClickAction
Definition applicationsettings.h:62
@ ShowOnTable
Definition applicationsettings.h:65
@ StartEditor
Definition applicationsettings.h:64
@ OpenDefault
Definition applicationsettings.h:66
bool readMsgBoxShouldBeShown(const QString &dontShowAgainName)
void saveMsgBoxShouldBeShown(const QString &dontShowAgainName)
void addToImageFileFilter(const QString &extensions)
QHash< OperationType, ApplicationSettings::ApplyToEntireGroup > OperationModes
Definition applicationsettings.h:93
TextStyle
Definition sidebar.h:57
Definition dbengineparameters.h:39
FaceDetectionSize
Definition facescansettings.h:76
FaceRecognitionModel
Definition facescansettings.h:89
FaceDetectionModel
Definition facescansettings.h:65
RefImageSelMethod
The RefImageSelMethod enum Selection method to determine which image will be the reference in the dup...
Definition haariface.h:100
Definition previewsettings.h:25
Definition versionmanagersettings.h:33
qulonglong value
Definition itemviewutilities.cpp:585
Definition datefolderview.cpp:34
OperationType
Definition digikam_globals.h:161