summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp11
1 files changed, 0 insertions, 11 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 6c17974..b31e14f 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -50,109 +50,98 @@
50 50
51 51
52using namespace OpieTooth; 52using namespace OpieTooth;
53 53
54BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) 54BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
55 : BluetoothBase( parent, name, fl ) { 55 : BluetoothBase( parent, name, fl ) {
56 56
57 m_localDevice = new Manager( "hci0" ); 57 m_localDevice = new Manager( "hci0" );
58 58
59 connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); 59 connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) );
60 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) ); 60 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) );
61 // not good since lib is async 61 // not good since lib is async
62 // connect( ListView2, SIGNAL( expanded ( QListViewItem* ) ), 62 // connect( ListView2, SIGNAL( expanded ( QListViewItem* ) ),
63 // this, SLOT( addServicesToDevice( QListViewItem * ) ) ); 63 // this, SLOT( addServicesToDevice( QListViewItem * ) ) );
64 connect( ListView2, SIGNAL( clicked( QListViewItem* )), 64 connect( ListView2, SIGNAL( clicked( QListViewItem* )),
65 this, SLOT( startServiceActionClicked( QListViewItem* ) ) ); 65 this, SLOT( startServiceActionClicked( QListViewItem* ) ) );
66 connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ), 66 connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ),
67 this, SLOT(startServiceActionHold( QListViewItem *, const QPoint &, int) ) ); 67 this, SLOT(startServiceActionHold( QListViewItem *, const QPoint &, int) ) );
68 connect( m_localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ), 68 connect( m_localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ),
69 this, SLOT( addServicesToDevice( const QString& , Services::ValueList ) ) ); 69 this, SLOT( addServicesToDevice( const QString& , Services::ValueList ) ) );
70 connect( m_localDevice, SIGNAL( available( const QString&, bool ) ), 70 connect( m_localDevice, SIGNAL( available( const QString&, bool ) ),
71 this, SLOT( deviceActive( const QString& , bool ) ) ); 71 this, SLOT( deviceActive( const QString& , bool ) ) );
72 connect( m_localDevice, SIGNAL( connections( ConnectionState::ValueList ) ), 72 connect( m_localDevice, SIGNAL( connections( ConnectionState::ValueList ) ),
73 this, SLOT( addConnectedDevices( ConnectionState::ValueList ) ) ); 73 this, SLOT( addConnectedDevices( ConnectionState::ValueList ) ) );
74 74
75 75
76 // let hold be rightButtonClicked() 76 // let hold be rightButtonClicked()
77 QPEApplication::setStylusOperation( ListView2->viewport(), QPEApplication::RightOnHold); 77 QPEApplication::setStylusOperation( ListView2->viewport(), QPEApplication::RightOnHold);
78 QPEApplication::setStylusOperation( ListView4->viewport(), QPEApplication::RightOnHold); 78 QPEApplication::setStylusOperation( ListView4->viewport(), QPEApplication::RightOnHold);
79 79
80 //Load all icons needed 80 //Load all icons needed
81 m_offPix = Resource::loadPixmap( "opietooth/notconnected" ); 81 m_offPix = Resource::loadPixmap( "opietooth/notconnected" );
82 m_onPix = Resource::loadPixmap( "opietooth/connected" ); 82 m_onPix = Resource::loadPixmap( "opietooth/connected" );
83 m_findPix = Resource::loadPixmap( "opietooth/find" ); 83 m_findPix = Resource::loadPixmap( "opietooth/find" );
84 84
85 QPalette pal = this->palette(); 85 QPalette pal = this->palette();
86 QColor col = pal.color( QPalette::Active, QColorGroup::Background ); 86 QColor col = pal.color( QPalette::Active, QColorGroup::Background );
87 pal.setColor( QPalette::Active, QColorGroup::Button, col ); 87 pal.setColor( QPalette::Active, QColorGroup::Button, col );
88 pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); 88 pal.setColor( QPalette::Inactive, QColorGroup::Button, col );
89 pal.setColor( QPalette::Normal, QColorGroup::Button, col ); 89 pal.setColor( QPalette::Normal, QColorGroup::Button, col );
90 pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); 90 pal.setColor( QPalette::Disabled, QColorGroup::Button, col );
91 this->setPalette( pal ); 91 this->setPalette( pal );
92 92
93 setCaption( tr( "Bluetooth Manager" ) ); 93 setCaption( tr( "Bluetooth Manager" ) );
94 94
95 readConfig(); 95 readConfig();
96 initGui(); 96 initGui();
97 97
98 //TESTING
99 ListView2->setRootIsDecorated(true); 98 ListView2->setRootIsDecorated(true);
100 99
101 BTDeviceItem *topLV2 = new BTDeviceItem( ListView2, RemoteDevice("xx:", "Siemens S45" ) );
102 topLV2->setPixmap( 1, m_onPix );
103 Services s1;
104 s1.setServiceName( "Serial" );
105 s1.insertClassId(1, "BlueNic");
106 (void) new BTServiceItem( topLV2, s1 );
107 s1.setServiceName( "BlueNic" );
108 s1.insertClassId(2, "Obex");
109 (void) new BTServiceItem( topLV2, s1 );
110
111 writeToHciConfig(); 100 writeToHciConfig();
112 // search conncetions 101 // search conncetions
113 addConnectedDevices(); 102 addConnectedDevices();
114 m_iconLoader = new BTIconLoader(); 103 m_iconLoader = new BTIconLoader();
115 readSavedDevices(); 104 readSavedDevices();
116} 105}
117 106
118/** 107/**
119 * Reads all options from the config file 108 * Reads all options from the config file
120 */ 109 */
121void BlueBase::readConfig() { 110void BlueBase::readConfig() {
122 111
123 Config cfg( "bluetoothmanager" ); 112 Config cfg( "bluetoothmanager" );
124 cfg.setGroup( "bluezsettings" ); 113 cfg.setGroup( "bluezsettings" );
125 114
126 m_deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with 115 m_deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with
127 m_defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak 116 m_defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak
128 m_useEncryption = cfg.readBoolEntry( "useEncryption" , TRUE ); 117 m_useEncryption = cfg.readBoolEntry( "useEncryption" , TRUE );
129 m_enableAuthentification = cfg.readBoolEntry( "enableAuthentification" , TRUE ); 118 m_enableAuthentification = cfg.readBoolEntry( "enableAuthentification" , TRUE );
130 m_enablePagescan = cfg.readBoolEntry( "enablePagescan" , TRUE ); 119 m_enablePagescan = cfg.readBoolEntry( "enablePagescan" , TRUE );
131 m_enableInquiryscan = cfg.readBoolEntry( "enableInquiryscan" , TRUE ); 120 m_enableInquiryscan = cfg.readBoolEntry( "enableInquiryscan" , TRUE );
132} 121}
133 122
134/** 123/**
135 * Writes all options to the config file 124 * Writes all options to the config file
136 */ 125 */
137void BlueBase::writeConfig() { 126void BlueBase::writeConfig() {
138 127
139 Config cfg( "bluetoothmanager" ); 128 Config cfg( "bluetoothmanager" );
140 cfg.setGroup( "bluezsettings" ); 129 cfg.setGroup( "bluezsettings" );
141 130
142 cfg.writeEntry( "name" , m_deviceName ); 131 cfg.writeEntry( "name" , m_deviceName );
143 cfg.writeEntryCrypt( "passkey" , m_defaultPasskey ); 132 cfg.writeEntryCrypt( "passkey" , m_defaultPasskey );
144 cfg.writeEntry( "useEncryption" , m_useEncryption ); 133 cfg.writeEntry( "useEncryption" , m_useEncryption );
145 cfg.writeEntry( "enableAuthentification" , m_enableAuthentification ); 134 cfg.writeEntry( "enableAuthentification" , m_enableAuthentification );
146 cfg.writeEntry( "enablePagescan" , m_enablePagescan ); 135 cfg.writeEntry( "enablePagescan" , m_enablePagescan );
147 cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan ); 136 cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan );
148 137
149 writeToHciConfig(); 138 writeToHciConfig();
150} 139}
151 140
152/** 141/**
153 * Modify the hcid.conf file to our needs 142 * Modify the hcid.conf file to our needs
154 */ 143 */
155void BlueBase::writeToHciConfig() { 144void BlueBase::writeToHciConfig() {
156 qWarning("writeToHciConfig"); 145 qWarning("writeToHciConfig");
157 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" ); 146 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" );
158 hciconf.load(); 147 hciconf.load();