-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 10 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/bticonloader.cpp | 61 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/bticonloader.h | 8 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/btserviceitem.cpp | 3 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/btserviceitem.h | 1 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/stdpopups.cpp | 5 |
6 files changed, 52 insertions, 36 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 9cfeaa2..189001d 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp | |||
@@ -314,6 +314,7 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
314 | delete groups; | 314 | delete groups; |
315 | 315 | ||
316 | } else if ( ((BTListItem*)item)->type() == "service") { | 316 | } else if ( ((BTListItem*)item)->type() == "service") { |
317 | |||
317 | menu->insertItem( tr("Test1:"), 0); | 318 | menu->insertItem( tr("Test1:"), 0); |
318 | menu->insertItem( tr("connect"), 1); | 319 | menu->insertItem( tr("connect"), 1); |
319 | menu->insertItem( tr("delete"), 2); | 320 | menu->insertItem( tr("delete"), 2); |
@@ -370,9 +371,16 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
370 | 371 | ||
371 | if (!servicesList.isEmpty() ) { | 372 | if (!servicesList.isEmpty() ) { |
372 | // add services | 373 | // add services |
374 | QMap<int, QString> list; | ||
375 | QMap<int, QString>::Iterator classIt; | ||
373 | for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) { | 376 | for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) { |
374 | serviceItem = new BTServiceItem( deviceItem , (*it2) ); | 377 | serviceItem = new BTServiceItem( deviceItem , (*it2) ); |
375 | serviceItem->setPixmap( 0, m_iconLoader->serviceIcon( (*it2).classIdList() ) ); | 378 | list = (*it2).classIdList(); |
379 | classIt = list.begin(); | ||
380 | int classId; | ||
381 | if ( classIt != list.end() ) | ||
382 | classId = classIt.key(); | ||
383 | serviceItem->setPixmap( 0, m_iconLoader->serviceIcon( classId ) ); | ||
376 | } | 384 | } |
377 | } else { | 385 | } else { |
378 | Services s1; | 386 | Services s1; |
diff --git a/noncore/net/opietooth/manager/bticonloader.cpp b/noncore/net/opietooth/manager/bticonloader.cpp index 3fb0edd..f299117 100644 --- a/noncore/net/opietooth/manager/bticonloader.cpp +++ b/noncore/net/opietooth/manager/bticonloader.cpp | |||
@@ -10,32 +10,33 @@ namespace OpieTooth { | |||
10 | BTIconLoader::BTIconLoader() { | 10 | BTIconLoader::BTIconLoader() { |
11 | 11 | ||
12 | // still need to find out real ids | 12 | // still need to find out real ids |
13 | deviceIcons.insert( "100" , "computer_16" ); | 13 | deviceIcons.insert( 100 , "computer_16" ); |
14 | deviceIcons.insert( "101" , "phone_16" ); | 14 | deviceIcons.insert( 101 , "phone_16" ); |
15 | deviceIcons.insert( "102" , "brain_16" ); | 15 | deviceIcons.insert( 102 , "brain_16" ); |
16 | deviceIcons.insert( "103" , "conduit_16" ); | 16 | deviceIcons.insert( 103 , "conduit_16" ); |
17 | 17 | ||
18 | 18 | ||
19 | serviceIcons.insert( "0x1105" , "obex_16" ); //OBEXObjectPush | 19 | serviceIcons.insert( 4357 , "obex_16" ); //OBEXObjectPush |
20 | serviceIcons.insert( "0x1106" , "obex_16" ); //OBEXFileTransfer | 20 | serviceIcons.insert( 4358 , "obex_16" ); //OBEXFileTransfer |
21 | serviceIcons.insert( "0x1111" , "print_16" ); //Fax | 21 | serviceIcons.insert( 4369 , "print_16" ); //Fax |
22 | serviceIcons.insert( "0x1101" , "serial_16" ); //SerialPort | 22 | serviceIcons.insert( 4353 , "serial_16" ); //SerialPort |
23 | serviceIcons.insert( "0x1104" , "sync_16" ); //IrMCSync | 23 | serviceIcons.insert( 4356 , "sync_16" ); //IrMCSync |
24 | serviceIcons.insert( "0x1107" , "sync_16" ); //IrMCSyncCommand | 24 | serviceIcons.insert( 4359 , "sync_16" ); //IrMCSyncCommand |
25 | serviceIcons.insert( "0x1102" , "network_16" ); //LANAccessUsingPPP | 25 | serviceIcons.insert( 4354 , "network_16" ); //LANAccessUsingPPP |
26 | serviceIcons.insert( "0x1103" , "network_16"); //DialupNetworking | 26 | serviceIcons.insert( 4355 , "network_16"); //DialupNetworking |
27 | serviceIcons.insert( "0x1108" , "phone_16"); // Headset | 27 | serviceIcons.insert( 4360 , "phone_16"); // Headset |
28 | serviceIcons.insert( "0x1112" , "audio_16"); //HeadsetAudioGateway | 28 | serviceIcons.insert( 4370 , "audio_16"); //HeadsetAudioGateway |
29 | serviceIcons.insert( "0x1109" , "phone_16"); // CordlessTelephony | 29 | serviceIcons.insert( 4361 , "phone_16"); // CordlessTelephony |
30 | serviceIcons.insert( "0x110A" , "audio_16"); // AudioSource | 30 | serviceIcons.insert( 4362 , "audio_16"); // AudioSource |
31 | serviceIcons.insert( "0x110B" , "audio_16"); // AudioSink | 31 | serviceIcons.insert( 4363 , "audio_16"); // AudioSink |
32 | serviceIcons.insert( "0x1126" , "print_16" ); //HCR_Print | 32 | serviceIcons.insert( 4390 , "print_16" ); //HCR_Print |
33 | serviceIcons.insert( "0x1128" , "phone_16" ); //Common_ISDN_Access | 33 | serviceIcons.insert( 4392 , "phone_16" ); //Common_ISDN_Access |
34 | 34 | ||
35 | serviceIcons.insert( "0x1201" , "network_16" ); //GenericNetworking | 35 | serviceIcons.insert( 4609 , "network_16" ); //GenericNetworking |
36 | serviceIcons.insert( "0x1202" , "folder_16" ); //GenericFileTransfer | 36 | serviceIcons.insert( 4610 , "folder_16" ); //GenericFileTransfer |
37 | serviceIcons.insert( "0x1128" , "audio_16" ); //GenericAudio | 37 | serviceIcons.insert( 4392 , "audio_16" ); //GenericAudio |
38 | serviceIcons.insert( "0x1128" , "phone_16" ); //GenericTelephony | 38 | // serviceIcons.insert( 4392 , "phone_16" ); //GenericTelephony |
39 | // the above is duplicated? -zecke | ||
39 | 40 | ||
40 | //serviceIcons.insert( "106" , "link_16" ); | 41 | //serviceIcons.insert( "106" , "link_16" ); |
41 | //serviceIcons.insert( "107" , "misc_16" ); | 42 | //serviceIcons.insert( "107" , "misc_16" ); |
@@ -44,11 +45,11 @@ namespace OpieTooth { | |||
44 | BTIconLoader::~BTIconLoader() { | 45 | BTIconLoader::~BTIconLoader() { |
45 | } | 46 | } |
46 | 47 | ||
47 | QPixmap BTIconLoader::deviceIcon( const QString &deviceClass ) { | 48 | QPixmap BTIconLoader::deviceIcon( int deviceClass ) { |
48 | 49 | ||
49 | QString iconName; | 50 | QString iconName; |
50 | 51 | ||
51 | QMap<QString, QString>::Iterator it; | 52 | QMap<int, QString>::Iterator it; |
52 | 53 | ||
53 | it = deviceIcons.find( deviceClass ); | 54 | it = deviceIcons.find( deviceClass ); |
54 | iconName = it.data(); | 55 | iconName = it.data(); |
@@ -59,11 +60,11 @@ namespace OpieTooth { | |||
59 | return( Resource::loadPixmap( "opietooth/icons/" + iconName ) ); | 60 | return( Resource::loadPixmap( "opietooth/icons/" + iconName ) ); |
60 | } | 61 | } |
61 | 62 | ||
62 | QPixmap BTIconLoader::serviceIcon( const QString &serviceClass ) { | 63 | QPixmap BTIconLoader::serviceIcon( int serviceClass ) { |
63 | 64 | ||
64 | QString iconName; | 65 | QString iconName; |
65 | 66 | ||
66 | QMap<QString, QString>::Iterator it; | 67 | QMap<int, QString>::Iterator it; |
67 | 68 | ||
68 | it = deviceIcons.find( serviceClass ); | 69 | it = deviceIcons.find( serviceClass ); |
69 | iconName = it.data(); | 70 | iconName = it.data(); |
diff --git a/noncore/net/opietooth/manager/bticonloader.h b/noncore/net/opietooth/manager/bticonloader.h index 1b48009..9951c4c 100644 --- a/noncore/net/opietooth/manager/bticonloader.h +++ b/noncore/net/opietooth/manager/bticonloader.h | |||
@@ -18,19 +18,19 @@ namespace OpieTooth { | |||
18 | * @param deviceClass the device class id | 18 | * @param deviceClass the device class id |
19 | * @return the pixmap | 19 | * @return the pixmap |
20 | */ | 20 | */ |
21 | QPixmap deviceIcon( const QString &deviceClass ); | 21 | QPixmap deviceIcon( int ); |
22 | 22 | ||
23 | /** | 23 | /** |
24 | * Returns an icon depending on service id | 24 | * Returns an icon depending on service id |
25 | * @param serviceClass the service id | 25 | * @param serviceClass the service id |
26 | * @return the pixmap | 26 | * @return the pixmap |
27 | */ | 27 | */ |
28 | QPixmap serviceIcon( const QString &serviceClass ); | 28 | QPixmap serviceIcon( int ); |
29 | 29 | ||
30 | private: | 30 | private: |
31 | // first ist id, second is icon name | 31 | // first ist id, second is icon name |
32 | QMap<QString,QString> deviceIcons; | 32 | QMap<int,QString> deviceIcons; |
33 | QMap<QString,QString> serviceIcons; | 33 | QMap<int,QString> serviceIcons; |
34 | }; | 34 | }; |
35 | } | 35 | } |
36 | 36 | ||
diff --git a/noncore/net/opietooth/manager/btserviceitem.cpp b/noncore/net/opietooth/manager/btserviceitem.cpp index 352e793..7db93c9 100644 --- a/noncore/net/opietooth/manager/btserviceitem.cpp +++ b/noncore/net/opietooth/manager/btserviceitem.cpp | |||
@@ -21,3 +21,6 @@ int BTServiceItem::typeId() const { | |||
21 | Services BTServiceItem::services() const { | 21 | Services BTServiceItem::services() const { |
22 | return m_service; | 22 | return m_service; |
23 | } | 23 | } |
24 | int BTServiceItem::serviceId() const { | ||
25 | return m_service.recHandle(); | ||
26 | }; | ||
diff --git a/noncore/net/opietooth/manager/btserviceitem.h b/noncore/net/opietooth/manager/btserviceitem.h index 6dbd8f1..625a5f7 100644 --- a/noncore/net/opietooth/manager/btserviceitem.h +++ b/noncore/net/opietooth/manager/btserviceitem.h | |||
@@ -16,6 +16,7 @@ namespace OpieTooth { | |||
16 | QString type() const; | 16 | QString type() const; |
17 | int typeId() const; | 17 | int typeId() const; |
18 | Services services() const; | 18 | Services services() const; |
19 | int serviceId() const; | ||
19 | private: | 20 | private: |
20 | Services m_service; | 21 | Services m_service; |
21 | 22 | ||
diff --git a/noncore/net/opietooth/manager/stdpopups.cpp b/noncore/net/opietooth/manager/stdpopups.cpp index 43a0f62..f462368 100644 --- a/noncore/net/opietooth/manager/stdpopups.cpp +++ b/noncore/net/opietooth/manager/stdpopups.cpp | |||
@@ -1,8 +1,11 @@ | |||
1 | 1 | ||
2 | //#include "rfccompopup.h" | ||
3 | |||
2 | #include "stdpopups.h" | 4 | #include "stdpopups.h" |
3 | 5 | ||
4 | 6 | ||
5 | QPopupMenu* newRfcComPopup( const OpieTooth::Services&, QListViewItem* ) { | 7 | QPopupMenu* newRfcComPopup( const OpieTooth::Services& servive, QListViewItem* item ) { |
8 | // return OpieTooth::RfcComPopup( servive, item ); | ||
6 | return 0l; | 9 | return 0l; |
7 | } | 10 | } |
8 | QPopupMenu* newObexPushPopup( const OpieTooth::Services&, QListViewItem* ) { | 11 | QPopupMenu* newObexPushPopup( const OpieTooth::Services&, QListViewItem* ) { |