[PC-BSD Commits] r2302 - pcbsd/trunk/PCInstall

svn at pcbsd.org svn at pcbsd.org
Wed Jul 9 14:10:06 PDT 2008


Author: kris
Date: 2008-07-09 14:10:06 -0700 (Wed, 09 Jul 2008)
New Revision: 2302

Modified:
   pcbsd/trunk/PCInstall/pcinstall.cpp
   pcbsd/trunk/PCInstall/pcinstall.h
   pcbsd/trunk/PCInstall/pcinstall.ui
Log:

Improved the DVD support for PCInstall, now it will use one consistent progress
bar for both CD / DVD media, and some of the tips have been changed to reflect different media installs



Modified: pcbsd/trunk/PCInstall/pcinstall.cpp
===================================================================
--- pcbsd/trunk/PCInstall/pcinstall.cpp	2008-07-09 19:00:57 UTC (rev 2301)
+++ pcbsd/trunk/PCInstall/pcinstall.cpp	2008-07-09 21:10:06 UTC (rev 2302)
@@ -21,8 +21,6 @@
 
 void PCInstall::ProgramInit()
 {
-//    QFont f( "Dejavu", 10);
-//    setFont( f);    
 
     // Set the variable to regenerate the custom slices
     regenCustomSlices = 1;
@@ -1335,36 +1333,69 @@
 }
 
 
