[PC-BSD Commits] r6314 - pcbsd/trunk/SysInstaller

svn at pcbsd.org svn at pcbsd.org
Mon Mar 1 13:18:42 PST 2010


Author: kris
Date: 2010-03-01 13:18:42 -0800 (Mon, 01 Mar 2010)
New Revision: 6314

Modified:
   pcbsd/trunk/SysInstaller/dialogFileSystem.cpp
   pcbsd/trunk/SysInstaller/dialogFileSystem.h
   pcbsd/trunk/SysInstaller/dialogFileSystem.ui
Log:

Update to SysInstaller GUI

Started adding support for all the new ZFS options available in the backend, created new gui options for
selecting zpool type, additional devices, and specifying multiple mount-points

Not finished yet, still needs work to be fully integrated



Modified: pcbsd/trunk/SysInstaller/dialogFileSystem.cpp
===================================================================
--- pcbsd/trunk/SysInstaller/dialogFileSystem.cpp	2010-03-01 20:18:32 UTC (rev 6313)
+++ pcbsd/trunk/SysInstaller/dialogFileSystem.cpp	2010-03-01 21:18:42 UTC (rev 6314)
@@ -22,7 +22,9 @@
   connect(comboDiskSelection, SIGNAL(currentIndexChanged(int)), this, SLOT(slotDiskChanged(int)));
   connect(comboDiskType, SIGNAL(currentIndexChanged(int)), this, SLOT(slotTypeChanged(int)));
   connect(horizontalSizeSlider, SIGNAL(sliderMoved(int)), this, SLOT(slotSliderChangedValue(int)));
+  connect(horizontalSizeSliderZFS, SIGNAL(sliderMoved(int)), this, SLOT(slotSliderChangedValue(int)));
   connect(spinSize, SIGNAL(valueChanged(int)), this, SLOT(slotSpinBoxChanged(int)));
+  connect(spinSizeZFS, SIGNAL(valueChanged(int)), this, SLOT(slotSpinBoxChanged(int)));
 
 
   // Add the file-system types
@@ -44,6 +46,8 @@
   // Add the disks to the combobox
   addDisksSane();
 
+  // Add the available zpool items
+  populateZpoolList();
 
   // Check if we should enable the save slot
   slotCheckSanity();
