[PC-BSD Commits] r19769 - pcbsd/current/src-qt4/pc-updategui

svn at pcbsd.org svn at pcbsd.org
Thu Oct 18 13:55:36 PDT 2012


Author: kris
Date: 2012-10-18 20:55:36 +0000 (Thu, 18 Oct 2012)
New Revision: 19769

Modified:
   pcbsd/current/src-qt4/pc-updategui/mainWin.cpp
   pcbsd/current/src-qt4/pc-updategui/mainWin.h
Log:

Improve the update GUI to show the real error message from the backend when 
something fails



Modified: pcbsd/current/src-qt4/pc-updategui/mainWin.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-updategui/mainWin.cpp	2012-10-18 16:07:55 UTC (rev 19768)
+++ pcbsd/current/src-qt4/pc-updategui/mainWin.cpp	2012-10-18 20:55:36 UTC (rev 19769)
@@ -22,6 +22,7 @@
 void mainWin::ProgramInit(QString ch, QString ip)
 {
   // Set any warden directories
+  lastError="";
   wDir = ch;
   wIP = ip;
   if ( ! wDir.isEmpty() )
@@ -115,8 +116,14 @@
     qDebug() << "Finished Update";
     if ( uProc->exitStatus() != QProcess::NormalExit || uProc->exitCode() != 0)
     {
+      // Read any remaining buffers
+      slotReadUpdateOutput();
+
       // Warn user that this update failed
-      QMessageBox::critical(this, tr("Update Failed!"), tr("Failed to install:") + listUpdates.at(curUpdate).at(0) + " " + tr("Failed to install update! Please check your network connection, or change mirror servers in the System Manager.")); 
+      if ( lastError.isEmpty() )
+         QMessageBox::critical(this, tr("Update Failed!"), tr("Failed to install:") + listUpdates.at(curUpdate).at(0) + " " + tr("An unknown error occured!")); 
+      else
+         QMessageBox::critical(this, tr("Update Failed!"), tr("Failed to install:") + listUpdates.at(curUpdate).at(0) + " " + lastError); 
     } else {
       // If successfull system update download
       if ( listUpdates.at(curUpdate).at(1) == "SYSUPDATE" )
@@ -323,6 +330,10 @@
         progressUpdate->setValue(line.section(" ", 1, 1).toInt(&ok));
       continue;
     }
+    if ( line.indexOf("ERROR:") == 0 ) {
+       lastError = line;
+       continue; 
+    }
     qDebug() << line;
   }
 }

Modified: pcbsd/current/src-qt4/pc-updategui/mainWin.h
===================================================================
--- pcbsd/current/src-qt4/pc-updategui/mainWin.h	2012-10-18 16:07:55 UTC (rev 19768)
+++ pcbsd/current/src-qt4/pc-updategui/mainWin.h	2012-10-18 20:55:36 UTC (rev 19769)
@@ -60,6 +60,7 @@
     QProcess *uProc;
     QList<QStringList> listUpdates;
     QString wDir, wIP;
+    QString lastError;
 
 signals:
 



More information about the Commits mailing list