[PC-BSD Commits] r5072 - pcbsd/trunk/SysInstaller

svn at pcbsd.org svn at pcbsd.org
Wed Nov 18 13:31:33 PST 2009


Author: kris
Date: 2009-11-18 13:31:33 -0800 (Wed, 18 Nov 2009)
New Revision: 5072

Modified:
   pcbsd/trunk/SysInstaller/backend.cpp
   pcbsd/trunk/SysInstaller/sysinstaller.cpp
   pcbsd/trunk/SysInstaller/sysinstaller.h
   pcbsd/trunk/SysInstaller/sysinstaller.ui
Log:

Added support for loading NIC information inthe sysinstaller



Modified: pcbsd/trunk/SysInstaller/backend.cpp
===================================================================
--- pcbsd/trunk/SysInstaller/backend.cpp	2009-11-18 20:47:40 UTC (rev 5071)
+++ pcbsd/trunk/SysInstaller/backend.cpp	2009-11-18 21:31:33 UTC (rev 5072)
@@ -90,6 +90,7 @@
             nics.append(p.readLine().simplified());
         }
     }
+    qDebug() << "Found Nics:" << nics;
     return nics;
 }
 

Modified: pcbsd/trunk/SysInstaller/sysinstaller.cpp
===================================================================
--- pcbsd/trunk/SysInstaller/sysinstaller.cpp	2009-11-18 20:47:40 UTC (rev 5071)
+++ pcbsd/trunk/SysInstaller/sysinstaller.cpp	2009-11-18 21:31:33 UTC (rev 5072)
@@ -108,11 +108,13 @@
     connect(radioInstallFreeBSD,SIGNAL(toggled(bool)), this, SLOT(slotChangedOS()));
     connect(radioDVDUSBInstall,SIGNAL(toggled(bool)), this, SLOT(slotChangedInstallSource()));
     connect(radioNetworkInstall,SIGNAL(toggled(bool)), this, SLOT(slotChangedInstallSource()));
+    connect(comboSelectNic,SIGNAL(currentIndexChanged(int)), this, SLOT(slotChangedNic()));
 
     setKbDefaults();
 
     // Hide the network options until the user selects it
     slotChangedInstallSource();
+    slotChangedNic();
 
     // load drives
     comboDiskList->clear();
@@ -121,8 +123,24 @@
       comboDiskList->addItem(sysDisks.at(i).at(0) + " - " + sysDisks.at(i).at(1) + " " + sysDisks.at(i).at(2));
     }
 
+    // Load any nics
+    loadNics();
+
 }
 
+
+// Load the NICS
+void SysInstaller::loadNics()
+{
+  // load drives
+  comboSelectNic->clear();
+  comboSelectNic->addItem(tr("AUTO-DHCP"));
+  QStringList sysNics = Scripts::Backend::networkDevices();
+  for (int i=0; i < sysNics.count(); ++i) {
+    comboSelectNic->addItem(sysNics.at(i));
+  }
+}
+
 void SysInstaller::initPostInstall()
 {
     //
@@ -267,6 +285,29 @@
   } else {
     stackedWidgetNetOptions->setCurrentIndex(0);
   }
+}
 
+void SysInstaller::slotChangedNic()
+{
+  if ( comboSelectNic->currentText() == tr("AUTO-DHCP") )
+  {
+    lineIP->setEnabled(false);
+    lineNetmask->setEnabled(false);
+    lineDNS->setEnabled(false);
+    lineDefaultRouter->setEnabled(false);
+    textIP->setEnabled(false);
+    textNetmask->setEnabled(false);
+    textDNS->setEnabled(false);
+    textDefaultRouter->setEnabled(false);
+  } else {
+    lineIP->setEnabled(true);
+    lineNetmask->setEnabled(true);
+    lineDNS->setEnabled(true);
+    lineDefaultRouter->setEnabled(true);
+    textIP->setEnabled(false);
+    textNetmask->setEnabled(false);
+    textDNS->setEnabled(false);
+    textDefaultRouter->setEnabled(false);
+  } 
+ 
 }
-

