2017-12-14 13:42:24 +00:00
|
|
|
|
|
|
|
#include <QDialogButtonBox>
|
|
|
|
|
|
|
|
#include "PreferencesDialog.h"
|
|
|
|
#include "ui_PreferencesDialog.h"
|
|
|
|
|
2017-12-14 15:14:33 +00:00
|
|
|
#include "GeneralOptionsWidget.h"
|
2017-12-14 13:42:24 +00:00
|
|
|
#include "AsmOptionsWidget.h"
|
|
|
|
|
|
|
|
#include "utils/Helpers.h"
|
|
|
|
#include "utils/Configuration.h"
|
|
|
|
|
|
|
|
|
|
|
|
PreferencesDialog::PreferencesDialog(QWidget *parent)
|
|
|
|
: QDialog(parent),
|
|
|
|
ui(new Ui::PreferencesDialog)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
2017-12-14 15:14:33 +00:00
|
|
|
#define ADD_TAB(c) { auto w = new c(this); ui->tabWidget->addTab(w, w->windowTitle()); }
|
|
|
|
ADD_TAB(GeneralOptionsWidget)
|
|
|
|
ADD_TAB(AsmOptionsWidget)
|
|
|
|
#undef ADD_TAB
|
2017-12-14 13:42:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
PreferencesDialog::~PreferencesDialog()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void PreferencesDialog::showSection(PreferencesDialog::Section section)
|
|
|
|
{
|
|
|
|
switch(section)
|
|
|
|
{
|
2017-12-14 15:14:33 +00:00
|
|
|
case Section::General:
|
2017-12-14 13:42:24 +00:00
|
|
|
ui->tabWidget->setCurrentIndex(0);
|
|
|
|
break;
|
2017-12-14 15:14:33 +00:00
|
|
|
case Section::Disassembly:
|
|
|
|
ui->tabWidget->setCurrentIndex(1);
|
2017-12-14 13:42:24 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|