Moved printpoint type into create dialog.

This commit is contained in:
Ernie Pasveer
2024-12-22 17:18:09 -06:00
parent 9e4156ab11
commit 3ae0622cd3
17 changed files with 299 additions and 297 deletions
+78 -4
View File
@@ -26,10 +26,15 @@ SeerPrintpointCreateDialog::SeerPrintpointCreateDialog (QWidget* parent) : QDial
setFormat("");
setArguments("");
setDPrintfType ("gdb");
setDPrintfFunction ("");
setDPrintfChannel ("");
// Connect things.
QObject::connect(conditionalCheckBox, &QCheckBox::clicked, conditionalLineEdit, &QLineEdit::setEnabled);
QObject::connect(ignoreCountCheckBox, &QCheckBox::clicked, ignoreCountLineEdit, &QLineEdit::setEnabled);
QObject::connect(threadIdCheckBox, &QCheckBox::clicked, threadIdLineEdit, &QLineEdit::setEnabled);
QObject::connect(conditionalCheckBox, &QCheckBox::clicked, conditionalLineEdit, &QLineEdit::setEnabled);
QObject::connect(ignoreCountCheckBox, &QCheckBox::clicked, ignoreCountLineEdit, &QLineEdit::setEnabled);
QObject::connect(threadIdCheckBox, &QCheckBox::clicked, threadIdLineEdit, &QLineEdit::setEnabled);
QObject::connect(typeButtonGroup, &QButtonGroup::buttonClicked, this, &SeerPrintpointCreateDialog::handleDprintfTypeChanged);
}
SeerPrintpointCreateDialog::~SeerPrintpointCreateDialog () {
@@ -158,7 +163,72 @@ QString SeerPrintpointCreateDialog::arguments () const {
return argumentsLineEdit->text();
}
QString SeerPrintpointCreateDialog::printpointText () const {
QString SeerPrintpointCreateDialog::dprintfType () const {
if (typeGdbRadioButton->isChecked()) {
return "gdb";
}else if (typeCallRadioButton->isChecked()) {
return "call";
}else if (typeAgentRadioButton->isChecked()) {
return "agent";
}
// Default.
return "gdb";
}
QString SeerPrintpointCreateDialog::dprintfFunction () const {
if (dprintfType() == "gdb") {
return "";
}
return dprintfFunctionLineEdit->text();
}
QString SeerPrintpointCreateDialog::dprintfChannel () const {
if (dprintfType() == "gdb") {
return "";
}
return dprintfChannelLineEdit->text();
}
void SeerPrintpointCreateDialog::setDPrintfType (const QString& text) {
if (text == "gdb") {
typeGdbRadioButton->setChecked(true);
dprintfFunctionLineEdit->setEnabled(false);
dprintfChannelLineEdit->setEnabled(false);
return;
}else if (text == "call") {
typeCallRadioButton->setChecked(true);
dprintfFunctionLineEdit->setEnabled(true);
dprintfChannelLineEdit->setEnabled(true);
return;
}else if (text == "agent") {
typeAgentRadioButton->setChecked(true);
dprintfFunctionLineEdit->setEnabled(false);
dprintfChannelLineEdit->setEnabled(false);
return;
}
// Default.
typeGdbRadioButton->setChecked(true);
dprintfFunctionLineEdit->setEnabled(false);
dprintfChannelLineEdit->setEnabled(false);
}
void SeerPrintpointCreateDialog::setDPrintfFunction (const QString& text) {
dprintfFunctionLineEdit->setText(text);
}
void SeerPrintpointCreateDialog::setDPrintfChannel (const QString& text) {
dprintfChannelLineEdit->setText(text);
}
QString SeerPrintpointCreateDialog::printpointParameters () const {
// Build a printpoint specification.
//
@@ -234,3 +304,7 @@ QString SeerPrintpointCreateDialog::printpointText () const {
return printpointParameters;
}
void SeerPrintpointCreateDialog::handleDprintfTypeChanged () {
setDPrintfType(dprintfType());
}