1
0
Fork 0

GUI: close all source tabs on termination (closes #1443)

This commit is contained in:
mrexodia 2017-01-30 18:08:05 +01:00
parent c05bcd401a
commit f17d1756a6
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
2 changed files with 8 additions and 0 deletions

View File

@ -17,6 +17,7 @@ SourceViewerManager::SourceViewerManager(QWidget* parent) : QTabWidget(parent)
connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
connect(Bridge::getBridge(), SIGNAL(loadSourceFile(QString, int, int)), this, SLOT(loadSourceFile(QString, int, int)));
connect(Bridge::getBridge(), SIGNAL(dbgStateChanged(DBGSTATE)), this, SLOT(dbgStateChanged(DBGSTATE)));
}
void SourceViewerManager::loadSourceFile(QString path, int line, int selection)
@ -58,3 +59,9 @@ void SourceViewerManager::closeAllTabs()
{
clear();
}
void SourceViewerManager::dbgStateChanged(DBGSTATE state)
{
if(state == stopped)
closeAllTabs();
}

View File

@ -16,6 +16,7 @@ public slots:
void loadSourceFile(QString path, int line, int selection = 0);
void closeTab(int index);
void closeAllTabs();
void dbgStateChanged(DBGSTATE state);
private:
QPushButton* mCloseAllTabs;