author | wimpie <wimpie> | 2005-01-05 02:42:18 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2005-01-05 02:42:18 (UTC) |
commit | bf65cf9aeb5dddcc4b0c0d702afd748d97e95d5e (patch) (side-by-side diff) | |
tree | ec61a57a8ace5c74e6cae46a676f40d849f4b9b1 | |
parent | 2f343aab63dd30e97a893e3691501cdd55114e82 (diff) | |
download | opie-bf65cf9aeb5dddcc4b0c0d702afd748d97e95d5e.zip opie-bf65cf9aeb5dddcc4b0c0d702afd748d97e95d5e.tar.gz opie-bf65cf9aeb5dddcc4b0c0d702afd748d97e95d5e.tar.bz2 |
Slightly better layout for OTMainGUI.
Fixed segfault bug in disconnectNotify call (signal string could be NULL)
-rw-r--r-- | noncore/settings/networksettings2/opietooth2/OTGateway.cpp | 4 | ||||
-rw-r--r-- | noncore/settings/networksettings2/opietooth2/OTMainGUI.ui | 160 |
2 files changed, 103 insertions, 61 deletions
diff --git a/noncore/settings/networksettings2/opietooth2/OTGateway.cpp b/noncore/settings/networksettings2/opietooth2/OTGateway.cpp index 2d13ce9..6531cf6 100644 --- a/noncore/settings/networksettings2/opietooth2/OTGateway.cpp +++ b/noncore/settings/networksettings2/opietooth2/OTGateway.cpp @@ -123,103 +123,103 @@ OTDevice * OTGateway::getOTDevice( ) { // start bluetooth (if stopped) // return TRUE if started void OTGateway::SLOT_SetEnabled( bool Mode ) { if( Mode ) { SLOT_Enable(); return; } SLOT_Disable(); } void OTGateway::SLOT_Enable() { getOTDevice()->attach(); } void OTGateway::SLOT_Disable() { getOTDevice()->detach(); } bool OTGateway::needsEnabling() { return getOTDevice()->needsAttach(); } bool OTGateway::isEnabled() { if( getOTDevice()->deviceNr() >= 0 && driver( getOTDevice()->deviceNr() )->isUp() ) return TRUE; // else check system return getOTDevice()->isAttached(); } void OTGateway::SLOT_ShowError( const QString & S ) { owarn << S << oendl; if( ErrorConnectCount > 0 ) { // pass error emit error( QString( "<p>" ) + S + "</p>" ); return; } QMessageBox::warning( 0, tr("OTGateway error"), S ); } void OTGateway::connectNotify( const char * S ) { - if( strcmp( S, "error(const QString&)" ) == 0 ) { + if( S && strcmp( S, "error(const QString&)" ) == 0 ) { ErrorConnectCount ++; } } void OTGateway::disconnectNotify( const char * S ) { - if( strcmp( S, "error(const QString&)" ) == 0 ) { + if( S && strcmp( S, "error(const QString&)" ) == 0 ) { ErrorConnectCount --; } } void OTGateway::timerEvent( QTimerEvent * ) { OTDriver * D; unsigned int oldc = AllDrivers.count(); bool old; AllDrivers.update(); if( oldc != AllDrivers.count() ) { updateDrivers(); } else { for( unsigned int i = 0; i < AllDrivers.count(); i ++ ) { D = AllDrivers[i]; old = D->isUp(); if( D->currentState() >= 0 ) { if( old != D->isUp() ) { emit stateChange( D, D->isUp() ); } } else { // if one driver is unable to provide info // we refresh all devices updateDrivers(); return; } } } } void OTGateway::SLOT_Enabled( int id, bool Up ) { owarn << "device " << id << " state " << Up << oendl; if( Up ) { // device is up -> detect it updateDrivers(); if( (unsigned)id >= AllDrivers.count() ) { // to make sure that the driver really IS detected AllDrivers[id]->bringUp(); } } // if DOWN device already down emit deviceEnabled( Up ); } void OTGateway::updateDrivers( void ) { diff --git a/noncore/settings/networksettings2/opietooth2/OTMainGUI.ui b/noncore/settings/networksettings2/opietooth2/OTMainGUI.ui index 6005504..d9038ae 100644 --- a/noncore/settings/networksettings2/opietooth2/OTMainGUI.ui +++ b/noncore/settings/networksettings2/opietooth2/OTMainGUI.ui @@ -1,154 +1,175 @@ <!DOCTYPE UI><UI> <class>OTMainGUI</class> <widget> <class>QWidget</class> <property stdset="1"> <name>name</name> <cstring>OTMainGUI</cstring> </property> <property stdset="1"> <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>228</width> - <height>347</height> + <width>257</width> + <height>296</height> </rect> </property> <property stdset="1"> <name>caption</name> <string>Bluetooth Manager</string> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> <vbox> <property stdset="1"> <name>margin</name> - <number>5</number> + <number>3</number> </property> <property stdset="1"> <name>spacing</name> <number>0</number> </property> <spacer> <property> <name>name</name> <cstring>Spacer20</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Vertical</enum> </property> <property stdset="1"> <name>sizeType</name> <enum>Expanding</enum> </property> <property> <name>sizeHint</name> <size> <width>20</width> <height>20</height> </size> </property> </spacer> <widget> <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> <cstring>Layout7</cstring> </property> <hbox> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> <number>6</number> </property> <widget> <class>QPushButton</class> <property stdset="1"> <name>name</name> <cstring>ManageLocalHW_But</cstring> </property> <property stdset="1"> <name>text</name> <string>Local Bluetooth hardware</string> </property> </widget> <spacer> <property> <name>name</name> <cstring>Spacer9_2</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Horizontal</enum> </property> <property stdset="1"> <name>sizeType</name> <enum>Expanding</enum> </property> <property> <name>sizeHint</name> <size> <width>20</width> <height>20</height> </size> </property> </spacer> </hbox> </widget> + <spacer> + <property> + <name>name</name> + <cstring>Spacer20_3</cstring> + </property> + <property stdset="1"> + <name>orientation</name> + <enum>Vertical</enum> + </property> + <property stdset="1"> + <name>sizeType</name> + <enum>Expanding</enum> + </property> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> <widget> <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> <cstring>Layout2</cstring> </property> <hbox> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> <number>6</number> </property> <spacer> <property> <name>name</name> <cstring>Spacer7</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Horizontal</enum> </property> <property stdset="1"> <name>sizeType</name> <enum>Fixed</enum> </property> <property> <name>sizeHint</name> <size> <width>20</width> <height>20</height> </size> </property> </spacer> <widget> <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>TextLabel1</cstring> </property> <property stdset="1"> <name>sizePolicy</name> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>1</vsizetype> </sizepolicy> @@ -192,299 +213,341 @@ <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> <cstring>Layout8</cstring> </property> <hbox> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> <number>6</number> </property> <widget> <class>QPushButton</class> <property stdset="1"> <name>name</name> <cstring>Scan_But</cstring> </property> <property stdset="1"> <name>text</name> <string>Scan Neighbourhood</string> </property> </widget> <spacer> <property> <name>name</name> <cstring>Spacer9</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Horizontal</enum> </property> <property stdset="1"> <name>sizeType</name> <enum>Expanding</enum> </property> <property> <name>sizeHint</name> <size> <width>20</width> <height>20</height> </size> </property> </spacer> </hbox> </widget> + <spacer> + <property> + <name>name</name> + <cstring>Spacer20_4</cstring> + </property> + <property stdset="1"> + <name>orientation</name> + <enum>Vertical</enum> + </property> + <property stdset="1"> + <name>sizeType</name> + <enum>Expanding</enum> + </property> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> <widget> <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> - <cstring>Layout5</cstring> + <cstring>Layout10</cstring> </property> <hbox> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> <number>6</number> </property> <spacer> <property> <name>name</name> - <cstring>Spacer4</cstring> + <cstring>Spacer7_2</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Horizontal</enum> </property> <property stdset="1"> <name>sizeType</name> - <enum>Expanding</enum> + <enum>Fixed</enum> </property> <property> <name>sizeHint</name> <size> <width>20</width> <height>20</height> </size> </property> </spacer> <widget> - <class>QLabel</class> + <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel5</cstring> + <cstring>Layout9</cstring> </property> + <grid> <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>0</hsizetype> - <vsizetype>1</vsizetype> - </sizepolicy> + <name>margin</name> + <number>0</number> </property> <property stdset="1"> - <name>text</name> - <string>Use device :</string> + <name>spacing</name> + <number>6</number> </property> - </widget> - <widget> + <widget row="0" column="1" > <class>QComboBox</class> <property stdset="1"> <name>name</name> <cstring>DeviceList_CB</cstring> </property> <property stdset="1"> <name>sizePolicy</name> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>0</vsizetype> </sizepolicy> </property> </widget> - </hbox> - </widget> - <widget> - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout4</cstring> - </property> - <hbox> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <spacer> + <spacer row="0" column="2" > <property> <name>name</name> - <cstring>Spacer7_2</cstring> + <cstring>Spacer16</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Horizontal</enum> </property> <property stdset="1"> <name>sizeType</name> - <enum>Fixed</enum> + <enum>Expanding</enum> </property> <property> <name>sizeHint</name> <size> <width>20</width> <height>20</height> </size> </property> </spacer> - <widget> + <widget row="1" column="0" rowspan="1" colspan="3" > <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>TextLabel1_2</cstring> </property> <property stdset="1"> <name>sizePolicy</name> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>1</vsizetype> </sizepolicy> </property> <property stdset="1"> <name>text</name> <string>Select to scan the bluetooth network for reachable devices using the selected local device</string> </property> <property stdset="1"> <name>alignment</name> <set>WordBreak|AlignVCenter|AlignLeft</set> </property> <property> <name>wordwrap</name> </property> </widget> + <widget row="0" column="0" > + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel5</cstring> + </property> + <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>1</vsizetype> + </sizepolicy> + </property> + <property stdset="1"> + <name>text</name> + <string>Use device :</string> + </property> + </widget> + </grid> + </widget> </hbox> </widget> <spacer> <property> <name>name</name> <cstring>Spacer20_2_2</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Vertical</enum> </property> <property stdset="1"> <name>sizeType</name> <enum>Expanding</enum> </property> <property> <name>sizeHint</name> <size> <width>20</width> <height>20</height> </size> </property> </spacer> <widget> <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> <cstring>Layout9</cstring> </property> <hbox> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> <number>6</number> </property> <widget> <class>QPushButton</class> <property stdset="1"> <name>name</name> <cstring>Pairing_But</cstring> </property> <property stdset="1"> <name>text</name> <string>Manage Pairing</string> </property> </widget> <spacer> <property> <name>name</name> <cstring>Spacer9_3</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Horizontal</enum> </property> <property stdset="1"> <name>sizeType</name> <enum>Expanding</enum> </property> <property> <name>sizeHint</name> <size> <width>20</width> <height>20</height> </size> </property> </spacer> </hbox> </widget> + <spacer> + <property> + <name>name</name> + <cstring>Spacer20_5</cstring> + </property> + <property stdset="1"> + <name>orientation</name> + <enum>Vertical</enum> + </property> + <property stdset="1"> + <name>sizeType</name> + <enum>Expanding</enum> + </property> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> <widget> <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> <cstring>Layout6</cstring> </property> <hbox> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> <number>6</number> </property> <spacer> <property> <name>name</name> <cstring>Spacer7_3</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Horizontal</enum> </property> <property stdset="1"> <name>sizeType</name> <enum>Fixed</enum> </property> <property> <name>sizeHint</name> <size> <width>20</width> <height>20</height> </size> </property> </spacer> <widget> <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>TextLabel1_2_2</cstring> </property> <property stdset="1"> <name>sizePolicy</name> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>1</vsizetype> </sizepolicy> @@ -505,117 +568,96 @@ </widget> <spacer> <property> <name>name</name> <cstring>Spacer20_2_2_2</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Vertical</enum> </property> <property stdset="1"> <name>sizeType</name> <enum>Expanding</enum> </property> <property> <name>sizeHint</name> <size> <width>20</width> <height>20</height> </size> </property> </spacer> <widget> <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> <cstring>Layout2</cstring> </property> <hbox> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> <number>6</number> </property> <widget> <class>QCheckBox</class> <property stdset="1"> <name>name</name> <cstring>EnableTracing_CB</cstring> </property> <property stdset="1"> <name>text</name> <string>Trace Bluetooth</string> </property> </widget> - <spacer> - <property> - <name>name</name> - <cstring>Spacer4_2</cstring> - </property> - <property stdset="1"> - <name>orientation</name> - <enum>Horizontal</enum> - </property> - <property stdset="1"> - <name>sizeType</name> - <enum>Expanding</enum> - </property> - <property> - <name>sizeHint</name> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> <widget> <class>QCheckBox</class> <property stdset="1"> <name>name</name> <cstring>MustBeEnabled_CB</cstring> </property> <property stdset="1"> <name>text</name> <string>Bluetooth Enabled</string> </property> </widget> </hbox> </widget> </vbox> </widget> <connections> <connection> <sender>ManageLocalHW_But</sender> <signal>clicked()</signal> <receiver>OTMainGUI</receiver> <slot>SLOT_Manage()</slot> </connection> <connection> <sender>Scan_But</sender> <signal>clicked()</signal> <receiver>OTMainGUI</receiver> <slot>SLOT_Scan()</slot> </connection> <connection> <sender>MustBeEnabled_CB</sender> <signal>toggled(bool)</signal> <receiver>OTMainGUI</receiver> <slot>SLOT_EnableBluetooth(bool)</slot> </connection> <connection> <sender>Pairing_But</sender> <signal>clicked()</signal> <receiver>OTMainGUI</receiver> <slot>SLOT_Pairing()</slot> </connection> <connection> <sender>EnableTracing_CB</sender> <signal>toggled(bool)</signal> <receiver>OTMainGUI</receiver> <slot>SLOT_EnableTracing( bool )</slot> </connection> <slot access="public">SLOT_EnableBluetooth(bool)</slot> <slot access="public">SLOT_Manage()</slot> |