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

svn at pcbsd.org svn at pcbsd.org
Tue Dec 1 12:43:03 PST 2009


Author: kris
Date: 2009-12-01 12:43:03 -0800 (Tue, 01 Dec 2009)
New Revision: 5180

Modified:
   pcbsd/trunk/SysInstaller/sys-componentwidget.cpp
   pcbsd/trunk/SysInstaller/sys-diskwidget.cpp
   pcbsd/trunk/SysInstaller/sys-userwidget.cpp
   pcbsd/trunk/SysInstaller/sysinstaller.cpp
   pcbsd/trunk/SysInstaller/sysinstaller.h
   pcbsd/trunk/SysInstaller/sysinstaller.ui
Log:

Added a nice short summary to the installer, which lets you at a glance confirm your settings before
beginning an install



Modified: pcbsd/trunk/SysInstaller/sys-componentwidget.cpp
===================================================================
--- pcbsd/trunk/SysInstaller/sys-componentwidget.cpp	2009-12-01 19:47:30 UTC (rev 5179)
+++ pcbsd/trunk/SysInstaller/sys-componentwidget.cpp	2009-12-01 20:43:03 UTC (rev 5180)
@@ -64,7 +64,7 @@
 
 
 // Return list of components to install
-QStringList SysInstaller::getComponentCfgSettings()
+QStringList SysInstaller::getComponentCfgSettings(QStringList &summaryList)
 {
   QStringList componentList;
   QString tmpList;
@@ -80,5 +80,9 @@
   componentList << "# Optional Components";
   componentList << "installComponents=" + tmpList;
 
+  summaryList << "";
+  summaryList << tr("Selected Components:");
+  summaryList << tmpList;
+
   return componentList;
 }

Modified: pcbsd/trunk/SysInstaller/sys-diskwidget.cpp
===================================================================
--- pcbsd/trunk/SysInstaller/sys-diskwidget.cpp	2009-12-01 19:47:30 UTC (rev 5179)
+++ pcbsd/trunk/SysInstaller/sys-diskwidget.cpp	2009-12-01 20:43:03 UTC (rev 5180)
@@ -386,7 +386,7 @@
 }
 
 // Function which returns the pc-sysinstall cfg data
