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 | |||
@@ -12,5 +12,5 @@ | |||
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> |
@@ -39,5 +39,5 @@ | |||
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> |
@@ -484,5 +484,5 @@ | |||
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> |
@@ -1059,5 +1059,130 @@ | |||
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> |
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 | |||
@@ -10,5 +10,5 @@ static const char * NetworkNeeds[] = | |||
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 | ||
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 | |||
@@ -18,7 +18,4 @@ public: | |||
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 | ||
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,4 +1,5 @@ | |||
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> |
@@ -111,5 +112,11 @@ bool NetworkEdit::updateList( QStringList & SL, QListBox * LB ) { | |||
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(); |
@@ -159,2 +166,59 @@ void NetworkEdit::SLOT_NetmaskModified( const QString & ) { | |||
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 | |||
@@ -2,4 +2,6 @@ | |||
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 | ||
@@ -14,7 +16,13 @@ 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 ); |