S60: Provide a MessageBox for starting serial communication as well.

Generalize the concept of the Bluetooth starter, extract base class
BaseCommunicationStarter that can be used to start a serial communication
without further resources (listener) as well. Introduce convenience
functions for both types.

Note: This will only work for COM-ports that are not used otherwise
by the operating system.
This commit is contained in:
Friedemann Kleint
2009-10-26 15:37:09 +01:00
parent c6e9c041a7
commit 4091efb47f
13 changed files with 291 additions and 145 deletions

View File

@@ -302,22 +302,22 @@ bool S60DeviceRunConfigurationWidget::getDeviceInfo(QString *message)
const CommunicationDevice commDev = currentDevice();
launcher->setSerialFrame(commDev.type == SerialPortCommunication);
launcher->setTrkServerName(commDev.portName);
// Prompt the user to start
if (commDev.type == BlueToothCommunication) {
S60RunConfigBluetoothStarter starter(launcher->trkDevice());
starter.setDevice(launcher->trkServerName());
const trk::StartBluetoothGuiResult src = trk::startBluetoothGui(starter, this, message);
switch (src) {
case trk::BluetoothGuiConnected:
break;
case trk::BluetoothGuiCanceled:
launcher->deleteLater();
return true;
case trk::BluetoothGuiError:
launcher->deleteLater();
return false;
};
}
// Prompt user
const trk::PromptStartCommunicationResult src =
S60RunConfigBluetoothStarter::startCommunication(launcher->trkDevice(),
commDev.portName,
commDev.type, this,
message);
switch (src) {
case trk::PromptStartCommunicationConnected:
break;
case trk::PromptStartCommunicationCanceled:
launcher->deleteLater();
return true;
case trk::PromptStartCommunicationError:
launcher->deleteLater();
return false;
};
if (!launcher->startServer(message)) {
launcher->deleteLater();
return false;