Merge pull request #2857 from torusrxxx/patch000000d5
Add detach and exit to exit dialog
This commit is contained in:
commit
ba12bb6eba
|
@ -119,6 +119,7 @@ HandlesView::HandlesView(QWidget* parent) : QWidget(parent)
|
||||||
mWindowsTable->addAction(mActionFollowProc);
|
mWindowsTable->addAction(mActionFollowProc);
|
||||||
mActionToggleProcBP = new QAction(DIcon("breakpoint_toggle.png"), tr("Toggle Breakpoint in Proc"), this);
|
mActionToggleProcBP = new QAction(DIcon("breakpoint_toggle.png"), tr("Toggle Breakpoint in Proc"), this);
|
||||||
connect(mActionToggleProcBP, SIGNAL(triggered()), this, SLOT(toggleBPSlot()));
|
connect(mActionToggleProcBP, SIGNAL(triggered()), this, SLOT(toggleBPSlot()));
|
||||||
|
mWindowsTable->addAction(mActionToggleProcBP);
|
||||||
mActionMessageProcBP = new QAction(DIcon("breakpoint_execute.png"), tr("Message Breakpoint"), this);
|
mActionMessageProcBP = new QAction(DIcon("breakpoint_execute.png"), tr("Message Breakpoint"), this);
|
||||||
connect(mActionMessageProcBP, SIGNAL(triggered()), this, SLOT(messagesBPSlot()));
|
connect(mActionMessageProcBP, SIGNAL(triggered()), this, SLOT(messagesBPSlot()));
|
||||||
|
|
||||||
|
@ -169,6 +170,7 @@ void HandlesView::reloadData()
|
||||||
void HandlesView::refreshShortcuts()
|
void HandlesView::refreshShortcuts()
|
||||||
{
|
{
|
||||||
mActionRefresh->setShortcut(ConfigShortcut("ActionRefresh"));
|
mActionRefresh->setShortcut(ConfigShortcut("ActionRefresh"));
|
||||||
|
mActionToggleProcBP->setShortcut(ConfigShortcut("ActionToggleBreakpoint"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandlesView::dbgStateChanged(DBGSTATE state)
|
void HandlesView::dbgStateChanged(DBGSTATE state)
|
||||||
|
|
|
@ -390,6 +390,7 @@ MainWindow::MainWindow(QWidget* parent)
|
||||||
|
|
||||||
// Setup close thread and dialog
|
// Setup close thread and dialog
|
||||||
bCanClose = false;
|
bCanClose = false;
|
||||||
|
bExitWhenDetached = false;
|
||||||
mCloseThread = new MainWindowCloseThread(this);
|
mCloseThread = new MainWindowCloseThread(this);
|
||||||
connect(mCloseThread, SIGNAL(canClose()), this, SLOT(canClose()));
|
connect(mCloseThread, SIGNAL(canClose()), this, SLOT(canClose()));
|
||||||
mCloseDialog = new CloseDialog(this);
|
mCloseDialog = new CloseDialog(this);
|
||||||
|
@ -595,7 +596,7 @@ void MainWindow::closeEvent(QCloseEvent* event)
|
||||||
msgbox.setWindowIcon(DIcon("bug.png"));
|
msgbox.setWindowIcon(DIcon("bug.png"));
|
||||||
msgbox.addButton(QMessageBox::Yes)->setText(tr("&Exit"));
|
msgbox.addButton(QMessageBox::Yes)->setText(tr("&Exit"));
|
||||||
msgbox.addButton(QMessageBox::Cancel)->setText(tr("&Cancel"));
|
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.addButton(QMessageBox::Retry)->setText(tr("&Restart debugging"));
|
||||||
msgbox.setDefaultButton(QMessageBox::Cancel);
|
msgbox.setDefaultButton(QMessageBox::Cancel);
|
||||||
msgbox.setEscapeButton(QMessageBox::Cancel);
|
msgbox.setEscapeButton(QMessageBox::Cancel);
|
||||||
|
@ -609,8 +610,11 @@ void MainWindow::closeEvent(QCloseEvent* event)
|
||||||
auto code = msgbox.exec();
|
auto code = msgbox.exec();
|
||||||
if(code == QMessageBox::Retry)
|
if(code == QMessageBox::Retry)
|
||||||
restartDebugging();
|
restartDebugging();
|
||||||
if(code == QMessageBox::Abort)
|
else if(code == QMessageBox::Abort)
|
||||||
DbgCmdExec("stop");
|
{
|
||||||
|
bExitWhenDetached = true;
|
||||||
|
DbgCmdExec("detach");
|
||||||
|
}
|
||||||
if(code != QMessageBox::Yes)
|
if(code != QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
event->ignore();
|
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
|
if(state == initialized) //fixes a crash when restarting with certain settings in another tab
|
||||||
displayCpuWidget();
|
displayCpuWidget();
|
||||||
|
if(bExitWhenDetached && state == stopped) //detach and exit: the debugger has detached, no exit confirmation dialog this time
|
||||||
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionFaq_triggered()
|
void MainWindow::on_actionFaq_triggered()
|
||||||
|
|
|
@ -245,6 +245,7 @@ private:
|
||||||
void clearMenuImpl(int hMenu, bool erase);
|
void clearMenuImpl(int hMenu, bool erase);
|
||||||
|
|
||||||
bool bCanClose;
|
bool bCanClose;
|
||||||
|
bool bExitWhenDetached;
|
||||||
MainWindowCloseThread* mCloseThread;
|
MainWindowCloseThread* mCloseThread;
|
||||||
|
|
||||||
struct WidgetInfo
|
struct WidgetInfo
|
||||||
|
|
Loading…
Reference in New Issue