[PC-BSD Commits] r21876 - pcbsd/current/src-qt4/pc-installgui

svn at pcbsd.org svn at pcbsd.org
Fri Mar 15 02:14:47 PDT 2013


Author: kris
Date: 2013-03-15 09:14:47 +0000 (Fri, 15 Mar 2013)
New Revision: 21876

Modified:
   pcbsd/current/src-qt4/pc-installgui/wizardDisk.cpp
   pcbsd/current/src-qt4/pc-installgui/wizardDisk.h
Log:

Add ability to adjust ZFS swap size via the GUI



Modified: pcbsd/current/src-qt4/pc-installgui/wizardDisk.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-installgui/wizardDisk.cpp	2013-03-15 08:59:54 UTC (rev 21875)
+++ pcbsd/current/src-qt4/pc-installgui/wizardDisk.cpp	2013-03-15 09:14:47 UTC (rev 21876)
@@ -768,8 +768,11 @@
     // End of UFS options
   } else {
     // No options to change for /swap
-    if ( treeMounts->currentItem()->text(1) == "/swap" )
+    if ( treeMounts->currentItem()->text(1) == "/swap" ) {
+      popup->addAction( "Change size", this, SLOT(slotZSwapSize()));
+      popup->exec( QCursor::pos() );
       return;
+    }
 
     // Create atime sub-menu
     popupAT = popup->addMenu("atime");
@@ -876,6 +879,21 @@
   toggleZFSOpt(QString("atime=on"));
 }
 
+void wizardDisk::slotZSwapSize()
+{
+  bool ok;
+  QString tmp;
+  int size = QInputDialog::getInt(this, tr("Enter SWAP size"),
+                                  tr("Size (MB)"), 2048, 0, 1000000, 1, &ok);
+  if ( ok )
+  {
+    tmp.setNum(size);
+    QString optString = "volsize=" + tmp + "M|org.freebsd:swap=on|checksum=off";
+    treeMounts->currentItem()->setText(2, optString);
+    treeMounts->currentItem()->setToolTip(2, optString);
+  }
+}
+
 void wizardDisk::slotZATOFF()
 {
   toggleZFSOpt(QString("atime=off"));

Modified: pcbsd/current/src-qt4/pc-installgui/wizardDisk.h
===================================================================
--- pcbsd/current/src-qt4/pc-installgui/wizardDisk.h	2013-03-15 08:59:54 UTC (rev 21875)
+++ pcbsd/current/src-qt4/pc-installgui/wizardDisk.h	2013-03-15 09:14:47 UTC (rev 21876)
@@ -56,6 +56,7 @@
     void slotZEXON();
     void slotZEXOFF();
     void slotUEnc();
+    void slotZSwapSize();
 
 private:
     void populateDiskInfo();



More information about the Commits mailing list