[PC-BSD Commits] r4677 - pcbsd/trunk/lifePreserver

svn at pcbsd.org svn at pcbsd.org
Fri Oct 16 13:58:08 PDT 2009


Author: kris
Date: 2009-10-16 13:58:08 -0700 (Fri, 16 Oct 2009)
New Revision: 4677

Modified:
   pcbsd/trunk/lifePreserver/lifePreserverWizard.cpp
   pcbsd/trunk/lifePreserver/lifePreserverWizard.ui
Log:

Small update to lifePreserver, start fixing up the add wizard, and add beginnings of Solid interface



Modified: pcbsd/trunk/lifePreserver/lifePreserverWizard.cpp
===================================================================
--- pcbsd/trunk/lifePreserver/lifePreserverWizard.cpp	2009-10-16 17:20:35 UTC (rev 4676)
+++ pcbsd/trunk/lifePreserver/lifePreserverWizard.cpp	2009-10-16 20:58:08 UTC (rev 4677)
@@ -34,6 +34,9 @@
 #include "lifePreserverWizard.h"
 
 /* KDE */
+#include <solid/devicenotifier.h>
+#include <solid/device.h>
+#include <solid/storagedrive.h>
 
 
 void lifePreserverWizard::widgetInit()
@@ -41,10 +44,21 @@
    qDebug("Starting wizard...");
    setWindowModality ( Qt::WindowModal );
 
+   // Read our list of solid devices
+   foreach (Solid::Device device, Solid::Device::listFromType(Solid::DeviceInterface::StorageDrive, QString()))
+   {
+     Solid::StorageDrive *devint = device.as<Solid::StorageDrive>();
+     if ( devint->driveType() == Solid::StorageDrive::HardDisk || devint->driveType() == Solid::StorageDrive::MemoryStick)
+     comboDeviceSelect->addItem(device.product() + device.vendor() );
+   }
+
    // Connect our slots for complete status checking
    connect(this,SIGNAL(currentIdChanged(int)),this,SLOT(slotCheckComplete()));
    connect(radioSpecifyMount,SIGNAL(clicked()),this,SLOT(slotCheckComplete()));
    connect(radioSelectDevice,SIGNAL(clicked()),this,SLOT(slotCheckComplete()));
+   connect(radioDisable,SIGNAL(clicked()),this,SLOT(slotCheckComplete()));
+   connect(radioDaily,SIGNAL(clicked()),this,SLOT(slotCheckComplete()));
+   connect(radioWeekly,SIGNAL(clicked()),this,SLOT(slotCheckComplete()));
    connect(lineMountPoint,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckComplete()));
    connect(lineHostName,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckComplete()));
    connect(lineUserName,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckComplete()));
@@ -109,6 +123,29 @@
 {
    // Validate this page
    validatePage();
+
+   // Check if we need to enable / disable any stuff relating to automated backup selection
+   if ( radioDisable->isChecked() )
+   {
+       spinDailyHour->setEnabled(false);   
+       comboDailyTime->setEnabled(false);   
+       comboWeeklyDay->setEnabled(false);   
+       spinWeeklyHour->setEnabled(false);   
+       comboWeeklyTime->setEnabled(false);   
+   } else if (radioDaily->isChecked() ) {
+       spinDailyHour->setEnabled(true);   
+       comboDailyTime->setEnabled(true);   
+       comboWeeklyDay->setEnabled(false);   
+       spinWeeklyHour->setEnabled(false);   
+       comboWeeklyTime->setEnabled(false);   
+   } else {
+       spinDailyHour->setEnabled(false);   
+       comboDailyTime->setEnabled(false);   
+       comboWeeklyDay->setEnabled(true);   
+       spinWeeklyHour->setEnabled(true);   
+       comboWeeklyTime->setEnabled(true);   
+
+   }
 }
 
 void lifePreserverWizard::slotSelectKeyFile()

Modified: pcbsd/trunk/lifePreserver/lifePreserverWizard.ui
===================================================================
--- pcbsd/trunk/lifePreserver/lifePreserverWizard.ui	2009-10-16 17:20:35 UTC (rev 4676)
+++ pcbsd/trunk/lifePreserver/lifePreserverWizard.ui	2009-10-16 20:58:08 UTC (rev 4677)
@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>406</width>
+    <width>453</width>
     <height>277</height>
    </rect>
   </property>
@@ -434,158 +434,214 @@
       <property name="title">
        <string>Preserver Settings</string>
       </property>
-      <layout class="QGridLayout" name="gridLayout_6">
+      <layout class="QGridLayout" name="gridLayout_8">
        <item row="0" column="0">
-        <widget class="QRadioButton" name="radioDisable">
-         <property name="text">
-          <string>Disable automatic backups</string>
-         </property>
-         <property name="checked">
-          <bool>true</bool>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="0">
-        <layout class="QHBoxLayout" name="horizontalLayout_10">
-         <item>
-          <widget class="QRadioButton" name="radioDaily">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="text">
-            <string>Backup daily at</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QSpinBox" name="spinDailyHour">
-           <property name="minimum">
-            <number>1</number>
-           </property>
-           <property name="maximum">
-            <number>12</number>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QComboBox" name="comboDailyTime">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
+        <layout class="QGridLayout" name="gridLayout_6">
+         <item row="0" column="0">
+          <layout class="QHBoxLayout" name="horizontalLayout_10">
            <item>