-QStringList SysInstaller::getDiskCfgSettings()
+QStringList SysInstaller::getDiskCfgSettings(QStringList &summaryList)
 {
   QStringList tmpList;
   QList<QStringList> copyList;
@@ -396,6 +396,10 @@
   // Copy over the list to a new variable we can mangle without modifying the original
   copyList = sysFinalDiskLayout;
 
+  // Start our summary
+  summaryList << "";
+  summaryList << "<b>" + tr("The disk will be setup with the following configuration:") + "</b>";
+
   while ( ! copyList.empty() )
   {
     workingDisk = copyList.at(0).at(0);
@@ -416,6 +420,7 @@
        {
          tmpList << "mirror=" + copyList.at(i).at(0);
          tmpList << "mirrorbal=" + copyList.at(i).at(3);
+         summaryList << tr("Disk:") + copyList.at(i).at(0) + " " + tr("Mirroring:") + workingDisk;
          copyList.removeAt(i);
          break;
        }
@@ -441,6 +446,13 @@
         tmpList << "disk" + tmp.setNum(disk) + "-part=" \
                  + copyList.at(i).at(3) + " " + copyList.at(i).at(4) \
                  + " " + copyList.at(i).at(2);
+
+        summaryList << "";
+        summaryList << tr("Partition:") + " " + workingDisk + "(" + workingSlice + "):";
+        summaryList << tr("FileSystem:") + " " + copyList.at(i).at(3);
+        summaryList << tr("Size:") + " " + copyList.at(i).at(4) + "MB ";
+        summaryList << tr("Mount:") + " " + copyList.at(i).at(2);
+
         // Done with this item, remove it now
         copyList.removeAt(i);
         break;
@@ -456,6 +468,11 @@
         tmpList << "disk" + tmp.setNum(disk) + "-part=" \
                  + copyList.at(i).at(3) + " " + copyList.at(i).at(4) \
                  + " none";
+        summaryList << "";
+        summaryList << tr("Partition:") + " " + workingDisk + "(" + workingSlice + "):";
+        summaryList << tr("FileSystem:") + " " + copyList.at(i).at(3);
+        summaryList << tr("Size:") + " " + copyList.at(i).at(4) + "MB ";
+
         // Done with this item, remove it now
         copyList.removeAt(i);
         break;
@@ -471,6 +488,12 @@
         tmpList << "disk" + tmp.setNum(disk) + "-part=" \
                  + copyList.at(i).at(3) + " " + copyList.at(i).at(4) \
                  + " " + copyList.at(i).at(2);
+        summaryList << "";
+        summaryList << tr("Partition:") + " " + workingDisk + "(" + workingSlice + "):";
+        summaryList << tr("FileSystem:") + " " + copyList.at(i).at(3);
+        summaryList << tr("Size:") + " " + copyList.at(i).at(4) + "MB ";
+        summaryList << tr("Mount:") + " " + copyList.at(i).at(2);
+
         // Done with this item, remove it now
         copyList.removeAt(i);
         i--;

Modified: pcbsd/trunk/SysInstaller/sys-userwidget.cpp
===================================================================
--- pcbsd/trunk/SysInstaller/sys-userwidget.cpp	2009-12-01 19:47:30 UTC (rev 5179)
+++ pcbsd/trunk/SysInstaller/sys-userwidget.cpp	2009-12-01 20:43:03 UTC (rev 5180)
@@ -254,7 +254,7 @@
 }
 
 // Return list of users in cfg format
-QStringList SysInstaller::getUsersCfgSettings()
+QStringList SysInstaller::getUsersCfgSettings(QStringList &summaryList)
 {
    QStringList userList;
 
@@ -265,6 +265,9 @@
    userList << ""; 
    userList << "# Users"; 
 
+   summaryList << "";
+   summaryList << "<b>" + tr("The following users will be created:") + "</b>";
+
    for ( int i = 0; i < listUsers.count(); ++i) {
       userList << "userName=" + listUsers.at(i).at(0);
       userList << "userComment=" + listUsers.at(i).at(1);
@@ -276,6 +279,7 @@
         userList << "autoLoginUser=" + listUsers.at(i).at(0);
       userList << "commitUser";
       userList << "";
+      summaryList << listUsers.at(i).at(1) + " (" + listUsers.at(i).at(0) + ")";
    }
 
 

Modified: pcbsd/trunk/SysInstaller/sysinstaller.cpp
===================================================================
--- pcbsd/trunk/SysInstaller/sysinstaller.cpp	2009-12-01 19:47:30 UTC (rev 5179)
+++ pcbsd/trunk/SysInstaller/sysinstaller.cpp	2009-12-01 20:43:03 UTC (rev 5180)
@@ -334,23 +334,22 @@
  
 }
 
-QStringList SysInstaller::getGlobalCfgSettings()
+QStringList SysInstaller::getGlobalCfgSettings(QStringList &summaryList)
 {
 
   QStringList tmpList;
   QString tmp;
 
+  summaryList << "<b>" + tr("The system will be installed with the following options:") + "</b>";
+
   tmpList << "# Auto-Generated pc-sysinstall configuration";
   tmpList << "installInteractive=no";
  
-  if ( radioUpgrade->isChecked() )
-    tmpList << "installMode=upgrade";
-  else
-    tmpList << "installMode=fresh";
 
 
   if ( radioRestore->isChecked() )
   {
+    tmpList << "installMode=fresh";
     tmpList << "installType=PCBSD";
     tmpList << "installMedium=rsync";
     tmpList << "";
@@ -359,24 +358,44 @@
     tmpList << "rsyncHost=" + lineRsyncHost->text();
     tmpList << "rsyncUser=" + lineRsyncUser->text();
     tmpList << "rsyncPort=" + tmp.setNum(spinRsyncPort->value());
+    summaryList << tr("Performing a system restore from:") + " " + lineRsyncHost->text();
 
+  } else if ( radioUpgrade->isChecked() ) {
+    // Doing an upgrade
+    tmpList << "installMode=upgrade";
+    if ( radioInstallPCBSD->isChecked() ) {
+      tmpList << "installType=PCBSD";
+      tmpList << "packageType=uzip";
+      summaryList << tr("Performing a system upgrade of PC-BSD");
+    } else {
+      tmpList << "installType=FreeBSD";
+      tmpList << "packageType=tar";
+      summaryList << tr("Performing a system upgrade of FreeBSD");
+    }
   } else {
+    // Doing a fresh install
+    tmpList << "installMode=fresh";
     if ( radioInstallPCBSD->isChecked() ) {
       tmpList << "installType=PCBSD";
       tmpList << "packageType=uzip";
+      summaryList << tr("Performing a fresh install of PC-BSD");
     } else {
       tmpList << "installType=FreeBSD";
       tmpList << "packageType=tar";
+      summaryList << tr("Performing a fresh install of FreeBSD");
     }
   }
 
+
   // Check if we are doing net or DVD/usb install
   if ( radioNetworkInstall->isChecked() )
   {
+
     // If this is rsync restore, only print the network settings
     if ( ! radioRestore->isChecked() ) {
       tmpList << "installMedium=ftp";
       tmpList << "ftpPath=" + netURL;
+      summaryList << tr("Installing From:") + " " + netURL;
     } 
     tmpList << "";
     tmpList << "# Network Settings";
@@ -400,6 +419,7 @@
   } else {
     // Doing a regular DVD/USB install
     tmpList << "installMedium=dvd";
+    summaryList << tr("Installing From:") + " " + tr("DVD/USB");
   }
 
   if ( comboLanguage->currentIndex() != 0 ) {
@@ -414,6 +434,10 @@
   tmpList << "";
   tmpList << "# Timezone";
   tmpList << "timeZone=" + tmp ;
+  if ( checkTimeSync->isChecked() )
+    tmpList << "enableNTP=yes";
+  else
+    tmpList << "enableNTP=no";
 
   // Now figure out of we need to set custom keyboard layouts
   if ( ! checkKbDefault->isChecked() )
@@ -449,11 +473,12 @@
 void SysInstaller::startConfigGen()
 {
   QStringList cfgList;
+  QStringList summaryList;
 
-  cfgList+=getGlobalCfgSettings();
-  cfgList+=getDiskCfgSettings();
-  cfgList+=getComponentCfgSettings();
-  cfgList+=getUsersCfgSettings();
+  cfgList+=getGlobalCfgSettings(summaryList);
+  cfgList+=getDiskCfgSettings(summaryList);
+  cfgList+=getComponentCfgSettings(summaryList);
+  cfgList+=getUsersCfgSettings(summaryList);
 
   textEditSummary->clear();
 
@@ -463,11 +488,13 @@
     QTextStream stream( &cfgfile );
     for ( int i=0; i < cfgList.count(); ++i) {
       stream <<  cfgList.at(i) << "\n";
-      textEditSummary->append(cfgList.at(i));
     }
     cfgfile.close();
   }
 
+  for ( int i=0; i < summaryList.count(); ++i)
+    textEditSummary->append(summaryList.at(i));
+
   textEditSummary->moveCursor(QTextCursor::Start);
 
 }

Modified: pcbsd/trunk/SysInstaller/sysinstaller.h
===================================================================
--- pcbsd/trunk/SysInstaller/sysinstaller.h	2009-12-01 19:47:30 UTC (rev 5179)
+++ pcbsd/trunk/SysInstaller/sysinstaller.h	2009-12-01 20:43:03 UTC (rev 5180)
@@ -131,10 +131,10 @@
     void refreshComponents(); // Function which re-draws components list widgets
 
     // Functions which return parts of the config file
-    QStringList getGlobalCfgSettings();
-    QStringList getDiskCfgSettings();
-    QStringList getComponentCfgSettings();
-    QStringList getUsersCfgSettings();
+    QStringList getGlobalCfgSettings(QStringList &summaryList);
+    QStringList getDiskCfgSettings(QStringList &summaryList);
+    QStringList getComponentCfgSettings(QStringList &summaryList);
+    QStringList getUsersCfgSettings(QStringList &summaryList);
     
 
     void startConfigGen(); // Function which takes pieces of cfg, and assembles

Modified: pcbsd/trunk/SysInstaller/sysinstaller.ui
===================================================================
--- pcbsd/trunk/SysInstaller/sysinstaller.ui	2009-12-01 19:47:30 UTC (rev 5179)
+++ pcbsd/trunk/SysInstaller/sysinstaller.ui	2009-12-01 20:43:03 UTC (rev 5180)
@@ -300,7 +300,7 @@
              <item>
               <widget class="QStackedWidget" name="anteInstallStack">
                <property name="currentIndex">
-                <number>2</number>
+                <number>7</number>
                </property>
                <widget class="QWidget" name="aiStep0">
                 <layout class="QGridLayout" name="gridLayout_10">
@@ -2386,7 +2386,7 @@
                </widget>
                <widget class="QWidget" name="aiStep7">
                 <layout class="QGridLayout" name="gridLayout_20">
-                 <item row="0" column="0" rowspan="4">
+                 <item row="0" column="0" rowspan="5">
                   <spacer name="horizontalSpacer_29">
                    <property name="orientation">
                     <enum>Qt::Horizontal</enum>
@@ -2412,7 +2412,7 @@
                    </property>
                   </spacer>
                  </item>
-                 <item row="0" column="2" rowspan="4">
+                 <item row="0" column="2" rowspan="5">
                   <spacer name="horizontalSpacer_30">
                    <property name="orientation">
                     <enum>Qt::Horizontal</enum>
@@ -2467,7 +2467,7 @@
                    </property>
                   </widget>
                  </item>
-                 <item row="3" column="1">
+                 <item row="4" column="1">
                   <spacer name="verticalSpacer_17">
                    <property name="orientation">
                     <enum>Qt::Vertical</enum>
@@ -2480,6 +2480,13 @@
                    </property>
                   </spacer>
                  </item>
+                 <item row="3" column="1">
+                  <widget class="QLabel" name="label_20">
+                   <property name="text">
+                    <string>Please check the summary above, and click 'back' to make any corrections.</string>
+                   </property>
+                  </widget>
+                 </item>
                 </layout>
                </widget>
                <widget class="QWidget" name="aiStep8">
@@ -2643,7 +2650,7 @@
                     <item row="0" column="0">
                      <widget class="QLabel" name="labelInstallComplete">
                       <property name="text">
-                       <string>The installation is now complete! You may now remove any DVD or USB media, and reboot the system to finish.</string>
+                       <string>The installation is now complete! You may now remove any boot media, and reboot the system to finish.</string>
                       </property>
                       <property name="alignment">
                        <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>



More information about the Commits mailing list