Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
5f426c23
Commit
5f426c23
authored
Feb 24, 2011
by
Kai Koehne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QmlDebug: Make error dialogs non-blocking and shorter
parent
2e84e42a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
19 deletions
+32
-19
src/plugins/debugger/qml/qmlengine.cpp
src/plugins/debugger/qml/qmlengine.cpp
+29
-18
src/plugins/debugger/qml/qmlengine.h
src/plugins/debugger/qml/qmlengine.h
+2
-1
src/plugins/projectexplorer/winguiprocess.cpp
src/plugins/projectexplorer/winguiprocess.cpp
+1
-0
No files found.
src/plugins/debugger/qml/qmlengine.cpp
View file @
5f426c23
...
...
@@ -237,16 +237,25 @@ void QmlEngine::connectionEstablished()
void
QmlEngine
::
connectionStartupFailed
()
{
QMessageBox
::
Button
button
=
QMessageBox
::
critical
(
0
,
tr
(
"Failed to connect to QML debugger"
),
tr
(
"Qt Creator could not connect to the in-process debugger at %1:%2.
\n
"
"Do you want to retry?"
)
.
arg
(
startParameters
().
qmlServerAddress
)
.
arg
(
startParameters
().
qmlServerPort
),
QMessageBox
::
Retry
|
QMessageBox
::
Cancel
|
QMessageBox
::
Help
,
QMessageBox
::
Retry
);
switch
(
button
)
{
Core
::
ICore
*
const
core
=
Core
::
ICore
::
instance
();
QMessageBox
*
infoBox
=
new
QMessageBox
(
core
->
mainWindow
());
infoBox
->
setIcon
(
QMessageBox
::
Critical
);
infoBox
->
setWindowTitle
(
tr
(
"Qt Creator"
));
infoBox
->
setText
(
tr
(
"Could not connect to the in-process QML debugger.
\n
"
"Do you want to retry?"
));
infoBox
->
setStandardButtons
(
QMessageBox
::
Retry
|
QMessageBox
::
Cancel
|
QMessageBox
::
Help
);
infoBox
->
setDefaultButton
(
QMessageBox
::
Retry
);
infoBox
->
setModal
(
true
);
connect
(
infoBox
,
SIGNAL
(
finished
(
int
)),
this
,
SLOT
(
retryMessageBoxFinished
(
int
)));
infoBox
->
show
();
}
void
QmlEngine
::
retryMessageBoxFinished
(
int
result
)
{
switch
(
result
)
{
case
QMessageBox
::
Retry
:
{
d
->
m_adapter
.
beginConnection
();
break
;
...
...
@@ -254,6 +263,7 @@ void QmlEngine::connectionStartupFailed()
case
QMessageBox
::
Help
:
{
Core
::
HelpManager
*
helpManager
=
Core
::
HelpManager
::
instance
();
helpManager
->
handleHelpRequest
(
"qthelp://com.nokia.qtcreator/doc/creator-debugging-qml.html"
);
// fall through
}
default:
notifyEngineRunFailed
();
...
...
@@ -281,7 +291,8 @@ bool QmlEngine::canDisplayTooltip() const
void
QmlEngine
::
filterApplicationMessage
(
const
QString
&
msg
,
int
/*channel*/
)
{
static
QString
qddserver
=
QLatin1String
(
"QDeclarativeDebugServer: "
);
static
QString
cannotRetrieve
=
"Cannot retrieve debugging output!"
;
//: Must be the same translation as the one in WinGuiProcess
static
QString
cannotRetrieve
=
tr
(
"Cannot retrieve debugging output!"
);
int
index
=
msg
.
indexOf
(
qddserver
);
if
(
index
!=
-
1
)
{
...
...
@@ -297,9 +308,11 @@ void QmlEngine::filterApplicationMessage(const QString &msg, int /*channel*/)
if
(
status
.
startsWith
(
waitingForConnection
))
{
d
->
m_adapter
.
beginConnection
();
}
else
if
(
status
.
startsWith
(
unableToListen
))
{
//: Error message shown after 'Could not connect ... debugger:"
errorMessage
=
tr
(
"The port seems to be in use."
);
}
else
if
(
status
.
startsWith
(
debuggingNotEnabled
))
{
errorMessage
=
tr
(
"The application isn't set up for QML/JS debugging."
);
//: Error message shown after 'Could not connect ... debugger:"
errorMessage
=
tr
(
"The application is not set up for QML/JS debugging."
);
}
else
if
(
status
.
startsWith
(
connectionEstablished
))
{
// nothing to do
}
else
{
...
...
@@ -313,18 +326,16 @@ void QmlEngine::filterApplicationMessage(const QString &msg, int /*channel*/)
QMessageBox
*
infoBox
=
new
QMessageBox
(
core
->
mainWindow
());
infoBox
->
setIcon
(
QMessageBox
::
Critical
);
infoBox
->
setWindowTitle
(
tr
(
"Qt Creator"
));
infoBox
->
setText
(
tr
(
"Failed to connect to QML debugger
\n\n
"
"Qt Creator c
ould not connect to the in-process debugger
at %1:%2
:
\n
"
//: %3 is detailed error message
infoBox
->
setText
(
tr
(
"C
ould not connect to the in-process
QML
debugger:
\n
"
"%3"
)
.
arg
(
startParameters
().
qmlServerAddress
)
.
arg
(
startParameters
().
qmlServerPort
)
.
arg
(
errorMessage
));
infoBox
->
setStandardButtons
(
QMessageBox
::
Ok
|
QMessageBox
::
Help
);
infoBox
->
setDefaultButton
(
QMessageBox
::
Ok
);
infoBox
->
setModal
(
true
);
connect
(
infoBox
,
SIGNAL
(
finished
(
int
)),
this
,
SLOT
(
m
essageBoxFinished
(
int
)));
this
,
SLOT
(
wrongSetupM
essageBoxFinished
(
int
)));
infoBox
->
show
();
}
...
...
@@ -934,7 +945,7 @@ void QmlEngine::disconnected()
notifyInferiorExited
();
}
void
QmlEngine
::
m
essageBoxFinished
(
int
result
)
void
QmlEngine
::
wrongSetupM
essageBoxFinished
(
int
result
)
{
if
(
result
==
QMessageBox
::
Help
)
{
Core
::
HelpManager
*
helpManager
=
Core
::
HelpManager
::
instance
();
...
...
src/plugins/debugger/qml/qmlengine.h
View file @
5f426c23
...
...
@@ -70,7 +70,8 @@ public slots:
void
disconnected
();
private
slots
:
void
messageBoxFinished
(
int
result
);
void
retryMessageBoxFinished
(
int
result
);
void
wrongSetupMessageBoxFinished
(
int
result
);
private:
// DebuggerEngine implementation.
...
...
src/plugins/projectexplorer/winguiprocess.cpp
View file @
5f426c23
...
...
@@ -136,6 +136,7 @@ void WinGuiProcess::run()
}
if
(
!
dbgInterface
)
{
// Text is dublicated in qmlengine.cpp
emit
receivedDebugOutput
(
tr
(
"Cannot retrieve debugging output!"
),
true
);
WaitForSingleObject
(
m_pid
->
hProcess
,
INFINITE
);
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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