-            <property name="text">
-             <string>AM</string>
-            </property>
+            <widget class="QRadioButton" name="radioDisable">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+             <property name="text">
+              <string>Disable automatic backups</string>
+             </property>
+             <property name="checked">
+              <bool>true</bool>
+             </property>
+            </widget>
            </item>
            <item>
-            <property name="text">
-             <string>PM</string>
-            </property>
+            <spacer name="horizontalSpacer_6">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
            </item>
-          </widget>
+          </layout>
          </item>
-        </layout>
-       </item>
-       <item row="2" column="0">
-        <layout class="QHBoxLayout" name="horizontalLayout_11">
-         <item>
-          <widget class="QRadioButton" name="radioWeekly">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="text">
-            <string>Backup weekly on</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QComboBox" name="comboBox">
+         <item row="1" column="0">
+          <layout class="QHBoxLayout" name="horizontalLayout_11">
            <item>
-            <property name="text">
-             <string>Monday</string>
-            </property>
+            <widget class="QRadioButton" name="radioDaily">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+             <property name="text">
+              <string>Backup daily at</string>
+             </property>
+            </widget>
            </item>
            <item>
-            <property name="text">
-             <string>Tuesday</string>
-            </property>
+            <spacer name="horizontalSpacer_5">
+             <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>
-            <property name="text">
-             <string>Wednesday</string>
-            </property>
+            <widget class="QSpinBox" name="spinDailyHour">
+             <property name="minimum">
+              <number>1</number>
+             </property>
+             <property name="maximum">
+              <number>12</number>
+             </property>
+            </widget>
            </item>
            <item>
-            <property name="text">
-             <string>Thursday</string>
-            </property>
+            <widget class="QComboBox" name="comboDailyTime">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+             <item>
+              <property name="text">
+               <string>AM</string>
+              </property>
+             </item>
+             <item>
+              <property name="text">
+               <string>PM</string>
+              </property>
+             </item>
+            </widget>
            </item>
+          </layout>
+         </item>
+         <item row="2" column="0">
+          <layout class="QHBoxLayout" name="horizontalLayout_12">
            <item>
-            <property name="text">
-             <string>Friday</string>
-            </property>
+            <widget class="QRadioButton" name="radioWeekly">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+             <property name="text">
+              <string>Backup weekly on</string>
+             </property>
+            </widget>
            </item>
            <item>
-            <property name="text">
-             <string>Saturday</string>
-            </property>
+            <spacer name="horizontalSpacer_7">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeType">
+              <enum>QSizePolicy::Preferred</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>17</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
            </item>
            <item>
-            <property name="text">
-             <string>Sunday</string>
-            </property>
+            <widget class="QComboBox" name="comboWeeklyDay">
+             <item>
+              <property name="text">
+               <string>Monday</string>
+              </property>
+             </item>
+             <item>
+              <property name="text">
+               <string>Tuesday</string>
+              </property>
+             </item>
+             <item>
+              <property name="text">
+               <string>Wednesday</string>
+              </property>
+             </item>
+             <item>
+              <property name="text">
+               <string>Thursday</string>
+              </property>
+             </item>
+             <item>
+              <property name="text">
+               <string>Friday</string>
+              </property>
+             </item>
+             <item>
+              <property name="text">
+               <string>Saturday</string>
+              </property>
+             </item>
+             <item>
+              <property name="text">
+               <string>Sunday</string>
+              </property>
+             </item>
+            </widget>
            </item>
-          </widget>
-         </item>
-         <item>
-          <widget class="QLabel" name="label_12">
-           <property name="text">
-            <string>at</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QSpinBox" name="spinWeeklyHour">
-           <property name="minimum">
-            <number>1</number>
-           </property>
-           <property name="maximum">
-            <number>12</number>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QComboBox" name="comboWeeklyTime">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
            <item>
-            <property name="text">
-             <string>AM</string>
-            </property>
+            <widget class="QLabel" name="label_12">
+             <property name="text">
+              <string>at</string>
+             </property>
+            </widget>
            </item>
            <item>
-            <property name="text">
-             <string>PM</string>
-            </property>
+            <widget class="QSpinBox" name="spinWeeklyHour">
+             <property name="minimum">
+              <number>1</number>
+             </property>
+             <property name="maximum">
+              <number>12</number>
+             </property>
+            </widget>
            </item>
-          </widget>
+           <item>
+            <widget class="QComboBox" name="comboWeeklyTime">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+             <item>
+              <property name="text">
+               <string>AM</string>
+              </property>
+             </item>
+             <item>
+              <property name="text">
+               <string>PM</string>
+              </property>
+             </item>
+            </widget>
+           </item>
+          </layout>
          </item>
         </layout>
        </item>
-       <item row="3" column="0">
+       <item row="1" column="0">
         <spacer name="verticalSpacer_3">
          <property name="orientation">
           <enum>Qt::Vertical</enum>



More information about the Commits mailing list