cutter/src/dialogs/preferences/PreferencesDialog.cpp
2018-03-21 21:33:40 +01:00

44 lines
961 B
C++

#include <QDialogButtonBox>
#include "PreferencesDialog.h"
#include "ui_PreferencesDialog.h"
#include "GeneralOptionsWidget.h"
#include "AsmOptionsWidget.h"
#include "GraphOptionsWidget.h"
#include "utils/Helpers.h"
#include "utils/Configuration.h"
PreferencesDialog::PreferencesDialog(QWidget *parent)
: QDialog(parent),
ui(new Ui::PreferencesDialog)
{
setAttribute(Qt::WA_DeleteOnClose);
ui->setupUi(this);
#define ADD_TAB(c) { auto w = new c(this); ui->tabWidget->addTab(w, w->windowTitle()); }
ADD_TAB(GeneralOptionsWidget)
ADD_TAB(AsmOptionsWidget)
ADD_TAB(GraphOptionsWidget)
#undef ADD_TAB
}
PreferencesDialog::~PreferencesDialog()
{
}
void PreferencesDialog::showSection(PreferencesDialog::Section section)
{
switch (section) {
case Section::General:
ui->tabWidget->setCurrentIndex(0);
break;
case Section::Disassembly:
ui->tabWidget->setCurrentIndex(1);
break;
}
}