[PC-BSD Commits] r7346 - pcbsd/current/src-qt4/pc-pbigui

svn at pcbsd.org svn at pcbsd.org
Wed Aug 4 07:13:23 PDT 2010


Author: kris
Date: 2010-08-04 07:13:23 -0700 (Wed, 04 Aug 2010)
New Revision: 7346

Modified:
   pcbsd/current/src-qt4/pc-pbigui/pbi.cpp
   pcbsd/current/src-qt4/pc-pbigui/pbi.h
   pcbsd/current/src-qt4/pc-pbigui/pbi.ui
Log:

Updated pc-pbigui, now display progress during hash-dir merging, report failure in pbi_add, and change colors properly for text reflecting digital signature status



Modified: pcbsd/current/src-qt4/pc-pbigui/pbi.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-pbigui/pbi.cpp	2010-08-04 14:02:41 UTC (rev 7345)
+++ pcbsd/current/src-qt4/pc-pbigui/pbi.cpp	2010-08-04 14:13:23 UTC (rev 7346)
@@ -42,6 +42,10 @@
 	
     }
     
+    // Connect the page changed slot to proper signal
+    connect( this, SIGNAL(currentIdChanged(int)), this, SLOT(PageChanged(int)) );
+    connect( LicenseCheckBox, SIGNAL( clicked() ), this, SLOT(AgreeButtonSlot() ) );
+
     // Lets the app know if the file-extraction has begun
     ExtractStarted = false;
     TotalLinesTar = 0;
@@ -61,11 +65,7 @@
 	exit(-1);
     }
      
-    // Connect the page changed slot to proper signal
-    connect( this, SIGNAL(currentIdChanged(int)), this, SLOT(PageChanged(int)) );
     
-    connect( LicenseCheckBox, SIGNAL( clicked() ), this, SLOT(AgreeButtonSlot() ) );
-    
     // Read in this programs configuration data
      readSettingsSlot();
 
@@ -267,6 +267,10 @@
 
 void PBI::FinishedInstallSlot()
 {    
+   if ( pbiAdd->exitCode() != 0 ) {
+      QMessageBox::critical( this, tr("Error!"), tr("The pbi_add command returned an error, the source file may be corrupt or invalid.") );
+      exit(-1);
+   }
 
    installProgress->setValue(installProgress->maximum());
    StatusLabel->setText(tr("Installation Finished!"));
@@ -279,13 +283,15 @@
 {
     QString tmp;
     QString value;
+    bool ok;
+
     while (pbiAdd->canReadLine() )
     {	 
          // Read the line, sanitize it for display
 	 tmp = pbiAdd->readLine();
 	 tmp = tmp.simplified();
 
-	 // Check if we've begun the installation
+	 // TAR PROGRESS
 	 if ( tmp.indexOf("Extracting to:") == 0) {
 	   inTar = true;
            installProgress->setMaximum(TotalLinesTar);
@@ -310,7 +316,33 @@
 	   progressTextDialog->setText(value);
 	   // Set the steps +1
 	   installProgress->setValue(installProgress->value() + 1);
+	   continue;
+	 } // End TAR Progress
+
+
+	 // HASH Progress
+	 if ( tmp.indexOf("HASHCOUNT:") == 0 ) {
+		inHash = true;
+	  	value = tmp.replace("HASHCOUNT: ", "").simplified();
+		value.toInt(&ok);
+		if ( ok )
+	        	installProgress->setMaximum(value.toInt(&ok));
+	        installProgress->setValue(0);
+                progressTextDialog->setText(tr("Merging Files..."));	
+		continue;
 	 }
+	 if ( inHash ) {
+	   if ( tmp.indexOf("HASHDONE") == 0 ) {
+		inHash = false;
+                progressTextDialog->setText(tr("Registering installation and cleanup..."));	
+	        installProgress->setValue(0);
+	        installProgress->setMaximum(0);
+		continue;
+           }
+	   installProgress->setValue(installProgress->value() + 1);
+	   continue;
+	 }
+	 // End of HASH Checks
 	 
     }
 
@@ -329,7 +361,8 @@
 {
        progressTextDialog->setText(tr("Preparing to install..."));	
        
-       inTar = true;
+       inTar = false;
+       inHash = false;
        installProgress->setMaximum(0);
        installProgress->setValue(0);
         
@@ -340,7 +373,7 @@
        ExtractStarted = true;
        pbiAdd = new QProcess(this);
        QStringList arguments;
-       arguments << "-f" << "-v" << "--licagree" << PBIFILE;
+       arguments << "-f" << "-v" << "--licagree" << "--no-checksig" << PBIFILE;
 
        connect( pbiAdd, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(FinishedInstallSlot() ) ); 
        connect( pbiAdd, SIGNAL(readyRead()), this, SLOT(setProgressSlot() ) );
@@ -433,7 +466,7 @@
 
 	if ( ProgramSig == "Not Signed" ) {
 		labelSig->setText(tr("No digital signature"));
-		labelSig->setStyleSheet("color: rgb(255, 255, 255);");
+		labelSig->setStyleSheet("color: rgb(255, 0, 0);");
         	QPixmap pixmap;
 		pixmap.load(":/no-sign.png");
         	labelSigPic->setPixmap(pixmap);
@@ -450,7 +483,7 @@
 	}
 	if ( ProgramSig == "Bad" ) {
 		labelSig->setText(tr("Invalid digital signature"));
-		labelSig->setStyleSheet("color: rgb(255, 255, 255);");
+		labelSig->setStyleSheet("color: rgb(255, 0, 0);");
         	QPixmap pixmap;
 		pixmap.load(":/invalid-sign.png");
         	labelSigPic->setPixmap(pixmap);

Modified: pcbsd/current/src-qt4/pc-pbigui/pbi.h
===================================================================
--- pcbsd/current/src-qt4/pc-pbigui/pbi.h	2010-08-04 14:02:41 UTC (rev 7345)
+++ pcbsd/current/src-qt4/pc-pbigui/pbi.h	2010-08-04 14:13:23 UTC (rev 7346)
@@ -28,6 +28,13 @@
     void PageChanged( int pageId );
 private slots:
     void slotCheckExistingProgram();
+    void AgreeButtonSlot();
+    void FinishedInstallSlot();
+    void readSettingsSlot();
+    void setProgressSlot();
+    void startInstallSlot();
+    void reject();
+    void accept();
 
 private:
 
@@ -51,17 +58,11 @@
     int OverWrote;
     bool ExtractStarted;
     bool inTar;
+    bool inHash;
 
     QPixmap topbanner;
     void uninstall();
-    void readSettingsSlot();
-    void AgreeButtonSlot();
-    void FinishedInstallSlot();
-    void setProgressSlot();
     void runCommand( QString Command );
-    void startInstallSlot();
-    void reject();
-    void accept();
     void checkSignature();
 
 

Modified: pcbsd/current/src-qt4/pc-pbigui/pbi.ui
===================================================================
--- pcbsd/current/src-qt4/pc-pbigui/pbi.ui	2010-08-04 14:02:41 UTC (rev 7345)
+++ pcbsd/current/src-qt4/pc-pbigui/pbi.ui	2010-08-04 14:13:23 UTC (rev 7346)
@@ -342,7 +342,7 @@
          </sizepolicy>
         </property>
         <property name="styleSheet">
-         <string notr="true">color: rgb(0, 85, 0);</string>
+         <string notr="true">color: rgb(0, 60, 0);</string>
         </property>
         <property name="text">
          <string>Valid Digital Signature</string>



More information about the Commits mailing list