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

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/quicklaunch
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2008-11-15 22:25:47
Message-ID: 1226787947.965506.785.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 884825 by aseigo:

* prettify the config dialog
* hide the dialog row settings; a bit overconfig
* only refactor the ui if things changed


 M  +29 -8     quicklaunchApplet.cpp  
 M  +40 -5     quicklaunchConfig.ui  


--- trunk/KDE/kdebase/workspace/plasma/applets/quicklaunch/quicklaunchApplet.cpp #884824:884825
@@ -255,21 +255,42 @@
     connect(parent, SIGNAL(accepted()), SLOT(configAccepted()));
     uiConfig.rowCount->setValue(m_rowCount);
     uiConfig.dialogRowCount->setValue(m_dialogRowCount);
+    uiConfig.dialogRowCount->hide();
+    uiConfig.dialogrowLabel->hide();
     uiConfig.icons->setValue(m_visibleIcons);
     parent->addPage(widget, parent->windowTitle());
 }
 
 void QuicklaunchApplet::configAccepted()
 {
-    m_rowCount = uiConfig.rowCount->value();
-    m_visibleIcons = uiConfig.icons->value();
-    m_dialogRowCount = uiConfig.dialogRowCount->value();
+    bool changed = false;
+    int temp = uiConfig.rowCount->value();
+
     KConfigGroup cg = config();
-    cg.writeEntry("rowCount", m_rowCount);
-    cg.writeEntry("dialogRowCount", m_dialogRowCount);
-    cg.writeEntry("visibleIcons", m_visibleIcons);
-    emit configNeedsSaving();
-    refactorUi();
+    if (temp != m_rowCount) {
+        m_rowCount = temp;
+        cg.writeEntry("rowCount", m_rowCount);
+        changed = true;
+    }
+
+    temp = uiConfig.icons->value();
+    if (temp != m_visibleIcons) {
+        m_visibleIcons = temp;
+        cg.writeEntry("visibleIcons", m_visibleIcons);
+        changed = true;
+    }
+
+    temp = uiConfig.dialogRowCount->value();
+    if (temp != m_dialogRowCount) {
+        m_dialogRowCount = temp;
+        cg.writeEntry("dialogRowCount", m_dialogRowCount);
+        changed = true;
+    }
+
+    if (changed) {
+        emit configNeedsSaving();
+        refactorUi();
+    }
 }
 
 QList<QAction*> QuicklaunchApplet::contextActions(QuicklaunchIcon *icon)
--- trunk/KDE/kdebase/workspace/plasma/applets/quicklaunch/quicklaunchConfig.ui #884824:884825
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>272</width>
-    <height>91</height>
+    <width>219</width>
+    <height>109</height>
    </rect>
   </property>
   <property name="windowTitle" >
@@ -19,15 +19,21 @@
    <item row="1" column="0" >
     <widget class="QLabel" name="lblRowNums" >
      <property name="text" >
-      <string>Maximum number of rows:</string>
+      <string>Maximum Rows:</string>
      </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
     </widget>
    </item>
    <item row="3" column="0" >
-    <widget class="QLabel" name="label_2" >
+    <widget class="QLabel" name="dialogrowLabel" >
      <property name="text" >
-      <string>Maximum number of rows in the dialog:</string>
+      <string>Rows in the dialog:</string>
      </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
     </widget>
    </item>
    <item row="3" column="1" >
@@ -45,6 +51,9 @@
      <property name="text" >
       <string>Visible icons:</string>
      </property>
+     <property name="alignment" >
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
     </widget>
    </item>
    <item row="0" column="1" >
@@ -85,6 +94,32 @@
      </property>
     </widget>
    </item>
+   <item row="1" column="2" >
+    <spacer name="horizontalSpacer" >
+     <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 row="4" column="0" >
+    <spacer name="verticalSpacer" >
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0" >
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
   </layout>
  </widget>
  <resources/>
[prev in list] [next in list] [prev in thread] [next in thread] 

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