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
cd5492eb
Commit
cd5492eb
authored
Aug 13, 2010
by
Pawel Polanski
Browse files
Progress bar for Launching for S60 sequence has been changed to behave like for other targets
Reviewed-by: Tobias Hunger
parent
f9a69a5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp
View file @
cd5492eb
...
...
@@ -660,38 +660,10 @@ bool S60DeviceRunControlBase::isRunning() const
void
S60DeviceRunControlBase
::
startLaunching
()
{
QString
errorMessage
;
bool
success
=
false
;
do
{
connect
(
SymbianUtils
::
SymbianDeviceManager
::
instance
(),
SIGNAL
(
deviceRemoved
(
const
SymbianUtils
::
SymbianDevice
)),
this
,
SLOT
(
deviceRemoved
(
SymbianUtils
::
SymbianDevice
)));
m_launcher
=
trk
::
Launcher
::
acquireFromDeviceManager
(
m_serialPortName
,
0
,
&
errorMessage
);
if
(
!
m_launcher
)
break
;
connect
(
m_launcher
,
SIGNAL
(
finished
()),
this
,
SLOT
(
launcherFinished
()));
connect
(
m_launcher
,
SIGNAL
(
canNotConnect
(
QString
)),
this
,
SLOT
(
printConnectFailed
(
QString
)));
connect
(
m_launcher
,
SIGNAL
(
stateChanged
(
int
)),
this
,
SLOT
(
slotLauncherStateChanged
(
int
)));
connect
(
m_launcher
,
SIGNAL
(
processStopped
(
uint
,
uint
,
uint
,
QString
)),
this
,
SLOT
(
processStopped
(
uint
,
uint
,
uint
,
QString
)));
if
(
!
m_commandLineArguments
.
isEmpty
())
m_launcher
->
setCommandLineArgs
(
m_commandLineArguments
);
const
QString
runFileName
=
QString
::
fromLatin1
(
"%1:
\\
sys
\\
bin
\\
%2.exe"
).
arg
(
m_installationDrive
).
arg
(
m_targetName
);
initLauncher
(
runFileName
,
m_launcher
);
const
trk
::
PromptStartCommunicationResult
src
=
S60RunConfigBluetoothStarter
::
startCommunication
(
m_launcher
->
trkDevice
(),
0
,
&
errorMessage
);
if
(
src
!=
trk
::
PromptStartCommunicationConnected
)
break
;
if
(
!
m_launcher
->
startServer
(
&
errorMessage
))
{
errorMessage
=
tr
(
"Could not connect to phone on port '%1': %2
\n
"
"Check if the phone is connected and App TRK is running."
).
arg
(
m_serialPortName
,
errorMessage
);
break
;
}
success
=
true
;
}
while
(
false
);
if
(
!
success
)
{
if
(
setupLauncher
(
errorMessage
))
{
if
(
m_deployProgress
)
m_deployProgress
->
setProgressValue
(
PROGRESS_MAX
/
2
);
}
else
{
if
(
!
errorMessage
.
isEmpty
())
appendMessage
(
this
,
errorMessage
,
true
);
stop
();
...
...
@@ -699,6 +671,39 @@ void S60DeviceRunControlBase::startLaunching()
}
}
bool
S60DeviceRunControlBase
::
setupLauncher
(
QString
&
errorMessage
)
{
connect
(
SymbianUtils
::
SymbianDeviceManager
::
instance
(),
SIGNAL
(
deviceRemoved
(
const
SymbianUtils
::
SymbianDevice
)),
this
,
SLOT
(
deviceRemoved
(
SymbianUtils
::
SymbianDevice
)));
m_launcher
=
trk
::
Launcher
::
acquireFromDeviceManager
(
m_serialPortName
,
0
,
&
errorMessage
);
if
(
!
m_launcher
)
return
false
;
connect
(
m_launcher
,
SIGNAL
(
finished
()),
this
,
SLOT
(
launcherFinished
()));
connect
(
m_launcher
,
SIGNAL
(
canNotConnect
(
QString
)),
this
,
SLOT
(
printConnectFailed
(
QString
)));
connect
(
m_launcher
,
SIGNAL
(
stateChanged
(
int
)),
this
,
SLOT
(
slotLauncherStateChanged
(
int
)));
connect
(
m_launcher
,
SIGNAL
(
processStopped
(
uint
,
uint
,
uint
,
QString
)),
this
,
SLOT
(
processStopped
(
uint
,
uint
,
uint
,
QString
)));
if
(
!
m_commandLineArguments
.
isEmpty
())
m_launcher
->
setCommandLineArgs
(
m_commandLineArguments
);
const
QString
runFileName
=
QString
::
fromLatin1
(
"%1:
\\
sys
\\
bin
\\
%2.exe"
).
arg
(
m_installationDrive
).
arg
(
m_targetName
);
initLauncher
(
runFileName
,
m_launcher
);
const
trk
::
PromptStartCommunicationResult
src
=
S60RunConfigBluetoothStarter
::
startCommunication
(
m_launcher
->
trkDevice
(),
0
,
&
errorMessage
);
if
(
src
!=
trk
::
PromptStartCommunicationConnected
)
return
false
;
if
(
!
m_launcher
->
startServer
(
&
errorMessage
))
{
errorMessage
=
tr
(
"Could not connect to phone on port '%1': %2
\n
"
"Check if the phone is connected and App TRK is running."
).
arg
(
m_serialPortName
,
errorMessage
);
return
false
;
}
return
true
;
}
void
S60DeviceRunControlBase
::
printConnectFailed
(
const
QString
&
errorMessage
)
{
emit
appendMessage
(
this
,
tr
(
"Could not connect to App TRK on device: %1. Restarting App TRK might help."
).
arg
(
errorMessage
),
true
);
...
...
@@ -799,8 +804,8 @@ S60DeviceRunControl::S60DeviceRunControl(ProjectExplorer::RunConfiguration *runC
void
S60DeviceRunControl
::
initLauncher
(
const
QString
&
executable
,
trk
::
Launcher
*
launcher
)
{
connect
(
launcher
,
SIGNAL
(
startingApplication
()),
this
,
SLOT
(
printStartingNotice
()));
connect
(
launcher
,
SIGNAL
(
applicationRunning
(
uint
)),
this
,
SLOT
(
print
RunNotice
(
uint
)));
connect
(
launcher
,
SIGNAL
(
canNotRun
(
QString
)),
this
,
SLOT
(
print
RunFailNotice
(
QString
)));
connect
(
launcher
,
SIGNAL
(
applicationRunning
(
uint
)),
this
,
SLOT
(
application
RunNotice
(
uint
)));
connect
(
launcher
,
SIGNAL
(
canNotRun
(
QString
)),
this
,
SLOT
(
application
RunFail
ed
Notice
(
QString
)));
connect
(
launcher
,
SIGNAL
(
applicationOutputReceived
(
QString
)),
this
,
SLOT
(
printApplicationOutput
(
QString
)));
launcher
->
addStartupActions
(
trk
::
Launcher
::
ActionRun
);
launcher
->
setFileName
(
executable
);
...
...
@@ -817,12 +822,15 @@ void S60DeviceRunControl::printStartingNotice()
emit
appendMessage
(
this
,
tr
(
"Starting application..."
),
false
);
}
void
S60DeviceRunControl
::
print
RunNotice
(
uint
pid
)
void
S60DeviceRunControl
::
application
RunNotice
(
uint
pid
)
{
emit
appendMessage
(
this
,
tr
(
"Application running with pid %1."
).
arg
(
pid
),
false
);
if
(
m_deployProgress
)
m_deployProgress
->
setProgressValue
(
PROGRESS_MAX
);
}
void
S60DeviceRunControl
::
printRunFailNotice
(
const
QString
&
errorMessage
)
{
void
S60DeviceRunControl
::
applicationRunFailedNotice
(
const
QString
&
errorMessage
)
{
emit
appendMessage
(
this
,
tr
(
"Could not start application: %1"
).
arg
(
errorMessage
),
true
);
}
...
...
src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h
View file @
cd5492eb
...
...
@@ -183,6 +183,7 @@ protected slots:
void
printApplicationOutput
(
const
QString
&
output
,
bool
onStdErr
);
void
printApplicationOutput
(
const
QString
&
output
);
void
deviceRemoved
(
const
SymbianUtils
::
SymbianDevice
&
);
void
reportDeployFinished
();
private
slots
:
void
processStopped
(
uint
pc
,
uint
pid
,
uint
tid
,
const
QString
&
reason
);
...
...
@@ -190,10 +191,13 @@ private slots:
void
launcherFinished
();
void
slotLauncherStateChanged
(
int
);
void
slotWaitingForTrkClosed
();
void
reportDeployFinished
();
protected:
QFutureInterface
<
void
>
*
m_deployProgress
;
private:
void
startLaunching
();
bool
setupLauncher
(
QString
&
errorMessage
);
ProjectExplorer
::
ToolChain
::
ToolChainType
m_toolChain
;
QString
m_serialPortName
;
...
...
@@ -205,7 +209,6 @@ private:
QString
m_qtBinPath
;
bool
m_releaseDeviceAfterLauncherFinish
;
bool
m_handleDeviceRemoval
;
QFutureInterface
<
void
>
*
m_deployProgress
;
trk
::
Launcher
*
m_launcher
;
char
m_installationDrive
;
};
...
...
@@ -223,8 +226,8 @@ protected:
private
slots
:
void
printStartingNotice
();
void
print
RunNotice
(
uint
pid
);
void
print
RunFailNotice
(
const
QString
&
errorMessage
);
void
application
RunNotice
(
uint
pid
);
void
application
RunFail
ed
Notice
(
const
QString
&
errorMessage
);
private:
};
...
...
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