Skip to content

Commit 2e4ff83

Browse files
author
timlinux
committedFeb 9, 2008
Remember last used page size
Default to A4 on first use (prevents those fantastic A0 printouts when you click ok without thinking) git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8130 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎src/plugins/quick_print/quickprintgui.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ QuickPrintGui::QuickPrintGui( QgsMapCanvas * thepMapCanvas,
2828
: mpMapCanvas ( thepMapCanvas ), QDialog ( parent, fl )
2929
{
3030
setupUi(this);
31-
readSettings();
3231
grpOuput->hide(); //until properly implemented
3332
cboPageSize->addItem("A0 (841 x 1189 mm)","QPrinter::A0");
3433
cboPageSize->addItem("A1 (594 x 841 mm)","QPrinter::A1");
@@ -59,6 +58,7 @@ QuickPrintGui::QuickPrintGui( QgsMapCanvas * thepMapCanvas,
5958
cboPageSize->addItem("Ledger (432 x 279 mm)","QPrinter::Ledger");
6059
cboPageSize->addItem("Legal (8.5 x 14 inches, 216 x 356 mm)","QPrinter::Legal");
6160
cboPageSize->addItem("Letter (8.5 x 11 inches, 216 x 279 mm)","QPrinter::Letter");
61+
readSettings();
6262
}
6363

6464
QuickPrintGui::~QuickPrintGui()
@@ -73,6 +73,9 @@ void QuickPrintGui::readSettings()
7373
bool myIncrementLastFileFlag = mySettings.value("quickprint/incrementLastFile", false).toBool();
7474
radUseIncrementedFileName->setChecked(myIncrementLastFileFlag);
7575

76+
QString myPageSize = mySettings.value("quickprint/pageSize",
77+
"QPrinter::A4").toString();
78+
cboPageSize->setCurrentIndex(cboPageSize->findData(myPageSize));
7679
}
7780

7881
void QuickPrintGui::writeSettings()
@@ -82,6 +85,8 @@ void QuickPrintGui::writeSettings()
8285
mySettings.setValue("quickprint/mapName", leMapName->text());
8386
mySettings.setValue("quickprint/mapCopyright", teCopyright->text());
8487
mySettings.setValue("quickprint/incrementLastFile", radUseIncrementedFileName->isChecked());
88+
mySettings.setValue("quickprint/pageSize",
89+
cboPageSize->itemData(cboPageSize->currentIndex()));
8590
}
8691

8792

0 commit comments

Comments
 (0)
Please sign in to comment.