2018-06-14 11:49:22 +00:00
|
|
|
#include "DebugOptionsWidget.h"
|
|
|
|
#include "ui_DebugOptionsWidget.h"
|
2018-06-15 13:07:18 +00:00
|
|
|
#include <QLabel>
|
|
|
|
#include <QTimer>
|
2018-06-14 11:49:22 +00:00
|
|
|
#include <QComboBox>
|
2018-06-15 13:07:18 +00:00
|
|
|
#include <QShortcut>
|
|
|
|
#include <QFontDialog>
|
2018-06-14 11:49:22 +00:00
|
|
|
#include "PreferencesDialog.h"
|
|
|
|
|
2018-10-17 07:55:53 +00:00
|
|
|
#include "common/Helpers.h"
|
|
|
|
#include "common/Configuration.h"
|
2018-06-14 11:49:22 +00:00
|
|
|
|
2019-03-16 12:41:45 +00:00
|
|
|
DebugOptionsWidget::DebugOptionsWidget(PreferencesDialog *dialog)
|
|
|
|
: QDialog(dialog),
|
2018-06-14 11:49:22 +00:00
|
|
|
ui(new Ui::DebugOptionsWidget)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
|
|
updateDebugPlugin();
|
|
|
|
}
|
|
|
|
|
|
|
|
DebugOptionsWidget::~DebugOptionsWidget() {}
|
|
|
|
|
|
|
|
void DebugOptionsWidget::updateDebugPlugin()
|
|
|
|
{
|
2018-07-27 12:00:23 +00:00
|
|
|
ui->esilBreakOnInvalid->setChecked(Config()->getConfigBool("esil.breakoninvalid"));
|
2018-06-14 11:49:22 +00:00
|
|
|
disconnect(ui->pluginComboBox, SIGNAL(currentIndexChanged(const QString &)), this,
|
|
|
|
SLOT(on_pluginComboBox_currentIndexChanged(const QString &)));
|
|
|
|
|
|
|
|
QStringList plugins = Core()->getDebugPlugins();
|
2018-11-26 22:34:34 +00:00
|
|
|
for (const QString &str : plugins)
|
2018-06-14 11:49:22 +00:00
|
|
|
ui->pluginComboBox->addItem(str);
|
|
|
|
|
|
|
|
QString plugin = Core()->getActiveDebugPlugin();
|
|
|
|
ui->pluginComboBox->setCurrentText(plugin);
|
|
|
|
|
|
|
|
connect(ui->pluginComboBox, SIGNAL(currentIndexChanged(const QString &)), this,
|
|
|
|
SLOT(on_pluginComboBox_currentIndexChanged(const QString &)));
|
|
|
|
|
2018-07-17 19:00:35 +00:00
|
|
|
QString stackSize = Core()->getConfig("esil.stack.size");
|
|
|
|
ui->stackSize->setText(stackSize);
|
|
|
|
ui->stackSize->setPlaceholderText(stackSize);
|
|
|
|
QString stackAddr = Core()->getConfig("esil.stack.addr");
|
|
|
|
ui->stackAddr->setText(stackAddr);
|
|
|
|
ui->stackAddr->setPlaceholderText(stackAddr);
|
|
|
|
connect(ui->stackAddr, &QLineEdit::editingFinished, this, &DebugOptionsWidget::updateStackAddr);
|
|
|
|
connect(ui->stackSize, &QLineEdit::editingFinished, this, &DebugOptionsWidget::updateStackSize);
|
2018-06-15 13:07:18 +00:00
|
|
|
}
|
|
|
|
|
2018-06-14 11:49:22 +00:00
|
|
|
void DebugOptionsWidget::on_pluginComboBox_currentIndexChanged(const QString &plugin)
|
|
|
|
{
|
|
|
|
Core()->setDebugPlugin(plugin);
|
|
|
|
}
|
2018-07-17 19:00:35 +00:00
|
|
|
|
|
|
|
void DebugOptionsWidget::updateStackSize()
|
|
|
|
{
|
|
|
|
QString newSize = ui->stackSize->text();
|
|
|
|
Core()->setConfig("esil.stack.size", newSize);
|
|
|
|
ui->stackSize->setPlaceholderText(newSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DebugOptionsWidget::updateStackAddr()
|
|
|
|
{
|
|
|
|
QString newAddr = ui->stackAddr->text();
|
|
|
|
Core()->setConfig("esil.stack.addr", newAddr);
|
|
|
|
ui->stackAddr->setPlaceholderText(newAddr);
|
|
|
|
}
|
2018-07-27 12:00:23 +00:00
|
|
|
|
|
|
|
void DebugOptionsWidget::on_esilBreakOnInvalid_toggled(bool checked)
|
|
|
|
{
|
|
|
|
Config()->setConfig("esil.breakoninvalid", checked);
|
|
|
|
}
|