Commit 89456e0c authored by Boudewijn Rempt's avatar Boudewijn Rempt

Save options for the tiff filter as well.

parent ea5f2af1
......@@ -28,6 +28,10 @@
#include <kcombobox.h>
#include <klocale.h>
#include <kis_properties_configuration.h>
#include <kis_config.h>
#include "ui_kis_wdg_options_tiff.h"
KisDlgOptionsTIFF::KisDlgOptionsTIFF(QWidget *parent)
......@@ -43,6 +47,21 @@ KisDlgOptionsTIFF::KisDlgOptionsTIFF(QWidget *parent)
setMainWidget(wdg);
kapp->restoreOverrideCursor();
setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
QString filterConfig = KisConfig().exportConfiguration("TIFF");
KisPropertiesConfiguration cfg;
cfg.fromXML(filterConfig);
optionswdg->kComboBoxCompressionType->setCurrentIndex(cfg.getInt("compressiontype", 0));
activated(optionswdg->kComboBoxCompressionType->currentIndex());
optionswdg->kComboBoxPredictor->setCurrentIndex(cfg.getInt("predictor", 0));
optionswdg->alpha->setChecked(cfg.getBool("alpha", true));
optionswdg->flatten->setChecked(cfg.getBool("flatten", true));
flattenToggled(optionswdg->flatten->isChecked());
optionswdg->qualityLevel->setValue(cfg.getInt("quality", 80));
optionswdg->compressionLevelDeflate->setValue(cfg.getInt("deflate", 6));
optionswdg->kComboBoxFaxMode->setCurrentIndex(cfg.getInt("faxmode", 0));
optionswdg->compressionLevelPixarLog->setValue(cfg.getInt("pixarlog", 6));
}
KisDlgOptionsTIFF::~KisDlgOptionsTIFF()
......@@ -129,6 +148,20 @@ KisTIFFOptions KisDlgOptionsTIFF::options()
options.faxMode = optionswdg->kComboBoxFaxMode->currentIndex() + 1;
options.pixarLogCompress = optionswdg->compressionLevelPixarLog->value();
qDebug() << options.compressionType << options.predictor << options.alpha << options.jpegQuality << options.deflateCompress << options.faxMode << options.pixarLogCompress;
KisPropertiesConfiguration cfg;
cfg.setProperty("compressiontype", optionswdg->kComboBoxCompressionType->currentIndex());
cfg.setProperty("predictor", options.predictor - 1);
cfg.setProperty("alpha", options.alpha);
cfg.setProperty("flatten", options.flatten);
cfg.setProperty("quality", options.jpegQuality);
cfg.setProperty("deflate", options.deflateCompress);
cfg.setProperty("faxmode", options.faxMode - 1);
cfg.setProperty("pixarlog", options.pixarLogCompress);
KisConfig().setExportConfiguration("TIFF", cfg);
return options;
}
......
......@@ -76,6 +76,7 @@ KoFilter::ConversionStatus KisTIFFExport::convert(const QByteArray& from, const
if (cs->colorModelId() == CMYKAColorModelID) {
kdb->optionswdg->alpha->setChecked(false);
kdb->optionswdg->alpha->setEnabled(false);
}
if (!m_chain->manager()->getBatchMode()) {
if (kdb->exec() == QDialog::Rejected) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment