2017-12-19 16:13:44 +00:00
|
|
|
#include <QLabel>
|
|
|
|
#include <QFontDialog>
|
|
|
|
|
|
|
|
#include "GraphOptionsWidget.h"
|
|
|
|
#include "ui_GraphOptionsWidget.h"
|
|
|
|
|
|
|
|
#include "PreferencesDialog.h"
|
|
|
|
|
|
|
|
#include "utils/Helpers.h"
|
|
|
|
#include "utils/Configuration.h"
|
|
|
|
|
|
|
|
GraphOptionsWidget::GraphOptionsWidget(PreferencesDialog */*dialog*/, QWidget *parent)
|
2018-03-21 20:32:32 +00:00
|
|
|
: QDialog(parent),
|
|
|
|
ui(new Ui::GraphOptionsWidget)
|
2017-12-19 16:13:44 +00:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
|
|
updateOptionsFromVars();
|
|
|
|
|
|
|
|
connect(Core(), SIGNAL(graphOptionsChanged()), this, SLOT(updateOptionsFromVars()));
|
|
|
|
}
|
|
|
|
|
|
|
|
GraphOptionsWidget::~GraphOptionsWidget() {}
|
|
|
|
|
|
|
|
|
|
|
|
void GraphOptionsWidget::updateOptionsFromVars()
|
|
|
|
{
|
2018-08-12 16:20:16 +00:00
|
|
|
qhelpers::setCheckedWithoutSignals(ui->graphOffsetCheckBox, Config()->getConfigBool("graph.offset"));
|
2017-12-19 16:13:44 +00:00
|
|
|
ui->maxColsSpinBox->blockSignals(true);
|
|
|
|
ui->maxColsSpinBox->setValue(Config()->getGraphBlockMaxChars());
|
|
|
|
ui->maxColsSpinBox->blockSignals(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GraphOptionsWidget::triggerOptionsChanged()
|
|
|
|
{
|
|
|
|
disconnect(Core(), SIGNAL(graphOptionsChanged()), this, SLOT(updateOptionsFromVars()));
|
|
|
|
Core()->triggerGraphOptionsChanged();
|
|
|
|
connect(Core(), SIGNAL(graphOptionsChanged()), this, SLOT(updateOptionsFromVars()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void GraphOptionsWidget::on_maxColsSpinBox_valueChanged(int value)
|
|
|
|
{
|
|
|
|
Config()->setGraphBlockMaxChars(value);
|
|
|
|
triggerOptionsChanged();
|
|
|
|
}
|
|
|
|
|
2018-08-12 16:20:16 +00:00
|
|
|
void GraphOptionsWidget::on_graphOffsetCheckBox_toggled(bool checked)
|
|
|
|
{
|
|
|
|
Config()->setConfig("graph.offset", checked);
|
|
|
|
triggerOptionsChanged();
|
|
|
|
}
|