mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Printing: save/load selected template by QSettings
We save the selected template name on closing the printDialog, We also load the last selected template from QSettings when initializing the dialog. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
2b2c506cb7
commit
2a85be91b1
2 changed files with 12 additions and 2 deletions
|
@ -30,12 +30,20 @@ void PrintOptions::setup()
|
|||
break;
|
||||
}
|
||||
|
||||
// insert existing templates in the UI
|
||||
ui.printTemplate->clear();
|
||||
// insert existing templates in the UI and select the current template
|
||||
qSort(grantlee_templates);
|
||||
int current_index = 0;
|
||||
for (QList<QString>::iterator i = grantlee_templates.begin(); i != grantlee_templates.end(); ++i) {
|
||||
if ((*i).compare(printOptions->p_template) == 0) {
|
||||
break;
|
||||
}
|
||||
current_index++;
|
||||
}
|
||||
ui.printTemplate->clear();
|
||||
for (QList<QString>::iterator i = grantlee_templates.begin(); i != grantlee_templates.end(); ++i) {
|
||||
ui.printTemplate->addItem((*i).split('.')[0], QVariant::fromValue(*i));
|
||||
}
|
||||
ui.printTemplate->setCurrentIndex(current_index);
|
||||
|
||||
// general print option checkboxes
|
||||
if (printOptions->color_selected)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue