Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
ce8b257f
Commit
ce8b257f
authored
May 04, 2010
by
dt
Browse files
Close output windows on session switching
Task-Nr: QTCREATORBUG-390
parent
c0429dbd
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/outputwindow.cpp
View file @
ce8b257f
...
...
@@ -32,6 +32,7 @@
#include
"projectexplorer.h"
#include
"projectexplorersettings.h"
#include
"runconfiguration.h"
#include
"session.h"
#include
<coreplugin/actionmanager/actionmanager.h>
#include
<coreplugin/actionmanager/actioncontainer.h>
...
...
@@ -114,6 +115,9 @@ OutputPane::OutputPane()
connect
(
Core
::
ICore
::
instance
(),
SIGNAL
(
coreAboutToClose
()),
this
,
SLOT
(
coreAboutToClose
()));
connect
(
ProjectExplorer
::
ProjectExplorerPlugin
::
instance
()
->
session
(),
SIGNAL
(
aboutToUnloadSession
()),
this
,
SLOT
(
aboutToUnloadSession
()));
}
void
OutputPane
::
coreAboutToClose
()
...
...
@@ -126,6 +130,16 @@ void OutputPane::coreAboutToClose()
}
}
void
OutputPane
::
aboutToUnloadSession
()
{
int
i
=
0
;
while
(
i
<
m_tabWidget
->
count
())
{
bool
closed
=
closeTab
(
i
);
if
(
!
closed
)
// skip to next one
++
i
;
}
}
OutputPane
::~
OutputPane
()
{
delete
m_mainWidget
;
...
...
@@ -259,7 +273,7 @@ void OutputPane::stopRunControl()
rc
->
stop
();
}
void
OutputPane
::
closeTab
(
int
index
)
bool
OutputPane
::
closeTab
(
int
index
)
{
OutputWindow
*
ow
=
static_cast
<
OutputWindow
*>
(
m_tabWidget
->
widget
(
index
));
RunControl
*
rc
=
m_outputWindows
.
key
(
ow
);
...
...
@@ -267,15 +281,16 @@ void OutputPane::closeTab(int index)
if
(
rc
->
isRunning
())
{
QMessageBox
messageBox
(
QMessageBox
::
Warning
,
tr
(
"Unable to close"
),
tr
(
"
The application
is still running."
),
tr
(
"
%1
is still running."
)
.
arg
(
rc
->
displayName
())
,
QMessageBox
::
Cancel
|
QMessageBox
::
Yes
,
ow
->
window
());
messageBox
.
setInformativeText
(
tr
(
"Force it to quit?"
));
messageBox
.
setDefaultButton
(
QMessageBox
::
Yes
);
messageBox
.
button
(
QMessageBox
::
Yes
)
->
setText
(
tr
(
"Force Quit"
));
messageBox
.
button
(
QMessageBox
::
Cancel
)
->
setText
(
tr
(
"Keep Running"
));
if
(
messageBox
.
exec
()
!=
QMessageBox
::
Yes
)
return
;
return
false
;
rc
->
stop
();
}
...
...
@@ -283,6 +298,7 @@ void OutputPane::closeTab(int index)
m_tabWidget
->
removeTab
(
index
);
delete
ow
;
delete
rc
;
return
true
;
}
void
OutputPane
::
projectRemoved
()
...
...
src/plugins/projectexplorer/outputwindow.h
View file @
ce8b257f
...
...
@@ -102,11 +102,13 @@ public slots:
private
slots
:
void
reRunRunControl
();
void
stopRunControl
();
void
closeTab
(
int
index
);
bool
closeTab
(
int
index
);
void
tabChanged
(
int
);
void
runControlStarted
();
void
runControlFinished
();
void
aboutToUnloadSession
();
private:
RunControl
*
runControlForTab
(
int
index
)
const
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment