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

svn at pcbsd.org svn at pcbsd.org
Fri Nov 20 07:52:45 PST 2009


Author: kris
Date: 2009-11-20 07:52:45 -0800 (Fri, 20 Nov 2009)
New Revision: 5108

Modified:
   pcbsd/trunk/SysInstaller/sys-diskwidget.cpp
   pcbsd/trunk/SysInstaller/sysinstaller.cpp
   pcbsd/trunk/SysInstaller/sysinstaller.h
   pcbsd/trunk/SysInstaller/sysinstaller.ui
Log:

Updated SysInstaller, now custom partition auto-gen works, and updates the treeWidget
with info about the partition layout



Modified: pcbsd/trunk/SysInstaller/sys-diskwidget.cpp
===================================================================
--- pcbsd/trunk/SysInstaller/sys-diskwidget.cpp	2009-11-20 15:04:41 UTC (rev 5107)
+++ pcbsd/trunk/SysInstaller/sys-diskwidget.cpp	2009-11-20 15:52:45 UTC (rev 5108)
@@ -102,11 +102,6 @@
   }
 }
 
-// Slot which is called when the user clicks on a slice to select in basic view
-void SysInstaller::slotSliceListClicked()
-{
-}
-
 // Function which will auto-generate a partition layout based upon the target disk / slice
 bool SysInstaller::autoGenPartitionLayout(QString target, bool isDisk)
 {
@@ -124,7 +119,7 @@
 
   if ( isDisk ) {
     targetType = "DRIVE";
-    targetSlice = "all";
+    targetSlice = "ALL";
     targetDisk = target;
     targetLoc = 1;
   } else {
@@ -184,8 +179,45 @@
      sysFinalDiskLayout << fileSystem;
      fileSystem.clear();
 
+     // Update the custom widget with this partition information
+     slotRefreshCustomPartitionWidget();
+
      return true; 
   }
   
   return false;
 }
+
+
+// Function which will start the generation of auto-fs layout based upon selected disk up top
+void SysInstaller::slotPushAutoMountClicked()
+{
+  QString disk = comboDiskList->currentText();
+  disk.truncate(disk.indexOf(" -"));
+  autoGenPartitionLayout(disk, true); 
+
+}
+
+
+// Function which will refresh the custom partition widget based upon our sysFileDiskLayout
+void SysInstaller::slotRefreshCustomPartitionWidget()
+{
+  QStringList tmpList;
+  QString tmp;
+
+  treeWidgetCustomPartition->clear();
+  for (int i=0; i < sysFinalDiskLayout.count(); ++i) {
+      tmpList.clear();
+
+      // Start adding the disk items to our tree widget
+      if ( sysFinalDiskLayout.at(i).at(1) == "ALL" )
+        tmpList << tmp.setNum(i) << sysFinalDiskLayout.at(i).at(0) \
+        << sysFinalDiskLayout.at(i).at(2) << sysFinalDiskLayout.at(i).at(4) << sysFinalDiskLayout.at(i).at(3) ;
+      else 
+        tmpList << tmp.setNum(i) << sysFinalDiskLayout.at(i).at(0) + sysFinalDiskLayout.at(i).at(1) \
+        << sysFinalDiskLayout.at(i).at(2) << sysFinalDiskLayout.at(i).at(4) << sysFinalDiskLayout.at(i).at(3) ;
+
+      new QTreeWidgetItem(treeWidgetCustomPartition, tmpList);
+  }
+  
+}

Modified: pcbsd/trunk/SysInstaller/sysinstaller.cpp
===================================================================
--- pcbsd/trunk/SysInstaller/sysinstaller.cpp	2009-11-20 15:04:41 UTC (rev 5107)
+++ pcbsd/trunk/SysInstaller/sysinstaller.cpp	2009-11-20 15:52:45 UTC (rev 5108)
@@ -115,8 +115,12 @@
     connect(checkUseEntireDisk,SIGNAL(clicked()), this, SLOT(slotUseEntireDiskClicked()));
     connect(radioCustomDisk,SIGNAL(toggled(bool)), this, SLOT(slotChangeRadioCustomDisk()));
     connect(radioAutoPartition,SIGNAL(toggled(bool)), this, SLOT(slotChangeRadioCustomDisk()));
