warn about system upgrade, minor fixes, code cleanup
[fapman] / mainwindow.cpp
index 5e01956..036d6ee 100644 (file)
@@ -351,6 +351,7 @@ void MainWindow::operationQueueFinished(QList<AAptInterface::interfaceMode> last
                if( inst.count()>0 )
                        pkglist += QString("Total download size: %L1 kB<br>").arg(total_dl_size);
                bool mismatch = false;
+               bool warn_system_package = false;
 
                if( remv.count()>0 ) {
                        pkglist += "<br><b><u>REMOVE:</u></b><br><font size=\"-1\">";
@@ -362,6 +363,11 @@ void MainWindow::operationQueueFinished(QList<AAptInterface::interfaceMode> last
                                        pkglist += "<font color=\"red\">***UNKNOWN***</font>";
                                        mismatch = true;
                                }
+#ifdef Q_WS_MAEMO_5
+                               if( pkg && pkg->maemoDisplayName()=="Maemo 5" ) {
+                                       warn_system_package = true;
+                               }
+#endif
                                if( remvver.count()>i ) {
                                        pkglist += " " + remvver.at(i);
                                        if( pkg && remvver.at(i) != pkg->version() ) {
@@ -393,6 +399,11 @@ void MainWindow::operationQueueFinished(QList<AAptInterface::interfaceMode> last
                                        pkglist += "<font color=\"red\">***BLACKLISTED***</font>";
                                        installing_blacklisted = true;
                                }
+#ifdef Q_WS_MAEMO_5
+                               if( pkg && pkg->maemoDisplayName()=="Maemo 5" ) {
+                                       warn_system_package = true;
+                               }
+#endif
                                if( instver.count()>i ) {
                                        pkglist += " " + instver.at(i);
                                        if( pkg && instver.at(i) != pkg->version() ) {
@@ -420,6 +431,12 @@ void MainWindow::operationQueueFinished(QList<AAptInterface::interfaceMode> last
                        b.setText("Warning","Blacklisted package(s) will be installed");
                        b.exec();
                }
+               if( warn_system_package ) {
+                       ConfirmDialog s(false, this);
+                       s.setText("Warning","You are trying to perform an operation on a critical system package. This is an operation which has not been tested and " \
+                                         "it is unknown whether it will succeed or result in a horrible failure. You have been warned.");
+                       s.exec();
+               }
 
                busyDialog(false);
                ConfirmDialog d(true, this);
@@ -469,6 +486,10 @@ void MainWindow::operationQueueFinished(QList<AAptInterface::interfaceMode> last
                } else {
 #ifdef Q_WS_MAEMO_5
                        QMaemo5InformationBox::information(0, text, QMaemo5InformationBox::NoTimeout);
+#else
+                       ConfirmDialog d(false, this);
+                       d.setText(title,msgs.join("<br>"));
+                       d.exec();
 #endif
                }