[PC-BSD Commits] r7769 - pcbsd/current/src-qt4/pc-sysmanager

svn at pcbsd.org svn at pcbsd.org
Sat Oct 9 09:22:14 PDT 2010


Author: kris
Date: 2010-10-09 09:22:14 -0700 (Sat, 09 Oct 2010)
New Revision: 7769

Modified:
   pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp
   pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h
Log:

Implement checking when trying to change meta-pkgs, make sure the user has
A desktop of some type still. 



Modified: pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp	2010-10-09 14:24:28 UTC (rev 7768)
+++ pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp	2010-10-09 16:22:14 UTC (rev 7769)
@@ -228,18 +228,14 @@
      else { saveValue("/boot/loader.conf", "beastie_disable=", "beastie_disable=\"NO\""); }
      saveValue("/boot/loader.conf", "autoboot_delay=", "autoboot_delay=\"" + QString::number(autobootDelay) + "\"");
     
-    showRebootRequired();
-    
 }
 
 
 
 void PBSystemTab::showRebootRequired()
 {
-    
     QMessageBox::information( this, "PC-BSD Notification",
     "Settings Updated!\n You must reboot for changes to take effect!" );
-
 }
 
 
@@ -619,7 +615,10 @@
 }
 
 void PBSystemTab::slotSave() {
+    miscSavePressed();
+    saveKernScreen();
     saveMirrorConfig();
+    saveMetaPkgs();
 }
 
 void PBSystemTab::saveMirrorConfig() {
@@ -808,3 +807,28 @@
   return metaPkgs;
 }
 
+void PBSystemTab::saveMetaPkgs()
+{
+	if ( ! haveAMetaDesktop() )
+		return;
+}
+
+bool PBSystemTab::haveAMetaDesktop()
+{
+        QTreeWidgetItemIterator it(treeMetaPkgs);
+        while (*it) {
+         if ((*it)->checkState(0) == Qt::Checked )
+	   for (int z=0; z < metaPkgList.count(); ++z)
+	     if ( (*it)->text(0) == metaPkgList.at(z).at(0) && metaPkgList.at(z).at(4) == "YES" )
+		return true;
+         ++it;
+        }
+
+        QMessageBox::warning(this, tr("No Desktop"),
+          tr("No desktops have been selected! Please choose at least one desktop before saving."),
+          QMessageBox::Ok,
+          QMessageBox::Ok);
+
+	return false;
+
+}

Modified: pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h	2010-10-09 14:24:28 UTC (rev 7768)
+++ pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h	2010-10-09 16:22:14 UTC (rev 7769)
@@ -142,6 +142,8 @@
     QList<QStringList> getPackageData();
     QList<QStringList> metaPkgList;
     bool isMetaPkgInstalled(QString mPkg);
+    bool haveAMetaDesktop();
+    void saveMetaPkgs();
 
     updaterStatus *UpdaterStatusDialog;
     



More information about the Commits mailing list