[PC-BSD Commits] r2908 - in pcbsd: branches/7.0/SystemUpdater trunk/SystemUpdater
svn at pcbsd.org
svn at pcbsd.org
Wed Oct 15 12:51:30 PDT 2008
Author: kris
Date: 2008-10-15 12:51:29 -0700 (Wed, 15 Oct 2008)
New Revision: 2908
Modified:
pcbsd/branches/7.0/SystemUpdater/UpdaterTray.cpp
pcbsd/branches/7.0/SystemUpdater/main.cpp
pcbsd/trunk/SystemUpdater/UpdaterTray.cpp
pcbsd/trunk/SystemUpdater/main.cpp
Log:
Updated a few more potential crashes in the System Updater tool, and make it a KUniqueApplication to prevent multiple copies from crashing into one another.
Modified: pcbsd/branches/7.0/SystemUpdater/UpdaterTray.cpp
===================================================================
--- pcbsd/branches/7.0/SystemUpdater/UpdaterTray.cpp 2008-10-15 19:22:41 UTC (rev 2907)
+++ pcbsd/branches/7.0/SystemUpdater/UpdaterTray.cpp 2008-10-15 19:51:29 UTC (rev 2908)
@@ -897,6 +897,7 @@
contextMenuRefresh();
// Hide the system updater tool
SystemUpdaterDialog->hide();
+ UpdaterStatusDialog->show();
// Clear out the reboot status flag
requiresSysReboot = 0;
@@ -940,6 +941,9 @@
if ( rebootFlag == 1 )
{
+ // Show the updater status dialog, so user can see any errors
+ UpdaterStatusDialog->show();
+
QMessageBox::warning( this->contextMenu(), tr("Online Update"), tr("One or more updates will require a reboot. You will be prompted to restart after the update is finished."), QMessageBox::Ok );
requiresSysReboot = 1;
}
@@ -1263,7 +1267,14 @@
connect( extractProc, SIGNAL(processExited()), this, SLOT(slotSysExtractFinished() ) );
if ( ! extractProc->start() ) {
+ // Show the updater status dialog, so user can see any errors
+ UpdaterStatusDialog->show();
+
QMessageBox::critical( this->contextMenu(), tr("Online Update"), tr("An error occured while extracting. Please try again later."), QMessageBox::Ok );
+ if ( UpdaterStatusDialog->isShown() )
+ {
+ UpdaterStatusDialog->hide();
+ }
exit(15);
}
@@ -1687,6 +1698,7 @@
contextMenuRefresh();
// Hide the system updater tool
SystemUpdaterDialog->hide();
+ UpdaterStatusDialog->show();
// Get our list of PBIs ready to be updated
@@ -1749,6 +1761,9 @@
// If the download failed with all 3 mirrors, issue an error
if ( attemptedRedownload == 3)
{
+ // Show the updater status dialog, so user can see any errors
+ UpdaterStatusDialog->show();
+
QMessageBox::critical( this->contextMenu(), tr("Online Update"), PBIProgName[currentWorkingPBI] + ": " + tr("An error occured while downloading. Please try again later."), QMessageBox::Ok );
// Set the status that this failed
Modified: pcbsd/branches/7.0/SystemUpdater/main.cpp
===================================================================
--- pcbsd/branches/7.0/SystemUpdater/main.cpp 2008-10-15 19:22:41 UTC (rev 2907)
+++ pcbsd/branches/7.0/SystemUpdater/main.cpp 2008-10-15 19:51:29 UTC (rev 2908)
@@ -1,7 +1,7 @@
#include <qtranslator.h>
#include <qtextcodec.h>
-#include <kapplication.h>
+#include <kuniqueapplication.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
@@ -22,14 +22,14 @@
aboutData.addAuthor(ki18n("Kris Moore"), ki18n("Current maintainer"), "kris at pcbsd.org");
- KCmdLineArgs::init(argc, argv, &aboutData);
+ KCmdLineArgs::init(argc, argv, &aboutData);
KCmdLineOptions options;
// Tell which options are supported
KCmdLineArgs::addCmdLineOptions( options );
- KApplication a;
+ KUniqueApplication a;
UpdaterTray tray;
a.setMainWidget(tray.contextMenu());
Modified: pcbsd/trunk/SystemUpdater/UpdaterTray.cpp
===================================================================
--- pcbsd/trunk/SystemUpdater/UpdaterTray.cpp 2008-10-15 19:22:41 UTC (rev 2907)
+++ pcbsd/trunk/SystemUpdater/UpdaterTray.cpp 2008-10-15 19:51:29 UTC (rev 2908)
@@ -897,6 +897,7 @@
contextMenuRefresh();
// Hide the system updater tool
SystemUpdaterDialog->hide();
+ UpdaterStatusDialog->show();
// Clear out the reboot status flag
requiresSysReboot = 0;
@@ -940,6 +941,9 @@
if ( rebootFlag == 1 )
{
+ // Show the updater status dialog, so user can see any errors
+ UpdaterStatusDialog->show();
+
QMessageBox::warning( this->contextMenu(), tr("Online Update"), tr("One or more updates will require a reboot. You will be prompted to restart after the update is finished."), QMessageBox::Ok );
requiresSysReboot = 1;
}
@@ -1263,7 +1267,14 @@
connect( extractProc, SIGNAL(processExited()), this, SLOT(slotSysExtractFinished() ) );
if ( ! extractProc->start() ) {
+ // Show the updater status dialog, so user can see any errors
+ UpdaterStatusDialog->show();
+
QMessageBox::critical( this->contextMenu(), tr("Online Update"), tr("An error occured while extracting. Please try again later."), QMessageBox::Ok );
+ if ( UpdaterStatusDialog->isShown() )
+ {
+ UpdaterStatusDialog->hide();
+ }
exit(15);
}
@@ -1687,6 +1698,7 @@
contextMenuRefresh();
// Hide the system updater tool
SystemUpdaterDialog->hide();
+ UpdaterStatusDialog->show();
// Get our list of PBIs ready to be updated
@@ -1749,6 +1761,9 @@
// If the download failed with all 3 mirrors, issue an error
if ( attemptedRedownload == 3)
{
+ // Show the updater status dialog, so user can see any errors
+ UpdaterStatusDialog->show();
+
QMessageBox::critical( this->contextMenu(), tr("Online Update"), PBIProgName[currentWorkingPBI] + ": " + tr("An error occured while downloading. Please try again later."), QMessageBox::Ok );
// Set the status that this failed
Modified: pcbsd/trunk/SystemUpdater/main.cpp
===================================================================
--- pcbsd/trunk/SystemUpdater/main.cpp 2008-10-15 19:22:41 UTC (rev 2907)
+++ pcbsd/trunk/SystemUpdater/main.cpp 2008-10-15 19:51:29 UTC (rev 2908)
@@ -1,7 +1,7 @@
#include <qtranslator.h>
#include <qtextcodec.h>
-#include <kapplication.h>
+#include <kuniqueapplication.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
@@ -22,14 +22,14 @@
aboutData.addAuthor(ki18n("Kris Moore"), ki18n("Current maintainer"), "kris at pcbsd.org");
- KCmdLineArgs::init(argc, argv, &aboutData);
+ KCmdLineArgs::init(argc, argv, &aboutData);
KCmdLineOptions options;
// Tell which options are supported
KCmdLineArgs::addCmdLineOptions( options );
- KApplication a;
+ KUniqueApplication a;
UpdaterTray tray;
a.setMainWidget(tray.contextMenu());
More information about the Commits
mailing list