Modified: pcbsd/trunk/SysInstaller/sysinstaller.h
===================================================================
--- pcbsd/trunk/SysInstaller/sysinstaller.h	2009-11-18 20:47:40 UTC (rev 5071)
+++ pcbsd/trunk/SysInstaller/sysinstaller.h	2009-11-18 21:31:33 UTC (rev 5072)
@@ -69,12 +69,14 @@
     void slotChangedInstallType();
     void slotChangedOS();
     void slotChangedInstallSource();
+    void slotChangedNic();
 
 private:
     void initSteps();
     void initAnteInstall();
     void initPostInstall();
     void loadStepsInfo(bool installed);
+    void loadNics();
 
     void setCurrentIndex(int);
     void setKbVariants(const QString &);

Modified: pcbsd/trunk/SysInstaller/sysinstaller.ui
===================================================================
--- pcbsd/trunk/SysInstaller/sysinstaller.ui	2009-11-18 20:47:40 UTC (rev 5071)
+++ pcbsd/trunk/SysInstaller/sysinstaller.ui	2009-11-18 21:31:33 UTC (rev 5072)
@@ -883,17 +883,7 @@
                    </property>
                    <widget class="QWidget" name="stackedWidgetInstallBoxPage1">
                     <layout class="QGridLayout" name="gridLayout_3">
-                     <item row="0" column="1" colspan="2">
-                      <widget class="QLabel" name="label_3">
-                       <property name="text">
-                        <string>Select the system you wish to install</string>
-                       </property>
-                       <property name="alignment">
-                        <set>Qt::AlignCenter</set>
-                       </property>
-                      </widget>
-                     </item>
-                     <item row="3" column="0" colspan="4">
+                     <item row="4" column="0" colspan="4">
                       <widget class="QLabel" name="label_9">
                        <property name="text">
                         <string>Tip: PC-BSD is designed for the desktop, while FreeBSD makes a great choice for servers</string>
@@ -903,7 +893,7 @@
                        </property>
                       </widget>
                      </item>
-                     <item row="1" column="1">
+                     <item row="2" column="1">
                       <widget class="QRadioButton" name="radioInstallPCBSD">
                        <property name="text">
                         <string>PC-BSD</string>
@@ -923,7 +913,7 @@
                        </property>
                       </widget>
                      </item>
-                     <item row="1" column="2">
+                     <item row="2" column="2">
                       <widget class="QRadioButton" name="radioInstallFreeBSD">
                        <property name="text">
                         <string>FreeBSD</string>
@@ -940,7 +930,7 @@
                        </property>
                       </widget>
                      </item>
-                     <item row="1" column="3">
+                     <item row="2" column="3">
                       <spacer name="horizontalSpacer_20">
                        <property name="orientation">
                         <enum>Qt::Horizontal</enum>
@@ -953,7 +943,7 @@
                        </property>
                       </spacer>
                      </item>
-                     <item row="1" column="0">
+                     <item row="2" column="0">
                       <spacer name="horizontalSpacer_21">
                        <property name="orientation">
                         <enum>Qt::Horizontal</enum>
@@ -966,13 +956,13 @@
                        </property>
                       </spacer>
                      </item>
-                     <item row="4" column="0" colspan="4">
+                     <item row="5" column="0" colspan="4">
                       <spacer name="verticalSpacer_7">
                        <property name="orientation">
                         <enum>Qt::Vertical</enum>
                        </property>
                        <property name="sizeType">
-                        <enum>QSizePolicy::Preferred</enum>
+                        <enum>QSizePolicy::MinimumExpanding</enum>
                        </property>
                        <property name="sizeHint" stdset="0">
                         <size>
@@ -982,15 +972,46 @@
                        </property>
                       </spacer>
                      </item>
+                     <item row="1" column="0" colspan="4">
+                      <widget class="QLabel" name="label_3">
+                       <property name="sizePolicy">
+                        <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+                         <horstretch>0</horstretch>
+                         <verstretch>0</verstretch>
+                        </sizepolicy>
+                       </property>
+                       <property name="font">
+                        <font>
+                         <weight>75</weight>
+                         <bold>true</bold>
+                        </font>
+                       </property>
+                       <property name="text">
+                        <string>System Type</string>
+                       </property>
+                       <property name="alignment">
+                        <set>Qt::AlignCenter</set>
+                       </property>
+                      </widget>
+                     </item>
                     </layout>
                    </widget>
                    <widget class="QWidget" name="page_5">
                     <layout class="QGridLayout" name="gridLayout">
                      <item row="0" column="0">
                       <widget class="QLabel" name="labelUpgradePartitions">
