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

svn at pcbsd.org svn at pcbsd.org
Thu Dec 17 07:30:11 PST 2009


Author: kris
Date: 2009-12-17 07:30:11 -0800 (Thu, 17 Dec 2009)
New Revision: 5644

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

Added multiple selection support to the component lists



Modified: pcbsd/trunk/SysInstaller/sys-componentwidget.cpp
===================================================================
--- pcbsd/trunk/SysInstaller/sys-componentwidget.cpp	2009-12-17 15:15:06 UTC (rev 5643)
+++ pcbsd/trunk/SysInstaller/sys-componentwidget.cpp	2009-12-17 15:30:11 UTC (rev 5644)
@@ -32,12 +32,18 @@
   if ( ! listAvailComponents->currentItem() )
     return;
 
-  QString name = listAvailComponents->currentItem()->text();
-  name.truncate(name.indexOf(")"));
-  name = name.remove(0, name.indexOf(" (") + 2 );
-  for ( int i=0; i<listComponents.count(); ++i) {
-     if ( listComponents.at(i).at(0) == name )
-       listComponents[i][3] = "on";
+  for ( int z=0; z<listAvailComponents->count(); ++z)
+  {
+    if ( listAvailComponents->item(z)->isSelected() )
+    {
+      QString name = listAvailComponents->item(z)->text();
+      name.truncate(name.indexOf(")"));
+      name = name.remove(0, name.indexOf(" (") + 2 );
+      for ( int i=0; i<listComponents.count(); ++i) {
+         if ( listComponents.at(i).at(0) == name )
+           listComponents[i][3] = "on";
+      }
+    }
   }
 
   refreshComponents();
@@ -49,12 +55,19 @@
   if ( ! listSelComponents->currentItem() )
     return;
 
-  QString name = listSelComponents->currentItem()->text();
-  name.truncate(name.indexOf(")"));
-  name = name.remove(0, name.indexOf(" (") + 2 );
-  for ( int i=0; i<listComponents.count(); ++i) {
-     if ( listComponents.at(i).at(0) == name )
-       listComponents[i][3] = "off";
+
+  for ( int z=0; z<listSelComponents->count(); ++z)
+  {
+    if ( listSelComponents->item(z)->isSelected() )
+    {
+      QString name = listSelComponents->item(z)->text();
+      name.truncate(name.indexOf(")"));
+      name = name.remove(0, name.indexOf(" (") + 2 );
+      for ( int i=0; i<listComponents.count(); ++i) {
+         if ( listComponents.at(i).at(0) == name )
+           listComponents[i][3] = "off";
+      }
+    }
   }
 
   refreshComponents();

Modified: pcbsd/trunk/SysInstaller/sysinstaller.ui
===================================================================
--- pcbsd/trunk/SysInstaller/sysinstaller.ui	2009-12-17 15:15:06 UTC (rev 5643)
+++ pcbsd/trunk/SysInstaller/sysinstaller.ui	2009-12-17 15:30:11 UTC (rev 5644)
@@ -307,7 +307,7 @@
              <item>
               <widget class="QStackedWidget" name="anteInstallStack">
                <property name="currentIndex">
-                <number>4</number>
+                <number>6</number>
                </property>
                <widget class="QWidget" name="aiStep0">
                 <layout class="QGridLayout" name="gridLayout_10">
@@ -1953,6 +1953,42 @@
                    </property>
                   </spacer>
                  </item>
+                 <item row="0" column="2" rowspan="6">
+                  <spacer name="horizontalSpacer_22">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>112</width>
+                     <height>497</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item row="4" column="1">
+                  <spacer name="verticalSpacer_6">
+                   <property name="orientation">
+                    <enum>Qt::Vertical</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>518</width>
+                     <height>18</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item row="3" column="1">
+                  <widget class="QCheckBox" name="checkAutoLogon">
+                   <property name="text">
+                    <string>Auto-login User (The first user listed will be logged on automatically)</string>
+                   </property>
+                   <property name="checked">
+                    <bool>true</bool>
+                   </property>
+                  </widget>
+                 </item>
                  <item row="0" column="1">
                   <widget class="QGroupBox" name="groupBox">
                    <property name="title">
@@ -2002,19 +2038,6 @@
                    </layout>
                   </widget>
                  </item>
-                 <item row="0" column="2" rowspan="6">
-                  <spacer name="horizontalSpacer_22">
-                   <property name="orientation">
-                    <enum>Qt::Horizontal</enum>
-                   </property>
-                   <property name="sizeHint" stdset="0">
-                    <size>
-                     <width>112</width>
-                     <height>497</height>
-                    </size>
-                   </property>
-                  </spacer>
-                 </item>
                  <item row="1" column="1">
                   <widget class="QGroupBox" name="groupBox_2">
                    <property name="sizePolicy">
@@ -2213,29 +2236,6 @@
                    </layout>
                   </widget>
                  </item>
-                 <item row="3" column="1">
-                  <widget class="QCheckBox" name="checkAutoLogon">
-                   <property name="text">
-                    <string>Auto-login User (The first user listed will be logged on automatically)</string>
-                   </property>
-                   <property name="checked">
-                    <bool>true</bool>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="4" column="1">
-                  <spacer name="verticalSpacer_6">
-                   <property name="orientation">
-                    <enum>Qt::Vertical</enum>
-                   </property>
-                   <property name="sizeHint" stdset="0">
-                    <size>
-                     <width>518</width>
-                     <height>18</height>
-                    </size>
-                   </property>
-                  </spacer>
-                 </item>
                  <item row="5" column="1">
                   <widget class="QLabel" name="textAcctNotify">
                    <property name="styleSheet">
@@ -2255,7 +2255,6 @@
                 <zorder>groupBox_2</zorder>
                 <zorder>groupBox_3</zorder>
                 <zorder>textAcctNotify</zorder>
-                <zorder>footerWidget</zorder>
                </widget>
                <widget class="QWidget" name="aiStep5">
                 <layout class="QGridLayout" name="gridLayout_16">
@@ -2426,7 +2425,11 @@
                     </widget>
                    </item>
                    <item row="1" column="0">
-                    <widget class="QListWidget" name="listAvailComponents"/>
+                    <widget class="QListWidget" name="listAvailComponents">
+                     <property name="selectionMode">
+                      <enum>QAbstractItemView::MultiSelection</enum>
+                     </property>
+                    </widget>
                    </item>
                   </layout>
                  </item>
@@ -2545,7 +2548,11 @@
                     </widget>
                    </item>
                    <item row="1" column="0">
-                    <widget class="QListWidget" name="listSelComponents"/>
+                    <widget class="QListWidget" name="listSelComponents">
+                     <property name="selectionMode">
+                      <enum>QAbstractItemView::MultiSelection</enum>
+                     </property>
+                    </widget>
                    </item>
                   </layout>
                  </item>



More information about the Commits mailing list