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  * Copyright (C) 2003-2004 by Renchi Raju <renchi dot raju at gmail dot com>
10  * Copyright (C) 2003-2021 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2007      by Arnd Baecker <arnd dot baecker at web dot de>
12  * Copyright (C) 2014      by Mohamed_Anwer <m_dot_anwer at gmx dot com>
13  * Copyright (C) 2014      by Veaceslav Munteanu <veaceslav dot munteanu90 at gmail dot com>
14  *
15  * This program is free software; you can redistribute it
16  * and/or modify it under the terms of the GNU General
17  * Public License as published by the Free Software Foundation;
18  * either version 2, or (at your option)
19  * any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  * GNU General Public License for more details.
25  *
26  * ============================================================ */
27 
28 #include "applicationsettings_p.h"
29 
30 namespace Digikam
31 {
32 
setToolTipsFont(const QFont & font)33 void ApplicationSettings::setToolTipsFont(const QFont& font)
34 {
35     d->toolTipsFont = font;
36 }
37 
getToolTipsFont() const38 QFont ApplicationSettings::getToolTipsFont() const
39 {
40     return d->toolTipsFont;
41 }
42 
setShowToolTips(bool val)43 void ApplicationSettings::setShowToolTips(bool val)
44 {
45     d->showToolTips = val;
46 }
47 
getShowToolTips() const48 bool ApplicationSettings::getShowToolTips() const
49 {
50     return d->showToolTips;
51 }
52 
setToolTipsShowFileName(bool val)53 void ApplicationSettings::setToolTipsShowFileName(bool val)
54 {
55     d->tooltipShowFileName = val;
56 }
57 
getToolTipsShowFileName() const58 bool ApplicationSettings::getToolTipsShowFileName() const
59 {
60     return d->tooltipShowFileName;
61 }
62 
setToolTipsShowFileDate(bool val)63 void ApplicationSettings::setToolTipsShowFileDate(bool val)
64 {
65     d->tooltipShowFileDate = val;
66 }
67 
getToolTipsShowFileDate() const68 bool ApplicationSettings::getToolTipsShowFileDate() const
69 {
70     return d->tooltipShowFileDate;
71 }
72 
setToolTipsShowFileSize(bool val)73 void ApplicationSettings::setToolTipsShowFileSize(bool val)
74 {
75     d->tooltipShowFileSize = val;
76 }
77 
getToolTipsShowFileSize() const78 bool ApplicationSettings::getToolTipsShowFileSize() const
79 {
80     return d->tooltipShowFileSize;
81 }
82 
setToolTipsShowImageType(bool val)83 void ApplicationSettings::setToolTipsShowImageType(bool val)
84 {
85     d->tooltipShowImageType = val;
86 }
87 
getToolTipsShowImageType() const88 bool ApplicationSettings::getToolTipsShowImageType() const
89 {
90     return d->tooltipShowImageType;
91 }
92 
setToolTipsShowImageDim(bool val)93 void ApplicationSettings::setToolTipsShowImageDim(bool val)
94 {
95     d->tooltipShowImageDim = val;
96 }
97 
getToolTipsShowImageDim() const98 bool ApplicationSettings::getToolTipsShowImageDim() const
99 {
100     return d->tooltipShowImageDim;
101 }
102 
setToolTipsShowImageAR(bool val)103 void ApplicationSettings::setToolTipsShowImageAR(bool val)
104 {
105     d->tooltipShowImageAR = val;
106 }
107 
getToolTipsShowImageAR() const108 bool ApplicationSettings::getToolTipsShowImageAR() const
109 {
110     return d->tooltipShowImageAR;
111 }
112 
setToolTipsShowPhotoMake(bool val)113 void ApplicationSettings::setToolTipsShowPhotoMake(bool val)
114 {
115     d->tooltipShowPhotoMake = val;
116 }
117 
getToolTipsShowPhotoMake() const118 bool ApplicationSettings::getToolTipsShowPhotoMake() const
119 {
120     return d->tooltipShowPhotoMake;
121 }
122 
setToolTipsShowPhotoLens(bool val)123 void ApplicationSettings::setToolTipsShowPhotoLens(bool val)
124 {
125     d->tooltipShowPhotoLens = val;
126 }
127 
getToolTipsShowPhotoLens() const128 bool ApplicationSettings::getToolTipsShowPhotoLens() const
129 {
130     return d->tooltipShowPhotoLens;
131 }
132 
setToolTipsShowPhotoDate(bool val)133 void ApplicationSettings::setToolTipsShowPhotoDate(bool val)
134 {
135     d->tooltipShowPhotoDate = val;
136 }
137 
getToolTipsShowPhotoDate() const138 bool ApplicationSettings::getToolTipsShowPhotoDate() const
139 {
140     return d->tooltipShowPhotoDate;
141 }
142 
setToolTipsShowPhotoFocal(bool val)143 void ApplicationSettings::setToolTipsShowPhotoFocal(bool val)
144 {
145     d->tooltipShowPhotoFocal = val;
146 }
147 
getToolTipsShowPhotoFocal() const148 bool ApplicationSettings::getToolTipsShowPhotoFocal() const
149 {
150     return d->tooltipShowPhotoFocal;
151 }
152 
setToolTipsShowPhotoExpo(bool val)153 void ApplicationSettings::setToolTipsShowPhotoExpo(bool val)
154 {
155     d->tooltipShowPhotoExpo = val;
156 }
157 
getToolTipsShowPhotoExpo() const158 bool ApplicationSettings::getToolTipsShowPhotoExpo() const
159 {
160     return d->tooltipShowPhotoExpo;
161 }
162 
setToolTipsShowPhotoMode(bool val)163 void ApplicationSettings::setToolTipsShowPhotoMode(bool val)
164 {
165     d->tooltipShowPhotoMode = val;
166 }
167 
getToolTipsShowPhotoMode() const168 bool ApplicationSettings::getToolTipsShowPhotoMode() const
169 {
170     return d->tooltipShowPhotoMode;
171 }
172 
setToolTipsShowPhotoFlash(bool val)173 void ApplicationSettings::setToolTipsShowPhotoFlash(bool val)
174 {
175     d->tooltipShowPhotoFlash = val;
176 }
177 
getToolTipsShowPhotoFlash() const178 bool ApplicationSettings::getToolTipsShowPhotoFlash() const
179 {
180     return d->tooltipShowPhotoFlash;
181 }
182 
setToolTipsShowPhotoWB(bool val)183 void ApplicationSettings::setToolTipsShowPhotoWB(bool val)
184 {
185     d->tooltipShowPhotoWb = val;
186 }
187 
getToolTipsShowPhotoWB() const188 bool ApplicationSettings::getToolTipsShowPhotoWB() const
189 {
190     return d->tooltipShowPhotoWb;
191 }
192 
setToolTipsShowAlbumName(bool val)193 void ApplicationSettings::setToolTipsShowAlbumName(bool val)
194 {
195     d->tooltipShowAlbumName = val;
196 }
197 
getToolTipsShowAlbumName() const198 bool ApplicationSettings::getToolTipsShowAlbumName() const
199 {
200     return d->tooltipShowAlbumName;
201 }
202 
setToolTipsShowTitles(bool val)203 void ApplicationSettings::setToolTipsShowTitles(bool val)
204 {
205     d->tooltipShowTitles = val;
206 }
207 
getToolTipsShowTitles() const208 bool ApplicationSettings::getToolTipsShowTitles() const
209 {
210     return d->tooltipShowTitles;
211 }
212 
setToolTipsShowComments(bool val)213 void ApplicationSettings::setToolTipsShowComments(bool val)
214 {
215     d->tooltipShowComments = val;
216 }
217 
getToolTipsShowComments() const218 bool ApplicationSettings::getToolTipsShowComments() const
219 {
220     return d->tooltipShowComments;
221 }
222 
setToolTipsShowTags(bool val)223 void ApplicationSettings::setToolTipsShowTags(bool val)
224 {
225     d->tooltipShowTags = val;
226 }
227 
getToolTipsShowTags() const228 bool ApplicationSettings::getToolTipsShowTags() const
229 {
230     return d->tooltipShowTags;
231 }
232 
setToolTipsShowLabelRating(bool val)233 void ApplicationSettings::setToolTipsShowLabelRating(bool val)
234 {
235     d->tooltipShowLabelRating = val;
236 }
237 
getToolTipsShowLabelRating() const238 bool ApplicationSettings::getToolTipsShowLabelRating() const
239 {
240     return d->tooltipShowLabelRating;
241 }
242 
setShowAlbumToolTips(bool val)243 void ApplicationSettings::setShowAlbumToolTips(bool val)
244 {
245     d->showAlbumToolTips = val;
246 }
247 
getShowAlbumToolTips() const248 bool ApplicationSettings::getShowAlbumToolTips() const
249 {
250     return d->showAlbumToolTips;
251 }
252 
setToolTipsShowAlbumTitle(bool val)253 void ApplicationSettings::setToolTipsShowAlbumTitle(bool val)
254 {
255     d->tooltipShowAlbumTitle = val;
256 }
257 
getToolTipsShowAlbumTitle() const258 bool ApplicationSettings::getToolTipsShowAlbumTitle() const
259 {
260     return d->tooltipShowAlbumTitle;
261 }
262 
setToolTipsShowAlbumDate(bool val)263 void ApplicationSettings::setToolTipsShowAlbumDate(bool val)
264 {
265     d->tooltipShowAlbumDate = val;
266 }
267 
getToolTipsShowAlbumDate() const268 bool ApplicationSettings::getToolTipsShowAlbumDate() const
269 {
270     return d->tooltipShowAlbumDate;
271 }
272 
setToolTipsShowAlbumCollection(bool val)273 void ApplicationSettings::setToolTipsShowAlbumCollection(bool val)
274 {
275     d->tooltipShowAlbumCollection = val;
276 }
277 
getToolTipsShowAlbumCollection() const278 bool ApplicationSettings::getToolTipsShowAlbumCollection() const
279 {
280     return d->tooltipShowAlbumCollection;
281 }
282 
setToolTipsShowAlbumCategory(bool val)283 void ApplicationSettings::setToolTipsShowAlbumCategory(bool val)
284 {
285     d->tooltipShowAlbumCategory = val;
286 }
287 
getToolTipsShowAlbumCategory() const288 bool ApplicationSettings::getToolTipsShowAlbumCategory() const
289 {
290     return d->tooltipShowAlbumCategory;
291 }
292 
setToolTipsShowAlbumCaption(bool val)293 void ApplicationSettings::setToolTipsShowAlbumCaption(bool val)
294 {
295     d->tooltipShowAlbumCaption = val;
296 }
297 
getToolTipsShowAlbumCaption() const298 bool ApplicationSettings::getToolTipsShowAlbumCaption() const
299 {
300     return d->tooltipShowAlbumCaption;
301 }
302 
setToolTipsShowAlbumPreview(bool val)303 void ApplicationSettings::setToolTipsShowAlbumPreview(bool val)
304 {
305     d->tooltipShowAlbumPreview = val;
306 }
307 
getToolTipsShowAlbumPreview() const308 bool ApplicationSettings::getToolTipsShowAlbumPreview() const
309 {
310     return d->tooltipShowAlbumPreview;
311 }
312 
setToolTipsShowVideoAspectRatio(bool val)313 void ApplicationSettings::setToolTipsShowVideoAspectRatio(bool val)
314 {
315     d->tooltipShowVideoAspectRatio = val;
316 }
317 
getToolTipsShowVideoAspectRatio() const318 bool ApplicationSettings::getToolTipsShowVideoAspectRatio() const
319 {
320     return d->tooltipShowVideoAspectRatio;
321 }
322 
setToolTipsShowVideoAudioBitRate(bool val)323 void ApplicationSettings::setToolTipsShowVideoAudioBitRate(bool val)
324 {
325     d->tooltipShowVideoAudioBitRate = val;
326 }
327 
getToolTipsShowVideoAudioBitRate() const328 bool ApplicationSettings::getToolTipsShowVideoAudioBitRate() const
329 {
330     return d->tooltipShowVideoAudioBitRate;
331 }
332 
setToolTipsShowVideoAudioChannelType(bool val)333 void ApplicationSettings::setToolTipsShowVideoAudioChannelType(bool val)
334 {
335     d->tooltipShowVideoAudioChannelType = val;
336 }
337 
getToolTipsShowVideoAudioChannelType() const338 bool ApplicationSettings::getToolTipsShowVideoAudioChannelType() const
339 {
340     return d->tooltipShowVideoAudioChannelType;
341 }
342 
setToolTipsShowVideoAudioCodec(bool val)343 void ApplicationSettings::setToolTipsShowVideoAudioCodec(bool val)
344 {
345     d->tooltipShowVideoAudioCodec = val;
346 }
347 
getToolTipsShowVideoAudioCodec() const348 bool ApplicationSettings::getToolTipsShowVideoAudioCodec() const
349 {
350     return d->tooltipShowVideoAudioCodec;
351 }
352 
setToolTipsShowVideoDuration(bool val)353 void ApplicationSettings::setToolTipsShowVideoDuration(bool val)
354 {
355     d->tooltipShowVideoDuration = val;
356 }
357 
getToolTipsShowVideoDuration() const358 bool ApplicationSettings::getToolTipsShowVideoDuration() const
359 {
360     return d->tooltipShowVideoDuration;
361 }
362 
setToolTipsShowVideoFrameRate(bool val)363 void ApplicationSettings::setToolTipsShowVideoFrameRate(bool val)
364 {
365     d->tooltipShowVideoFrameRate = val;
366 }
367 
getToolTipsShowVideoFrameRate() const368 bool ApplicationSettings::getToolTipsShowVideoFrameRate() const
369 {
370     return d->tooltipShowVideoFrameRate;
371 }
372 
setToolTipsShowVideoVideoCodec(bool val)373 void ApplicationSettings::setToolTipsShowVideoVideoCodec(bool val)
374 {
375     d->tooltipShowVideoVideoCodec = val;
376 }
377 
getToolTipsShowVideoVideoCodec() const378 bool ApplicationSettings::getToolTipsShowVideoVideoCodec() const
379 {
380     return d->tooltipShowVideoVideoCodec;
381 }
382 
showToolTipsIsValid() const383 bool ApplicationSettings::showToolTipsIsValid() const
384 {
385     if (d->showToolTips)
386     {
387         if (d->tooltipShowFileName   ||
388             d->tooltipShowFileDate   ||
389             d->tooltipShowFileSize   ||
390             d->tooltipShowImageType  ||
391             d->tooltipShowImageDim   ||
392             d->tooltipShowImageAR    ||
393             d->tooltipShowPhotoMake  ||
394             d->tooltipShowPhotoLens  ||
395             d->tooltipShowPhotoDate  ||
396             d->tooltipShowPhotoFocal ||
397             d->tooltipShowPhotoExpo  ||
398             d->tooltipShowPhotoMode  ||
399             d->tooltipShowPhotoFlash ||
400             d->tooltipShowPhotoWb    ||
401             d->tooltipShowAlbumName  ||
402             d->tooltipShowComments   ||
403             d->tooltipShowTags       ||
404             d->tooltipShowLabelRating
405            )
406         {
407             return true;
408         }
409     }
410 
411     return false;
412 }
413 
showAlbumToolTipsIsValid() const414 bool ApplicationSettings::showAlbumToolTipsIsValid() const
415 {
416     if (d->showAlbumToolTips)
417     {
418         if (
419             d->tooltipShowAlbumTitle      ||
420             d->tooltipShowAlbumDate       ||
421             d->tooltipShowAlbumCollection ||
422             d->tooltipShowAlbumCaption    ||
423             d->tooltipShowAlbumCategory
424            )
425         {
426             return true;
427         }
428     }
429 
430     return false;
431 }
432 
433 } // namespace Digikam
434