UI tune: use buttonBox instead of single buttons to comply with platform conventions
authorkirilma <kirilma@localhost>
Tue, 4 May 2010 05:58:05 +0000 (05:58 +0000)
committerkirilma <kirilma@localhost>
Tue, 4 May 2010 05:58:05 +0000 (05:58 +0000)
maemo5 does not print "Cancel" buttons, and names "OK" differently
just use buttonBox, and it will behave properly at each platform

src/gui/conferenceeditor.cpp
src/gui/conferenceeditor.ui
src/gui/settingsdialog.cpp
src/gui/settingsdialog.ui

index 7d654840344ba4269f2f8dbe1abb2a9b83fff925..34eb7e3bc279358b590a730fbf165913a24e4911 100644 (file)
@@ -49,6 +49,7 @@ ConferenceEditor::ConferenceEditor(ConferenceModel* model, QWidget* parent)
     connect(changeUrl, SIGNAL(clicked()), SLOT(changeUrlClicked()));
     connect(refreshBtn, SIGNAL(clicked()), SLOT(refreshClicked()));
     connect(showMapButton, SIGNAL(clicked()), SLOT(conferenceMapClicked()));
+    connect(buttonBox, SIGNAL(rejected()), SLOT(close()));
 
     // it's OK to emit selection signals here
     // because they are not yet connected to anybody
index 2f3a9ed0bfe0f4be6c5e04b48d93f6dc592234dc..8ee3908118e1962e2bdef87845a79ae0d35e8dec 100644 (file)
           </item>
           <item>
            <widget class="QWidget" name="widget_5" native="true">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
             <layout class="QHBoxLayout" name="horizontalLayout_3">
              <item>
               <widget class="QPushButton" name="refreshBtn">
                </property>
               </spacer>
              </item>
+             <item>
+              <widget class="QWidget" name="widget" native="true">
+               <layout class="QVBoxLayout" name="verticalLayout">
+                <property name="spacing">
+                 <number>0</number>
+                </property>
+                <property name="margin">
+                 <number>0</number>
+                </property>
+                <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>
+                 <widget class="QDialogButtonBox" name="buttonBox">
+                  <property name="standardButtons">
+                   <set>QDialogButtonBox::Close</set>
+                  </property>
+                  <property name="centerButtons">
+                   <bool>false</bool>
+                  </property>
+                 </widget>
+                </item>
+               </layout>
+              </widget>
+             </item>
             </layout>
            </widget>
           </item>
index 2e47556ee7ca294feb8bbf75a3be224ffa6d92a1..1fa81d73f10328df48a71ab958a6fe7818433458 100644 (file)
@@ -31,7 +31,7 @@ SettingsDialog::SettingsDialog(QWidget *aParent)
     port->setValue(AppSettings::proxyPort());
     directConnection->setChecked(AppSettings::isDirectConnection());
 
-    connect(okButton, SIGNAL(clicked()), SLOT(saveDialogData()));
+    connect(buttonBox, SIGNAL(accepted()), SLOT(saveDialogData()));
     connect(directConnection, SIGNAL(clicked(bool)), SLOT(connectionTypeChanged(bool)));
 
     if(directConnection->isChecked())
index 2c6a1ca666d403fc9e60833697cfb1ba10089c8c..940b03c4540c2b683b394b3a4aed81fc7e3badf7 100644 (file)
@@ -2,20 +2,18 @@
 <ui version="4.0">
  <class>SettingsDialog</class>
  <widget class="QDialog" name="SettingsDialog">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>469</width>
-    <height>195</height>
-   </rect>
-  </property>
   <property name="sizePolicy">
    <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
   </property>
+  <property name="minimumSize">
+   <size>
+    <width>500</width>
+    <height>0</height>
+   </size>
+  </property>
   <property name="windowTitle">
    <string>Settings</string>
   </property>
         </layout>
        </widget>
       </item>
-      <item>
-       <spacer name="verticalSpacer">
-        <property name="orientation">
-         <enum>Qt::Vertical</enum>
-        </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>20</width>
-          <height>24</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>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QPushButton" name="okButton">
-          <property name="text">
-           <string>OK</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
      </layout>
     </widget>
    </item>
+   <item>
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <resources/>