[QGIS Commit] r8130 - trunk/qgis/src/plugins/quick_print

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Feb 9 11:20:27 EST 2008


Author: timlinux
Date: 2008-02-09 11:20:27 -0500 (Sat, 09 Feb 2008)
New Revision: 8130

Modified:
   trunk/qgis/src/plugins/quick_print/quickprintgui.cpp
Log:
Remember last used page size
Default to A4 on first use
(prevents those fantastic A0 printouts when you click ok without thinking) 


Modified: trunk/qgis/src/plugins/quick_print/quickprintgui.cpp
===================================================================
--- trunk/qgis/src/plugins/quick_print/quickprintgui.cpp	2008-02-09 14:59:36 UTC (rev 8129)
+++ trunk/qgis/src/plugins/quick_print/quickprintgui.cpp	2008-02-09 16:20:27 UTC (rev 8130)
@@ -28,7 +28,6 @@
 : mpMapCanvas ( thepMapCanvas ), QDialog ( parent, fl ) 
 {
   setupUi(this);
-  readSettings();
   grpOuput->hide();  //until properly implemented
   cboPageSize->addItem("A0 (841 x 1189 mm)","QPrinter::A0");
   cboPageSize->addItem("A1 (594 x 841 mm)","QPrinter::A1");
@@ -59,6 +58,7 @@
   cboPageSize->addItem("Ledger (432 x 279 mm)","QPrinter::Ledger");
   cboPageSize->addItem("Legal (8.5 x 14 inches, 216 x 356 mm)","QPrinter::Legal");
   cboPageSize->addItem("Letter (8.5 x 11 inches, 216 x 279 mm)","QPrinter::Letter");
+  readSettings();
 }  
 
 QuickPrintGui::~QuickPrintGui()
@@ -73,6 +73,9 @@
   bool myIncrementLastFileFlag = mySettings.value("quickprint/incrementLastFile", false).toBool();
   radUseIncrementedFileName->setChecked(myIncrementLastFileFlag);
 
+  QString myPageSize = mySettings.value("quickprint/pageSize",
+            "QPrinter::A4").toString();
+  cboPageSize->setCurrentIndex(cboPageSize->findData(myPageSize));
 }
 
 void QuickPrintGui::writeSettings()
@@ -82,6 +85,8 @@
   mySettings.setValue("quickprint/mapName", leMapName->text());
   mySettings.setValue("quickprint/mapCopyright", teCopyright->text());
   mySettings.setValue("quickprint/incrementLastFile", radUseIncrementedFileName->isChecked());
+  mySettings.setValue("quickprint/pageSize", 
+      cboPageSize->itemData(cboPageSize->currentIndex()));
 }
 
 



More information about the QGIS-commit mailing list