summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/network
authorwimpie <wimpie>2004-04-02 18:29:49 (UTC)
committer wimpie <wimpie>2004-04-02 18:29:49 (UTC)
commit5334b639c9f97793bcae4f50f7b47c7a2ada4e2f (patch) (side-by-side diff)
treef55aebd4314ab878bc39b6b08b8323a8ef78d803 /noncore/settings/networksettings2/network
parent7c8922b37b5bb7696c0ff2cbc999e2936b9b509f (diff)
downloadopie-5334b639c9f97793bcae4f50f7b47c7a2ada4e2f.zip
opie-5334b639c9f97793bcae4f50f7b47c7a2ada4e2f.tar.gz
opie-5334b639c9f97793bcae4f50f7b47c7a2ada4e2f.tar.bz2
First import of NS2 app
Diffstat (limited to 'noncore/settings/networksettings2/network') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/network/config.in4
-rw-r--r--noncore/settings/networksettings2/network/network.pro18
-rw-r--r--noncore/settings/networksettings2/network/networkGUI.ui1071
-rw-r--r--noncore/settings/networksettings2/network/network_NN.cpp64
-rw-r--r--noncore/settings/networksettings2/network/network_NN.h44
-rw-r--r--noncore/settings/networksettings2/network/network_NNI.cpp170
-rw-r--r--noncore/settings/networksettings2/network/network_NNI.h45
-rw-r--r--noncore/settings/networksettings2/network/networkdata.h22
-rw-r--r--noncore/settings/networksettings2/network/networkedit.cpp160
-rw-r--r--noncore/settings/networksettings2/network/networkedit.h21
-rw-r--r--noncore/settings/networksettings2/network/networkrun.cpp63
-rw-r--r--noncore/settings/networksettings2/network/networkrun.h20
12 files changed, 1702 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/network/config.in b/noncore/settings/networksettings2/network/config.in
new file mode 100644
index 0000000..9dab059
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/config.in
@@ -0,0 +1,4 @@
+ config NS2NS2WORK
+ boolean "opie-networksettings2plugin-ipsetup (set up TCP/IP)"
+ default "n" if NS2
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE
diff --git a/noncore/settings/networksettings2/network/network.pro b/noncore/settings/networksettings2/network/network.pro
new file mode 100644
index 0000000..f9b2b7f
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/network.pro
@@ -0,0 +1,18 @@
+TEMPLATE = lib
+CONFIG += qt warn_on release
+DESTDIR = $(OPIEDIR)/plugins/networksettings2
+HEADERS = network_NN.h \
+ network_NNI.h \
+ networkedit.h
+SOURCES = network_NN.cpp \
+ network_NNI.cpp \
+ networkedit.cpp \
+ networkrun.cpp
+INCLUDEPATH += $(OPIEDIR)/include ../ ../networksettings2
+DEPENDPATH += $(OPIEDIR)/include ../ ../networksettings2
+LIBS += -lqpe
+INTERFACES = networkGUI.ui
+TARGET = network
+VERSION = 1.0.0
+
+include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/networksettings2/network/networkGUI.ui b/noncore/settings/networksettings2/network/networkGUI.ui
new file mode 100644
index 0000000..9115ec0
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/networkGUI.ui
@@ -0,0 +1,1071 @@
+<!DOCTYPE UI><UI>
+<class>NetworkGUI</class>
+<widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>NetworkGUI</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>293</width>
+ <height>254</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>Interface Configuration</string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QTabWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TabWidget11</cstring>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Setup</string>
+ </attribute>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DHCP_CB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Address from server</string>
+ </property>
+ <property stdset="1">
+ <name>checked</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer6</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Fixed</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>StaticIP_GB</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget row="0" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>IP Address</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ <widget row="1" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Subnet Mask</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ <widget row="4" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>First DNS</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ <widget row="3" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Gateway</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ <widget row="2" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Broadcast</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ <widget row="5" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Second DNS</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ <widget row="0" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>IPAddress_LE</cstring>
+ </property>
+ </widget>
+ <widget row="1" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>SubnetMask_LE</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>255.255.255.0</string>
+ </property>
+ </widget>
+ <widget row="2" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Broadcast_LE</cstring>
+ </property>
+ </widget>
+ <widget row="3" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Gateway_LE</cstring>
+ </property>
+ </widget>
+ <widget row="4" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DNS1_LE</cstring>
+ </property>
+ </widget>
+ <widget row="5" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DNS2_LE</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>DHCP Settings</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer26</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Fixed</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame27</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>SendHostname_CB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Send hostname</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Hostname_LE</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer38</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Extra commands</string>
+ </attribute>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Command_LE</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QTabWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Tab_TB</cstring>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Pre-Up</string>
+ </attribute>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QListBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PreUp_LB</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame5_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>StyledPanel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>AddPreUp_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DeletePreUp_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>UpPreUp_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DownPreUp_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer5_2_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Post-Up</string>
+ </attribute>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QListBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PostUp_LB</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame5</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>StyledPanel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>AddPostUp_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DeletePostUp_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>UpPostUp_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DownPostUp_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer5_5</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Pre-Down</string>
+ </attribute>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QListBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PreDown_LB</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame5_3</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>3</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>StyledPanel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>AddPreDown_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DeletePreDown_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>UpPreDown_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DownPreDown_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer5_3_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Post-Down</string>
+ </attribute>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QListBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PostDown_LB</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame5_4</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>StyledPanel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>AddPostDown_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DeletePostDown_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>UpPostDown_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DownPostDown_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer5_4</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>DHCP_CB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>StaticIP_GB</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>SubnetMask_LE</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_NetmaskModified( const QString &amp; )</slot>
+ </connection>
+ <connection>
+ <sender>IPAddress_LE</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_NetmaskModified( const QString &amp; )</slot>
+ </connection>
+ <connection>
+ <sender>DHCP_CB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Frame27</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>DHCP_CB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel2_2</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>SendHostname_CB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Hostname_LE</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <slot access="public">SLOT_NetmaskModified( const QString &amp; )</slot>
+</connections>
+<tabstops>
+ <tabstop>DHCP_CB</tabstop>
+ <tabstop>IPAddress_LE</tabstop>
+ <tabstop>SubnetMask_LE</tabstop>
+ <tabstop>Gateway_LE</tabstop>
+ <tabstop>DNS1_LE</tabstop>
+ <tabstop>DNS2_LE</tabstop>
+</tabstops>
+</UI>
diff --git a/noncore/settings/networksettings2/network/network_NN.cpp b/noncore/settings/networksettings2/network/network_NN.cpp
new file mode 100644
index 0000000..bb371ad
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/network_NN.cpp
@@ -0,0 +1,64 @@
+#include "network_NN.h"
+#include "network_NNI.h"
+
+static const char * NetworkNeeds[] =
+ { "device",
+ 0
+ };
+
+/**
+ * Constructor, find all of the possible interfaces
+ */
+NetworkNetNode::NetworkNetNode() : ANetNode() {
+}
+
+/**
+ * Delete any interfaces that we own.
+ */
+NetworkNetNode::~NetworkNetNode(){
+}
+
+const QString NetworkNetNode::nodeDescription(){
+ return tr("\
+<p>Sets up TCP/IP options.</p>\
+<p>Use this to configure the TCP/IP protocol</p>\
+"
+);
+}
+
+ANetNodeInstance * NetworkNetNode::createInstance( void ) {
+ return new ANetwork( this );
+}
+
+const char ** NetworkNetNode::needs( void ) {
+ return NetworkNeeds;
+}
+
+const char * NetworkNetNode::provides( void ) {
+ return "connection";
+}
+
+bool NetworkNetNode::generateProperFilesFor(
+ ANetNodeInstance * ) {
+ return 1;
+}
+
+bool NetworkNetNode::hasDataFor( const QString & S ) {
+ if( S == "interfaces" ) {
+ return 1;
+ }
+ return 0;
+}
+
+bool NetworkNetNode::generateDataForCommonFile(
+ SystemFile & S,
+ long DevNr,
+ ANetNodeInstance * NNI ) {
+ return ((ANetwork *)NNI)->generateDataForCommonFile(S, DevNr);
+}
+
+extern "C" {
+void create_plugin( QList<ANetNode> & PNN ) {
+ PNN.append( new NetworkNetNode() );
+}
+}
diff --git a/noncore/settings/networksettings2/network/network_NN.h b/noncore/settings/networksettings2/network/network_NN.h
new file mode 100644
index 0000000..3b0cd64
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/network_NN.h
@@ -0,0 +1,44 @@
+#ifndef NETWORK_NETNODE_H
+#define NETWORK_NETNODE_H
+
+#include "netnode.h"
+
+class ANetwork;
+
+class NetworkNetNode : public ANetNode{
+
+ Q_OBJECT
+
+public:
+
+ NetworkNetNode();
+ virtual ~NetworkNetNode();
+
+ virtual const QString pixmapName()
+ { return "tcpip"; }
+
+ virtual const QString nodeName()
+ { return tr("IP Configuration"); }
+
+ virtual const QString nodeDescription() ;
+
+ virtual ANetNodeInstance * createInstance( void );
+
+ virtual const char ** needs( void );
+ virtual const char * provides( void );
+
+ virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
+ virtual bool hasDataFor( const QString & S );
+ virtual bool generateDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+
+private:
+
+};
+
+extern "C"
+{
+ void create_plugin( QList<ANetNode> & PNN );
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/network/network_NNI.cpp b/noncore/settings/networksettings2/network/network_NNI.cpp
new file mode 100644
index 0000000..7130764
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/network_NNI.cpp
@@ -0,0 +1,170 @@
+#include <system.h>
+#include <asdevice.h>
+#include "networkedit.h"
+#include "network_NNI.h"
+#include "network_NN.h"
+
+ANetwork::ANetwork( NetworkNetNode * PNN ) : ANetNodeInstance( PNN ) {
+ Data.UseDHCP = 1;
+ Data.IPAddress = "";
+ Data.NetMask = "";
+ Data.Broadcast = "";
+ Data.Gateway = "";
+ Data.DNS1 = "";
+ Data.DNS2 = "";
+ Data.SendHostname = 0;
+ Data.Hostname = "";
+ Data.PreUp_SL.clear();
+ Data.PreDown_SL.clear();
+ Data.PostUp_SL.clear();
+ Data.PostDown_SL.clear();
+ GUI = 0;
+ RT = 0;
+}
+
+void ANetwork::setSpecificAttribute( QString & A, QString & V ) {
+ if( A == "usedhcp" ) {
+ Data.UseDHCP = (V == "yes");
+ } else if( A == "sendhostname" ) {
+ Data.SendHostname = (V=="yes");
+ } else if( A == "hostname" ) {
+ Data.Hostname = V;
+ } else if( A == "ipaddress" ) {
+ Data.IPAddress = V;
+ } else if( A == "netmask" ) {
+ Data.NetMask = V;
+ } else if( A == "broadcast" ) {
+ Data.Broadcast = V;
+ } else if( A == "gateway" ) {
+ Data.Gateway = V;
+ } else if( A == "dns1" ) {
+ Data.DNS1 = V;
+ } else if( A == "dns2" ) {
+ Data.DNS2 = V;
+ } else if( A == "preup" ) {
+ Data.PreUp_SL.append( V );
+ } else if( A == "predown" ) {
+ Data.PreDown_SL.append( V );
+ } else if( A == "postup" ) {
+ Data.PostUp_SL.append( V );
+ } else if( A == "postdown" ) {
+ Data.PostDown_SL.append( V );
+ }
+}
+
+void ANetwork::saveSpecificAttribute( QTextStream & TS ) {
+ TS << "usedhcp=" << ((Data.UseDHCP) ? "yes" : "no") << endl;
+ TS << "sendhostname=" << ((Data.SendHostname) ? "yes" : "no") << endl;
+ TS << "hostname=" << Data.Hostname << endl;
+ TS << "ipaddress=" << Data.IPAddress << endl;
+ TS << "netmask=" << Data.NetMask << endl;
+ TS << "broadcast=" << Data.Broadcast << endl;
+ TS << "gateway=" << Data.Gateway << endl;
+ TS << "dns1=" << Data.DNS1 << endl;
+ TS << "dns2=" << Data.DNS2 << endl;
+ for ( QStringList::Iterator it = Data.PreUp_SL.begin();
+ it != Data.PreUp_SL.end();
+ ++it ) {
+ TS << "preup=" << quote(*it) << endl;
+ }
+ for ( QStringList::Iterator it = Data.PreDown_SL.begin();
+ it != Data.PreDown_SL.end();
+ ++it ) {
+ TS << "predown=" << quote(*it) << endl;
+ }
+ for ( QStringList::Iterator it = Data.PostUp_SL.begin();
+ it != Data.PostUp_SL.end();
+ ++it ) {
+ TS << "postup=" << quote(*it) << endl;
+ }
+ for ( QStringList::Iterator it = Data.PostDown_SL.begin();
+ it != Data.PostDown_SL.end();
+ ++it ) {
+ TS << "postdown=" << quote(*it) << endl;
+ }
+}
+
+QWidget * ANetwork::edit( QWidget * parent ) {
+ GUI = new NetworkEdit( parent );
+ GUI->showData( Data );
+ return GUI;
+}
+
+QString ANetwork::acceptable( void ) {
+ return ( GUI ) ? GUI->acceptable( ) : QString();
+}
+
+void ANetwork::commit( void ) {
+ if( GUI && GUI->commit( Data ) )
+ setModified( 1 );
+}
+
+bool ANetwork::generateDataForCommonFile( SystemFile & S, long DevNr ) {
+ AsDevice * Dev = runtime()->device();
+ QString NIC = Dev->genNic( DevNr );
+
+ if( S.name() == "interfaces" ) {
+ // generate mapping stanza for this interface
+ S << "# check if " << NIC << " can be brought UP" << endl;
+ S << "mapping " << NIC << endl;
+ S << " script networksettings2-request" << endl << endl;
+
+ // we can safely call from here since device item is deeper
+ if( Data.UseDHCP ) {
+ S << "iface " << NIC << "-c" << connection()->number() <<
+ "-allowed inet dhcp" << endl;
+ S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() <<
+ ".up" << Data.IPAddress << endl;
+ if( Data.SendHostname ) {
+ S << " hostname "<< Data.Hostname << endl;
+ }
+
+ S << " down rm -f /tmp/profile-" << connection()->number() <<
+ ".up" << Data.IPAddress << endl;
+ } else {
+ S << "iface " << NIC << "-c" << connection()->number() <<
+ "-allowed inet static" << endl;
+ S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() <<
+ ".up" << Data.IPAddress << endl;
+ S << " down rm -f /tmp/profile-" << connection()->number() <<
+ ".up" << Data.IPAddress << endl;
+ S << " address " << Data.IPAddress << endl;
+ S << " broadcast " << Data.Broadcast << endl;
+ S << " netmask " << Data.NetMask << endl;
+
+ // derive network address = IPAddress & netmask
+ { QString NW;
+ QStringList ipal = QStringList::split( '.', Data.IPAddress );
+ QStringList nmal = QStringList::split( '.', Data.NetMask );
+
+ NW = QString( "%1.%2.%3.%4" ).
+ arg( ipal[0].toShort() & nmal[0].toShort() ).
+ arg( ipal[1].toShort() & nmal[1].toShort() ).
+ arg( ipal[2].toShort() & nmal[2].toShort() ).
+ arg( ipal[3].toShort() & nmal[3].toShort() );
+ S << " network " << NW << endl;
+ }
+ }
+ for ( QStringList::Iterator it = Data.PreUp_SL.begin();
+ it != Data.PreUp_SL.end();
+ ++it ) {
+ S << " pre-up " << (*it) << endl;
+ }
+ for ( QStringList::Iterator it = Data.PostUp_SL.begin();
+ it != Data.PostUp_SL.end();
+ ++it ) {
+ S << " up " << (*it) << endl;
+ }
+ for ( QStringList::Iterator it = Data.PreDown_SL.begin();
+ it != Data.PreDown_SL.end();
+ ++it ) {
+ S << " down " << (*it) << endl;
+ }
+ for ( QStringList::Iterator it = Data.PostDown_SL.begin();
+ it != Data.PostDown_SL.end();
+ ++it ) {
+ S << " post-down " << (*it) << endl;
+ }
+ }
+ return 0;
+}
diff --git a/noncore/settings/networksettings2/network/network_NNI.h b/noncore/settings/networksettings2/network/network_NNI.h
new file mode 100644
index 0000000..b98ff6e
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/network_NNI.h
@@ -0,0 +1,45 @@
+#ifndef NETWORK_H
+#define NETWORK_H
+
+#include <netnode.h>
+#include "networkdata.h"
+#include "networkrun.h"
+
+class NetworkNetNode;
+class NetworkEdit;
+class SystemFile;
+
+class ANetwork : public ANetNodeInstance{
+
+public :
+
+ ANetwork( NetworkNetNode * PNN );
+
+ QWidget * edit( QWidget * parent );
+ QString acceptable( void );
+ void commit( void );
+
+ RuntimeInfo * runtime( void )
+ { if( RT == 0 )
+ RT = new NetworkRun( this, Data );
+ return RT;
+ }
+
+ virtual void * data( void )
+ { return (void *)&Data; }
+
+ bool generateDataForCommonFile( SystemFile & S, long DevNr );
+
+protected :
+
+ virtual void setSpecificAttribute( QString & Attr, QString & Value );
+ virtual void saveSpecificAttribute( QTextStream & TS );
+
+private :
+
+ NetworkEdit * GUI;
+ NetworkData_t Data;
+ NetworkRun * RT;
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/network/networkdata.h b/noncore/settings/networksettings2/network/networkdata.h
new file mode 100644
index 0000000..2c5da37
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/networkdata.h
@@ -0,0 +1,22 @@
+#ifndef NETWORK_DATA_H
+#define NETWORK_DATA_H
+
+#include <qstring.h>
+#include <qstringlist.h>
+typedef struct NetworkData {
+ bool UseDHCP;
+ QString Hostname;
+ bool SendHostname;
+ QString IPAddress;
+ QString NetMask;
+ QString Gateway;
+ QString Broadcast;
+ QString DNS1;
+ QString DNS2;
+ QStringList PreUp_SL;
+ QStringList PostUp_SL;
+ QStringList PreDown_SL;
+ QStringList PostDown_SL;
+} NetworkData_t;
+
+#endif
diff --git a/noncore/settings/networksettings2/network/networkedit.cpp b/noncore/settings/networksettings2/network/networkedit.cpp
new file mode 100644
index 0000000..b17d745
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/networkedit.cpp
@@ -0,0 +1,160 @@
+#include <qtoolbutton.h>
+#include <qcheckbox.h>
+#include <qlineedit.h>
+#include <qlistbox.h>
+#include <GUIUtils.h>
+#include <resources.h>
+#include "networkedit.h"
+
+NetworkEdit::NetworkEdit( QWidget * Parent ) : NetworkGUI( Parent ){
+
+ AddPreDown_TB->setPixmap( NSResources->getPixmap( "add" ) );
+ AddPreUp_TB->setPixmap( NSResources->getPixmap( "add" ) );
+ AddPostDown_TB->setPixmap( NSResources->getPixmap( "add" ) );
+ AddPostUp_TB->setPixmap( NSResources->getPixmap( "add" ) );
+
+ DeletePreDown_TB->setPixmap( NSResources->getPixmap( "remove" ) );
+ DeletePreUp_TB->setPixmap( NSResources->getPixmap( "remove" ) );
+ DeletePostDown_TB->setPixmap( NSResources->getPixmap( "remove" ) );
+ DeletePostUp_TB->setPixmap( NSResources->getPixmap( "remove" ) );
+
+ UpPreDown_TB->setPixmap( NSResources->getPixmap( "up" ) );
+ UpPreUp_TB->setPixmap( NSResources->getPixmap( "up" ) );
+ UpPostDown_TB->setPixmap( NSResources->getPixmap( "up" ) );
+ UpPostUp_TB->setPixmap( NSResources->getPixmap( "up" ) );
+
+ DownPreDown_TB->setPixmap( NSResources->getPixmap( "down" ) );
+ DownPreUp_TB->setPixmap( NSResources->getPixmap( "down" ) );
+ DownPostDown_TB->setPixmap( NSResources->getPixmap( "down" ) );
+ DownPostUp_TB->setPixmap( NSResources->getPixmap( "down" ) );
+
+}
+
+QString NetworkEdit::acceptable( void ) {
+ if( DHCP_CB->isChecked() ) {
+ if( SendHostname_CB->isChecked() )
+ if( Hostname_LE->text().isEmpty() )
+ return tr("Hostname needed");
+ return QString();
+ }
+
+ if( IPAddress_LE->text().isEmpty() )
+ return tr("IPAddress needed");
+ if( Broadcast_LE->text().isEmpty() )
+ return tr("Broadcast needed");
+ if( SubnetMask_LE->text().isEmpty() )
+ return tr("Subnet mask needed");
+
+ // valid IP ?
+ if( ! validIP( IPAddress_LE->text() ) )
+ return tr("IPAddress not valid");
+ if( ! validIP( SubnetMask_LE->text() ) )
+ return tr("Subnet mask not valid");
+ if( ! validIP( Broadcast_LE->text() ) )
+ return tr("Broadcast address not valid");
+ if( Gateway_LE->text().isEmpty() &&
+ ! validIP( Gateway_LE->text() ) )
+ return tr("Gateway address not valid");
+ if( DNS1_LE->text().isEmpty() &&
+ ! validIP( DNS1_LE->text() ) )
+ return tr("DNS1 address not valid");
+ if( DNS2_LE->text().isEmpty() &&
+ ! validIP( DNS2_LE->text() ) )
+ return tr("DNS2 address not valid");
+ return QString();
+}
+
+bool NetworkEdit::commit( NetworkData_t & Data ) {
+ bool SM = 0;
+ CBM( Data.UseDHCP, DHCP_CB, SM );
+ TXTM( Data.IPAddress, IPAddress_LE, SM );
+ CBM( Data.SendHostname, SendHostname_CB, SM );
+ TXTM( Data.Hostname, Hostname_LE, SM );
+ TXTM( Data.Gateway, Gateway_LE, SM );
+ TXTM( Data.Broadcast, Broadcast_LE, SM );
+ TXTM( Data.NetMask, SubnetMask_LE, SM );
+ TXTM( Data.DNS1, DNS1_LE, SM );
+ TXTM( Data.DNS2, DNS2_LE, SM );
+
+ SM |= updateList( Data.PreUp_SL, PreUp_LB );
+ SM |= updateList( Data.PostUp_SL, PostUp_LB );
+ SM |= updateList( Data.PreDown_SL, PreDown_LB );
+ SM |= updateList( Data.PostDown_SL, PostDown_LB );
+
+ return SM;
+}
+
+void NetworkEdit::showData( NetworkData_t & Data ) {
+ DHCP_CB->setChecked( Data.UseDHCP );
+ SendHostname_CB->setChecked( Data.SendHostname );
+ Hostname_LE->setText( Data.Hostname );
+ IPAddress_LE->setText( Data.IPAddress );
+ Gateway_LE->setText( Data.Gateway );
+ SubnetMask_LE->setText( Data.NetMask );
+ Broadcast_LE->setText( Data.Broadcast );
+ DNS1_LE->setText( Data.DNS1 );
+ DNS2_LE->setText( Data.DNS2 );
+
+ populateList( Data.PreUp_SL, PreUp_LB );
+ populateList( Data.PostUp_SL, PostUp_LB );
+ populateList( Data.PreDown_SL, PreDown_LB );
+ populateList( Data.PostDown_SL, PostDown_LB );
+}
+
+bool NetworkEdit::updateList( QStringList & SL, QListBox * LB ) {
+ bool Changed;
+ QStringList NewSL;
+
+ // collect new list
+ for( unsigned int i = 0; i < LB->count() ; i ++ ) {
+ NewSL.append( LB->text(i) );
+ }
+
+ // check if at least ONE item in new list is NEW
+ Changed = 0;
+ for ( QStringList::Iterator it = NewSL.begin();
+ it != NewSL.end();
+ ++it ) {
+ if( SL.findIndex( (*it) ) < 0 ) {
+ // new or modified item
+ Changed = 1;
+ SL = NewSL;
+ break;
+ }
+ }
+ return Changed;
+}
+
+void NetworkEdit::populateList( QStringList & SL, QListBox * LB ) {
+ LB->clear();
+ for ( QStringList::Iterator it = SL.begin();
+ it != SL.end();
+ ++it ) {
+ LB->insertItem( (*it) );
+ }
+}
+
+void NetworkEdit::SLOT_NetmaskModified( const QString & ) {
+ QString IP, SN;
+ IP = IPAddress_LE->text();
+ SN = SubnetMask_LE->text();
+ if( IP.isEmpty() || SN.isEmpty() )
+ return;
+
+ if( ! validIP(IP) || ! validIP( SN ) )
+ return;
+
+ // if all ones
+ // broadcast = (IPAddress | ~netmask )
+ { QString NW;
+ QStringList ipal = QStringList::split( '.', IP );
+ QStringList nmal = QStringList::split( '.', SN );
+
+ NW = QString( "%1.%2.%3.%4" ).
+ arg( ipal[0].toShort() | ( ~ nmal[0].toShort() & 0x00ff) ).
+ arg( ipal[1].toShort() | ( ~ nmal[1].toShort() & 0x00ff) ).
+ arg( ipal[2].toShort() | ( ~ nmal[2].toShort() & 0x00ff) ).
+ arg( ipal[3].toShort() | ( ~ nmal[3].toShort() & 0x00ff) );
+ Broadcast_LE->setText( NW );
+ }
+}
diff --git a/noncore/settings/networksettings2/network/networkedit.h b/noncore/settings/networksettings2/network/networkedit.h
new file mode 100644
index 0000000..9ed4e84
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/networkedit.h
@@ -0,0 +1,21 @@
+#include "networkdata.h"
+#include "networkGUI.h"
+
+class NetworkEdit : public NetworkGUI {
+
+public :
+
+ NetworkEdit( QWidget * parent );
+ QString acceptable( void );
+ bool commit( NetworkData_t & Data );
+ void showData( NetworkData_t & Data );
+
+public slots :
+
+ void SLOT_NetmaskModified( const QString & S );
+
+private :
+
+ bool updateList( QStringList &SL, QListBox * LB );
+ void populateList( QStringList &SL, QListBox * LB );
+};
diff --git a/noncore/settings/networksettings2/network/networkrun.cpp b/noncore/settings/networksettings2/network/networkrun.cpp
new file mode 100644
index 0000000..e732bfa
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/networkrun.cpp
@@ -0,0 +1,63 @@
+#include <system.h>
+#include <asdevice.h>
+#include "networkrun.h"
+
+void NetworkRun::detectState( NodeCollection * NC ) {
+ RuntimeInfo * RI = netNode()->nextNode()->runtime();
+ AsDevice * Next = RI->asDevice();
+ InterfaceInfo * II = Next->assignedInterface();
+
+ if( II ) {
+ // device has assigned interface
+ NC->setCurrentState( (( II->IsUp ) ? IsUp : Available) );
+ }
+
+ // has no interface -> delegate
+ RI->detectState( NC );
+}
+
+bool NetworkRun::setState( NodeCollection * NC, Action_t A ) {
+ // we handle UP and DOWN
+ RuntimeInfo * RI = netNode()->nextNode()->runtime();
+ AsDevice * Next = RI->asDevice();
+ InterfaceInfo * II = Next->assignedInterface();
+
+ if( A == Up ) {
+ // we can bring UP if lower level is available
+ if( NC->currentState() == Available ) {
+ QString S;
+ S.sprintf( "ifup %s=manual", II->Name.latin1() );
+ NSResources->system().execute( S );
+ NC->setCurrentState( IsUp );
+ }
+ return 1;
+ } else if( A == Down ) {
+ if( NC->currentState() == IsUp ) {
+ QString S;
+ S.sprintf( "ifdown %s", II->Name.latin1() );
+ NSResources->system().execute( S );
+ NC->setCurrentState( Available );
+ }
+ return 1;
+ }
+ // delegate
+ return RI->setState( NC, A );
+}
+
+bool NetworkRun::canSetState( State_t Curr, Action_t A ) {
+ // we handle UP and DOWN
+ RuntimeInfo * RI = netNode()->nextNode()->runtime();
+
+ if( A == Up ) {
+ return ( Curr == Available );
+ } else if( A == Down ) {
+ return ( Curr == IsUp );
+ }
+ // delegate
+ return RI->canSetState( Curr, A );
+}
+
+bool NetworkRun::handlesInterface( const QString & S ) {
+ // donno -> pass deeper
+ return netNode()->nextNode()->runtime()->handlesInterface(S);
+}
diff --git a/noncore/settings/networksettings2/network/networkrun.h b/noncore/settings/networksettings2/network/networkrun.h
new file mode 100644
index 0000000..f3d840e
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/networkrun.h
@@ -0,0 +1,20 @@
+#include <asconnection.h>
+#include "networkdata.h"
+
+class NetworkRun : public AsConnection {
+
+public :
+
+ NetworkRun( ANetNodeInstance * NNI,
+ NetworkData & Data ) : AsConnection( NNI )
+ { }
+
+protected :
+
+ void detectState( NodeCollection * );
+ bool setState( NodeCollection * ,Action_t A );
+ bool canSetState( State_t , Action_t A );
+
+ bool handlesInterface( const QString & I );
+
+};