@@ -98,7 +102,7 @@
   // Start adding / listing our disks / partitions available
   for (int i=0; i < sysDisks.count(); ++i) {
     // Make sure to only add the drives to the comboDiskList
-    if ( sysDisks.at(i).at(0) == "DRIVE" && diskNoExistingPartition(sysDisks.at(i).at(1)) ) {
+    if ( sysDisks.at(i).at(0) == "DRIVE" && diskNoExistingPartition(sysDisks.at(i).at(1)) && calculateFreeSpace(i) > 0 ) {
       availSize.setNum(calculateFreeSpace(i));
       desc = sysDisks.at(i).at(3);
       desc = desc.remove(0, 1);
@@ -106,7 +110,7 @@
       desc.truncate(20);
       comboDiskSelection->addItem(sysDisks.at(i).at(1) + " - " + sysDisks.at(i).at(2) + "MB (" + availSize + " Avail) " + desc);
       comboMirrorDisk->addItem(sysDisks.at(i).at(1) + " - " + sysDisks.at(i).at(2) + "MB " + sysDisks.at(i).at(3));
-    } else if ( sysDisks.at(i).at(0) == "SLICE" && sliceNoExistingDiskPartition(sysDisks.at(i).at(2) ) ) {
+    } else if ( sysDisks.at(i).at(0) == "SLICE" && sliceNoExistingDiskPartition(sysDisks.at(i).at(2) ) && calculateFreeSpace(i) > 0 ) {
       availSize.setNum(calculateFreeSpace(i));
       desc = sysDisks.at(i).at(4);
       if ( desc != "Unused Space") {
@@ -120,6 +124,50 @@
 
 }
 
+
+// Function to display the list of available drivces / partitions which can be added to this zpool
+void dialogFileSystem::populateZpoolList()
+{
+  QString availSize, desc;
+
+  // Figure out the current device
+  QString curDevice;
+
+    // Get the index
+  int sysIndex = getSysIndexFromCombo(comboDiskSelection->currentIndex());
+
+  if ( sysIndex == -1 )
+     return;
+
+  // Set our vars with Disk / Slice info, size, etc
+  if ( sysDisks.at(sysIndex).at(0) == "DRIVE")
+     curDevice = sysDisks.at(sysIndex).at(1);
+  else 
+     curDevice = sysDisks.at(sysIndex).at(1);
+
+
+  listZPoolDevices->clear();
+
+  // Start adding / listing our disks / partitions available
+  for (int i=0; i < sysDisks.count(); ++i) {
+    // Make sure to only add the drives to the comboDiskList
+    if ( sysDisks.at(i).at(0) == "DRIVE" \
+         && diskNoExistingPartition(sysDisks.at(i).at(1)) \
+         && curDevice != sysDisks.at(i).at(1) \
+         && calculateFreeSpace(i) > 0 ) {
+      availSize.setNum(calculateFreeSpace(i));
+      desc = sysDisks.at(i).at(3);
+      desc = desc.remove(0, 1);
+      desc.truncate(desc.size() -1);
+      desc.truncate(20);
+      
+      QListWidgetItem *zpoolDev = new QListWidgetItem(sysDisks.at(i).at(1) + " - " + sysDisks.at(i).at(2) + "MB (" + availSize + " Avail) " + desc, listZPoolDevices);
+      zpoolDev->setCheckState(Qt::Unchecked);
+
+    } 
+  }
+}
+
 // Public slot which lets us set if we are editing a partition, or creating a new one
 void dialogFileSystem::setEditing( int id )
 {
@@ -227,11 +275,15 @@
 {
   if ( comboDiskType->itemText(index) == "MIRROR" )
     stackedWidgetOptions->setCurrentIndex(1); 
+  else if (comboDiskType->itemText(index) == "ZFS" )
+    stackedWidgetOptions->setCurrentIndex(2); 
   else if (comboDiskType->itemText(index) == "SWAP" ) {
     stackedWidgetOptions->setCurrentIndex(0); 
     lineEditMount->setEnabled(false); 
+    lineEditMount->setVisible(false); 
   } else {
     stackedWidgetOptions->setCurrentIndex(0); 
+    lineEditMount->setVisible(true); 
     lineEditMount->setEnabled(true); 
   }
 
@@ -289,9 +341,16 @@
   horizontalSizeSlider->setMinimum(0);
   horizontalSizeSlider->setMaximum(maxsize);
   horizontalSizeSlider->setValue(maxsize);
+  horizontalSizeSliderZFS->setMinimum(0);
+  horizontalSizeSliderZFS->setMaximum(maxsize);
+  horizontalSizeSliderZFS->setValue(maxsize);
   spinSize->setRange(0, maxsize);
   spinSize->setValue(maxsize);
+  spinSizeZFS->setRange(0, maxsize);
+  spinSizeZFS->setValue(maxsize);
 
+  // Relist the zpools
+  populateZpoolList();
 }
 
 
@@ -299,12 +358,14 @@
 void dialogFileSystem::slotSliderChangedValue(int newVal)
 {
   spinSize->setValue(newVal);
+  spinSizeZFS->setValue(newVal);
 }
 
 // function which updates the spinbox when the user drags the slider
 void dialogFileSystem::slotSpinBoxChanged(int newVal)
 {
   horizontalSizeSlider->setValue(newVal);
+  horizontalSizeSliderZFS->setValue(newVal);
 }
 
 // Function which takes a combo index, and returns the associated sysDisk index

Modified: pcbsd/trunk/SysInstaller/dialogFileSystem.h
===================================================================
--- pcbsd/trunk/SysInstaller/dialogFileSystem.h	2010-03-01 20:18:32 UTC (rev 6313)
+++ pcbsd/trunk/SysInstaller/dialogFileSystem.h	2010-03-01 21:18:42 UTC (rev 6314)
@@ -35,6 +35,7 @@
 
 private:
     int getSysIndexFromCombo(int cIndex);
+    void populateZpoolList();
     void addEmit();
     bool diskNoExistingPartition(QString Device);
     bool sliceNoExistingDiskPartition(QString Device);

Modified: pcbsd/trunk/SysInstaller/dialogFileSystem.ui
===================================================================
--- pcbsd/trunk/SysInstaller/dialogFileSystem.ui	2010-03-01 20:18:32 UTC (rev 6313)
+++ pcbsd/trunk/SysInstaller/dialogFileSystem.ui	2010-03-01 21:18:42 UTC (rev 6314)
@@ -9,8 +9,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>371</width>
-    <height>320</height>
+    <width>362</width>
+    <height>543</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -37,6 +37,63 @@
    <item row="3" column="0">
     <widget class="QComboBox" name="comboDiskType"/>
    </item>
+   <item row="5" column="0">
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pushCancel">
+       <property name="text">
+        <string>&amp;Cancel</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_2">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pushSave">
+       <property name="text">
+        <string>&amp;Save</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_3">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
    <item row="4" column="0">
     <widget class="QStackedWidget" name="stackedWidgetOptions">
      <property name="currentIndex">
@@ -174,67 +231,169 @@
        </item>
       </layout>
      </widget>
+     <widget class="QWidget" name="page_3">
+      <layout class="QGridLayout" name="gridLayout_5">
+       <item row="0" column="0" colspan="2">
+        <layout class="QHBoxLayout" name="horizontalLayout_4">
+         <item>
+          <widget class="QLabel" name="label_8">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="text">
+            <string>Size:</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QSlider" name="horizontalSizeSliderZFS">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QSpinBox" name="spinSizeZFS">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_9">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="text">
+            <string>MB</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item row="1" column="0" colspan="2">
+        <widget class="QCheckBox" name="checkEncryptionZFS">
+         <property name="layoutDirection">
+          <enum>Qt::RightToLeft</enum>
+         </property>
+         <property name="text">
+          <string>Enable Encryption</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1">
+        <widget class="QLabel" name="label_11">
+         <property name="text">
+          <string>ZFS Pool Type</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="0">
+        <widget class="QLabel" name="labelStatus_2">
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="1">
+        <widget class="QComboBox" name="comboPoolType">
+         <item>
+          <property name="text">
+           <string>basic</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string notr="true">mirror</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string notr="true">raidz</string>
+          </property>
+         </item>
+        </widget>
+       </item>
+       <item row="4" column="1">
+        <widget class="QLabel" name="label_12">
+         <property name="text">
+          <string>Additional ZFS Pool Devices</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="1">
+        <widget class="QListWidget" name="listZPoolDevices"/>
+       </item>
+       <item row="6" column="1">
+        <layout class="QGridLayout" name="gridLayout_4">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_10">
+           <property name="text">
+            <string>ZFS File Systems / Mount Points</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="0">
+          <widget class="QListWidget" name="listZFSFileSystems"/>
+         </item>
+        </layout>
+       </item>
+       <item row="7" column="1">
+        <layout class="QHBoxLayout" name="horizontalLayout_5">
+         <item>
+          <spacer name="horizontalSpacer_4">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>118</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QPushButton" name="pushAddZFS">
+           <property name="text">
+            <string>Add</string>
+           </property>
+           <property name="icon">
+            <iconset resource="sysinstaller.qrc">
+             <normaloff>:/PCBSD/images/edit_add.png</normaloff>:/PCBSD/images/edit_add.png</iconset>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="pushRemoveZFS">
+           <property name="text">
+            <string>Remove</string>
+           </property>
+           <property name="icon">
+            <iconset resource="sysinstaller.qrc">
+             <normaloff>:/PCBSD/images/edit_remove.png</normaloff>:/PCBSD/images/edit_remove.png</iconset>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
     </widget>
    </item>
-   <item row="5" column="0">
-    <layout class="QHBoxLayout" name="horizontalLayout">
-     <item>
-      <spacer name="horizontalSpacer">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="pushCancel">
-       <property name="text">
-        <string>&amp;Cancel</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="horizontalSpacer_2">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="pushSave">
-       <property name="text">
-        <string>&amp;Save</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="horizontalSpacer_3">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
   </layout>
  </widget>
- <resources/>
+ <resources>
+  <include location="sysinstaller.qrc"/>
+ </resources>
  <connections/>
 </ui>



More information about the Commits mailing list