-void PCInstall::startMountCD()
+// Function which calculates the total size of our progress bar, and sets it
+void PCInstall::calcProgressBarSize()
 {
+    int totalLength = 0;
+
      QString line;
-    ExtractCD2Lines = 0;
-    // Get the size of the extracted image for CD2
+    
+    // Get the size of the first lzma file
+    QFile file( "/usr/local/pcbsd/scripts/PCBSD.ExtractSize" );
+    if ( file.open( IO_ReadOnly ) ) {
+	QTextStream stream( &file );
+	line = stream.readLine(); // line of text excluding '\n'
+	totalLength = totalLength + line.toInt();
+	file.close();
+    }
+
+
+    // Get the lzma2 size now
     QFile file1( "/usr/local/pcbsd/scripts/PCBSD.ExtractSize2" );
     if ( file1.open( IO_ReadOnly ) ) {
 	QTextStream stream1( &file1 );
 	line = stream1.readLine(); // line of text excluding '\n'
-	ExtractCD2Lines = line.toInt();
+	totalLength = totalLength + line.toInt();
 	file1.close();
     }
        
        
-    // Get the size of the extracted image for our box
-    QFile file( "/usr/local/pcbsd/scripts/PCBSD.ExtractSize" );
-    if ( file.open( IO_ReadOnly ) ) {
-	QTextStream stream( &file );
-	line = stream.readLine(); // line of text excluding '\n'
-	file.close();
+
+    // Get the number of components we have 
+    for ( int i = 0; !ComponentDir[i].isEmpty(); i++ )
+    {
+       if ( ComponentSelected[i] == 1 )
+   	  totalLength++;
     }
 
-    // Set number of lines to 0 first
+
+    // Set our current progress variable to 0
     ExtractSize = 0;
+
+
+    // Add a few extra steps for misc items, like kernel setup, etc
+    totalLength = totalLength + 10;
     
-    installProgress->setTotalSteps(line.toInt());
+    // Set our total steps to the found size
+    installProgress->setTotalSteps(totalLength);
+    installProgressUpgrade->setTotalSteps(totalLength + 30);
     
+    // Zero out the progress bars now
+    installProgress->setProgress(0);
+    installProgressUpgrade->setProgress(0);
+
+
+}
+
+
+void PCInstall::startMountCD()
+{
+
+    // Figure out the progress bar steps
+    calcProgressBarSize();
     
+    
     textFileProgress->setText(tr("Mounting CD..."));
-    installProgress->setProgress(1);
     
       //Setup Process to mount the root partition
     MountCD = new Q3Process( this );
@@ -1991,23 +2022,10 @@
 
 void PCInstall::startUpgradeMount()
 {
-    QString line;
-    // Get the size of the extracted image for our box
-    QFile file( "/usr/local/pcbsd/scripts/PCBSD.ExtractSize" );
-    if ( file.open( IO_ReadOnly ) ) {
-	QTextStream stream( &file );
-	line = stream.readLine(); // line of text excluding '\n'
-	file.close();
-    }
-
-    // Set number of lines to 0 first
-    ExtractSize = 0;
+    // Setup the length of our progress bars
+    calcProgressBarSize();
     
-    installProgressUpgrade->setTotalSteps(line.toInt() + 30);
-    
-    
     textFileProgressUpgrade->setText(tr("Mounting CD..."));
-    installProgressUpgrade->setProgress(1);
     
      //Setup Process to mount the root partition
     MountCD = new Q3Process( this );
@@ -2908,11 +2926,6 @@
     
        textFileProgress->setText(tr("Installing Language Packages..."));
        textFileProgressUpgrade->setText(tr("Installing Language Packages..."));
-       installProgressUpgrade->setTotalSteps(2);
-       installProgress->setTotalSteps(2);
-       installProgress->setProgress(0);
-       installProgressUpgrade->setProgress(0);
-       ExtractSize = 0;
 	
        //Setup Process to mount the root partition
       AddLangFiles = new Q3Process( this );
@@ -2967,12 +2980,6 @@
 	file.close();
     }
        
-       ExtractSize = 0;
-       installProgressUpgrade->setTotalSteps(totalItems);
-       installProgress->setTotalSteps(totalItems);
-       installProgress->setProgress(0);
-       installProgressUpgrade->setProgress(0);
-	
   
       InstallComponentsProc = new Q3Process( this );
       InstallComponentsProc->addArgument( "/usr/local/pcbsd/scripts/PCBSD.InstallCD3.sh" );
@@ -3177,19 +3184,6 @@
      textFileProgress->setText(tr("Installing CD2..."));
      textFileProgressUpgrade->setText(tr("Installing CD2..."));
 
-     // Reset the progress bar
-     installProgress->reset();
-     installProgressUpgrade->reset();
-
-     // Set the total steps to the new size
-     installProgress->setTotalSteps(ExtractCD2Lines);
-     installProgressUpgrade->setTotalSteps(ExtractCD2Lines);
-
-     // Set the Progress to 0
-     installProgress->setProgress(0);
-     installProgressUpgrade->setProgress(0);
-
-     ExtractSize = 0;
     
      // We have mounted CD2, now lets kick off the installer for it
     installCD2proc = new Q3Process( this );

Modified: pcbsd/trunk/PCInstall/pcinstall.h
===================================================================
--- pcbsd/trunk/PCInstall/pcinstall.h	2008-07-09 19:00:57 UTC (rev 2301)
+++ pcbsd/trunk/PCInstall/pcinstall.h	2008-07-09 21:10:06 UTC (rev 2302)
@@ -159,7 +159,6 @@
     int installComponents;
     int regenCustomSlices;
     dialogKeyboard *keyboardDialog;
-    int ExtractCD2Lines;
     Q3Process *installCD2proc;
     Q3Process *findCD3proc;
     void loadLangs();
@@ -174,6 +173,7 @@
     void loadComponents();
     void refreshComponents();
     void loadLicense();
+    void calcProgressBarSize();
 
 signals:
 

Modified: pcbsd/trunk/PCInstall/pcinstall.ui
===================================================================
--- pcbsd/trunk/PCInstall/pcinstall.ui	2008-07-09 19:00:57 UTC (rev 2301)
+++ pcbsd/trunk/PCInstall/pcinstall.ui	2008-07-09 21:10:06 UTC (rev 2302)
@@ -1908,7 +1908,7 @@
       </rect>
      </property>
      <property name="text" >
-      <string>Install from CD</string>
+      <string>Install from CD/DVD</string>
      </property>
      <property name="checked" >
       <bool>true</bool>
@@ -5023,7 +5023,7 @@
      <property name="text" >
       <string>PC-BSD has several optional components which some users may wish to install. You may select any of the components above that you wish to load on your system. 
 
-Note: You will be prompted to insert CD #2 to install any of the above components.</string>
+Note: If performing a CD install you will need CD #3 to install any of the above components.</string>
      </property>
      <property name="alignment" >
       <set>Qt::AlignTop</set>
@@ -7406,7 +7406,7 @@
       </rect>
      </property>
      <property name="text" >
-      <string>Installation is now complete! You may now remove the CD from the drive. When you click reboot, the system will automatically restart. You will be prompted to setup your display resolution during the startup process. 
+      <string>Installation is now complete! You may now remove the installation media from the drive. When you click reboot, the system will automatically restart. You will be prompted to setup your display resolution during the startup process. 
 
 Need help with something? Please checkout our FAQs at faqs.pcbsd.org or post your questions at forums.pcbsd.org.</string>
      </property>



More information about the Commits mailing list