author | wimpie <wimpie> | 2004-04-07 00:09:37 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-04-07 00:09:37 (UTC) |
commit | b93d9e0c4384be0a6f40be257ba791004388400b (patch) (unidiff) | |
tree | 2ca0e41dc8c99e1af3ce2f0305d458f76d10db45 /noncore/settings/networksettings2/network | |
parent | 1b7aaf904fa70c16eee03155bd826e921798cc22 (diff) | |
download | opie-b93d9e0c4384be0a6f40be257ba791004388400b.zip opie-b93d9e0c4384be0a6f40be257ba791004388400b.tar.gz opie-b93d9e0c4384be0a6f40be257ba791004388400b.tar.bz2 |
MANY changes ... lancards should be OK now
Diffstat (limited to 'noncore/settings/networksettings2/network') (more/less context) (ignore whitespace changes)
5 files changed, 202 insertions, 8 deletions
diff --git a/noncore/settings/networksettings2/network/networkGUI.ui b/noncore/settings/networksettings2/network/networkGUI.ui index 9115ec0..5f71f82 100644 --- a/noncore/settings/networksettings2/network/networkGUI.ui +++ b/noncore/settings/networksettings2/network/networkGUI.ui | |||
@@ -6,17 +6,17 @@ | |||
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>NetworkGUI</cstring> | 7 | <cstring>NetworkGUI</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>293</width> | 14 | <width>289</width> |
15 | <height>254</height> | 15 | <height>254</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Interface Configuration</string> | 20 | <string>Interface Configuration</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
@@ -33,17 +33,17 @@ | |||
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>0</number> | 35 | <number>0</number> |
36 | </property> | 36 | </property> |
37 | <widget> | 37 | <widget> |
38 | <class>QTabWidget</class> | 38 | <class>QTabWidget</class> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
40 | <name>name</name> | 40 | <name>name</name> |
41 | <cstring>TabWidget11</cstring> | 41 | <cstring>MainTab_TAB</cstring> |
42 | </property> | 42 | </property> |
43 | <property> | 43 | <property> |
44 | <name>layoutMargin</name> | 44 | <name>layoutMargin</name> |
45 | </property> | 45 | </property> |
46 | <property> | 46 | <property> |
47 | <name>layoutSpacing</name> | 47 | <name>layoutSpacing</name> |
48 | </property> | 48 | </property> |
49 | <widget> | 49 | <widget> |
@@ -478,17 +478,17 @@ | |||
478 | <name>name</name> | 478 | <name>name</name> |
479 | <cstring>Command_LE</cstring> | 479 | <cstring>Command_LE</cstring> |
480 | </property> | 480 | </property> |
481 | </widget> | 481 | </widget> |
482 | <widget> | 482 | <widget> |
483 | <class>QTabWidget</class> | 483 | <class>QTabWidget</class> |
484 | <property stdset="1"> | 484 | <property stdset="1"> |
485 | <name>name</name> | 485 | <name>name</name> |
486 | <cstring>Tab_TB</cstring> | 486 | <cstring>Tab_TAB</cstring> |
487 | </property> | 487 | </property> |
488 | <property> | 488 | <property> |
489 | <name>layoutMargin</name> | 489 | <name>layoutMargin</name> |
490 | </property> | 490 | </property> |
491 | <property> | 491 | <property> |
492 | <name>layoutSpacing</name> | 492 | <name>layoutSpacing</name> |
493 | </property> | 493 | </property> |
494 | <widget> | 494 | <widget> |
@@ -1053,17 +1053,142 @@ | |||
1053 | <slot>setEnabled(bool)</slot> | 1053 | <slot>setEnabled(bool)</slot> |
1054 | </connection> | 1054 | </connection> |
1055 | <connection> | 1055 | <connection> |
1056 | <sender>SendHostname_CB</sender> | 1056 | <sender>SendHostname_CB</sender> |
1057 | <signal>toggled(bool)</signal> | 1057 | <signal>toggled(bool)</signal> |
1058 | <receiver>Hostname_LE</receiver> | 1058 | <receiver>Hostname_LE</receiver> |
1059 | <slot>setEnabled(bool)</slot> | 1059 | <slot>setEnabled(bool)</slot> |
1060 | </connection> | 1060 | </connection> |
1061 | <connection> | ||
1062 | <sender>AddPreUp_TB</sender> | ||
1063 | <signal>clicked()</signal> | ||
1064 | <receiver>NetworkGUI</receiver> | ||
1065 | <slot>SLOT_Add()</slot> | ||
1066 | </connection> | ||
1067 | <connection> | ||
1068 | <sender>DeletePreUp_TB</sender> | ||
1069 | <signal>clicked()</signal> | ||
1070 | <receiver>NetworkGUI</receiver> | ||
1071 | <slot>SLOT_Remove()</slot> | ||
1072 | </connection> | ||
1073 | <connection> | ||
1074 | <sender>UpPreUp_TB</sender> | ||
1075 | <signal>clicked()</signal> | ||
1076 | <receiver>NetworkGUI</receiver> | ||
1077 | <slot>SLOT_Up()</slot> | ||
1078 | </connection> | ||
1079 | <connection> | ||
1080 | <sender>DownPreUp_TB</sender> | ||
1081 | <signal>clicked()</signal> | ||
1082 | <receiver>NetworkGUI</receiver> | ||
1083 | <slot>SLOT_Down()</slot> | ||
1084 | </connection> | ||
1085 | <connection> | ||
1086 | <sender>AddPostUp_TB</sender> | ||
1087 | <signal>clicked()</signal> | ||
1088 | <receiver>NetworkGUI</receiver> | ||
1089 | <slot>SLOT_Add()</slot> | ||
1090 | </connection> | ||
1091 | <connection> | ||
1092 | <sender>DeletePostUp_TB</sender> | ||
1093 | <signal>clicked()</signal> | ||
1094 | <receiver>NetworkGUI</receiver> | ||
1095 | <slot>SLOT_Remove()</slot> | ||
1096 | </connection> | ||
1097 | <connection> | ||
1098 | <sender>UpPostUp_TB</sender> | ||
1099 | <signal>clicked()</signal> | ||
1100 | <receiver>NetworkGUI</receiver> | ||
1101 | <slot>SLOT_Up()</slot> | ||
1102 | </connection> | ||
1103 | <connection> | ||
1104 | <sender>DownPostUp_TB</sender> | ||
1105 | <signal>clicked()</signal> | ||
1106 | <receiver>NetworkGUI</receiver> | ||
1107 | <slot>SLOT_Down()</slot> | ||
1108 | </connection> | ||
1109 | <connection> | ||
1110 | <sender>AddPreDown_TB</sender> | ||
1111 | <signal>clicked()</signal> | ||
1112 | <receiver>NetworkGUI</receiver> | ||
1113 | <slot>SLOT_Add()</slot> | ||
1114 | </connection> | ||
1115 | <connection> | ||
1116 | <sender>DeletePreDown_TB</sender> | ||
1117 | <signal>clicked()</signal> | ||
1118 | <receiver>NetworkGUI</receiver> | ||
1119 | <slot>SLOT_Remove()</slot> | ||
1120 | </connection> | ||
1121 | <connection> | ||
1122 | <sender>UpPreDown_TB</sender> | ||
1123 | <signal>clicked()</signal> | ||
1124 | <receiver>NetworkGUI</receiver> | ||
1125 | <slot>SLOT_Up()</slot> | ||
1126 | </connection> | ||
1127 | <connection> | ||
1128 | <sender>DownPreDown_TB</sender> | ||
1129 | <signal>clicked()</signal> | ||
1130 | <receiver>NetworkGUI</receiver> | ||
1131 | <slot>SLOT_Down()</slot> | ||
1132 | </connection> | ||
1133 | <connection> | ||
1134 | <sender>AddPostDown_TB</sender> | ||
1135 | <signal>clicked()</signal> | ||
1136 | <receiver>NetworkGUI</receiver> | ||
1137 | <slot>SLOT_Add()</slot> | ||
1138 | </connection> | ||
1139 | <connection> | ||
1140 | <sender>DeletePostDown_TB</sender> | ||
1141 | <signal>clicked()</signal> | ||
1142 | <receiver>NetworkGUI</receiver> | ||
1143 | <slot>SLOT_Remove()</slot> | ||
1144 | </connection> | ||
1145 | <connection> | ||
1146 | <sender>UpPostDown_TB</sender> | ||
1147 | <signal>clicked()</signal> | ||
1148 | <receiver>NetworkGUI</receiver> | ||
1149 | <slot>SLOT_Up()</slot> | ||
1150 | </connection> | ||
1151 | <connection> | ||
1152 | <sender>DownPostDown_TB</sender> | ||
1153 | <signal>clicked()</signal> | ||
1154 | <receiver>NetworkGUI</receiver> | ||
1155 | <slot>SLOT_Down()</slot> | ||
1156 | </connection> | ||
1157 | <connection> | ||
1158 | <sender>PreUp_LB</sender> | ||
1159 | <signal>doubleClicked(QListBoxItem*)</signal> | ||
1160 | <receiver>NetworkGUI</receiver> | ||
1161 | <slot>SLOT_ShowCommand( QListBoxItem *)</slot> | ||
1162 | </connection> | ||
1163 | <connection> | ||
1164 | <sender>PreDown_LB</sender> | ||
1165 | <signal>doubleClicked(QListBoxItem*)</signal> | ||
1166 | <receiver>NetworkGUI</receiver> | ||
1167 | <slot>SLOT_ShowCommand( QListBoxItem *)</slot> | ||
1168 | </connection> | ||
1169 | <connection> | ||
1170 | <sender>PostDown_LB</sender> | ||
1171 | <signal>doubleClicked(QListBoxItem*)</signal> | ||
1172 | <receiver>NetworkGUI</receiver> | ||
1173 | <slot>SLOT_ShowCommand( QListBoxItem *)</slot> | ||
1174 | </connection> | ||
1175 | <connection> | ||
1176 | <sender>PostUp_LB</sender> | ||
1177 | <signal>doubleClicked(QListBoxItem*)</signal> | ||
1178 | <receiver>NetworkGUI</receiver> | ||
1179 | <slot>SLOT_ShowCommand( QListBoxItem *)</slot> | ||
1180 | </connection> | ||
1181 | <slot access="public">SLOT_Add()</slot> | ||
1182 | <slot access="public">SLOT_Down()</slot> | ||
1061 | <slot access="public">SLOT_NetmaskModified( const QString & )</slot> | 1183 | <slot access="public">SLOT_NetmaskModified( const QString & )</slot> |
1184 | <slot access="public">SLOT_Remove()</slot> | ||
1185 | <slot access="public">SLOT_Up()</slot> | ||
1186 | <slot access="public">SLOT_ShowCommand( QListBoxItem *)</slot> | ||
1062 | </connections> | 1187 | </connections> |
1063 | <tabstops> | 1188 | <tabstops> |
1064 | <tabstop>DHCP_CB</tabstop> | 1189 | <tabstop>DHCP_CB</tabstop> |
1065 | <tabstop>IPAddress_LE</tabstop> | 1190 | <tabstop>IPAddress_LE</tabstop> |
1066 | <tabstop>SubnetMask_LE</tabstop> | 1191 | <tabstop>SubnetMask_LE</tabstop> |
1067 | <tabstop>Gateway_LE</tabstop> | 1192 | <tabstop>Gateway_LE</tabstop> |
1068 | <tabstop>DNS1_LE</tabstop> | 1193 | <tabstop>DNS1_LE</tabstop> |
1069 | <tabstop>DNS2_LE</tabstop> | 1194 | <tabstop>DNS2_LE</tabstop> |
diff --git a/noncore/settings/networksettings2/network/network_NN.cpp b/noncore/settings/networksettings2/network/network_NN.cpp index d27d54a..b5989df 100644 --- a/noncore/settings/networksettings2/network/network_NN.cpp +++ b/noncore/settings/networksettings2/network/network_NN.cpp | |||
@@ -4,17 +4,17 @@ | |||
4 | static const char * NetworkNeeds[] = | 4 | static const char * NetworkNeeds[] = |
5 | { "device", | 5 | { "device", |
6 | 0 | 6 | 0 |
7 | }; | 7 | }; |
8 | 8 | ||
9 | /** | 9 | /** |
10 | * Constructor, find all of the possible interfaces | 10 | * Constructor, find all of the possible interfaces |
11 | */ | 11 | */ |
12 | NetworkNetNode::NetworkNetNode() : ANetNode() { | 12 | NetworkNetNode::NetworkNetNode() : ANetNode(tr("IP Configuration")) { |
13 | } | 13 | } |
14 | 14 | ||
15 | /** | 15 | /** |
16 | * Delete any interfaces that we own. | 16 | * Delete any interfaces that we own. |
17 | */ | 17 | */ |
18 | NetworkNetNode::~NetworkNetNode(){ | 18 | NetworkNetNode::~NetworkNetNode(){ |
19 | } | 19 | } |
20 | 20 | ||
diff --git a/noncore/settings/networksettings2/network/network_NN.h b/noncore/settings/networksettings2/network/network_NN.h index 0f87e1b..6548c32 100644 --- a/noncore/settings/networksettings2/network/network_NN.h +++ b/noncore/settings/networksettings2/network/network_NN.h | |||
@@ -12,19 +12,16 @@ class NetworkNetNode : public ANetNode{ | |||
12 | public: | 12 | public: |
13 | 13 | ||
14 | NetworkNetNode(); | 14 | NetworkNetNode(); |
15 | virtual ~NetworkNetNode(); | 15 | virtual ~NetworkNetNode(); |
16 | 16 | ||
17 | virtual const QString pixmapName() | 17 | virtual const QString pixmapName() |
18 | { return "Devices/tcpip"; } | 18 | { return "Devices/tcpip"; } |
19 | 19 | ||
20 | virtual const QString nodeName() | ||
21 | { return tr("IP Configuration"); } | ||
22 | |||
23 | virtual const QString nodeDescription() ; | 20 | virtual const QString nodeDescription() ; |
24 | 21 | ||
25 | virtual ANetNodeInstance * createInstance( void ); | 22 | virtual ANetNodeInstance * createInstance( void ); |
26 | 23 | ||
27 | virtual const char ** needs( void ); | 24 | virtual const char ** needs( void ); |
28 | virtual const char * provides( void ); | 25 | virtual const char * provides( void ); |
29 | 26 | ||
30 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); | 27 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); |
diff --git a/noncore/settings/networksettings2/network/networkedit.cpp b/noncore/settings/networksettings2/network/networkedit.cpp index 182213b..05110d9 100644 --- a/noncore/settings/networksettings2/network/networkedit.cpp +++ b/noncore/settings/networksettings2/network/networkedit.cpp | |||
@@ -1,10 +1,11 @@ | |||
1 | #include <qtoolbutton.h> | 1 | #include <qtoolbutton.h> |
2 | #include <qcheckbox.h> | 2 | #include <qcheckbox.h> |
3 | #include <qtabwidget.h> | ||
3 | #include <qlineedit.h> | 4 | #include <qlineedit.h> |
4 | #include <qlistbox.h> | 5 | #include <qlistbox.h> |
5 | #include <GUIUtils.h> | 6 | #include <GUIUtils.h> |
6 | #include <resources.h> | 7 | #include <resources.h> |
7 | #include "networkedit.h" | 8 | #include "networkedit.h" |
8 | 9 | ||
9 | NetworkEdit::NetworkEdit( QWidget * Parent ) : NetworkGUI( Parent ){ | 10 | NetworkEdit::NetworkEdit( QWidget * Parent ) : NetworkGUI( Parent ){ |
10 | 11 | ||
@@ -105,17 +106,23 @@ bool NetworkEdit::updateList( QStringList & SL, QListBox * LB ) { | |||
105 | bool Changed; | 106 | bool Changed; |
106 | QStringList NewSL; | 107 | QStringList NewSL; |
107 | 108 | ||
108 | // collect new list | 109 | // collect new list |
109 | for( unsigned int i = 0; i < LB->count() ; i ++ ) { | 110 | for( unsigned int i = 0; i < LB->count() ; i ++ ) { |
110 | NewSL.append( LB->text(i) ); | 111 | NewSL.append( LB->text(i) ); |
111 | } | 112 | } |
112 | 113 | ||
113 | // check if at least ONE item in new list is NEW | 114 | if( NewSL.count() != SL.count() ) { |
115 | // less or more items | ||
116 | SL= NewSL; | ||
117 | return 1; | ||
118 | } | ||
119 | |||
120 | // Same size -> same content ? | ||
114 | Changed = 0; | 121 | Changed = 0; |
115 | for ( QStringList::Iterator it = NewSL.begin(); | 122 | for ( QStringList::Iterator it = NewSL.begin(); |
116 | it != NewSL.end(); | 123 | it != NewSL.end(); |
117 | ++it ) { | 124 | ++it ) { |
118 | if( SL.findIndex( (*it) ) < 0 ) { | 125 | if( SL.findIndex( (*it) ) < 0 ) { |
119 | // new or modified item | 126 | // new or modified item |
120 | Changed = 1; | 127 | Changed = 1; |
121 | SL = NewSL; | 128 | SL = NewSL; |
@@ -153,8 +160,65 @@ void NetworkEdit::SLOT_NetmaskModified( const QString & ) { | |||
153 | NW = QString( "%1.%2.%3.%4" ). | 160 | NW = QString( "%1.%2.%3.%4" ). |
154 | arg( ipal[0].toShort() | ( ~ nmal[0].toShort() & 0x00ff) ). | 161 | arg( ipal[0].toShort() | ( ~ nmal[0].toShort() & 0x00ff) ). |
155 | arg( ipal[1].toShort() | ( ~ nmal[1].toShort() & 0x00ff) ). | 162 | arg( ipal[1].toShort() | ( ~ nmal[1].toShort() & 0x00ff) ). |
156 | arg( ipal[2].toShort() | ( ~ nmal[2].toShort() & 0x00ff) ). | 163 | arg( ipal[2].toShort() | ( ~ nmal[2].toShort() & 0x00ff) ). |
157 | arg( ipal[3].toShort() | ( ~ nmal[3].toShort() & 0x00ff) ); | 164 | arg( ipal[3].toShort() | ( ~ nmal[3].toShort() & 0x00ff) ); |
158 | Broadcast_LE->setText( NW ); | 165 | Broadcast_LE->setText( NW ); |
159 | } | 166 | } |
160 | } | 167 | } |
168 | |||
169 | QListBox * NetworkEdit::getActiveLB( void ) { | ||
170 | switch( Tab_TAB->currentPageIndex() ) { | ||
171 | case 0 : | ||
172 | return PreUp_LB; | ||
173 | case 1 : | ||
174 | return PostUp_LB; | ||
175 | case 2 : | ||
176 | return PreDown_LB; | ||
177 | } | ||
178 | return PostDown_LB; | ||
179 | } | ||
180 | |||
181 | void NetworkEdit::SLOT_Add( void ) { | ||
182 | if( Command_LE->text().isEmpty() ) | ||
183 | return; | ||
184 | QListBox * LB = getActiveLB(); | ||
185 | |||
186 | LB->insertItem( Command_LE->text() ); | ||
187 | } | ||
188 | |||
189 | void NetworkEdit::SLOT_Remove( void ) { | ||
190 | QListBox * LB = getActiveLB(); | ||
191 | int i; | ||
192 | |||
193 | if( ( i = LB->currentItem() ) >= 0 ) { | ||
194 | LB->removeItem( i ); | ||
195 | } | ||
196 | } | ||
197 | |||
198 | void NetworkEdit::SLOT_Up( void ) { | ||
199 | QListBox * LB = getActiveLB(); | ||
200 | int i; | ||
201 | |||
202 | if( ( i = LB->currentItem() ) > 0 ) { | ||
203 | QListBoxItem * LBI = LB->item(i); | ||
204 | LB->takeItem( LBI ); | ||
205 | LB->insertItem( LBI, --i ); | ||
206 | LB->setCurrentItem( i ); | ||
207 | } | ||
208 | } | ||
209 | |||
210 | void NetworkEdit::SLOT_Down( void ) { | ||
211 | QListBox * LB = getActiveLB(); | ||
212 | int i; | ||
213 | |||
214 | if( ( i = LB->currentItem() ) >= 0 && (unsigned)(i+1) != LB->count() ) { | ||
215 | QListBoxItem * LBI = LB->item(i); | ||
216 | LB->takeItem( LBI ); | ||
217 | LB->insertItem( LBI, ++i ); | ||
218 | LB->setCurrentItem( i ); | ||
219 | } | ||
220 | } | ||
221 | |||
222 | void NetworkEdit::SLOT_ShowCommand( QListBoxItem * It ) { | ||
223 | Command_LE->setText( It->text() ); | ||
224 | } | ||
diff --git a/noncore/settings/networksettings2/network/networkedit.h b/noncore/settings/networksettings2/network/networkedit.h index 9ed4e84..adc20e0 100644 --- a/noncore/settings/networksettings2/network/networkedit.h +++ b/noncore/settings/networksettings2/network/networkedit.h | |||
@@ -1,21 +1,29 @@ | |||
1 | #include "networkdata.h" | 1 | #include "networkdata.h" |
2 | #include "networkGUI.h" | 2 | #include "networkGUI.h" |
3 | 3 | ||
4 | class QListBox; | ||
5 | |||
4 | class NetworkEdit : public NetworkGUI { | 6 | class NetworkEdit : public NetworkGUI { |
5 | 7 | ||
6 | public : | 8 | public : |
7 | 9 | ||
8 | NetworkEdit( QWidget * parent ); | 10 | NetworkEdit( QWidget * parent ); |
9 | QString acceptable( void ); | 11 | QString acceptable( void ); |
10 | bool commit( NetworkData_t & Data ); | 12 | bool commit( NetworkData_t & Data ); |
11 | void showData( NetworkData_t & Data ); | 13 | void showData( NetworkData_t & Data ); |
12 | 14 | ||
13 | public slots : | 15 | public slots : |
14 | 16 | ||
15 | void SLOT_NetmaskModified( const QString & S ); | 17 | void SLOT_NetmaskModified( const QString & S ); |
18 | void SLOT_ShowCommand( QListBoxItem * LBI ); | ||
19 | void SLOT_Add( void ); | ||
20 | void SLOT_Remove( void ); | ||
21 | void SLOT_Up( void ); | ||
22 | void SLOT_Down( void ); | ||
16 | 23 | ||
17 | private : | 24 | private : |
18 | 25 | ||
26 | QListBox * getActiveLB( void ); | ||
19 | bool updateList( QStringList &SL, QListBox * LB ); | 27 | bool updateList( QStringList &SL, QListBox * LB ); |
20 | void populateList( QStringList &SL, QListBox * LB ); | 28 | void populateList( QStringList &SL, QListBox * LB ); |
21 | }; | 29 | }; |