r24193 by craig - #12493: Improve export to image dialog defaults and behaviour

scribus-commit scribus-commit at lists.scribus.net
Sat Nov 7 11:19:33 UTC 2020


Author: craig
Date: Sat Nov  7 11:19:33 2020
New Revision: 24193

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24193
Log:
#12493: Improve export to image dialog defaults and behaviour

Modified:
    trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.cpp
    trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.h
    trunk/Scribus/scribus/plugins/export/pixmapexport/export.cpp

Modified: trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24193&path=/trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.cpp	(original)
+++ trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.cpp	Sat Nov  7 11:19:33 2020
@@ -5,6 +5,7 @@
 for which a new license (GPL+exception) is in place.
 */
 #include <QCompleter>
+#include <QComboBox>
 #include <QDebug>
 #include <QDirModel>
 #include <QFileDialog>
@@ -17,6 +18,7 @@
 #include "prefscontext.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"
+#include "scpaths.h"
 #include "scribusdoc.h"
 #include "ui/createrange.h"
 #include "ui/scrspinbox.h"
@@ -34,10 +36,10 @@
 	dirModel->setFilter(QDir::AllDirs);
 	outputDirectory->setCompleter(new QCompleter(dirModel, this));
 
-	outputDirectory->setText( QDir::toNativeSeparators(prefs->get("wdir", QDir::currentPath())) );
 	QList<QByteArray> imgs = QImageWriter::supportedImageFormats();
 	for (int i = 0; i < imgs.count(); i++)
 		bitmapType->addItem(imgs[i]);
+
 	qualityBox->setValue(quality);
 	qualityBox->setWrapping(true);
 
@@ -75,13 +77,13 @@
 
 void ExportForm::OutputDirectoryButton_pressed()
 {
-	QString lastDir = prefs->get("wdir", ".");
+	QString lastDir = prefs->get("ExportDirectory", ".");
 	QString dirName = QFileDialog::getExistingDirectory(this, tr("Choose an Export Directory"), lastDir);
 	if (dirName.length()>0)
 	{
 		dirName = QDir::toNativeSeparators(dirName);
 		outputDirectory->setText(dirName);
-		prefs->set("wdir", dirName);
+		prefs->set("ExportDirectory", dirName);
 	}
 }
 
@@ -131,6 +133,7 @@
 
 void ExportForm::readConfig()
 {
+	outputDirectory->setText( QDir::toNativeSeparators(prefs->get("ExportDirectory", ScPaths::instance().userDocumentDir())) );
 	DPIBox->setValue(prefs->getUInt("DPIBox", 72));
 	enlargementBox->setValue(prefs->getInt("EnlargementBox", 100));
 	qualityBox->setValue(prefs->getUInt("QualityBox", -1));
@@ -146,7 +149,8 @@
 	}
 	rangeVal->setEnabled(exportPageValue==2);
 	pageNrButton->setEnabled(exportPageValue==2);
-	bitmapType->setCurrentText("png");
+	bitmapType->setCurrentIndex(prefs->getInt("BitmapType",1));
+
 	rangeVal->setText(prefs->get("RangeVal", ""));
 }
 

Modified: trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24193&path=/trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.h
==============================================================================
--- trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.h	(original)
+++ trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.h	Sat Nov  7 11:19:33 2020
@@ -21,16 +21,16 @@
 	~ExportForm();
 
 public slots:
-	virtual void OutputDirectoryButton_pressed();
-	virtual void IntervalPagesRadio_stateChanged();
-	virtual void AllPagesRadio_stateChanged();
-	virtual void OnePageRadio_stateChanged();
-	virtual void computeSize();
+	void OutputDirectoryButton_pressed();
+	void IntervalPagesRadio_stateChanged();
+	void AllPagesRadio_stateChanged();
+	void OnePageRadio_stateChanged();
+	void computeSize();
 
 protected:
-	PrefsContext* prefs;
-	ScribusDoc*  m_doc;
-	int m_PageCount;
+	PrefsContext* prefs {nullptr};
+	ScribusDoc* m_doc {nullptr};
+	int m_PageCount {1};
 
 protected slots:
 	void createPageNumberRange();

Modified: trunk/Scribus/scribus/plugins/export/pixmapexport/export.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24193&path=/trunk/Scribus/scribus/plugins/export/pixmapexport/export.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/pixmapexport/export.cpp	(original)
+++ trunk/Scribus/scribus/plugins/export/pixmapexport/export.cpp	Sat Nov  7 11:19:33 2020
@@ -104,7 +104,8 @@
 	// interval widgets handling
 	QString tmp;
 	dia->rangeVal->setText(tmp.setNum(doc->currentPageNumber()+1));
-	dia->prefixLineEdit->setText(doc->documentFileName());
+	QFileInfo docFileInfo(doc->documentFileName());
+	dia->prefixLineEdit->setText(docFileInfo.baseName());
 	// main "loop"
 	if (dia->exec() != QDialog::Accepted)
 		return true;




More information about the scribus-commit mailing list