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

@@ -30,6 +30,7 @@
#include "s60debuggerbluetoothstarter.h"
#include "bluetoothlistener.h"
#include "debuggermanager.h"
#include "trkoptions.h"
namespace Debugger {
namespace Internal {
@@ -48,5 +49,24 @@ trk::BluetoothListener *S60DebuggerBluetoothStarter::createListener()
return rc;
}
trk::PromptStartCommunicationResult
S60DebuggerBluetoothStarter::startCommunication(const TrkDevicePtr &trkDevice,
const QString &device,
int communicationType,
QWidget *msgBoxParent,
QString *errorMessage)
{
// Bluetooth?
if (communicationType == TrkOptions::BlueTooth) {
S60DebuggerBluetoothStarter bluetoothStarter(trkDevice);
bluetoothStarter.setDevice(device);
return trk::promptStartBluetooth(bluetoothStarter, msgBoxParent, errorMessage);
}
// Serial
BaseCommunicationStarter serialStarter(trkDevice);
serialStarter.setDevice(device);
return trk::promptStartSerial(serialStarter, msgBoxParent, errorMessage);
}
} // namespace Internal
} // namespace Debugger