File indexing completed on 2024-05-12 15:27:47
0001 /*************************************************************************** 0002 File : ImageOptionsWidget.cpp 0003 Project : LabPlot 0004 Description : widget providing options for the import of image data 0005 -------------------------------------------------------------------- 0006 Copyright : (C) 2015-2017 Stefan Gerlach (stefan.gerlach@uni.kn) 0007 ***************************************************************************/ 0008 0009 /*************************************************************************** 0010 * * 0011 * This program is free software; you can redistribute it and/or modify * 0012 * it under the terms of the GNU General Public License as published by * 0013 * the Free Software Foundation; either version 2 of the License, or * 0014 * (at your option) any later version. * 0015 * * 0016 * This program is distributed in the hope that it will be useful, * 0017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0019 * GNU General Public License for more details. * 0020 * * 0021 * You should have received a copy of the GNU General Public License * 0022 * along with this program; if not, write to the Free Software * 0023 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 0024 * Boston, MA 02110-1301 USA * 0025 * * 0026 ***************************************************************************/ 0027 #include "ImageOptionsWidget.h" 0028 0029 #include <KSharedConfig> 0030 #include <KConfigGroup> 0031 0032 /*! 0033 \class ImageOptionsWidget 0034 \brief Widget providing options for the import of image data 0035 0036 \ingroup kdefrontend 0037 */ 0038 0039 ImageOptionsWidget::ImageOptionsWidget(QWidget* parent) : QWidget(parent) { 0040 ui.setupUi(parent); 0041 0042 ui.cbImportFormat->addItems(ImageFilter::importFormats()); 0043 0044 const QString textImageFormatShort = i18n("This option determines how the image is converted when importing."); 0045 0046 ui.lImportFormat->setToolTip(textImageFormatShort); 0047 ui.lImportFormat->setWhatsThis(textImageFormatShort); 0048 ui.cbImportFormat->setToolTip(textImageFormatShort); 0049 ui.cbImportFormat->setWhatsThis(textImageFormatShort); 0050 } 0051 0052 void ImageOptionsWidget::loadSettings() const { 0053 KConfigGroup conf(KSharedConfig::openConfig(), "Import"); 0054 0055 ui.cbImportFormat->setCurrentIndex(conf.readEntry("ImportFormat", 0)); 0056 } 0057 0058 void ImageOptionsWidget::saveSettings() { 0059 KConfigGroup conf(KSharedConfig::openConfig(), "Import"); 0060 0061 conf.writeEntry("ImportFormat", ui.cbImportFormat->currentIndex()); 0062 }