diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-09-03 14:20:19 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-10-30 10:36:49 -0700 |
commit | e49d6213ad129284a45d53c3fcdc03249e84efe2 (patch) | |
tree | 2946a666ab38af3375e7bb2b8c5dd887d4a7f9a1 /qt-ui/btdeviceselectiondialog.h | |
parent | 588abd019fb2ed3f607682f2b6c7fe86a7a5bb90 (diff) | |
download | subsurface-e49d6213ad129284a45d53c3fcdc03249e84efe2.tar.gz |
Move qt-ui to desktop-widgets
Since we have now destkop and mobile versions, 'qt-ui' was a very
poor name choice for a folder that contains only destkop-enabled
widgets.
Also, move the graphicsview-common.h/cpp to subsurface-core because
it doesn't depend on qgraphicsview, it merely implements all the
colors that we use throughout Subsurface, and we will use colors on both
desktop and mobile versions
Same thing applies for metrics.h/cpp
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/btdeviceselectiondialog.h')
-rw-r--r-- | qt-ui/btdeviceselectiondialog.h | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/qt-ui/btdeviceselectiondialog.h b/qt-ui/btdeviceselectiondialog.h deleted file mode 100644 index 7651f164b..000000000 --- a/qt-ui/btdeviceselectiondialog.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef BTDEVICESELECTIONDIALOG_H -#define BTDEVICESELECTIONDIALOG_H - -#include <QDialog> -#include <QListWidgetItem> -#include <QPointer> -#include <QtBluetooth/QBluetoothLocalDevice> -#include <QtBluetooth/qbluetoothglobal.h> -#include <QtBluetooth/QBluetoothDeviceDiscoveryAgent> - -#if defined(Q_OS_WIN) - #include <QThread> - #include <winsock2.h> - #include <ws2bth.h> - - #define SUCCESS 0 - #define BTH_ADDR_BUF_LEN 40 - #define BTH_ADDR_PRETTY_STRING_LEN 17 // there are 6 two-digit hex values and 5 colons - - #undef ERROR // this is already declared in our headers - #undef IGNORE // this is already declared in our headers - #undef DC_VERSION // this is already declared in libdivecomputer header -#endif - -namespace Ui { - class BtDeviceSelectionDialog; -} - -#if defined(Q_OS_WIN) -class WinBluetoothDeviceDiscoveryAgent : public QThread { - Q_OBJECT -signals: - void deviceDiscovered(const QBluetoothDeviceInfo &info); - void error(QBluetoothDeviceDiscoveryAgent::Error error); - -public: - WinBluetoothDeviceDiscoveryAgent(QObject *parent); - ~WinBluetoothDeviceDiscoveryAgent(); - bool isActive() const; - QString errorToString() const; - QBluetoothDeviceDiscoveryAgent::Error error() const; - virtual void run(); - virtual void stop(); - -private: - bool running; - bool stopped; - QString lastErrorToString; - QBluetoothDeviceDiscoveryAgent::Error lastError; -}; -#endif - -class BtDeviceSelectionDialog : public QDialog { - Q_OBJECT - -public: - explicit BtDeviceSelectionDialog(QWidget *parent = 0); - ~BtDeviceSelectionDialog(); - QString getSelectedDeviceAddress(); - QString getSelectedDeviceName(); - -private slots: - void on_changeDeviceState_clicked(); - void on_save_clicked(); - void on_clear_clicked(); - void on_scan_clicked(); - void remoteDeviceScanFinished(); - void hostModeStateChanged(QBluetoothLocalDevice::HostMode mode); - void addRemoteDevice(const QBluetoothDeviceInfo &remoteDeviceInfo); - void itemClicked(QListWidgetItem *item); - void displayPairingMenu(const QPoint &pos); - void pairingFinished(const QBluetoothAddress &address,QBluetoothLocalDevice::Pairing pairing); - void error(QBluetoothLocalDevice::Error error); - void deviceDiscoveryError(QBluetoothDeviceDiscoveryAgent::Error error); - void localDeviceChanged(int); - -private: - Ui::BtDeviceSelectionDialog *ui; -#if defined(Q_OS_WIN) - WinBluetoothDeviceDiscoveryAgent *remoteDeviceDiscoveryAgent; -#else - QBluetoothLocalDevice *localDevice; - QBluetoothDeviceDiscoveryAgent *remoteDeviceDiscoveryAgent; -#endif - QSharedPointer<QBluetoothDeviceInfo> selectedRemoteDeviceInfo; - - void updateLocalDeviceInformation(); - void initializeDeviceDiscoveryAgent(); -}; - -#endif // BTDEVICESELECTIONDIALOG_H |