diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-11-22 18:41:30 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-11-22 18:41:30 +0900 |
commit | ee0d99607c14cb63d3ebdb3a970b508949fa8219 (patch) | |
tree | 94ac1efedb94cb38bf6879ba0610fe75b554216b /src/showfoto/setup | |
parent | 4adff739380e4ae9f30e443ee95644f184456869 (diff) | |
download | digikam-ee0d99607c14cb63d3ebdb3a970b508949fa8219.tar.gz digikam-ee0d99607c14cb63d3ebdb3a970b508949fa8219.zip |
Rename 'digikam' folder to 'src'
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/showfoto/setup')
-rw-r--r-- | src/showfoto/setup/Makefile.am | 14 | ||||
-rw-r--r-- | src/showfoto/setup/setup.cpp | 153 | ||||
-rw-r--r-- | src/showfoto/setup/setup.h | 78 | ||||
-rw-r--r-- | src/showfoto/setup/setupeditor.cpp | 246 | ||||
-rw-r--r-- | src/showfoto/setup/setupeditor.h | 63 | ||||
-rw-r--r-- | src/showfoto/setup/setuptooltip.cpp | 228 | ||||
-rw-r--r-- | src/showfoto/setup/setuptooltip.h | 59 |
7 files changed, 841 insertions, 0 deletions
diff --git a/src/showfoto/setup/Makefile.am b/src/showfoto/setup/Makefile.am new file mode 100644 index 00000000..d2767031 --- /dev/null +++ b/src/showfoto/setup/Makefile.am @@ -0,0 +1,14 @@ +METASOURCES = AUTO + +INCLUDES = -I$(top_srcdir)/src/utilities/setup \ + -I$(top_srcdir)/src/digikam \ + $(all_includes) + +noinst_LTLIBRARIES = libsetup.la + +libsetup_la_SOURCES = setup.cpp setupeditor.cpp setuptooltip.cpp + +libsetup_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor + +libsetup_la_LIBADD = $(top_builddir)/src/utilities/setup/libshowfotosetup.la + diff --git a/src/showfoto/setup/setup.cpp b/src/showfoto/setup/setup.cpp new file mode 100644 index 00000000..85ec82d2 --- /dev/null +++ b/src/showfoto/setup/setup.cpp @@ -0,0 +1,153 @@ +/* ============================================================ + * + * This file is a part of digiKam project + * http://www.digikam.org + * + * Date : 2005-04-02 + * Description : showfoto setup dialog. + * + * Copyright (C) 2005-2007 by Gilles Caulier <caulier dot gilles at gmail dot com> + * + * This program is free software; you can redistribute it + * and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; + * either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * ============================================================ */ + +// TQt includes. + +#include <tqtabwidget.h> +#include <tqapplication.h> +#include <tqframe.h> + +// KDE includes. + +#include <tdelocale.h> +#include <kiconloader.h> +#include <tdeconfig.h> +#include <tdeapplication.h> + +// Local includes. + +#include "setuptooltip.h" +#include "setupeditor.h" +#include "setupdcraw.h" +#include "setupiofiles.h" +#include "setupslideshow.h" +#include "setupicc.h" +#include "setup.h" +#include "setup.moc" + +namespace ShowFoto +{ + +class SetupPrivate +{ +public: + + SetupPrivate() + { + editorPage = 0; + toolTipPage = 0; + dcrawPage = 0; + iofilesPage = 0; + slideshowPage = 0; + iccPage = 0; + page_editor = 0; + page_toolTip = 0; + page_dcraw = 0; + page_iofiles = 0; + page_slideshow = 0; + page_icc = 0; + } + + TQFrame *page_editor; + TQFrame *page_toolTip; + TQFrame *page_dcraw; + TQFrame *page_iofiles; + TQFrame *page_slideshow; + TQFrame *page_icc; + + SetupEditor *editorPage; + SetupToolTip *toolTipPage; + + Digikam::SetupDcraw *dcrawPage; + Digikam::SetupIOFiles *iofilesPage; + Digikam::SetupSlideShow *slideshowPage; + Digikam::SetupICC *iccPage; +}; + +Setup::Setup(TQWidget* parent, const char* name, Setup::Page page) + : KDialogBase(IconList, i18n("Configure"), Help|Ok|Cancel, Ok, parent, + name, true, true ) +{ + d = new SetupPrivate; + setHelp("setupdialog.anchor", "showfoto"); + + d->page_editor = addPage(i18n("General"), i18n("General Settings"), + BarIcon("showfoto", TDEIcon::SizeMedium)); + d->editorPage = new SetupEditor(d->page_editor); + + d->page_toolTip = addPage(i18n("Tool Tip"), i18n("Thumbbar Items Tool Tip Settings"), + BarIcon("filetypes", TDEIcon::SizeMedium)); + d->toolTipPage = new SetupToolTip(d->page_toolTip); + + d->page_dcraw = addPage(i18n("RAW decoding"), i18n("RAW Files Decoding Settings"), + BarIcon("kdcraw", TDEIcon::SizeMedium)); + d->dcrawPage = new Digikam::SetupDcraw(d->page_dcraw); + + d->page_icc = addPage(i18n("Color Management"), i18n("Color Management Settings"), + BarIcon("colorize", TDEIcon::SizeMedium)); + d->iccPage = new Digikam::SetupICC(d->page_icc, this); + + d->page_iofiles = addPage(i18n("Save Images"), i18n("Save Images' Files' Settings"), + BarIcon("document-save", TDEIcon::SizeMedium)); + d->iofilesPage = new Digikam::SetupIOFiles(d->page_iofiles); + + d->page_slideshow = addPage(i18n("Slide Show"), i18n("Slide Show Settings"), + BarIcon("slideshow", TDEIcon::SizeMedium)); + d->slideshowPage = new Digikam::SetupSlideShow(d->page_slideshow); + + connect(this, TQ_SIGNAL(okClicked()), + this, TQ_SLOT(slotOkClicked()) ); + + if (page != LastPageUsed) + showPage((int) page); + else + { + TDEConfig* config = kapp->config(); + config->setGroup("General Settings"); + showPage(config->readNumEntry("Setup Page", EditorPage)); + } + + show(); +} + +Setup::~Setup() +{ + TDEConfig* config = kapp->config(); + config->setGroup("General Settings"); + config->writeEntry("Setup Page", activePageIndex()); + config->sync(); + delete d; +} + +void Setup::slotOkClicked() +{ + d->editorPage->applySettings(); + d->toolTipPage->applySettings(); + d->dcrawPage->applySettings(); + d->iofilesPage->applySettings(); + d->slideshowPage->applySettings(); + d->iccPage->applySettings(); + close(); +} + +} // namespace ShowFoto diff --git a/src/showfoto/setup/setup.h b/src/showfoto/setup/setup.h new file mode 100644 index 00000000..8f97acbd --- /dev/null +++ b/src/showfoto/setup/setup.h @@ -0,0 +1,78 @@ +/* ============================================================ + * + * This file is a part of digiKam project + * http://www.digikam.org + * + * Date : 2005-04-02 + * Description : showfoto setup dialog. + * + * Copyright (C) 2005-2007 by Gilles Caulier <caulier dot gilles at gmail dot com> + * + * This program is free software; you can redistribute it + * and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; + * either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * ============================================================ */ + +#ifndef SETUP_H +#define SETUP_H + +// KDE includes. + +#include <kdialogbase.h> + +class TQFrame; + +namespace Digikam +{ +class SetupIOFiles; +class SetupSlideShow; +class SetupICC; +} + +namespace ShowFoto +{ + +class SetupEditor; +class SetupPrivate; + +class Setup : public KDialogBase +{ + TQ_OBJECT + + +public: + + enum Page + { + LastPageUsed = -1, + EditorPage=0, + ToolTipPage, + DcrawPage, + IOFilesPage, + SlideshowPage, + ICCPage + }; + + Setup(TQWidget* parent=0, const char* name=0, Page page=LastPageUsed); + ~Setup(); + +private slots: + + void slotOkClicked(); + +private: + + SetupPrivate* d; +}; + +} // namespace ShowFoto + +#endif /* SETUP_H */ diff --git a/src/showfoto/setup/setupeditor.cpp b/src/showfoto/setup/setupeditor.cpp new file mode 100644 index 00000000..19bab8fb --- /dev/null +++ b/src/showfoto/setup/setupeditor.cpp @@ -0,0 +1,246 @@ +/* ============================================================ + * + * This file is a part of digiKam project + * http://www.digikam.org + * + * Date : 2005-04-02 + * Description : setup showfoto tab. + * + * Copyright (C) 2005-2008 by Gilles Caulier <caulier dot gilles at gmail dot com> + * Copyright (C) 2008 by Arnd Baecker <arnd dot baecker at web dot de> + * + * This program is free software; you can redistribute it + * and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; + * either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * ============================================================ */ + +// TQt includes. + +#include <tqlayout.h> +#include <tqcolor.h> +#include <tqhbox.h> +#include <tqvgroupbox.h> +#include <tqlabel.h> +#include <tqwhatsthis.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> + +// KDE includes. + +#include <tdelocale.h> +#include <kdialog.h> +#include <kcolorbutton.h> +#include <knuminput.h> +#include <tdeconfig.h> +#include <tdeapplication.h> + +// Local includes. + +#include "setupeditor.h" +#include "setupeditor.moc" + +namespace ShowFoto +{ + +class SetupEditorPriv +{ +public: + + SetupEditorPriv() + { + backgroundColor = 0; + hideToolBar = 0; + hideThumbBar = 0; + horizontalThumbBar = 0; + showSplash = 0; + useTrash = 0; + exifRotateBox = 0; + exifSetOrientationBox = 0; + overExposureColor = 0; + underExposureColor = 0; + themebackgroundColor = 0; + colorBox = 0; + sortOrderComboBox = 0; + sortReverse = 0; + useRawImportTool = 0; + } + + TQHBox *colorBox; + + TQCheckBox *sortReverse; + TQCheckBox *hideToolBar; + TQCheckBox *hideThumbBar; + TQCheckBox *horizontalThumbBar; + TQCheckBox *showSplash; + TQCheckBox *useTrash; + TQCheckBox *exifRotateBox; + TQCheckBox *exifSetOrientationBox; + TQCheckBox *themebackgroundColor; + TQCheckBox *useRawImportTool; + + TQComboBox *sortOrderComboBox; + + KColorButton *backgroundColor; + KColorButton *underExposureColor; + KColorButton *overExposureColor; +}; + +SetupEditor::SetupEditor(TQWidget* parent ) + : TQWidget(parent) +{ + d = new SetupEditorPriv; + TQVBoxLayout *layout = new TQVBoxLayout( parent, 0, KDialog::spacingHint() ); + + // -------------------------------------------------------- + + TQVGroupBox *interfaceOptionsGroup = new TQVGroupBox(i18n("Interface Options"), parent); + + d->themebackgroundColor = new TQCheckBox(i18n("&Use theme background color"), + interfaceOptionsGroup); + + TQWhatsThis::add( d->themebackgroundColor, i18n("<p>Enable this option to use background theme " + "color in image editor area") ); + + d->colorBox = new TQHBox(interfaceOptionsGroup); + TQLabel *backgroundColorlabel = new TQLabel( i18n("&Background color:"), d->colorBox); + d->backgroundColor = new KColorButton(d->colorBox); + backgroundColorlabel->setBuddy(d->backgroundColor); + TQWhatsThis::add( d->backgroundColor, i18n("<p>Select background color to use " + "for image editor area.") ); + + d->hideToolBar = new TQCheckBox(i18n("H&ide toolbar in fullscreen mode"), interfaceOptionsGroup); + d->hideThumbBar = new TQCheckBox(i18n("Hide &thumbbar in fullscreen mode"), interfaceOptionsGroup); + d->horizontalThumbBar = new TQCheckBox(i18n("Use &horizontal thumbbar (need to restart showFoto)"), interfaceOptionsGroup); + TQWhatsThis::add( d->horizontalThumbBar, i18n("<p>If this option is enabled, the thumbnails bar will be displayed horizontally behind " + "the image area. You need to restart showFoto for this option take effect.<p>")); + d->useTrash = new TQCheckBox(i18n("&Deleting items should move them to trash"), interfaceOptionsGroup); + d->showSplash = new TQCheckBox(i18n("&Show splash screen at startup"), interfaceOptionsGroup); + + d->useRawImportTool = new TQCheckBox(i18n("Use Raw Import Tool to handle Raw image"), interfaceOptionsGroup); + TQWhatsThis::add(d->useRawImportTool, i18n("<p>Set on this option to use Raw Import " + "tool before to load a Raw image, " + "to customize indeep decoding settings.")); + + // -------------------------------------------------------- + + TQVGroupBox *exposureOptionsGroup = new TQVGroupBox(i18n("Exposure Indicators"), parent); + + TQHBox *underExpoBox = new TQHBox(exposureOptionsGroup); + TQLabel *underExpoColorlabel = new TQLabel( i18n("&Under-exposure color:"), underExpoBox); + d->underExposureColor = new KColorButton(underExpoBox); + underExpoColorlabel->setBuddy(d->underExposureColor); + TQWhatsThis::add( d->underExposureColor, i18n("<p>Customize color used in image editor to identify " + "under-exposed pixels.") ); + + TQHBox *overExpoBox = new TQHBox(exposureOptionsGroup); + TQLabel *overExpoColorlabel = new TQLabel( i18n("&Over-exposure color:"), overExpoBox); + d->overExposureColor = new KColorButton(overExpoBox); + overExpoColorlabel->setBuddy(d->overExposureColor); + TQWhatsThis::add( d->overExposureColor, i18n("<p>Customize color used in image editor to identify " + "over-exposed pixels.") ); + + // -------------------------------------------------------- + + TQVGroupBox *ExifGroupOptions = new TQVGroupBox(i18n("EXIF Actions"), parent); + + d->exifRotateBox = new TQCheckBox(ExifGroupOptions); + d->exifRotateBox->setText(i18n("Show images/thumbs &rotated according to orientation tag")); + + d->exifSetOrientationBox = new TQCheckBox(ExifGroupOptions); + d->exifSetOrientationBox->setText(i18n("Set orientation tag to normal after rotate/flip")); + + // -------------------------------------------------------- + + TQVGroupBox *sortOptionsGroup = new TQVGroupBox(i18n("Sort order for images"), parent); + + TQHBox* sortBox = new TQHBox(sortOptionsGroup); + new TQLabel(i18n("Sort images by:"), sortBox); + d->sortOrderComboBox = new TQComboBox(false, sortBox); + d->sortOrderComboBox->insertItem(i18n("File Date"), 0); + d->sortOrderComboBox->insertItem(i18n("File Name"), 1); + d->sortOrderComboBox->insertItem(i18n("File size"), 2); + TQWhatsThis::add(d->sortOrderComboBox, i18n("<p>Here, select whether newly-loaded " + "images are sorted by file-date, file-name, or file-size.")); + + d->sortReverse = new TQCheckBox(i18n("Reverse ordering"), sortOptionsGroup); + TQWhatsThis::add(d->sortReverse, i18n("<p>If this option is enabled, newly-loaded " + "images will be sorted in descending order.")); + + // -------------------------------------------------------- + + layout->addWidget(interfaceOptionsGroup); + layout->addWidget(exposureOptionsGroup); + layout->addWidget(ExifGroupOptions); + layout->addWidget(sortOptionsGroup); + layout->addStretch(); + + // -------------------------------------------------------- + + connect(d->themebackgroundColor, TQ_SIGNAL(toggled(bool)), + this, TQ_SLOT(slotThemeBackgroundColor(bool))); + + readSettings(); +} + +SetupEditor::~SetupEditor() +{ + delete d; +} + +void SetupEditor::slotThemeBackgroundColor(bool e) +{ + d->colorBox->setEnabled(!e); +} + +void SetupEditor::readSettings() +{ + TDEConfig* config = kapp->config(); + TQColor Black(TQt::black); + TQColor White(TQt::white); + config->setGroup("ImageViewer Settings"); + d->themebackgroundColor->setChecked(config->readBoolEntry("UseThemeBackgroundColor", true)); + d->backgroundColor->setColor( config->readColorEntry("BackgroundColor", &Black ) ); + d->hideToolBar->setChecked(config->readBoolEntry("FullScreen Hide ToolBar", false)); + d->hideThumbBar->setChecked(config->readBoolEntry("FullScreenHideThumbBar", true)); + d->horizontalThumbBar->setChecked(config->readBoolEntry("HorizontalThumbbar", false)); + d->useTrash->setChecked(config->readBoolEntry("DeleteItem2Trash", false)); + d->showSplash->setChecked(config->readBoolEntry("ShowSplash", true)); + d->exifRotateBox->setChecked(config->readBoolEntry("EXIF Rotate", true)); + d->exifSetOrientationBox->setChecked(config->readBoolEntry("EXIF Set Orientation", true)); + d->underExposureColor->setColor(config->readColorEntry("UnderExposureColor", &White)); + d->overExposureColor->setColor(config->readColorEntry("OverExposureColor", &Black)); + d->sortOrderComboBox->setCurrentItem(config->readNumEntry("SortOrder", 0)); + d->sortReverse->setChecked(config->readBoolEntry("ReverseSort", false)); + d->useRawImportTool->setChecked(config->readBoolEntry("UseRawImportTool", false)); +} + +void SetupEditor::applySettings() +{ + TDEConfig* config = kapp->config(); + config->setGroup("ImageViewer Settings"); + config->writeEntry("UseThemeBackgroundColor", d->themebackgroundColor->isChecked()); + config->writeEntry("BackgroundColor", d->backgroundColor->color()); + config->writeEntry("FullScreen Hide ToolBar", d->hideToolBar->isChecked()); + config->writeEntry("FullScreenHideThumbBar", d->hideThumbBar->isChecked()); + config->writeEntry("HorizontalThumbbar", d->horizontalThumbBar->isChecked()); + config->writeEntry("DeleteItem2Trash", d->useTrash->isChecked()); + config->writeEntry("ShowSplash", d->showSplash->isChecked()); + config->writeEntry("EXIF Rotate", d->exifRotateBox->isChecked()); + config->writeEntry("EXIF Set Orientation", d->exifSetOrientationBox->isChecked()); + config->writeEntry("UnderExposureColor", d->underExposureColor->color()); + config->writeEntry("OverExposureColor", d->overExposureColor->color()); + config->writeEntry("SortOrder", d->sortOrderComboBox->currentItem()); + config->writeEntry("ReverseSort", d->sortReverse->isChecked()); + config->writeEntry("UseRawImportTool", d->useRawImportTool->isChecked()); + config->sync(); +} + +} // namespace ShowFoto diff --git a/src/showfoto/setup/setupeditor.h b/src/showfoto/setup/setupeditor.h new file mode 100644 index 00000000..877af8de --- /dev/null +++ b/src/showfoto/setup/setupeditor.h @@ -0,0 +1,63 @@ +/* ============================================================ + * + * This file is a part of digiKam project + * http://www.digikam.org + * + * Date : 2005-04-02 + * Description : setup showfoto tab. + * + * Copyright (C) 2005-2008 by Gilles Caulier <caulier dot gilles at gmail dot com> + * + * This program is free software; you can redistribute it + * and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; + * either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * ============================================================ */ + +#ifndef SETUPEDITOR_H +#define SETUPEDITOR_H + +// TQt includes. + +#include <tqwidget.h> + +namespace ShowFoto +{ + +class SetupEditorPriv; + +class SetupEditor : public TQWidget +{ + TQ_OBJECT + + +public: + + SetupEditor(TQWidget* parent=0); + ~SetupEditor(); + + void applySettings(); + +private slots: + + void slotThemeBackgroundColor(bool); + +private: + + void readSettings(); + +private: + + SetupEditorPriv* d; +}; + +} // namespace ShowFoto + +#endif /* SETUPEDITOR_H */ diff --git a/src/showfoto/setup/setuptooltip.cpp b/src/showfoto/setup/setuptooltip.cpp new file mode 100644 index 00000000..d3a08678 --- /dev/null +++ b/src/showfoto/setup/setuptooltip.cpp @@ -0,0 +1,228 @@ +/* ============================================================ + * + * This file is a part of digiKam project + * http://www.digikam.org + * + * Date : 2006-07-09 + * Description : tool tip contents configuration setup tab + * + * Copyright (C) 2006-2007 by Gilles Caulier <caulier dot gilles at gmail dot com> + * + * This program is free software; you can redistribute it + * and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; + * either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * ============================================================ */ + +// TQt includes. + +#include <tqlayout.h> +#include <tqvgroupbox.h> +#include <tqcheckbox.h> +#include <tqwhatsthis.h> + +// KDE includes. + +#include <tdelocale.h> +#include <kdialogbase.h> +#include <tdeapplication.h> +#include <tdeconfig.h> + +// Local includes. + +#include "setuptooltip.h" +#include "setuptooltip.moc" + +namespace ShowFoto +{ + +class SetupToolTipPriv +{ +public: + + SetupToolTipPriv() + { + showToolTipsBox = 0; + + showFileNameBox = 0; + showFileDateBox = 0; + showFileSizeBox = 0; + showImageTypeBox = 0; + showImageDimBox = 0; + + showPhotoMakeBox = 0; + showPhotoDateBox = 0; + showPhotoFocalBox = 0; + showPhotoExpoBox = 0; + showPhotoModeBox = 0; + showPhotoFlashBox = 0; + showPhotoWbBox = 0; + + fileSettingBox = 0; + photoSettingBox = 0; + } + + TQCheckBox *showToolTipsBox; + + TQCheckBox *showFileNameBox; + TQCheckBox *showFileDateBox; + TQCheckBox *showFileSizeBox; + TQCheckBox *showImageTypeBox; + TQCheckBox *showImageDimBox; + + TQCheckBox *showPhotoMakeBox; + TQCheckBox *showPhotoDateBox; + TQCheckBox *showPhotoFocalBox; + TQCheckBox *showPhotoExpoBox; + TQCheckBox *showPhotoModeBox; + TQCheckBox *showPhotoFlashBox; + TQCheckBox *showPhotoWbBox; + + TQVGroupBox *fileSettingBox; + TQVGroupBox *photoSettingBox; +}; + +SetupToolTip::SetupToolTip(TQWidget* parent) + : TQWidget(parent) +{ + d = new SetupToolTipPriv; + TQVBoxLayout *layout = new TQVBoxLayout( parent, 0, KDialog::spacingHint() ); + + d->showToolTipsBox = new TQCheckBox(i18n("Show Thumbbar items toolti&ps"), parent); + TQWhatsThis::add( d->showToolTipsBox, i18n("<p>Set this option to display image information when " + "the mouse hovers over a thumbbar item.")); + + layout->addWidget(d->showToolTipsBox); + + // -------------------------------------------------------- + + d->fileSettingBox = new TQVGroupBox(i18n("File/Image Information"), parent); + + d->showFileNameBox = new TQCheckBox(i18n("Show file name"), d->fileSettingBox); + TQWhatsThis::add( d->showFileNameBox, i18n("<p>Set this option to display the image file name.")); + + d->showFileDateBox = new TQCheckBox(i18n("Show file date"), d->fileSettingBox); + TQWhatsThis::add( d->showFileDateBox, i18n("<p>Set this option to display the image file date.")); + + d->showFileSizeBox = new TQCheckBox(i18n("Show file size"), d->fileSettingBox); + TQWhatsThis::add( d->showFileSizeBox, i18n("<p>Set this option to display the image file size.")); + + d->showImageTypeBox = new TQCheckBox(i18n("Show image type"), d->fileSettingBox); + TQWhatsThis::add( d->showImageTypeBox, i18n("<p>Set this option to display the image type.")); + + d->showImageDimBox = new TQCheckBox(i18n("Show image dimensions"), d->fileSettingBox); + TQWhatsThis::add( d->showImageDimBox, i18n("<p>Set this option to display the image dimensions in pixels.")); + + layout->addWidget(d->fileSettingBox); + + // -------------------------------------------------------- + + d->photoSettingBox = new TQVGroupBox(i18n("Photograph Information"), parent); + + d->showPhotoMakeBox = new TQCheckBox(i18n("Show camera make and model"), d->photoSettingBox); + TQWhatsThis::add( d->showPhotoMakeBox, i18n("<p>Set this option to display the make and model of the " + "camera with which the image has been taken.")); + + d->showPhotoDateBox = new TQCheckBox(i18n("Show camera date"), d->photoSettingBox); + TQWhatsThis::add( d->showPhotoDateBox, i18n("<p>Set this option to display the date when the image was taken.")); + + d->showPhotoFocalBox = new TQCheckBox(i18n("Show camera aperture and focal length"), d->photoSettingBox); + TQWhatsThis::add( d->showPhotoFocalBox, i18n("<p>Set this option to display the camera aperture and focal settings " + "used to take the image.")); + + d->showPhotoExpoBox = new TQCheckBox(i18n("Show camera exposure and sensitivity"), d->photoSettingBox); + TQWhatsThis::add( d->showPhotoExpoBox, i18n("<p>Set this option to display the camera exposure and sensitivity " + "used to take the image.")); + + d->showPhotoModeBox = new TQCheckBox(i18n("Show camera mode and program"), d->photoSettingBox); + TQWhatsThis::add( d->showPhotoModeBox, i18n("<p>Set this option to display the camera mode and program " + "used to take the image.")); + + d->showPhotoFlashBox = new TQCheckBox(i18n("Show camera flash settings"), d->photoSettingBox); + TQWhatsThis::add( d->showPhotoFlashBox, i18n("<p>Set this option to display the camera flash settings " + "used to take the image.")); + + d->showPhotoWbBox = new TQCheckBox(i18n("Show camera white balance settings"), d->photoSettingBox); + TQWhatsThis::add( d->showPhotoWbBox, i18n("<p>Set this option to display the camera white balance settings " + "used to take the image.")); + + layout->addWidget(d->photoSettingBox); + layout->addStretch(); + + // -------------------------------------------------------- + + connect(d->showToolTipsBox, TQ_SIGNAL(toggled(bool)), + d->fileSettingBox, TQ_SLOT(setEnabled(bool))); + + connect(d->showToolTipsBox, TQ_SIGNAL(toggled(bool)), + d->photoSettingBox, TQ_SLOT(setEnabled(bool))); + + // -------------------------------------------------------- + + readSettings(); + adjustSize(); +} + +SetupToolTip::~SetupToolTip() +{ + delete d; +} + +void SetupToolTip::readSettings() +{ + TDEConfig* config = kapp->config(); + config->setGroup("ImageViewer Settings"); + + d->showToolTipsBox->setChecked(config->readBoolEntry("Show ToolTips", true)); + + d->showFileNameBox->setChecked(config->readBoolEntry("ToolTips Show File Name", true)); + d->showFileDateBox->setChecked(config->readBoolEntry("ToolTips Show File Date", false)); + d->showFileSizeBox->setChecked(config->readBoolEntry("ToolTips Show File Size", false)); + d->showImageTypeBox->setChecked(config->readBoolEntry("ToolTips Show Image Type", false)); + d->showImageDimBox->setChecked(config->readBoolEntry("ToolTips Show Image Dim", true)); + + d->showPhotoMakeBox->setChecked(config->readBoolEntry("ToolTips Show Photo Make", true)); + d->showPhotoDateBox->setChecked(config->readBoolEntry("ToolTips Show Photo Date", true)); + d->showPhotoFocalBox->setChecked(config->readBoolEntry("ToolTips Show Photo Focal", true)); + d->showPhotoExpoBox->setChecked(config->readBoolEntry("ToolTips Show Photo Expo", true)); + d->showPhotoModeBox->setChecked(config->readBoolEntry("ToolTips Show Photo Mode", true)); + d->showPhotoFlashBox->setChecked(config->readBoolEntry("ToolTips Show Photo Flash", false)); + d->showPhotoWbBox->setChecked(config->readBoolEntry("ToolTips Show Photo WB", false)); + + d->fileSettingBox->setEnabled(d->showToolTipsBox->isChecked()); + d->photoSettingBox->setEnabled(d->showToolTipsBox->isChecked()); +} + +void SetupToolTip::applySettings() +{ + TDEConfig* config = kapp->config(); + config->setGroup("ImageViewer Settings"); + + config->writeEntry("Show ToolTips", d->showToolTipsBox->isChecked()); + + config->writeEntry("ToolTips Show File Name", d->showFileNameBox->isChecked()); + config->writeEntry("ToolTips Show File Date", d->showFileDateBox->isChecked()); + config->writeEntry("ToolTips Show File Size", d->showFileSizeBox->isChecked()); + config->writeEntry("ToolTips Show Image Type", d->showImageTypeBox->isChecked()); + config->writeEntry("ToolTips Show Image Dim", d->showImageDimBox->isChecked()); + + config->writeEntry("ToolTips Show Photo Make", d->showPhotoMakeBox->isChecked()); + config->writeEntry("ToolTips Show Photo Date", d->showPhotoDateBox->isChecked()); + config->writeEntry("ToolTips Show Photo Focal", d->showPhotoFocalBox->isChecked()); + config->writeEntry("ToolTips Show Photo Expo", d->showPhotoExpoBox->isChecked()); + config->writeEntry("ToolTips Show Photo Mode", d->showPhotoModeBox->isChecked()); + config->writeEntry("ToolTips Show Photo Flash", d->showPhotoFlashBox->isChecked()); + config->writeEntry("ToolTips Show Photo WB", d->showPhotoWbBox->isChecked()); + + config->sync(); +} + +} // namespace ShowFoto + diff --git a/src/showfoto/setup/setuptooltip.h b/src/showfoto/setup/setuptooltip.h new file mode 100644 index 00000000..ebd73f6e --- /dev/null +++ b/src/showfoto/setup/setuptooltip.h @@ -0,0 +1,59 @@ +/* ============================================================ + * + * This file is a part of digiKam project + * http://www.digikam.org + * + * Date : 2006-07-09 + * Description : tool tip contents configuration setup tab + * + * Copyright (C) 2006-2007 by Gilles Caulier <caulier dot gilles at gmail dot com> + * + * This program is free software; you can redistribute it + * and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; + * either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * ============================================================ */ + +#ifndef SETUPTOOLTIP_H +#define SETUPTOOLTIP_H + +// TQt includes. + +#include <tqwidget.h> + +namespace ShowFoto +{ + +class SetupToolTipPriv; + +class SetupToolTip : public TQWidget +{ + TQ_OBJECT + + +public: + + SetupToolTip(TQWidget* parent = 0); + ~SetupToolTip(); + + void applySettings(); + +private: + + void readSettings(); + +private: + + SetupToolTipPriv* d; +}; + +} // namespace ShowFoto + +#endif // SETUPTOOLTIP_H |