-    connect(listDiskSlices,SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(slotSliceListClicked()));
+    connect(pushAutoMount,SIGNAL(clicked()), this, SLOT(slotPushAutoMountClicked()));
 
+
+    // Hide the ID part of our custom treeWidget
+    treeWidgetCustomPartition->setColumnHidden(0, true);
+
     setKbDefaults();
 
     // Hide the network options until the user selects it
@@ -180,10 +184,7 @@
 
 void SysInstaller::slotNext()
 {
-   bool goforward;
-   goforward = true;
    if ( stackWidget->currentIndex() == 3 && ! checkDiskRequirements()) {
-     goforward = false;
      int minsize;
      QString tmp;
      if ( radioInstallPCBSD->isChecked() )
@@ -195,6 +196,7 @@
            tr("This install requires a disk/slice with at least") \
            + " " + tmp.setNum(minsize) + "MB " + tr("of disk space."),
            QMessageBox::Ok);
+      return;
    }
 
    // Check if we are on the disk page, and using auto-partitioning, and set it up if so
@@ -203,17 +205,16 @@
       if ( checkUseEntireDisk->isChecked() ) {
         QString disk = comboDiskList->currentText();
         disk.truncate(disk.indexOf(" -"));
-        if ( ! autoGenPartitionLayout(disk, true) ) goforward = false;
+        if ( ! autoGenPartitionLayout(disk, true) ) return;
       } else {
         QString slice = listDiskSlices->currentItem()->text();
         slice.truncate(slice.indexOf(":"));
-        if ( ! autoGenPartitionLayout(slice, false) ) goforward = false;
+        if ( ! autoGenPartitionLayout(slice, false) ) return;
       }
    }
 
 
-   if (goforward)
-      proceed(true);
+   proceed(true);
 }
 
 void SysInstaller::slotBack()

Modified: pcbsd/trunk/SysInstaller/sysinstaller.h
===================================================================
--- pcbsd/trunk/SysInstaller/sysinstaller.h	2009-11-20 15:04:41 UTC (rev 5107)
+++ pcbsd/trunk/SysInstaller/sysinstaller.h	2009-11-20 15:52:45 UTC (rev 5108)
@@ -73,7 +73,8 @@
     void slotChangedDisk();
     void slotUseEntireDiskClicked();
     void slotChangeRadioCustomDisk();
-    void slotSliceListClicked();
+    void slotRefreshCustomPartitionWidget(); // Slot which refreshes the custom partition view
+    void slotPushAutoMountClicked(); // Slot when user clicks to auto-create partitions in custom view
 
 private:
     void initSteps();

Modified: pcbsd/trunk/SysInstaller/sysinstaller.ui
===================================================================
--- pcbsd/trunk/SysInstaller/sysinstaller.ui	2009-11-20 15:04:41 UTC (rev 5107)
+++ pcbsd/trunk/SysInstaller/sysinstaller.ui	2009-11-20 15:52:45 UTC (rev 5108)
@@ -1466,7 +1466,12 @@
                         </widget>
                        </item>
                        <item row="1" column="0">
-                        <widget class="QListWidget" name="listDiskSlices"/>
+                        <widget class="QListWidget" name="listDiskSlices">
+                         <property name="styleSheet">
+                          <string notr="true">selection-background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(86, 130, 150, 255), stop:1 rgba(199, 199, 199, 255));
+selection-color: rgb(255, 255, 255);</string>
+                         </property>
+                        </widget>
                        </item>
                        <item row="2" column="0">
                         <spacer name="verticalSpacer_2">
@@ -1591,7 +1596,7 @@
                         </widget>
                        </item>
                        <item>
-                        <widget class="QTreeWidget" name="treeWidget">
+                        <widget class="QTreeWidget" name="treeWidgetCustomPartition">
                          <property name="styleSheet">
                           <string>selection-background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(86, 130, 150, 255), stop:1 rgba(199, 199, 199, 255));
 selection-color: rgb(255, 255, 255);</string>
@@ -1604,6 +1609,11 @@
                          </property>
                          <column>
                           <property name="text">
+                           <string>ID</string>
+                          </property>
+                         </column>
+                         <column>
+                          <property name="text">
                            <string>Slice</string>
                           </property>
                          </column>



More information about the Commits mailing list