author | wimpie <wimpie> | 2004-04-07 00:09:37 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-04-07 00:09:37 (UTC) |
commit | b93d9e0c4384be0a6f40be257ba791004388400b (patch) (side-by-side diff) | |
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) (show 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 @@ #include <qcheckbox.h> +#include <qtabwidget.h> #include <qlineedit.h> @@ -112,3 +113,9 @@ bool NetworkEdit::updateList( QStringList & SL, QListBox * LB ) { - // check if at least ONE item in new list is NEW + if( NewSL.count() != SL.count() ) { + // less or more items + SL= NewSL; + return 1; + } + + // Same size -> same content ? Changed = 0; @@ -160 +167,58 @@ void NetworkEdit::SLOT_NetmaskModified( const QString & ) { } + +QListBox * NetworkEdit::getActiveLB( void ) { + switch( Tab_TAB->currentPageIndex() ) { + case 0 : + return PreUp_LB; + case 1 : + return PostUp_LB; + case 2 : + return PreDown_LB; + } + return PostDown_LB; +} + +void NetworkEdit::SLOT_Add( void ) { + if( Command_LE->text().isEmpty() ) + return; + QListBox * LB = getActiveLB(); + + LB->insertItem( Command_LE->text() ); +} + +void NetworkEdit::SLOT_Remove( void ) { + QListBox * LB = getActiveLB(); + int i; + + if( ( i = LB->currentItem() ) >= 0 ) { + LB->removeItem( i ); + } +} + +void NetworkEdit::SLOT_Up( void ) { + QListBox * LB = getActiveLB(); + int i; + + if( ( i = LB->currentItem() ) > 0 ) { + QListBoxItem * LBI = LB->item(i); + LB->takeItem( LBI ); + LB->insertItem( LBI, --i ); + LB->setCurrentItem( i ); + } +} + +void NetworkEdit::SLOT_Down( void ) { + QListBox * LB = getActiveLB(); + int i; + + if( ( i = LB->currentItem() ) >= 0 && (unsigned)(i+1) != LB->count() ) { + QListBoxItem * LBI = LB->item(i); + LB->takeItem( LBI ); + LB->insertItem( LBI, ++i ); + LB->setCurrentItem( i ); + } +} + +void NetworkEdit::SLOT_ShowCommand( QListBoxItem * It ) { + Command_LE->setText( It->text() ); +} |