summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/bluebase.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opietooth/manager/bluebase.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp114
1 files changed, 109 insertions, 5 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index c993c7c..d45fbe0 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -41,7 +41,7 @@
+#include <remotedevice.h>
-namespace OpieTooth {
+namespace OpieTooth {
- #include <remotedevice.h>
@@ -53,6 +53,16 @@ namespace OpieTooth {
QObject::connect((QObject*)configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges()));
+ QObject::connect( (QObject*)ListView2, SIGNAL( expanded( QListViewItem * item ) ),
+ this, SLOT( addServicesToDevice( QListViewItem * item ) ) );
+ QObject::connect( (QObject*)ListView2, SIGNAL( clicked( QListViewItem * )),
+ this, SLOT( startServiceActionClicked( QListViewItem * item ) ) );
+ //
+ // QObject::connect( (QObject*) Manager, SIGNAL (foundServices( const QString& device, Services::ValueList ), this () ) );
+ //Load all icons needed
+ QPixmap offPix = Resource::loadPixmap( "editdelete" );
+ QPixmap onPix = Resource::loadPixmap( "installed" );
+
QPalette pal = this->palette();
@@ -69,4 +79,21 @@ namespace OpieTooth {
initGui();
+
+
+ //TESTING
+
+ ListView2->setRootIsDecorated(true);
+
+ QListViewItem *topLV = new QListViewItem( ListView2, "Harlekins Dongle" , "yes");
+ topLV->setPixmap(0, offPix);
+ (void) new QListViewItem( topLV, "on" );
+ (void) new QListViewItem( topLV, "off" );
+
+ QListViewItem *topLV2 = new QListViewItem( ListView2, "Siemens S45" , "no" );
+ topLV2->setPixmap(0, onPix);
+ (void) new QListViewItem( topLV2, "on" );
+ (void) new QListViewItem( topLV2, "off" );
+
}
+
/**
@@ -98,3 +125,2 @@ namespace OpieTooth {
-
cfg.writeEntry("name", deviceName);
@@ -108,2 +134,20 @@ namespace OpieTooth {
+ /*
+ * Read the list of allready known devices
+ *
+ */
+ void BlueBase::readSavedDevices() {
+
+ }
+
+ /*
+ * Read the list of allready known devices
+ *
+ */
+ void BlueBase::writeSavedDevices() {
+
+
+ }
+
+
/**
@@ -121,2 +165,4 @@ namespace OpieTooth {
passkeyLine->setText(defaultPasskey);
+ // set info tab
+ setInfo();
}
@@ -130,3 +176,7 @@ namespace OpieTooth {
- return ("manger.h need also a status method");
+ QString infoString = tr("<b>Device name : </b> Ipaq" );
+ infoString += QString("<br><b>" + tr("MAC adress: ") +"</b> No idea");
+ infoString += QString("<br><b>" + tr("Class") + "</b> PDA");
+
+ return (infoString);
@@ -157,2 +207,6 @@ namespace OpieTooth {
+ /*
+ * Add fresh found devices from scan dialog to the listing
+ *
+ */
void BlueBase::addSearchedDevices( QList<RemoteDevice> &newDevices ) {
@@ -167,3 +221,10 @@ namespace OpieTooth {
RemoteDevice *dev = it.current();
- deviceItem = new QListViewItem( ListView4, dev->name() );
+ deviceItem = new QListViewItem( ListView2, dev->name() );
+
+ if (deviceActive( dev ) ) {
+ deviceItem->setPixmap(0, onPix);
+ } else {
+ deviceItem->setPixmap(0, offPix);
+ }
+
deviceItem->setText(1, dev->mac() );
@@ -173,2 +234,39 @@ namespace OpieTooth {
+ /*
+ * Action that is toggled on entrys on click
+ */
+ void BlueBase::startServiceActionClicked( QListViewItem * item ) {
+
+
+ }
+
+ /*
+ * Action that are toggled on hold (mostly QPopups i guess)
+ */
+ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int column) {
+
+
+ }
+
+ /*
+ * Search and display avail. services for a device (on expand from device listing)
+ *
+ */
+ void BlueBase::addServicesToDevice( QListViewItem * item ) {
+ // row of mac adress
+ RemoteDevice *device = new RemoteDevice(item->text(1), item->text(0));
+ //dann nen manager und darauf dann searchServises, das liefert nen signal, das wieder connected
+ // werden muss.
+
+ // delete
+ }
+
+ /*
+ * Find out if a device can currently be reached
+ */
+ bool BlueBase::deviceActive( RemoteDevice *device ) {
+
+ return true;
+ }
+
/**
@@ -177,2 +275,3 @@ namespace OpieTooth {
void BlueBase::startScan() {
+
ScanDialog *scan = new ScanDialog( this, "", true);
@@ -184,2 +283,7 @@ namespace OpieTooth {
+
+ void BlueBase::setInfo() {
+ StatusLabel->setText(getStatus());
+ }
+
/**