Files
seer/src/SeerCatchpointCreateDialog.cpp
T

104 lines
2.3 KiB
C++
Raw Normal View History

2021-12-31 13:00:02 -06:00
#include "SeerCatchpointCreateDialog.h"
#include <QtCore/QDebug>
SeerCatchpointCreateDialog::SeerCatchpointCreateDialog (QWidget* parent) : QDialog(parent) {
// Set up the UI.
setupUi(this);
// Setup the widgets
2021-12-31 13:00:54 -06:00
setType("");
setNameText("");
2021-12-31 13:00:02 -06:00
setTemporaryEnabled (false);
// Connect things.
}
SeerCatchpointCreateDialog::~SeerCatchpointCreateDialog () {
}
2021-12-31 13:00:54 -06:00
void SeerCatchpointCreateDialog::setType (const QString& text) {
2021-12-31 13:00:02 -06:00
2021-12-31 13:00:54 -06:00
if (text == "throw") {
throwRadioButton->setChecked(true);
2021-12-31 13:00:02 -06:00
2021-12-31 13:00:54 -06:00
}else if (text == "rethrow") {
rethrowRadioButton->setChecked(true);
2021-12-31 13:00:02 -06:00
2021-12-31 13:00:54 -06:00
}else if (text == "catch") {
catchRadioButton->setChecked(true);
2021-12-31 13:00:02 -06:00
2022-01-13 11:03:24 -06:00
}else if (text == "load") {
loadRadioButton->setChecked(true);
}else if (text == "unload") {
unloadRadioButton->setChecked(true);
2021-12-31 13:00:54 -06:00
}else{
throwRadioButton->setChecked(true);
}
2021-12-31 13:00:02 -06:00
}
2021-12-31 13:00:54 -06:00
QString SeerCatchpointCreateDialog::typeText () const {
2021-12-31 13:00:02 -06:00
2021-12-31 13:00:54 -06:00
if (throwRadioButton->isChecked()) {
return "throw";
2021-12-31 13:00:02 -06:00
2021-12-31 13:00:54 -06:00
}else if (rethrowRadioButton->isChecked()) {
return "rethrow";
2021-12-31 13:00:02 -06:00
2021-12-31 13:00:54 -06:00
}else if (catchRadioButton->isChecked()) {
return "catch";
2021-12-31 13:00:02 -06:00
2022-01-13 11:03:24 -06:00
}else if (loadRadioButton->isChecked()) {
return "load";
}else if (unloadRadioButton->isChecked()) {
return "unload";
2021-12-31 13:00:54 -06:00
}else{
return "throw";
}
2021-12-31 13:00:02 -06:00
}
2021-12-31 13:00:54 -06:00
void SeerCatchpointCreateDialog::setTemporaryEnabled (bool flag) {
temporaryCheckBox->setChecked(flag);
2021-12-31 13:00:02 -06:00
}
2021-12-31 13:00:54 -06:00
void SeerCatchpointCreateDialog::setNameText (const QString& text) {
nameLineEdit->setText(text);
2021-12-31 13:00:02 -06:00
}
2021-12-31 13:00:54 -06:00
QString SeerCatchpointCreateDialog::nameText () const {
return nameLineEdit->text();
2021-12-31 13:00:02 -06:00
}
bool SeerCatchpointCreateDialog::temporaryEnabled () const {
return temporaryCheckBox->isChecked();
}
QString SeerCatchpointCreateDialog::catchpointText () const {
// Build a catchpoint specification.
2021-12-31 13:00:54 -06:00
QString catchpointParameters = typeText();
2021-12-31 13:00:02 -06:00
if (temporaryEnabled()) {
catchpointParameters += " -t";
}
2022-01-13 20:36:39 -06:00
if (typeText() == "load" || typeText() == "unload") { // These don't need a "-r"
catchpointParameters += " " + nameText();
}else{ // These do, but only if there is a name.
2021-12-31 13:00:54 -06:00
if (nameText() != "") {
2022-01-13 20:36:39 -06:00
catchpointParameters += " -r " + nameText();
2021-12-31 13:00:02 -06:00
}
}
//qDebug() << catchpointParameters;
2021-12-31 13:00:02 -06:00
return catchpointParameters;
}