Merge pull request #2763 from torusrxxx/patch000000ca
Add restart and stop debugging to exit dialog
This commit is contained in:
commit
f906585fa6
|
@ -593,9 +593,12 @@ void MainWindow::closeEvent(QCloseEvent* event)
|
||||||
msgbox.setText(tr("The debuggee is still running and will be terminated if you exit. Do you really want to exit?"));
|
msgbox.setText(tr("The debuggee is still running and will be terminated if you exit. Do you really want to exit?"));
|
||||||
msgbox.setWindowTitle(tr("Debuggee is still running"));
|
msgbox.setWindowTitle(tr("Debuggee is still running"));
|
||||||
msgbox.setWindowIcon(DIcon("bug.png"));
|
msgbox.setWindowIcon(DIcon("bug.png"));
|
||||||
msgbox.addButton(QMessageBox::Yes);
|
msgbox.addButton(QMessageBox::Yes)->setText(tr("&Exit"));
|
||||||
msgbox.addButton(QMessageBox::No);
|
msgbox.addButton(QMessageBox::Cancel)->setText(tr("&Cancel"));
|
||||||
msgbox.setDefaultButton(QMessageBox::No);
|
msgbox.addButton(QMessageBox::Abort)->setText(tr("&Stop debugging"));
|
||||||
|
msgbox.addButton(QMessageBox::Retry)->setText(tr("&Restart debugging"));
|
||||||
|
msgbox.setDefaultButton(QMessageBox::Cancel);
|
||||||
|
msgbox.setEscapeButton(QMessageBox::Cancel);
|
||||||
msgbox.setCheckBox(cb);
|
msgbox.setCheckBox(cb);
|
||||||
|
|
||||||
QObject::connect(cb, &QCheckBox::toggled, [](bool checked)
|
QObject::connect(cb, &QCheckBox::toggled, [](bool checked)
|
||||||
|
@ -603,7 +606,12 @@ void MainWindow::closeEvent(QCloseEvent* event)
|
||||||
Config()->setBool("Gui", "ShowExitConfirmation", !checked);
|
Config()->setBool("Gui", "ShowExitConfirmation", !checked);
|
||||||
});
|
});
|
||||||
|
|
||||||
if(msgbox.exec() != QMessageBox::Yes)
|
auto code = msgbox.exec();
|
||||||
|
if(code == QMessageBox::Retry)
|
||||||
|
restartDebugging();
|
||||||
|
if(code == QMessageBox::Abort)
|
||||||
|
DbgCmdExec("stop");
|
||||||
|
if(code != QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
event->ignore();
|
event->ignore();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue