Printing: disable ui elements on statistics print

Disable all the UI elements for "dive list print", disable
all the template settings as well, Template Edit button
will be enabled after statistics print supports color palettes.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
This commit is contained in:
Gehad elrobey 2015-08-12 00:57:19 +02:00 committed by Lubomir I. Ivanov
parent 72b35d8e79
commit 31df69c401
2 changed files with 26 additions and 4 deletions

View file

@ -64,17 +64,39 @@ void PrintOptions::setup()
}
// print type radio buttons
void PrintOptions::on_radioDiveListPrint_clicked(bool check)
void PrintOptions::on_radioDiveListPrint_toggled(bool check)
{
if (check) {
printOptions->type = print_options::DIVELIST;
// print options
ui.printInColor->setEnabled(true);
ui.printSelected->setEnabled(true);
// print template
ui.deleteButton->setEnabled(true);
ui.editButton->setEnabled(true);
ui.exportButton->setEnabled(true);
ui.importButton->setEnabled(true);
ui.printTemplate->setEnabled(true);
}
}
void PrintOptions::on_radioStatisticsPrint_clicked(bool check)
void PrintOptions::on_radioStatisticsPrint_toggled(bool check)
{
if (check) {
printOptions->type = print_options::STATISTICS;
// print options
ui.printInColor->setEnabled(false);
ui.printSelected->setEnabled(false);
// print template
ui.deleteButton->setEnabled(false);
ui.editButton->setEnabled(false);
ui.exportButton->setEnabled(false);
ui.importButton->setEnabled(false);
ui.printTemplate->setEnabled(false);
}
}

View file

@ -75,8 +75,8 @@ private
slots:
void printInColorClicked(bool check);
void printSelectedClicked(bool check);
void on_radioStatisticsPrint_clicked(bool check);
void on_radioDiveListPrint_clicked(bool check);
void on_radioStatisticsPrint_toggled(bool check);
void on_radioDiveListPrint_toggled(bool check);
void on_printTemplate_currentIndexChanged(int index);
void on_editButton_clicked();
void on_importButton_clicked();