-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathInterfaceOptionsWidget.cpp
More file actions
50 lines (40 loc) · 1.81 KB
/
InterfaceOptionsWidget.cpp
File metadata and controls
50 lines (40 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "InterfaceOptionsWidget.h"
#include "ui_InterfaceOptionsWidget.h"
#include "PreferencesDialog.h"
#include "Configuration.h"
InterfaceOptionsWidget::InterfaceOptionsWidget(PreferencesDialog *dialog)
: QDialog(dialog), ui(new Ui::InterfaceOptionsWidget)
{
ui->setupUi(this);
setUpQuickFilter();
setUpFunctions();
}
InterfaceOptionsWidget::~InterfaceOptionsWidget() {}
void InterfaceOptionsWidget::setUpFunctions()
{
bool truncate = Config()->getTruncateFunctionNameCol();
ui->fcnTruncateCheckBox->setChecked(truncate);
ui->fcnTruncateSpinBox->setEnabled(truncate);
ui->fcnTruncateSpinBox->setValue(Config()->getFunctionNameColWidth());
connect(ui->fcnTruncateCheckBox, &QCheckBox::toggled, this, [this](bool checked) {
ui->fcnTruncateSpinBox->setEnabled(checked);
Config()->setTruncateFunctionNameCol(checked);
});
connect<void (QSpinBox::*)(int)>(ui->fcnTruncateSpinBox, &QSpinBox::valueChanged, Config(),
&Configuration::setFunctionNameColWidth);
}
void InterfaceOptionsWidget::setUpQuickFilter()
{
ui->quickFilterCheckBox->setChecked(Config()->getShowQuickFilter());
connect(ui->quickFilterCheckBox, &QCheckBox::toggled, Config(),
&Configuration::setShowQuickFilter);
ui->itemCountCheckBox->setChecked(Config()->getItemCountVisible());
connect(ui->itemCountCheckBox, &QCheckBox::toggled, this, [this](bool checked) {
Config()->setItemCountVisible(checked);
ui->hideItemCountCheckBox->setEnabled(checked);
});
connect(ui->hideItemCountCheckBox, &QCheckBox::toggled, Config(),
&Configuration::setItemCountAutoHide);
ui->hideItemCountCheckBox->setChecked(Config()->getItemCountAutoHide());
ui->hideItemCountCheckBox->setEnabled(ui->itemCountCheckBox->isChecked());
}