| 1 |
/****************************************************************************** |
| 2 |
This source file is part of the Avogadro project. |
| 3 |
This source code is released under the 3-Clause BSD License, (see "LICENSE"). |
| 4 |
******************************************************************************/ |
| 5 |
|
| 6 |
#include "pdfoptionsdialog.h" |
| 7 |
#include "ui_pdfoptionsdialog.h" |
| 8 |
|
| 9 |
#include <QtCore/QSettings> |
| 10 |
|
| 11 |
namespace Avogadro::QtPlugins { |
| 12 |
|
| 13 |
PdfOptionsDialog::PdfOptionsDialog(QWidget* aParent) |
| 14 |
: QDialog(aParent), m_ui(new Ui::PdfOptionsDialog) |
| 15 |
{ |
| 16 |
m_ui->setupUi(this); |
| 17 |
|
| 18 |
// Read the settings |
| 19 |
QSettings settings; |
| 20 |
m_ui->spin_maxRadius->setValue( |
| 21 |
settings.value("plotpdfcurveoptions/maxRadius", 10.0).toDouble()); |
| 22 |
m_ui->spin_step->setValue( |
| 23 |
settings.value("plotpdfcurveoptions/step", 0.1).toDouble()); |
| 24 |
} |
| 25 |
|
| 26 |
PdfOptionsDialog::~PdfOptionsDialog() = default; |
| 27 |
|
| 28 |
double PdfOptionsDialog::maxRadius() const |
| 29 |
{ |
| 30 |
return m_ui->spin_maxRadius->value(); |
| 31 |
} |
| 32 |
|
| 33 |
double PdfOptionsDialog::step() const |
| 34 |
{ |
| 35 |
return m_ui->spin_step->value(); |
| 36 |
} |
| 37 |
|
| 38 |
void PdfOptionsDialog::accept() |
| 39 |
{ |
| 40 |
QSettings settings; |
| 41 |
settings.setValue("plotpdfcurveoptions/maxRadius", maxRadius()); |
| 42 |
settings.setValue("plotpdfcurveoptions/step", step()); |
| 43 |
QDialog::accept(); |
| 44 |
} |
| 45 |
|
| 46 |
} // namespace Avogadro::QtPlugins |