+                       <property name="font">
+                        <font>
+                         <weight>75</weight>
+                         <bold>true</bold>
+                        </font>
+                       </property>
                        <property name="text">
-                        <string>Upgradable Partitions</string>
+                        <string>Available Partitions</string>
                        </property>
+                       <property name="alignment">
+                        <set>Qt::AlignCenter</set>
+                       </property>
                       </widget>
                      </item>
                      <item row="1" column="0">
@@ -1009,6 +1030,12 @@
                     <layout class="QGridLayout" name="gridLayout_7">
                      <item row="0" column="0" colspan="3">
                       <widget class="QLabel" name="label_13">
+                       <property name="font">
+                        <font>
+                         <weight>75</weight>
+                         <bold>true</bold>
+                        </font>
+                       </property>
                        <property name="text">
                         <string>Life Preserver Restore</string>
                        </property>
@@ -1076,7 +1103,7 @@
                         <enum>Qt::Vertical</enum>
                        </property>
                        <property name="sizeType">
-                        <enum>QSizePolicy::Minimum</enum>
+                        <enum>QSizePolicy::MinimumExpanding</enum>
                        </property>
                        <property name="sizeHint" stdset="0">
                         <size>
@@ -1105,6 +1132,12 @@
                     <layout class="QGridLayout" name="gridLayout_5">
                      <item row="0" column="0" colspan="2">
                       <widget class="QLabel" name="label_12">
+                       <property name="font">
+                        <font>
+                         <weight>75</weight>
+                         <bold>true</bold>
+                        </font>
+                       </property>
                        <property name="text">
                         <string>Installation Source</string>
                        </property>
@@ -1155,63 +1188,47 @@
                               </property>
                              </widget>
                             </item>
-                            <item row="0" column="2">
-                             <spacer name="horizontalSpacer_22">
-                              <property name="orientation">
-                               <enum>Qt::Horizontal</enum>
-                              </property>
-                              <property name="sizeType">
-                               <enum>QSizePolicy::MinimumExpanding</enum>
-                              </property>
-                              <property name="sizeHint" stdset="0">
-                               <size>
-                                <width>101</width>
-                                <height>23</height>
-                               </size>
-                              </property>
-                             </spacer>
-                            </item>
                             <item row="1" column="0">
-                             <widget class="QLabel" name="label_19">
+                             <widget class="QLabel" name="textIP">
                               <property name="text">
                                <string>IP Address</string>
                               </property>
                              </widget>
                             </item>
-                            <item row="1" column="1" colspan="3">
+                            <item row="1" column="1" colspan="2">
                              <widget class="QLineEdit" name="lineIP"/>
                             </item>
                             <item row="2" column="0">
-                             <widget class="QLabel" name="label_20">
+                             <widget class="QLabel" name="textNetmask">
                               <property name="text">
                                <string>Netmask</string>
                               </property>
                              </widget>
                             </item>
-                            <item row="2" column="1" colspan="3">
+                            <item row="2" column="1" colspan="2">
                              <widget class="QLineEdit" name="lineNetmask"/>
                             </item>
                             <item row="3" column="0">
-                             <widget class="QLabel" name="label_21">
+                             <widget class="QLabel" name="textDNS">
                               <property name="text">
                                <string>Nameserver (DNS)</string>
                               </property>
                              </widget>
                             </item>
-                            <item row="3" column="1" colspan="3">
+                            <item row="3" column="1" colspan="2">
                              <widget class="QLineEdit" name="lineDNS"/>
                             </item>
                             <item row="4" column="0">
-                             <widget class="QLabel" name="label_22">
+                             <widget class="QLabel" name="textDefaultRouter">
                               <property name="text">
                                <string>Gateway</string>
                               </property>
                              </widget>
                             </item>
-                            <item row="4" column="1" colspan="3">
+                            <item row="4" column="1" colspan="2">
                              <widget class="QLineEdit" name="lineDefaultRouter"/>
                             </item>
-                            <item row="0" column="3">
+                            <item row="0" column="1" colspan="2">
                              <widget class="QComboBox" name="comboSelectNic">
                               <item>
                                <property name="text">



More information about the Commits mailing list