Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
timlinux committed Feb 9, 2008
1 parent 14c0618 commit 2e4ff83
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/plugins/quick_print/quickprintgui.cpp
Expand Up @@ -28,7 +28,6 @@ QuickPrintGui::QuickPrintGui( QgsMapCanvas * thepMapCanvas,
: 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");
Expand Down Expand Up @@ -59,6 +58,7 @@ QuickPrintGui::QuickPrintGui( QgsMapCanvas * thepMapCanvas,
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()
Expand All @@ -73,6 +73,9 @@ void QuickPrintGui::readSettings()
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()
Expand All @@ -82,6 +85,8 @@ void QuickPrintGui::writeSettings()
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()));
}


Expand Down

0 comments on commit 2e4ff83

Please sign in to comment.