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

svn at pcbsd.org svn at pcbsd.org
Tue Aug 5 08:47:17 PDT 2008


Author: kris
Date: 2008-08-05 08:47:16 -0700 (Tue, 05 Aug 2008)
New Revision: 2526

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

Added a network install feature, which confirms the presence of a valid install path
before allowing the user to continue with the install



Modified: pcbsd/trunk/PCInstall/pcinstall.cpp
===================================================================
--- pcbsd/trunk/PCInstall/pcinstall.cpp	2008-08-05 14:00:58 UTC (rev 2525)
+++ pcbsd/trunk/PCInstall/pcinstall.cpp	2008-08-05 15:47:16 UTC (rev 2526)
@@ -3427,11 +3427,10 @@
 void PCInstall::netDialogSlot(bool internet, QString ServerURL)
 {
   QString tmp;
-
-  networkInstall = true;
   networkServerURL = ServerURL;
   usingInternetInstall = internet;
 
+
   if ( networkServerURL.lastIndexOf("/") != networkServerURL.size() )
   {
        networkServerURL = networkServerURL + "/";
@@ -3445,18 +3444,55 @@
       file2.close();
   }
 
-  // Now move us to the next wizard page, the network setup is complete.
-  // If the user wanted to upgrade, jump to that screen
-  if ( ! radioFreshInstall->isChecked() )
+
+   // Now lets go ahead and confirm that we have a valid network install path
+   workDialog = new WorkingDialog();
+   workDialog->setModal(true);
+   workDialog->setText(tr("Confirming valid network location"));
+   workDialog->setTitle(tr("Network Setup"));
+   workDialog->show();
+
+   // Create our process now and start it
+   confirmNetproc = new QProcess(this);
+   QString program = "/usr/local/pcbsd/scripts/PCBSD.ConfirmNetFiles.sh";
+   QStringList arguments;
+   connect( confirmNetproc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(netFinishedConfirmSlot(int, QProcess::ExitStatus) ) );
+   confirmNetproc->start(program, arguments);
+
+    
+
+}
+
+void PCInstall::netFinishedConfirmSlot(int exitCode, QProcess::ExitStatus exitStatus)
+{
+  
+  // Close the working dialog
+  workDialog->doClose();
+
+  // Check if we found valid install data at this location
+  if ( exitCode == 0)
   {
-     showPage(page(6));
-     return;
+
+    networkInstall = true;
+
+    // Now move us to the next wizard page, the network setup is complete.
+    // If the user wanted to upgrade, jump to that screen
+    if ( ! radioFreshInstall->isChecked() )
+    {
+       showPage(page(6));
+       return;
+    } else {
+       showPage(page(3));
+       return;
+    }
+
   } else {
-        showPage(page(3));
-        return;
+    // Looks like we have a bad network install path, PCBSD.tar.lzma and / or
+    // PCBSD.tar.lzma2 could not be found
+    networkInstall = false;
+     
+    QMessageBox::warning( this, tr("Network Setup"), tr("The URL: %s does not appear to be a valid install location. Please check the network location and try again.", networkServerURL ) );
+
   }
 
-    
-
 }
-

Modified: pcbsd/trunk/PCInstall/pcinstall.h
===================================================================
--- pcbsd/trunk/PCInstall/pcinstall.h	2008-08-05 14:00:58 UTC (rev 2525)
+++ pcbsd/trunk/PCInstall/pcinstall.h	2008-08-05 15:47:16 UTC (rev 2526)
@@ -103,8 +103,8 @@
     void slotFinishedMountCD3();
     void slotFinishedInstallCD3();
     void netDialogSlot(bool internet, QString ServerURL);
+    void netFinishedConfirmSlot(int exitCode, QProcess::ExitStatus exitStatus);
 
-
 private:
     QColor colourWhite;
     QColor colourRed;
@@ -177,6 +177,7 @@
     Q3Process *installCD2proc;
     Q3Process *findCD3proc;
     QProcess *enableNICproc;
+    QProcess *confirmNetproc;
     QProcess *mountNetISOproc;
     KIO::FileCopyJob *copyJob;
     QString Sanitize_Bios_Geom( QString cyl, QString head, QString sec, QString block );



More information about the Commits mailing list