forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user