[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kcm-grub2] /: Fix a small glitch.
From:       Konstantinos Smanis <konstantinos.smanis () gmail ! com>
Date:       2013-10-01 20:39:47
Message-ID: E1VR6jT-0007o7-Fu () scm ! kde ! org
[Download RAW message or body]

Git commit 9eb649d27310e759e80e9ba55691656e67cfabfd by Konstantinos Smanis.
Committed on 01/10/2013 at 20:37.
Pushed by ksmanis into branch 'master'.

Fix a small glitch.

The timeout spinbox was not properly disabled. Moved the signal/slot
connections from the .ui file to the source files where they belong and
we have better control.

M  +15   -0    src/kcm_grub2.cpp
M  +2    -0    src/kcm_grub2.h
M  +5    -83   ui/kcm_grub2.ui

http://commits.kde.org/kcm-grub2/9eb649d27310e759e80e9ba55691656e67cfabfd

diff --git a/src/kcm_grub2.cpp b/src/kcm_grub2.cpp
index 48f9269..56e0466 100644
--- a/src/kcm_grub2.cpp
+++ b/src/kcm_grub2.cpp
@@ -528,6 +528,11 @@ void KCMGRUB2::slotGrubSavedefaultChanged()
     m_dirtyBits.setBit(grubSavedefaultDirty);
     emit changed(true);
 }
+void KCMGRUB2::slotGrubHiddenTimeoutToggled(bool checked)
+{
+    ui->spinBox_hiddenTimeout->setEnabled(checked);
+    ui->checkBox_hiddenTimeoutShowTimer->setEnabled(checked);
+}
 void KCMGRUB2::slotGrubHiddenTimeoutChanged()
 {
     m_dirtyBits.setBit(grubHiddenTimeoutDirty);
@@ -538,6 +543,12 @@ void KCMGRUB2::slotGrubHiddenTimeoutQuietChanged()
     m_dirtyBits.setBit(grubHiddenTimeoutQuietDirty);
     emit changed(true);
 }
+void KCMGRUB2::slotGrubTimeoutToggled(bool checked)
+{
+    ui->radioButton_timeout0->setEnabled(checked);
+    ui->radioButton_timeout->setEnabled(checked);
+    ui->spinBox_timeout->setEnabled(checked && \
ui->radioButton_timeout->isChecked()); +}
 void KCMGRUB2::slotGrubTimeoutChanged()
 {
     m_dirtyBits.setBit(grubTimeoutDirty);
@@ -882,11 +893,15 @@ void KCMGRUB2::setupConnections()
     connect(ui->kpushbutton_remove, SIGNAL(clicked(bool)), this, \
                SLOT(slotRemoveOldEntries()));
     connect(ui->checkBox_savedefault, SIGNAL(clicked(bool)), this, \
SLOT(slotGrubSavedefaultChanged()));  
+    connect(ui->checkBox_hiddenTimeout, SIGNAL(toggled(bool)), this, \
                SLOT(slotGrubHiddenTimeoutToggled(bool)));
     connect(ui->checkBox_hiddenTimeout, SIGNAL(clicked(bool)), this, \
                SLOT(slotGrubHiddenTimeoutChanged()));
     connect(ui->spinBox_hiddenTimeout, SIGNAL(valueChanged(int)), this, \
                SLOT(slotGrubHiddenTimeoutChanged()));
     connect(ui->checkBox_hiddenTimeoutShowTimer, SIGNAL(clicked(bool)), this, \
SLOT(slotGrubHiddenTimeoutQuietChanged())); +
+    connect(ui->checkBox_timeout, SIGNAL(toggled(bool)), this, \
                SLOT(slotGrubTimeoutToggled(bool)));
     connect(ui->checkBox_timeout, SIGNAL(clicked(bool)), this, \
                SLOT(slotGrubTimeoutChanged()));
     connect(ui->radioButton_timeout0, SIGNAL(clicked(bool)), this, \
SLOT(slotGrubTimeoutChanged())); +    connect(ui->radioButton_timeout, \
                SIGNAL(toggled(bool)), ui->spinBox_timeout, SLOT(setEnabled(bool)));
     connect(ui->radioButton_timeout, SIGNAL(clicked(bool)), this, \
                SLOT(slotGrubTimeoutChanged()));
     connect(ui->spinBox_timeout, SIGNAL(valueChanged(int)), this, \
SLOT(slotGrubTimeoutChanged()));  
diff --git a/src/kcm_grub2.h b/src/kcm_grub2.h
index 998cf64..605029f 100644
--- a/src/kcm_grub2.h
+++ b/src/kcm_grub2.h
@@ -50,8 +50,10 @@ public:
 private Q_SLOTS:
     void slotRemoveOldEntries();
     void slotGrubSavedefaultChanged();
+    void slotGrubHiddenTimeoutToggled(bool checked);
     void slotGrubHiddenTimeoutChanged();
     void slotGrubHiddenTimeoutQuietChanged();
+    void slotGrubTimeoutToggled(bool checked);
     void slotGrubTimeoutChanged();
     void slotGrubDisableRecoveryChanged();
     void slotMemtestChanged();
diff --git a/ui/kcm_grub2.ui b/ui/kcm_grub2.ui
index 212260f..24acc06 100644
--- a/ui/kcm_grub2.ui
+++ b/ui/kcm_grub2.ui
@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>494</width>
+    <width>492</width>
     <height>507</height>
    </rect>
   </property>
@@ -151,6 +151,9 @@
                   <property name="text">
                    <string comment="@option:radio">After:</string>
                   </property>
+                  <property name="checked">
+                   <bool>true</bool>
+                  </property>
                  </widget>
                 </item>
                 <item row="0" column="1">
@@ -669,86 +672,5 @@
   </customwidget>
  </customwidgets>
  <resources/>
- <connections>
-  <connection>
-   <sender>checkBox_hiddenTimeout</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>checkBox_hiddenTimeoutShowTimer</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>82</x>
-     <y>166</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>89</x>
-     <y>200</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>checkBox_hiddenTimeout</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>spinBox_hiddenTimeout</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>129</x>
-     <y>165</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>188</x>
-     <y>163</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>checkBox_timeout</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>radioButton_timeout0</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>48</x>
-     <y>216</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>86</x>
-     <y>243</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>checkBox_timeout</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>radioButton_timeout</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>33</x>
-     <y>221</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>97</x>
-     <y>267</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>radioButton_timeout</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>spinBox_timeout</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>110</x>
-     <y>276</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>158</x>
-     <y>276</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
+ <connections/>
 </ui>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic