[PC-BSD Commits] r1118 - pcbsd/trunk/kcmPBUsource
svn at pcbsd.org
svn at pcbsd.org
Wed Jan 9 08:20:08 PST 2008
Author: tim
Date: 2008-01-09 08:20:08 -0800 (Wed, 09 Jan 2008)
New Revision: 1118
Modified:
pcbsd/trunk/kcmPBUsource/kcm.cpp
pcbsd/trunk/kcmPBUsource/pbumain.ui
pcbsd/trunk/kcmPBUsource/pbumain.ui.h
Log:
Fixed bug #87 - Update configuration tool is now easier to understand. Also improved interface consistency.
Modified: pcbsd/trunk/kcmPBUsource/kcm.cpp
===================================================================
--- pcbsd/trunk/kcmPBUsource/kcm.cpp 2008-01-09 16:06:56 UTC (rev 1117)
+++ pcbsd/trunk/kcmPBUsource/kcm.cpp 2008-01-09 16:20:08 UTC (rev 1118)
@@ -59,6 +59,7 @@
void PCBSDKCModule::save()
{
pbuproc->saveCron();
+ pbuproc->UpdateStartupChanged();
}
void PCBSDKCModule::configChanged()
Modified: pcbsd/trunk/kcmPBUsource/pbumain.ui
===================================================================
--- pcbsd/trunk/kcmPBUsource/pbumain.ui 2008-01-09 16:06:56 UTC (rev 1117)
+++ pcbsd/trunk/kcmPBUsource/pbumain.ui 2008-01-09 16:20:08 UTC (rev 1118)
@@ -39,166 +39,51 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QRadioButton" row="1" column="0" rowspan="1" colspan="2">
+ <widget class="QLayoutWidget" row="3" column="0">
<property name="name">
- <cstring>updateRadio</cstring>
+ <cstring>layout2</cstring>
</property>
- <property name="text">
- <string>Check for updates</string>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- </widget>
- <widget class="QRadioButton" row="0" column="0" rowspan="1" colspan="2">
- <property name="name">
- <cstring>noUpdateRadio</cstring>
- </property>
- <property name="text">
- <string>Do not check for updates</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QButtonGroup" row="2" column="0" rowspan="1" colspan="2">
- <property name="name">
- <cstring>whenButtonGroup</cstring>
- </property>
- <property name="title">
- <string>When?</string>
- </property>
- <widget class="QRadioButton">
+ <hbox>
<property name="name">
- <cstring>dailyRadio</cstring>
+ <cstring>unnamed</cstring>
</property>
- <property name="geometry">
- <rect>
- <x>20</x>
- <y>30</y>
- <width>150</width>
- <height>24</height>
- </rect>
- </property>
- <property name="text">
- <string>Daily at:</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QRadioButton">
- <property name="name">
- <cstring>weeklyRadio</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>20</x>
- <y>60</y>
- <width>150</width>
- <height>24</height>
- </rect>
- </property>
- <property name="text">
- <string>Weekly on:</string>
- </property>
- </widget>
- <widget class="QComboBox">
- <item>
- <property name="text">
- <string>Sun</string>
+ <spacer>
+ <property name="name">
+ <cstring>spacer13</cstring>
</property>
- </item>
- <item>
- <property name="text">
- <string>Mon</string>
+ <property name="orientation">
+ <enum>Horizontal</enum>
</property>
- </item>
- <item>
- <property name="text">
- <string>Tue</string>
+ <property name="sizeType">
+ <enum>Expanding</enum>
</property>
- </item>
- <item>
- <property name="text">
- <string>Wed</string>
+ <property name="sizeHint">
+ <size>
+ <width>271</width>
+ <height>31</height>
+ </size>
</property>
- </item>
- <item>
- <property name="text">
- <string>Thur</string>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>checkButton</cstring>
</property>
- </item>
- <item>
- <property name="text">
- <string>Fri</string>
+ <property name="minimumSize">
+ <size>
+ <width>120</width>
+ <height>28</height>
+ </size>
</property>
- </item>
- <item>
<property name="text">
- <string>Sat</string>
+ <string>Check Now</string>
</property>
- </item>
- <property name="name">
- <cstring>dayComboBox</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>180</x>
- <y>60</y>
- <width>80</width>
- <height>26</height>
- </rect>
- </property>
- </widget>
- <widget class="QTimeEdit">
- <property name="name">
- <cstring>dailyTimeEdit</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>180</x>
- <y>30</y>
- <width>123</width>
- <height>26</height>
- </rect>
- </property>
- <property name="time">
- <time>
- <hour>9</hour>
- <minute>0</minute>
- <second>0</second>
- </time>
- </property>
- <property name="display">
- <set>AMPM|Minutes|Hours</set>
- </property>
- </widget>
- <widget class="QTimeEdit">
- <property name="name">
- <cstring>weeklyTimeEdit</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>270</x>
- <y>60</y>
- <width>123</width>
- <height>26</height>
- </rect>
- </property>
- <property name="time">
- <time>
- <hour>9</hour>
- <minute>0</minute>
- <second>0</second>
- </time>
- </property>
- <property name="display">
- <set>AMPM|Minutes|Hours</set>
- </property>
- </widget>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ </hbox>
</widget>
- <widget class="QCheckBox" row="3" column="0">
+ <widget class="QCheckBox" row="2" column="0">
<property name="name">
<cstring>checkUpdateStartup</cstring>
</property>
@@ -206,84 +91,124 @@
<string>Check for updates at system startup</string>
</property>
</widget>
- <spacer row="3" column="1">
+ <widget class="QButtonGroup" row="1" column="0">
<property name="name">
- <cstring>spacer7</cstring>
+ <cstring>whenButtonGroup</cstring>
</property>
- <property name="orientation">
- <enum>Vertical</enum>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
- <property name="sizeType">
- <enum>Fixed</enum>
+ <property name="title">
+ <string>When?</string>
</property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- <widget class="QLayoutWidget" row="4" column="0" rowspan="1" colspan="2">
- <property name="name">
- <cstring>layout1</cstring>
- </property>
- <hbox>
+ <grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QPushButton">
+ <widget class="QRadioButton" row="0" column="0">
<property name="name">
- <cstring>checkButton</cstring>
+ <cstring>dailyRadio</cstring>
</property>
- <property name="minimumSize">
- <size>
- <width>120</width>
- <height>28</height>
- </size>
+ <property name="text">
+ <string>Daily at:</string>
</property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>weeklyRadio</cstring>
+ </property>
<property name="text">
- <string>Check Now</string>
+ <string>Weekly on:</string>
</property>
- <property name="accel">
- <string></string>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <item>
+ <property name="text">
+ <string>Sun</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Mon</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Tue</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Wed</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Thur</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Fri</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Sat</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>dayComboBox</cstring>
</property>
</widget>
- <spacer>
+ <widget class="QTimeEdit" row="0" column="1" rowspan="1" colspan="2">
<property name="name">
- <cstring>spacer5</cstring>
+ <cstring>dailyTimeEdit</cstring>
</property>
- <property name="orientation">
- <enum>Horizontal</enum>
+ <property name="time">
+ <time>
+ <hour>9</hour>
+ <minute>0</minute>
+ <second>0</second>
+ </time>
</property>
- <property name="sizeType">
- <enum>Expanding</enum>
+ <property name="display">
+ <set>AMPM|Minutes|Hours</set>
</property>
- <property name="sizeHint">
- <size>
- <width>31</width>
- <height>20</height>
- </size>
+ </widget>
+ <widget class="QTimeEdit" row="1" column="2">
+ <property name="name">
+ <cstring>weeklyTimeEdit</cstring>
</property>
- </spacer>
- </hbox>
+ <property name="time">
+ <time>
+ <hour>9</hour>
+ <minute>0</minute>
+ <second>0</second>
+ </time>
+ </property>
+ <property name="display">
+ <set>AMPM|Minutes|Hours</set>
+ </property>
+ </widget>
+ </grid>
</widget>
- <spacer row="5" column="0">
+ <widget class="QCheckBox" row="0" column="0">
<property name="name">
- <cstring>spacer13</cstring>
+ <cstring>scheduledCheck</cstring>
</property>
- <property name="orientation">
- <enum>Vertical</enum>
+ <property name="text">
+ <string>Scheduled updates</string>
</property>
- <property name="sizeType">
- <enum>Maximum</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
+ </widget>
</grid>
</widget>
</grid>
@@ -311,7 +236,7 @@
<slot access="private">loadCron()</slot>
<slot>saveCron()</slot>
<slot access="private">checkNow()</slot>
- <slot access="private">UpdateStartupChanged()</slot>
+ <slot>UpdateStartupChanged()</slot>
</slots>
<functions>
<function access="private">checkStartupStatus()</function>
Modified: pcbsd/trunk/kcmPBUsource/pbumain.ui.h
===================================================================
--- pcbsd/trunk/kcmPBUsource/pbumain.ui.h 2008-01-09 16:06:56 UTC (rev 1117)
+++ pcbsd/trunk/kcmPBUsource/pbumain.ui.h 2008-01-09 16:20:08 UTC (rev 1118)
@@ -14,12 +14,11 @@
void PBUMain::ProgramInit()
{
- connect(noUpdateRadio, SIGNAL( clicked() ), this, SLOT(checkButtons() ) );
- connect(updateRadio, SIGNAL( clicked() ), this, SLOT(checkButtons() ) );
+ connect(scheduledCheck, SIGNAL( clicked() ), this, SLOT(checkButtons() ) );
connect(dailyRadio, SIGNAL( clicked() ), this, SLOT(checkButtons() ) );
connect(weeklyRadio, SIGNAL( clicked() ), this, SLOT(checkButtons() ) );
connect(checkButton, SIGNAL( clicked() ), this, SLOT(checkNow() ) );
- connect(checkUpdateStartup, SIGNAL( clicked() ), this, SLOT(UpdateStartupChanged() ) );
+ connect(checkUpdateStartup, SIGNAL( clicked() ), this, SLOT(checkButtons() ) );
loadCron();
checkButtons();
@@ -32,16 +31,10 @@
void PBUMain::checkButtons()
{
- if ( noUpdateRadio->isOn() )
+ if (! scheduledCheck->isChecked()) whenButtonGroup->setEnabled(false);
+ else
{
- dailyRadio->setEnabled(FALSE);
- weeklyRadio->setEnabled(FALSE);
- dailyTimeEdit->setEnabled(FALSE);
- weeklyTimeEdit->setEnabled(FALSE);
- dayComboBox->setEnabled(FALSE);
- } else {
- dailyRadio->setEnabled(TRUE);
- weeklyRadio->setEnabled(TRUE);
+ whenButtonGroup->setEnabled(true);
if ( dailyRadio->isOn() )
{
@@ -55,7 +48,7 @@
dayComboBox->setEnabled(TRUE);
weeklyTimeEdit->setEnabled(TRUE);
dailyTimeEdit->setEnabled(FALSE);
- }
+ }
}
emit changed();
@@ -78,8 +71,7 @@
line = stream.readLine(); // line of text excluding '\n'
if ( line.find("/PCBSD/Scripts/CheckUpdates.sh") != -1)
{
- noUpdateRadio->toggle();
- updateRadio->toggle();
+ scheduledCheck->setChecked(true);
Minutes = line.section("\t", 0, 0);
Hour = line.section("\t", 1, 1);
@@ -139,7 +131,7 @@
}
- if (updateRadio->isOn() )
+ if (scheduledCheck->isChecked())
{
if ( dailyRadio->isOn() )
{
@@ -214,14 +206,9 @@
void PBUMain::UpdateStartupChanged()
{
- QSettings settings;
- QString value;
+ QSettings settings;
+ QString value;
- if ( checkUpdateStartup->isChecked() )
- {
- settings.writeEntry("/PC-BSD/StartupUpdates", "0");
- } else {
- settings.writeEntry("/PC-BSD/StartupUpdates", "1");
- }
-
+ if (checkUpdateStartup->isChecked()) settings.writeEntry("/PC-BSD/StartupUpdates", "0");
+ else settings.writeEntry("/PC-BSD/StartupUpdates", "1");
}
More information about the Commits
mailing list