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 | |
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) (show 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 @@ <x>0</x> <y>0</y> - <width>293</width> + <width>289</width> <height>254</height> </rect> @@ -39,5 +39,5 @@ <property stdset="1"> <name>name</name> - <cstring>TabWidget11</cstring> + <cstring>MainTab_TAB</cstring> </property> <property> @@ -484,5 +484,5 @@ <property stdset="1"> <name>name</name> - <cstring>Tab_TB</cstring> + <cstring>Tab_TAB</cstring> </property> <property> @@ -1059,5 +1059,130 @@ <slot>setEnabled(bool)</slot> </connection> + <connection> + <sender>AddPreUp_TB</sender> + <signal>clicked()</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_Add()</slot> + </connection> + <connection> + <sender>DeletePreUp_TB</sender> + <signal>clicked()</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_Remove()</slot> + </connection> + <connection> + <sender>UpPreUp_TB</sender> + <signal>clicked()</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_Up()</slot> + </connection> + <connection> + <sender>DownPreUp_TB</sender> + <signal>clicked()</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_Down()</slot> + </connection> + <connection> + <sender>AddPostUp_TB</sender> + <signal>clicked()</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_Add()</slot> + </connection> + <connection> + <sender>DeletePostUp_TB</sender> + <signal>clicked()</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_Remove()</slot> + </connection> + <connection> + <sender>UpPostUp_TB</sender> + <signal>clicked()</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_Up()</slot> + </connection> + <connection> + <sender>DownPostUp_TB</sender> + <signal>clicked()</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_Down()</slot> + </connection> + <connection> + <sender>AddPreDown_TB</sender> + <signal>clicked()</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_Add()</slot> + </connection> + <connection> + <sender>DeletePreDown_TB</sender> + <signal>clicked()</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_Remove()</slot> + </connection> + <connection> + <sender>UpPreDown_TB</sender> + <signal>clicked()</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_Up()</slot> + </connection> + <connection> + <sender>DownPreDown_TB</sender> + <signal>clicked()</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_Down()</slot> + </connection> + <connection> + <sender>AddPostDown_TB</sender> + <signal>clicked()</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_Add()</slot> + </connection> + <connection> + <sender>DeletePostDown_TB</sender> + <signal>clicked()</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_Remove()</slot> + </connection> + <connection> + <sender>UpPostDown_TB</sender> + <signal>clicked()</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_Up()</slot> + </connection> + <connection> + <sender>DownPostDown_TB</sender> + <signal>clicked()</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_Down()</slot> + </connection> + <connection> + <sender>PreUp_LB</sender> + <signal>doubleClicked(QListBoxItem*)</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_ShowCommand( QListBoxItem *)</slot> + </connection> + <connection> + <sender>PreDown_LB</sender> + <signal>doubleClicked(QListBoxItem*)</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_ShowCommand( QListBoxItem *)</slot> + </connection> + <connection> + <sender>PostDown_LB</sender> + <signal>doubleClicked(QListBoxItem*)</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_ShowCommand( QListBoxItem *)</slot> + </connection> + <connection> + <sender>PostUp_LB</sender> + <signal>doubleClicked(QListBoxItem*)</signal> + <receiver>NetworkGUI</receiver> + <slot>SLOT_ShowCommand( QListBoxItem *)</slot> + </connection> + <slot access="public">SLOT_Add()</slot> + <slot access="public">SLOT_Down()</slot> <slot access="public">SLOT_NetmaskModified( const QString & )</slot> + <slot access="public">SLOT_Remove()</slot> + <slot access="public">SLOT_Up()</slot> + <slot access="public">SLOT_ShowCommand( QListBoxItem *)</slot> </connections> <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[] = * Constructor, find all of the possible interfaces */ -NetworkNetNode::NetworkNetNode() : ANetNode() { +NetworkNetNode::NetworkNetNode() : ANetNode(tr("IP Configuration")) { } 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: { return "Devices/tcpip"; } - virtual const QString nodeName() - { return tr("IP Configuration"); } - virtual const QString nodeDescription() ; 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 @@ #include <qtoolbutton.h> #include <qcheckbox.h> +#include <qtabwidget.h> #include <qlineedit.h> #include <qlistbox.h> @@ -111,5 +112,11 @@ 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; for ( QStringList::Iterator it = NewSL.begin(); @@ -159,2 +166,59 @@ 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() ); +} 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 @@ #include "networkGUI.h" +class QListBox; + class NetworkEdit : public NetworkGUI { @@ -14,7 +16,13 @@ public slots : void SLOT_NetmaskModified( const QString & S ); + void SLOT_ShowCommand( QListBoxItem * LBI ); + void SLOT_Add( void ); + void SLOT_Remove( void ); + void SLOT_Up( void ); + void SLOT_Down( void ); private : + QListBox * getActiveLB( void ); bool updateList( QStringList &SL, QListBox * LB ); void populateList( QStringList &SL, QListBox * LB ); |