Add detach and exit to exit dialog
This commit is contained in:
parent
78b77fa333
commit
01dba2c707
|
@ -390,6 +390,7 @@ MainWindow::MainWindow(QWidget* parent)
|
|||
|
||||
// Setup close thread and dialog
|
||||
bCanClose = false;
|
||||
bExitWhenDetached = false;
|
||||
mCloseThread = new MainWindowCloseThread(this);
|
||||
connect(mCloseThread, SIGNAL(canClose()), this, SLOT(canClose()));
|
||||
mCloseDialog = new CloseDialog(this);
|
||||
|
@ -595,7 +596,7 @@ void MainWindow::closeEvent(QCloseEvent* event)
|
|||
msgbox.setWindowIcon(DIcon("bug.png"));
|
||||
msgbox.addButton(QMessageBox::Yes)->setText(tr("&Exit"));
|
||||
msgbox.addButton(QMessageBox::Cancel)->setText(tr("&Cancel"));
|
||||
msgbox.addButton(QMessageBox::Abort)->setText(tr("&Stop debugging"));
|
||||
msgbox.addButton(QMessageBox::Abort)->setText(tr("&Detach and exit"));
|
||||
msgbox.addButton(QMessageBox::Retry)->setText(tr("&Restart debugging"));
|
||||
msgbox.setDefaultButton(QMessageBox::Cancel);
|
||||
msgbox.setEscapeButton(QMessageBox::Cancel);
|
||||
|
@ -609,8 +610,11 @@ void MainWindow::closeEvent(QCloseEvent* event)
|
|||
auto code = msgbox.exec();
|
||||
if(code == QMessageBox::Retry)
|
||||
restartDebugging();
|
||||
if(code == QMessageBox::Abort)
|
||||
DbgCmdExec("stop");
|
||||
else if(code == QMessageBox::Abort)
|
||||
{
|
||||
bExitWhenDetached = true;
|
||||
DbgCmdExec("detach");
|
||||
}
|
||||
if(code != QMessageBox::Yes)
|
||||
{
|
||||
event->ignore();
|
||||
|
@ -1891,6 +1895,8 @@ void MainWindow::dbgStateChangedSlot(DBGSTATE state)
|
|||
{
|
||||
if(state == initialized) //fixes a crash when restarting with certain settings in another tab
|
||||
displayCpuWidget();
|
||||
if(bExitWhenDetached && state == stopped) //detach and exit: the debugger has detached, no exit confirmation dialog this time
|
||||
close();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionFaq_triggered()
|
||||
|
|
|
@ -245,6 +245,7 @@ private:
|
|||
void clearMenuImpl(int hMenu, bool erase);
|
||||
|
||||
bool bCanClose;
|
||||
bool bExitWhenDetached;
|
||||
MainWindowCloseThread* mCloseThread;
|
||||
|
||||
struct WidgetInfo
|
||||
|
|
Loading…
Reference in New Issue