Diffstat (limited to 'noncore/settings/networksettings2/opietooth2/Opietooth.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/opietooth2/Opietooth.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/opietooth2/Opietooth.cpp b/noncore/settings/networksettings2/opietooth2/Opietooth.cpp index 8ea3a48..2d4885c 100644 --- a/noncore/settings/networksettings2/opietooth2/Opietooth.cpp +++ b/noncore/settings/networksettings2/opietooth2/Opietooth.cpp | |||
@@ -89,48 +89,69 @@ class LinkKeyLVI : public QListViewItem { | |||
89 | 89 | ||
90 | public : | 90 | public : |
91 | 91 | ||
92 | LinkKeyLVI( int Ch, QListView * it ) : QListViewItem (it) { | 92 | LinkKeyLVI( int Ch, QListView * it ) : QListViewItem (it) { |
93 | LinkKey = Ch; | 93 | LinkKey = Ch; |
94 | } | 94 | } |
95 | ~LinkKeyLVI( void ) { | 95 | ~LinkKeyLVI( void ) { |
96 | } | 96 | } |
97 | 97 | ||
98 | inline int index( void ) | 98 | inline int index( void ) |
99 | { return LinkKey; } | 99 | { return LinkKey; } |
100 | 100 | ||
101 | private : | 101 | private : |
102 | 102 | ||
103 | int LinkKey; | 103 | int LinkKey; |
104 | }; | 104 | }; |
105 | }; | 105 | }; |
106 | 106 | ||
107 | // | 107 | // |
108 | // | 108 | // |
109 | // | 109 | // |
110 | // | 110 | // |
111 | // | 111 | // |
112 | 112 | ||
113 | OTSniffing::OTSniffing( QWidget * parent ) : OTSniffGUI( parent ) { | ||
114 | |||
115 | OT = OTGateway::getOTGateway(); | ||
116 | |||
117 | } | ||
118 | |||
119 | OTSniffing::~OTSniffing() { | ||
120 | } | ||
121 | |||
122 | void OTSniffing::SLOT_Trace( void ) { | ||
123 | } | ||
124 | |||
125 | void OTSniffing::SLOT_ClearLog( void ) { | ||
126 | } | ||
127 | |||
128 | // | ||
129 | // | ||
130 | // | ||
131 | // | ||
132 | // | ||
133 | |||
113 | OTPairing::OTPairing( QWidget * parent, OTIcons * _IC ) : | 134 | OTPairing::OTPairing( QWidget * parent, OTIcons * _IC ) : |
114 | OTPairingGUI( parent ) { | 135 | OTPairingGUI( parent ) { |
115 | 136 | ||
116 | OT = OTGateway::getOTGateway(); | 137 | OT = OTGateway::getOTGateway(); |
117 | Icons = (_IC ) ? _IC : new OTIcons(); | 138 | Icons = (_IC ) ? _IC : new OTIcons(); |
118 | MyIcons = (_IC == 0 ); | 139 | MyIcons = (_IC == 0 ); |
119 | 140 | ||
120 | // unpairing can only be done if bluetooth is disabled | 141 | // unpairing can only be done if bluetooth is disabled |
121 | Unpair_But->setEnabled( ! OT->isEnabled() ); | 142 | Unpair_But->setEnabled( ! OT->isEnabled() ); |
122 | if( ! OT->isEnabled() ) { | 143 | if( ! OT->isEnabled() ) { |
123 | Unpair_LBL->hide(); | 144 | Unpair_LBL->hide(); |
124 | } else { | 145 | } else { |
125 | Unpair_LBL->show(); | 146 | Unpair_LBL->show(); |
126 | } | 147 | } |
127 | 148 | ||
128 | // open linkkey file and load pairs | 149 | // open linkkey file and load pairs |
129 | LinkKeyArray Keys = OT->getLinkKeys(); | 150 | LinkKeyArray Keys = OT->getLinkKeys(); |
130 | LinkKeyLVI * it; | 151 | LinkKeyLVI * it; |
131 | OTPeer * P; | 152 | OTPeer * P; |
132 | OTDriver * D; | 153 | OTDriver * D; |
133 | 154 | ||
134 | for( unsigned int i = 0 ; | 155 | for( unsigned int i = 0 ; |
135 | i < Keys.count(); | 156 | i < Keys.count(); |
136 | i ++ ) { | 157 | i ++ ) { |
@@ -852,48 +873,49 @@ void OTManage::SLOT_DriverListChanged( ) { | |||
852 | } | 873 | } |
853 | 874 | ||
854 | if( DL.count() ) { | 875 | if( DL.count() ) { |
855 | AllDrivers_LV->setCurrentItem( First ); | 876 | AllDrivers_LV->setCurrentItem( First ); |
856 | DriverIsUp_CB->setEnabled( TRUE ); | 877 | DriverIsUp_CB->setEnabled( TRUE ); |
857 | } else { | 878 | } else { |
858 | DriverIsUp_CB->setChecked( FALSE ); | 879 | DriverIsUp_CB->setChecked( FALSE ); |
859 | DriverIsUp_CB->setEnabled( FALSE ); | 880 | DriverIsUp_CB->setEnabled( FALSE ); |
860 | } | 881 | } |
861 | } | 882 | } |
862 | 883 | ||
863 | void OTManage::SLOT_SetRefreshTimer( int v ) { | 884 | void OTManage::SLOT_SetRefreshTimer( int v ) { |
864 | OT->setRefreshTimer( v * 1000 ); | 885 | OT->setRefreshTimer( v * 1000 ); |
865 | } | 886 | } |
866 | 887 | ||
867 | // | 888 | // |
868 | // | 889 | // |
869 | // | 890 | // |
870 | // | 891 | // |
871 | // | 892 | // |
872 | 893 | ||
873 | OTMain::OTMain( QWidget * parent ) : OTMainGUI( parent ) { | 894 | OTMain::OTMain( QWidget * parent ) : OTMainGUI( parent ) { |
874 | 895 | ||
875 | Icons = new OTIcons(); | 896 | Icons = new OTIcons(); |
897 | SnifWindow = 0; | ||
876 | OT = OTGateway::getOTGateway(); | 898 | OT = OTGateway::getOTGateway(); |
877 | 899 | ||
878 | connect( OT, | 900 | connect( OT, |
879 | SIGNAL( deviceEnabled( bool ) ), | 901 | SIGNAL( deviceEnabled( bool ) ), |
880 | this, | 902 | this, |
881 | SLOT( SLOT_DeviceIsEnabled( bool ) ) | 903 | SLOT( SLOT_DeviceIsEnabled( bool ) ) |
882 | ); | 904 | ); |
883 | connect( OT, | 905 | connect( OT, |
884 | SIGNAL( driverListChanged() ), | 906 | SIGNAL( driverListChanged() ), |
885 | this, | 907 | this, |
886 | SLOT( SLOT_DriverListChanged() ) | 908 | SLOT( SLOT_DriverListChanged() ) |
887 | ); | 909 | ); |
888 | connect( OT, | 910 | connect( OT, |
889 | SIGNAL( stateChange( OTDriver *, bool ) ), | 911 | SIGNAL( stateChange( OTDriver *, bool ) ), |
890 | this, | 912 | this, |
891 | SLOT( SLOT_StateChange( OTDriver *, bool ) ) | 913 | SLOT( SLOT_StateChange( OTDriver *, bool ) ) |
892 | ); | 914 | ); |
893 | 915 | ||
894 | if( ! OT->needsEnabling() ) { | 916 | if( ! OT->needsEnabling() ) { |
895 | MustBeEnabled_CB->hide(); | 917 | MustBeEnabled_CB->hide(); |
896 | } else { | 918 | } else { |
897 | // detect current state | 919 | // detect current state |
898 | MustBeEnabled_CB->setChecked( | 920 | MustBeEnabled_CB->setChecked( |
899 | OT->isEnabled() ); | 921 | OT->isEnabled() ); |
@@ -982,24 +1004,34 @@ void OTMain::SLOT_StateChange( OTDriver * D, bool Up ) { | |||
982 | i < DeviceList_CB->count(); | 1004 | i < DeviceList_CB->count(); |
983 | i ++ ) { | 1005 | i ++ ) { |
984 | if( DeviceList_CB->text(i) == D->devname() ) { | 1006 | if( DeviceList_CB->text(i) == D->devname() ) { |
985 | DeviceList_CB->changeItem( | 1007 | DeviceList_CB->changeItem( |
986 | Icons->loadPixmap( (Up) ? "bluezon" : "bluezoff" ), | 1008 | Icons->loadPixmap( (Up) ? "bluezon" : "bluezoff" ), |
987 | D->devname(), | 1009 | D->devname(), |
988 | i ); | 1010 | i ); |
989 | return; | 1011 | return; |
990 | } | 1012 | } |
991 | } | 1013 | } |
992 | } | 1014 | } |
993 | 1015 | ||
994 | void OTMain::SLOT_Pairing( void ) { | 1016 | void OTMain::SLOT_Pairing( void ) { |
995 | QDialog * Dlg = new QDialog( this, 0, TRUE ); | 1017 | QDialog * Dlg = new QDialog( this, 0, TRUE ); |
996 | QVBoxLayout * V = new QVBoxLayout( Dlg ); | 1018 | QVBoxLayout * V = new QVBoxLayout( Dlg ); |
997 | OTPairing * Pair = new OTPairing( Dlg, Icons ); | 1019 | OTPairing * Pair = new OTPairing( Dlg, Icons ); |
998 | 1020 | ||
999 | V->addWidget( Pair ); | 1021 | V->addWidget( Pair ); |
1000 | Dlg->showMaximized(); | 1022 | Dlg->showMaximized(); |
1001 | Dlg->setCaption( tr("Manage pairing" ) ); | 1023 | Dlg->setCaption( tr("Manage pairing" ) ); |
1002 | Dlg->exec(); | 1024 | Dlg->exec(); |
1003 | 1025 | ||
1004 | delete Dlg; | 1026 | delete Dlg; |
1005 | } | 1027 | } |
1028 | |||
1029 | void OTMain::SLOT_Sniffing( void ) { | ||
1030 | |||
1031 | if( SnifWindow == 0 ) { | ||
1032 | SnifWindow = new OTSniffing( this ); | ||
1033 | } | ||
1034 | |||
1035 | SnifWindow->showMaximized(); | ||
1036 | SnifWindow->show(); | ||
1037 | } | ||