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/networkedit.cpp | |
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/networkedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/network/networkedit.cpp | 66 |
1 files changed, 65 insertions, 1 deletions
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 | |||
@@ -2,2 +2,3 @@ | |||
2 | #include <qcheckbox.h> | 2 | #include <qcheckbox.h> |
3 | #include <qtabwidget.h> | ||
3 | #include <qlineedit.h> | 4 | #include <qlineedit.h> |
@@ -112,3 +113,9 @@ bool NetworkEdit::updateList( QStringList & SL, QListBox * LB ) { | |||
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; |
@@ -160 +167,58 @@ void NetworkEdit::SLOT_NetmaskModified( const QString & ) { | |||
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 | } | ||