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

List:       kde-panel-devel
Subject:    Re: Pager Configuration Dialog
From:       "Ignat Semenov" <ragnarokk91 () gmail ! com>
Date:       2010-05-23 11:00:19
Message-ID: op.vc5nitx1ybqwlo () localhost ! localdomain
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Patch version 2.

Regards,
Ignat
[Attachment #5 (multipart/related)]

[Attachment #7 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
<HEAD></HEAD>
<BODY style="font-family:'DejaVu Sans Mono'; font-size:12px"><DIV>Patch version \
2.<BR></DIV><DIV><BR></DIV><DIV>Regards,</DIV><DIV>Ignat</DIV></BODY></HTML>


["new_non_expanding.patch" (new_non_expanding.patch)]

Index: pager.h
===================================================================
--- pager.h	(revision 1129541)
+++ pager.h	(working copy)
@@ -123,8 +123,9 @@
         Ui::pagerConfig ui;
         enum DisplayedText
         {
+
+            Name,
             Number,
-            Name,
             None
         };
 
Index: pager.cpp
===================================================================
--- pager.cpp	(revision 1129541)
+++ pager.cpp	(working copy)
@@ -286,25 +286,14 @@
 {
     QWidget *widget = new QWidget();
     ui.setupUi(widget);
+    widget->setLayout(ui.verticalLayout);
     parent->addPage(widget, i18n("General"), icon());
     connect(parent, SIGNAL(applyClicked()), this, SLOT(configAccepted()));
     connect(parent, SIGNAL(okClicked()), this, SLOT(configAccepted()));
     connect(ui.configureDesktopsButton, SIGNAL(clicked()), SLOT(slotConfigureDesktop()));
 
-    switch (m_displayedText){
-        case Number:
-            ui. desktopNumberRadioButton->setChecked(true);
-            break;
+    ui.displayTextComboBox->setCurrentIndex((int)m_displayedText);
 
-        case Name:
-            ui.desktopNameRadioButton->setChecked(true);
-            break;
-
-        case None:
-            ui.displayNoneRadioButton->setChecked(true);
-            break;
-    }
-
     ui.showWindowIconsCheckBox->setChecked(m_showWindowIcons);
     if (formFactor() == Plasma::Vertical) {
         ui.labelRows->setText(i18n("Number of columns:"));
@@ -314,19 +303,8 @@
     }
     ui.spinRows->setMaximum(m_desktopCount);
 
-    switch (m_currentDesktopSelected){
-        case DoNothing:
-            ui.doNothingRadioButton->setChecked(true);
-            break;
+    ui.selectDesktopComboBox->setCurrentIndex((int)m_currentDesktopSelected);
 
-        case ShowDesktop:
-            ui.showDesktopRadioButton->setChecked(true);
-            break;
-
-        case ShowDashboard:
-            ui.showDashboardRadioButton->setChecked(true);
-            break;
-    }
 }
 
 void Pager::recalculateGeometry()
@@ -556,15 +534,8 @@
 
     DisplayedText displayedText;
 
-    if (ui.desktopNumberRadioButton->isChecked()) {
-        displayedText = Number;
+    displayedText = (DisplayedText)ui.displayTextComboBox->currentIndex();
 
-    } else if (ui.desktopNameRadioButton->isChecked()) {
-        displayedText = Name;
-    } else {
-        displayedText = None;
-    }
-
     if ((int)m_displayedText != (int)displayedText) {
         m_displayedText = displayedText;
         cg.writeEntry("displayedText", (int)m_displayedText);
@@ -579,13 +550,7 @@
 
     CurrentDesktopSelected currentDesktopSelected;
 
-    if (ui.doNothingRadioButton->isChecked()) {
-        currentDesktopSelected = DoNothing;
-    } else if (ui.showDesktopRadioButton->isChecked()) {
-        currentDesktopSelected = ShowDesktop;
-    } else {
-        currentDesktopSelected = ShowDashboard;
-    }
+    currentDesktopSelected = (CurrentDesktopSelected)ui.selectDesktopComboBox->currentIndex();
 
     if ((int)m_currentDesktopSelected != (int)currentDesktopSelected) {
         m_currentDesktopSelected = currentDesktopSelected;
Index: pagerConfig.ui
===================================================================
--- pagerConfig.ui	(revision 1129541)
+++ pagerConfig.ui	(working copy)
@@ -6,35 +6,47 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>342</width>
-    <height>276</height>
+    <width>350</width>
+    <height>300</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Configure Pager</string>
   </property>
-  <layout class="QGridLayout" name="gridLayout_2">
-   <property name="margin">
-    <number>0</number>
+  <widget class="QWidget" name="layoutWidget">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>351</width>
+     <height>301</height>
+    </rect>
    </property>
-   <property name="spacing">
-    <number>0</number>
-   </property>
-   <item row="0" column="0">
-    <widget class="QGroupBox" name="appearenceGroupBox">
-     <property name="title">
-      <string/>
-     </property>
-     <property name="flat">
-      <bool>true</bool>
-     </property>
-     <property name="checkable">
-      <bool>false</bool>
-     </property>
-     <layout class="QGridLayout" name="gridLayout">
-      <property name="margin">
-       <number>0</number>
+   <layout class="QVBoxLayout" name="verticalLayout">
+    <item>
+     <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>
+    <item>
+     <layout class="QFormLayout" name="formLayout">
+      <property name="sizeConstraint">
+       <enum>QLayout::SetDefaultConstraint</enum>
+      </property>
+      <property name="fieldGrowthPolicy">
+       <enum>QFormLayout::FieldsStayAtSizeHint</enum>
+      </property>
+      <property name="formAlignment">
+       <set>Qt::AlignHCenter|Qt::AlignTop</set>
+      </property>
       <item row="0" column="0">
        <widget class="QLabel" name="displayLabel">
         <property name="text">
@@ -45,37 +57,26 @@
         </property>
        </widget>
       </item>
-      <item row="0" column="1" colspan="2">
-       <widget class="QRadioButton" name="desktopNumberRadioButton">
-        <property name="text">
-         <string>Desktop number</string>
-        </property>
-        <attribute name="buttonGroup">
-         <string comment="KDE::DoNotExtract">buttonGroupText</string>
-        </attribute>
+      <item row="0" column="1">
+       <widget class="QComboBox" name="displayTextComboBox">
+        <item>
+         <property name="text">
+          <string>Desktop name</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Desktop number</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>No text</string>
+         </property>
+        </item>
        </widget>
       </item>
-      <item row="1" column="1" colspan="2">
-       <widget class="QRadioButton" name="desktopNameRadioButton">
-        <property name="text">
-         <string>Desktop name</string>
-        </property>
-        <attribute name="buttonGroup">
-         <string comment="KDE::DoNotExtract">buttonGroupText</string>
-        </attribute>
-       </widget>
-      </item>
-      <item row="2" column="1" colspan="2">
-       <widget class="QRadioButton" name="displayNoneRadioButton">
-        <property name="text">
-         <string>No text</string>
-        </property>
-        <attribute name="buttonGroup">
-         <string comment="KDE::DoNotExtract">buttonGroupText</string>
-        </attribute>
-       </widget>
-      </item>
-      <item row="3" column="0">
+      <item row="1" column="0">
        <widget class="QLabel" name="label">
         <property name="text">
          <string>Display icons:</string>
@@ -88,14 +89,43 @@
         </property>
        </widget>
       </item>
-      <item row="3" column="1" colspan="2">
+      <item row="1" column="1">
        <widget class="QCheckBox" name="showWindowIconsCheckBox">
         <property name="text">
          <string/>
         </property>
        </widget>
       </item>
-      <item row="4" column="0">
+      <item row="2" column="0">
+       <widget class="QLabel" name="currentLabel">
+        <property name="text">
+         <string>Selecting current desktop:</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="1">
+       <widget class="QComboBox" name="selectDesktopComboBox">
+        <item>
+         <property name="text">
+          <string>Does nothing</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Shows desktop</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Shows the dashboard</string>
+         </property>
+        </item>
+       </widget>
+      </item>
+      <item row="3" column="0">
        <widget class="QLabel" name="labelRows">
         <property name="text">
          <string>Number of rows:</string>
@@ -103,153 +133,85 @@
         <property name="alignment">
          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
         </property>
-        <property name="buddy">
-         <cstring>spinRows</cstring>
-        </property>
        </widget>
       </item>
-      <item row="4" column="1">
+      <item row="3" column="1">
        <widget class="KIntSpinBox" name="spinRows">
-        <property name="toolTip">
-         <string>Change the number of rows</string>
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
         </property>
-        <property name="whatsThis">
-         <string>Change the number of rows</string>
-        </property>
-        <property name="minimum">
-         <number>1</number>
-        </property>
-        <property name="maximum">
-         <number>20</number>
-        </property>
        </widget>
       </item>
-      <item row="4" column="2">
-       <spacer name="horizontalSpacer_3">
+     </layout>
+    </item>
+    <item>
+     <spacer name="verticalSpacer_2">
+      <property name="orientation">
+       <enum>Qt::Vertical</enum>
+      </property>
+      <property name="sizeHint" stdset="0">
+       <size>
+        <width>20</width>
+        <height>40</height>
+       </size>
+      </property>
+     </spacer>
+    </item>
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <item>
+       <spacer name="horizontalSpacer">
         <property name="orientation">
          <enum>Qt::Horizontal</enum>
         </property>
         <property name="sizeHint" stdset="0">
          <size>
-          <width>64</width>
+          <width>40</width>
           <height>20</height>
          </size>
         </property>
        </spacer>
       </item>
-      <item row="5" column="0">
-       <widget class="QLabel" name="currentLabel">
+      <item>
+       <widget class="QPushButton" name="configureDesktopsButton">
         <property name="text">
-         <string>Selecting current desktop:</string>
+         <string>Configure Desktops...</string>
         </property>
-        <property name="alignment">
-         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-        </property>
-        <property name="buddy">
-         <cstring>spinRows</cstring>
-        </property>
        </widget>
       </item>
-      <item row="5" column="1" colspan="2">
-       <widget class="QRadioButton" name="doNothingRadioButton">
-        <property name="text">
-         <string>Does nothing</string>
+      <item>
+       <spacer name="horizontalSpacer_2">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
         </property>
-        <attribute name="buttonGroup">
-         <string comment="KDE::DoNotExtract">buttonGroupAction</string>
-        </attribute>
-       </widget>
-      </item>
-      <item row="6" column="1" colspan="2">
-       <widget class="QRadioButton" name="showDesktopRadioButton">
-        <property name="text">
-         <string>Shows desktop</string>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>40</width>
+          <height>20</height>
+         </size>
         </property>
-        <attribute name="buttonGroup">
-         <string comment="KDE::DoNotExtract">buttonGroupAction</string>
-        </attribute>
-       </widget>
+       </spacer>
       </item>
-      <item row="7" column="1" colspan="2">
-       <widget class="QRadioButton" name="showDashboardRadioButton">
-        <property name="text">
-         <string>Shows the dashboard</string>
-        </property>
-        <attribute name="buttonGroup">
-         <string comment="KDE::DoNotExtract">buttonGroupAction</string>
-        </attribute>
-       </widget>
-      </item>
      </layout>
-    </widget>
-   </item>
-   <item row="0" column="1">
-    <spacer name="horizontalSpacer">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>4</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="1" column="0">
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>15</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="2" column="0" colspan="2">
-    <layout class="QHBoxLayout" name="horizontalLayout">
-     <item>
-      <widget class="QPushButton" name="configureDesktopsButton">
-       <property name="text">
-        <string>Configure Desktops...</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="horizontalSpacer_2">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>333</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-   <item row="3" column="0">
-    <spacer name="verticalSpacer_4">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>47</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
+    </item>
+    <item>
+     <spacer name="verticalSpacer_3">
+      <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>
  </widget>
  <customwidgets>
   <customwidget>
@@ -259,17 +221,8 @@
   </customwidget>
  </customwidgets>
  <tabstops>
-  <tabstop>desktopNumberRadioButton</tabstop>
-  <tabstop>desktopNameRadioButton</tabstop>
-  <tabstop>displayNoneRadioButton</tabstop>
-  <tabstop>showWindowIconsCheckBox</tabstop>
-  <tabstop>spinRows</tabstop>
   <tabstop>configureDesktopsButton</tabstop>
  </tabstops>
  <resources/>
  <connections/>
- <buttongroups>
-  <buttongroup name="buttonGroupText"/>
-  <buttongroup name="buttonGroupAction"/>
- </buttongroups>
 </ui>


_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


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

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