mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-19 02:48:49 +00:00
Move general options from AsmOptionsWidget to new GeneralOptionsWidget
This commit is contained in:
parent
94750ea15b
commit
c42b566a4c
@ -26,12 +26,12 @@
|
|||||||
/* border: 2px solid white;*/
|
/* border: 2px solid white;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
QTabBar
|
QMainWindow > QTabBar
|
||||||
{
|
{
|
||||||
qproperty-drawBase: 0;
|
qproperty-drawBase: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTabBar::tab {
|
QMainWindow > QTabBar::tab {
|
||||||
border-bottom-color: #2180a9;
|
border-bottom-color: #2180a9;
|
||||||
border-top-left-radius: 0px;
|
border-top-left-radius: 0px;
|
||||||
border-top-right-radius: 0px;
|
border-top-right-radius: 0px;
|
||||||
@ -41,12 +41,12 @@ QTabBar::tab {
|
|||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTabBar::tab:selected {
|
QMainWindow > QTabBar::tab:selected {
|
||||||
background: #2180a9;
|
background: #2180a9;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTabBar::tab:hover {
|
QMainWindow > QTabBar::tab:hover {
|
||||||
background: #2180a9; /* #3C879E; */
|
background: #2180a9; /* #3C879E; */
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,8 @@ SOURCES += \
|
|||||||
widgets/PseudocodeWidget.cpp \
|
widgets/PseudocodeWidget.cpp \
|
||||||
widgets/VisualNavbar.cpp \
|
widgets/VisualNavbar.cpp \
|
||||||
widgets/GraphView.cpp \
|
widgets/GraphView.cpp \
|
||||||
dialogs/preferences/PreferencesDialog.cpp
|
dialogs/preferences/PreferencesDialog.cpp \
|
||||||
|
dialogs/preferences/GeneralOptionsWidget.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
cutter.h \
|
cutter.h \
|
||||||
@ -133,7 +134,8 @@ HEADERS += \
|
|||||||
widgets/PseudocodeWidget.h \
|
widgets/PseudocodeWidget.h \
|
||||||
widgets/VisualNavbar.h \
|
widgets/VisualNavbar.h \
|
||||||
widgets/GraphView.h \
|
widgets/GraphView.h \
|
||||||
dialogs/preferences/PreferencesDialog.h
|
dialogs/preferences/PreferencesDialog.h \
|
||||||
|
dialogs/preferences/GeneralOptionsWidget.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
dialogs/AboutDialog.ui \
|
dialogs/AboutDialog.ui \
|
||||||
@ -164,7 +166,8 @@ FORMS += \
|
|||||||
widgets/HexdumpWidget.ui \
|
widgets/HexdumpWidget.ui \
|
||||||
dialogs/SaveProjectDialog.ui \
|
dialogs/SaveProjectDialog.ui \
|
||||||
widgets/PseudocodeWidget.ui \
|
widgets/PseudocodeWidget.ui \
|
||||||
dialogs/preferences/PreferencesDialog.ui
|
dialogs/preferences/PreferencesDialog.ui \
|
||||||
|
dialogs/preferences/GeneralOptionsWidget.ui
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
resources.qrc
|
resources.qrc
|
||||||
|
@ -20,27 +20,18 @@ AsmOptionsWidget::AsmOptionsWidget(PreferencesDialog *dialog, QWidget *parent)
|
|||||||
ui->syntaxComboBox->addItem(syntax, syntax);
|
ui->syntaxComboBox->addItem(syntax, syntax);
|
||||||
ui->syntaxComboBox->blockSignals(false);
|
ui->syntaxComboBox->blockSignals(false);
|
||||||
|
|
||||||
// asm.offset=false would break reading the offset in DisassemblyWidget
|
|
||||||
// TODO: remove this when DisassemblyWidget::readDisassemblyOffset() allows it
|
|
||||||
ui->offsetCheckBox->setVisible(false);
|
|
||||||
|
|
||||||
updateAsmOptionsFromVars();
|
updateAsmOptionsFromVars();
|
||||||
updateFontFromConfig();
|
|
||||||
|
|
||||||
connect(Core(), SIGNAL(asmOptionsChanged()), this, SLOT(updateAsmOptionsFromVars()));
|
connect(Core(), SIGNAL(asmOptionsChanged()), this, SLOT(updateAsmOptionsFromVars()));
|
||||||
connect(Config(), SIGNAL(fontsUpdated()), this, SLOT(updateFontFromConfig()));
|
|
||||||
|
|
||||||
connect(dialog, SIGNAL(saveAsDefault()), this, SLOT(saveAsDefault()));
|
ui->buttonBox->addButton(tr("Save as Defaults"), QDialogButtonBox::ButtonRole::ApplyRole);
|
||||||
connect(dialog, SIGNAL(resetToDefault()), this, SLOT(resetToDefault()));
|
|
||||||
|
//connect(dialog, SIGNAL(saveAsDefault()), this, SLOT(saveAsDefault()));
|
||||||
|
//connect(dialog, SIGNAL(resetToDefault()), this, SLOT(resetToDefault()));
|
||||||
}
|
}
|
||||||
|
|
||||||
AsmOptionsWidget::~AsmOptionsWidget() {}
|
AsmOptionsWidget::~AsmOptionsWidget() {}
|
||||||
|
|
||||||
void AsmOptionsWidget::updateFontFromConfig()
|
|
||||||
{
|
|
||||||
QFont currentFont = Config()->getFont();
|
|
||||||
ui->fontSelectionLabel->setText(currentFont.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AsmOptionsWidget::updateAsmOptionsFromVars()
|
void AsmOptionsWidget::updateAsmOptionsFromVars()
|
||||||
{
|
{
|
||||||
@ -220,12 +211,18 @@ void AsmOptionsWidget::on_varsubOnlyCheckBox_toggled(bool checked)
|
|||||||
triggerAsmOptionsChanged();
|
triggerAsmOptionsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AsmOptionsWidget::on_fontSelectionButton_clicked()
|
|
||||||
|
void AsmOptionsWidget::on_buttonBox_clicked(QAbstractButton *button)
|
||||||
{
|
{
|
||||||
QFont currentFont = Config()->getFont();
|
switch (ui->buttonBox->buttonRole(button))
|
||||||
bool ok;
|
{
|
||||||
QFont newFont = QFontDialog::getFont(&ok, currentFont, this);
|
case QDialogButtonBox::ButtonRole::ApplyRole:
|
||||||
if (ok) {
|
saveAsDefault();
|
||||||
Config()->setFont(newFont);
|
break;
|
||||||
|
case QDialogButtonBox::ButtonRole::ResetRole:
|
||||||
|
resetToDefault();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
#ifndef ASMOPTIONSDIALOG_H
|
#ifndef ASMOPTIONSWIDGET_H
|
||||||
#define ASMOPTIONSDIALOG_H
|
#define ASMOPTIONSWIDGET_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
@ -32,7 +32,6 @@ private slots:
|
|||||||
void saveAsDefault();
|
void saveAsDefault();
|
||||||
void resetToDefault();
|
void resetToDefault();
|
||||||
|
|
||||||
void updateFontFromConfig();
|
|
||||||
void updateAsmOptionsFromVars();
|
void updateAsmOptionsFromVars();
|
||||||
|
|
||||||
void on_esilCheckBox_toggled(bool checked);
|
void on_esilCheckBox_toggled(bool checked);
|
||||||
@ -48,7 +47,8 @@ private slots:
|
|||||||
void on_bblineCheckBox_toggled(bool checked);
|
void on_bblineCheckBox_toggled(bool checked);
|
||||||
void on_varsubCheckBox_toggled(bool checked);
|
void on_varsubCheckBox_toggled(bool checked);
|
||||||
void on_varsubOnlyCheckBox_toggled(bool checked);
|
void on_varsubOnlyCheckBox_toggled(bool checked);
|
||||||
void on_fontSelectionButton_clicked();
|
|
||||||
|
void on_buttonBox_clicked(QAbstractButton *button);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,30 +11,9 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Disassembly Options</string>
|
<string>Disassembly</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<property name="sizeConstraint">
|
|
||||||
<enum>QLayout::SetMinAndMaxSize</enum>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="fontSelectionLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="fontSelectionLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="fontSelectionButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Select font</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="esilCheckBox">
|
<widget class="QCheckBox" name="esilCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -159,6 +138,29 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::RestoreDefaults</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
<action name="actionSaveAsDefault">
|
<action name="actionSaveAsDefault">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
53
src/dialogs/preferences/GeneralOptionsWidget.cpp
Normal file
53
src/dialogs/preferences/GeneralOptionsWidget.cpp
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
#include <QLabel>
|
||||||
|
#include <QFontDialog>
|
||||||
|
|
||||||
|
#include "GeneralOptionsWidget.h"
|
||||||
|
#include "ui_GeneralOptionsWidget.h"
|
||||||
|
|
||||||
|
#include "PreferencesDialog.h"
|
||||||
|
|
||||||
|
#include "utils/Helpers.h"
|
||||||
|
#include "utils/Configuration.h"
|
||||||
|
|
||||||
|
GeneralOptionsWidget::GeneralOptionsWidget(PreferencesDialog *dialog, QWidget *parent)
|
||||||
|
: QDialog(parent),
|
||||||
|
ui(new Ui::GeneralOptionsWidget)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
updateFontFromConfig();
|
||||||
|
updateThemeFromConfig();
|
||||||
|
|
||||||
|
connect(Config(), SIGNAL(fontsUpdated()), this, SLOT(updateFontFromConfig()));
|
||||||
|
connect(Config(), SIGNAL(colorsUpdated()), this, SLOT(updateThemeFromConfig()));
|
||||||
|
}
|
||||||
|
|
||||||
|
GeneralOptionsWidget::~GeneralOptionsWidget() {}
|
||||||
|
|
||||||
|
void GeneralOptionsWidget::updateFontFromConfig()
|
||||||
|
{
|
||||||
|
QFont currentFont = Config()->getFont();
|
||||||
|
ui->fontSelectionLabel->setText(currentFont.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
void GeneralOptionsWidget::updateThemeFromConfig()
|
||||||
|
{
|
||||||
|
ui->themeComboBox->setCurrentIndex(Config()->getDarkTheme() ? 1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GeneralOptionsWidget::on_fontSelectionButton_clicked()
|
||||||
|
{
|
||||||
|
QFont currentFont = Config()->getFont();
|
||||||
|
bool ok;
|
||||||
|
QFont newFont = QFontDialog::getFont(&ok, currentFont, this);
|
||||||
|
if (ok) {
|
||||||
|
Config()->setFont(newFont);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GeneralOptionsWidget::on_themeComboBox_currentIndexChanged(int index)
|
||||||
|
{
|
||||||
|
disconnect(Config(), SIGNAL(colorsUpdated()), this, SLOT(updateThemeFromConfig()));
|
||||||
|
Config()->setDarkTheme(index == 1);
|
||||||
|
connect(Config(), SIGNAL(colorsUpdated()), this, SLOT(updateThemeFromConfig()));
|
||||||
|
}
|
38
src/dialogs/preferences/GeneralOptionsWidget.h
Normal file
38
src/dialogs/preferences/GeneralOptionsWidget.h
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
|
||||||
|
#ifndef GENERALOPTIONSWIDGET_H
|
||||||
|
#define GENERALOPTIONSWIDGET_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include "cutter.h"
|
||||||
|
|
||||||
|
class PreferencesDialog;
|
||||||
|
|
||||||
|
namespace Ui
|
||||||
|
{
|
||||||
|
class GeneralOptionsWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
class GeneralOptionsWidget : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit GeneralOptionsWidget(PreferencesDialog *dialog, QWidget *parent = nullptr);
|
||||||
|
~GeneralOptionsWidget();
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::unique_ptr<Ui::GeneralOptionsWidget> ui;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void updateFontFromConfig();
|
||||||
|
void updateThemeFromConfig();
|
||||||
|
|
||||||
|
void on_fontSelectionButton_clicked();
|
||||||
|
void on_themeComboBox_currentIndexChanged(int index);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif //ASMOPTIONSDIALOG_H
|
97
src/dialogs/preferences/GeneralOptionsWidget.ui
Normal file
97
src/dialogs/preferences/GeneralOptionsWidget.ui
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>GeneralOptionsWidget</class>
|
||||||
|
<widget class="QWidget" name="GeneralOptionsWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>442</width>
|
||||||
|
<height>225</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>General</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<property name="sizeConstraint">
|
||||||
|
<enum>QLayout::SetMinAndMaxSize</enum>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="fontLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Font:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="fontSelectionLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="fontSelectionLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="fontSelectionButton">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Select font</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="themeLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Theme:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QComboBox" name="themeComboBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Default</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Dark</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
<action name="actionSaveAsDefault">
|
||||||
|
<property name="text">
|
||||||
|
<string>Save as Default</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
@ -4,6 +4,7 @@
|
|||||||
#include "PreferencesDialog.h"
|
#include "PreferencesDialog.h"
|
||||||
#include "ui_PreferencesDialog.h"
|
#include "ui_PreferencesDialog.h"
|
||||||
|
|
||||||
|
#include "GeneralOptionsWidget.h"
|
||||||
#include "AsmOptionsWidget.h"
|
#include "AsmOptionsWidget.h"
|
||||||
|
|
||||||
#include "utils/Helpers.h"
|
#include "utils/Helpers.h"
|
||||||
@ -16,10 +17,10 @@ PreferencesDialog::PreferencesDialog(QWidget *parent)
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
ui->buttonBox->addButton(tr("Save as Defaults"), QDialogButtonBox::ButtonRole::ApplyRole);
|
#define ADD_TAB(c) { auto w = new c(this); ui->tabWidget->addTab(w, w->windowTitle()); }
|
||||||
|
ADD_TAB(GeneralOptionsWidget)
|
||||||
auto asmOptionsWidget = new AsmOptionsWidget(this);
|
ADD_TAB(AsmOptionsWidget)
|
||||||
ui->tabWidget->addTab(asmOptionsWidget, tr("Disassembly"));
|
#undef ADD_TAB
|
||||||
}
|
}
|
||||||
|
|
||||||
PreferencesDialog::~PreferencesDialog()
|
PreferencesDialog::~PreferencesDialog()
|
||||||
@ -30,23 +31,11 @@ void PreferencesDialog::showSection(PreferencesDialog::Section section)
|
|||||||
{
|
{
|
||||||
switch(section)
|
switch(section)
|
||||||
{
|
{
|
||||||
case Section::Disassembly:
|
case Section::General:
|
||||||
ui->tabWidget->setCurrentIndex(0);
|
ui->tabWidget->setCurrentIndex(0);
|
||||||
break;
|
break;
|
||||||
}
|
case Section::Disassembly:
|
||||||
}
|
ui->tabWidget->setCurrentIndex(1);
|
||||||
|
|
||||||
void PreferencesDialog::on_buttonBox_clicked(QAbstractButton *button)
|
|
||||||
{
|
|
||||||
switch (ui->buttonBox->buttonRole(button))
|
|
||||||
{
|
|
||||||
case QDialogButtonBox::ButtonRole::ApplyRole:
|
|
||||||
emit saveAsDefault();
|
|
||||||
break;
|
|
||||||
case QDialogButtonBox::ButtonRole::ResetRole:
|
|
||||||
emit resetToDefault();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,21 +18,19 @@ class PreferencesDialog : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum class Section { Disassembly };
|
enum class Section { General, Disassembly };
|
||||||
|
|
||||||
explicit PreferencesDialog(QWidget *parent = nullptr);
|
explicit PreferencesDialog(QWidget *parent = nullptr);
|
||||||
~PreferencesDialog();
|
~PreferencesDialog();
|
||||||
|
|
||||||
void showSection(Section section);
|
void showSection(Section section);
|
||||||
|
|
||||||
signals:
|
/*signals:
|
||||||
void saveAsDefault();
|
void saveAsDefault();
|
||||||
void resetToDefault();
|
void resetToDefault();*/
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Ui::PreferencesDialog> ui;
|
std::unique_ptr<Ui::PreferencesDialog> ui;
|
||||||
|
|
||||||
void on_buttonBox_clicked(QAbstractButton *button);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //PREFERENCESDIALOG_H
|
#endif //PREFERENCESDIALOG_H
|
||||||
|
@ -17,51 +17,8 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget"/>
|
<widget class="QTabWidget" name="tabWidget"/>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::RestoreDefaults</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections/>
|
||||||
<connection>
|
|
||||||
<sender>buttonBox</sender>
|
|
||||||
<signal>accepted()</signal>
|
|
||||||
<receiver>PreferencesDialog</receiver>
|
|
||||||
<slot>accept()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>248</x>
|
|
||||||
<y>254</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>157</x>
|
|
||||||
<y>274</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>buttonBox</sender>
|
|
||||||
<signal>rejected()</signal>
|
|
||||||
<receiver>PreferencesDialog</receiver>
|
|
||||||
<slot>reject()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>316</x>
|
|
||||||
<y>260</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>286</x>
|
|
||||||
<y>274</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
</ui>
|
||||||
|
@ -18,7 +18,7 @@ Configuration* Configuration::instance()
|
|||||||
|
|
||||||
void Configuration::loadInitial()
|
void Configuration::loadInitial()
|
||||||
{
|
{
|
||||||
setDarkTheme(s.value("dark").toBool());
|
setDarkTheme(getDarkTheme());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::resetAll()
|
void Configuration::resetAll()
|
||||||
|
@ -36,6 +36,7 @@ public:
|
|||||||
// Colors
|
// Colors
|
||||||
const QColor getColor(const QString &name) const;
|
const QColor getColor(const QString &name) const;
|
||||||
void setDarkTheme(bool set);
|
void setDarkTheme(bool set);
|
||||||
|
bool getDarkTheme() { return s.value("dark").toBool(); }
|
||||||
|
|
||||||
// TODO Imho it's wrong doing it this way. Should find something else.
|
// TODO Imho it's wrong doing it this way. Should find something else.
|
||||||
bool getAsmESIL() const { return s.value("asm.esil", false).toBool(); }
|
bool getAsmESIL() const { return s.value("asm.esil", false).toBool(); }
|
||||||
|
Loading…
Reference in New Issue
Block a user