mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Printing: refactor the print options class
-Remove unneeded parameter to member variable -Check if template_options struct is valid Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
605e1e2d93
commit
a70cea95e8
2 changed files with 5 additions and 5 deletions
|
@ -8,15 +8,15 @@ PrintOptions::PrintOptions(QWidget *parent, struct print_options *printOpt, stru
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
if (parent)
|
if (parent)
|
||||||
setParent(parent);
|
setParent(parent);
|
||||||
if (!printOpt)
|
if (!printOpt || !templateOpt)
|
||||||
return;
|
return;
|
||||||
setup(printOpt);
|
|
||||||
templateOptions = templateOpt;
|
templateOptions = templateOpt;
|
||||||
|
printOptions = printOpt;
|
||||||
|
setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintOptions::setup(struct print_options *printOpt)
|
void PrintOptions::setup()
|
||||||
{
|
{
|
||||||
printOptions = printOpt;
|
|
||||||
// print type radio buttons
|
// print type radio buttons
|
||||||
switch (printOptions->type) {
|
switch (printOptions->type) {
|
||||||
case print_options::DIVELIST:
|
case print_options::DIVELIST:
|
||||||
|
|
|
@ -27,7 +27,7 @@ class PrintOptions : public QWidget {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PrintOptions(QWidget *parent, struct print_options *printOpt, struct template_options *templateOpt);
|
explicit PrintOptions(QWidget *parent, struct print_options *printOpt, struct template_options *templateOpt);
|
||||||
void setup(struct print_options *printOpt);
|
void setup();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::PrintOptions ui;
|
Ui::PrintOptions ui;
|
||||||
|
|
Loading…
Add table
Reference in a new issue