[QGIS Commit] r12760 - in trunk/qgis/src: gui/symbology-ng ui

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Jan 14 13:15:20 EST 2010


Author: wonder
Date: 2010-01-14 13:15:19 -0500 (Thu, 14 Jan 2010)
New Revision: 12760

Modified:
   trunk/qgis/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp
   trunk/qgis/src/ui/qgssymbolv2selectordialogbase.ui
Log:
Updated symbol selector GUI to reflect the design created with Tim


Modified: trunk/qgis/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp	2010-01-14 18:13:35 UTC (rev 12759)
+++ trunk/qgis/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp	2010-01-14 18:15:19 UTC (rev 12760)
@@ -41,18 +41,9 @@
   updateSymbolPreview();
   updateSymbolInfo();
 
-  //output unit
+  // output unit
   mSymbolUnitComboBox->blockSignals( true );
-  mSymbolUnitComboBox->addItem( tr( "Millimeter" ) );
-  mSymbolUnitComboBox->addItem( tr( "Map unit" ) );
-  if ( mSymbol && mSymbol->outputUnit() == QgsSymbolV2::MM )
-  {
-    mSymbolUnitComboBox->setCurrentIndex( mSymbolUnitComboBox->findText( tr( "Millimeter" ) ) );
-  }
-  else
-  {
-    mSymbolUnitComboBox->setCurrentIndex( mSymbolUnitComboBox->findText( tr( "Map unit" ) ) );
-  }
+  mSymbolUnitComboBox->setCurrentIndex( mSymbol->outputUnit() );
   mSymbolUnitComboBox->blockSignals( false );
 
   // select correct page in stacked widget
@@ -241,18 +232,8 @@
 
 void QgsSymbolV2SelectorDialog::on_mSymbolUnitComboBox_currentIndexChanged( const QString & text )
 {
-  if ( !mSymbol )
-  {
-    return;
-  }
-  if ( text == tr( "Millimeter" ) )
-  {
-    mSymbol->setOutputUnit( QgsSymbolV2::MM );
-  }
-  else //map unit
-  {
-    mSymbol->setOutputUnit( QgsSymbolV2::MapUnit );
-  }
+  mSymbol->setOutputUnit( (QgsSymbolV2::OutputUnit) mSymbolUnitComboBox->currentIndex() );
+
   updateSymbolPreview();
   emit symbolModified();
 }

Modified: trunk/qgis/src/ui/qgssymbolv2selectordialogbase.ui
===================================================================
--- trunk/qgis/src/ui/qgssymbolv2selectordialogbase.ui	2010-01-14 18:13:35 UTC (rev 12759)
+++ trunk/qgis/src/ui/qgssymbolv2selectordialogbase.ui	2010-01-14 18:15:19 UTC (rev 12760)
@@ -45,122 +45,160 @@
       </widget>
      </item>
      <item>
-      <widget class="QStackedWidget" name="stackedWidget">
-       <property name="currentIndex">
-        <number>2</number>
-       </property>
-       <widget class="QWidget" name="pageMarker">
-        <layout class="QGridLayout" name="gridLayout">
-         <item row="0" column="0">
-          <widget class="QLabel" name="label_5">
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_4">
+         <item>
+          <widget class="QLabel" name="mSymbolUnitLabel">
            <property name="text">
-            <string>Color</string>
+            <string>Unit</string>
            </property>
           </widget>
          </item>
-         <item row="0" column="1">
-          <widget class="QgsColorButtonV2" name="btnColorMarker">
-           <property name="text">
-            <string>Change</string>
-           </property>
+         <item>
+          <widget class="QComboBox" name="mSymbolUnitComboBox">
+           <item>
+            <property name="text">
+             <string>Millimeter</string>
+            </property>
+           </item>
+           <item>
+            <property name="text">
+             <string>Map unit</string>
+            </property>
+           </item>
           </widget>
          </item>
-         <item row="1" column="0">
-          <widget class="QLabel" name="label_2">
-           <property name="text">
-            <string>Size</string>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <widget class="QDoubleSpinBox" name="spinSize">
-           <property name="decimals">
-            <number>1</number>
-           </property>
-           <property name="value">
-            <double>1.000000000000000</double>
-           </property>
-          </widget>
-         </item>
-         <item row="2" column="0">
-          <widget class="QLabel" name="label_3">
-           <property name="text">
-            <string>Rotation</string>
-           </property>
-          </widget>
-         </item>
-         <item row="2" column="1">
-          <widget class="QDoubleSpinBox" name="spinAngle">
-           <property name="suffix">
-            <string>°</string>
-           </property>
-           <property name="decimals">
-            <number>1</number>
-           </property>
-           <property name="maximum">
-            <double>360.000000000000000</double>
-           </property>
-           <property name="singleStep">
-            <double>5.000000000000000</double>
-           </property>
-          </widget>
-         </item>
         </layout>
-       </widget>
-       <widget class="QWidget" name="pageLine">
-        <layout class="QGridLayout" name="gridLayout_2">
-         <item row="0" column="0">
-          <widget class="QLabel" name="label_6">
-           <property name="text">
-            <string>Color</string>
+       </item>
+       <item>
+        <widget class="QStackedWidget" name="stackedWidget">
+         <property name="currentIndex">
+          <number>0</number>
+         </property>
+         <widget class="QWidget" name="pageMarker">
+          <layout class="QGridLayout" name="gridLayout">
+           <property name="margin">
+            <number>0</number>
            </property>
-          </widget>
-         </item>
-         <item row="0" column="1">
-          <widget class="QgsColorButtonV2" name="btnColorLine">
-           <property name="text">
-            <string>Change</string>
+           <item row="0" column="0">
+            <widget class="QLabel" name="label_5">
+             <property name="text">
+              <string>Color</string>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="1">
+            <widget class="QgsColorButtonV2" name="btnColorMarker">
+             <property name="text">
+              <string>Change</string>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="0">
+            <widget class="QLabel" name="label_2">
+             <property name="text">
+              <string>Size</string>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="1">
+            <widget class="QDoubleSpinBox" name="spinSize">
+             <property name="decimals">
+              <number>1</number>
+             </property>
+             <property name="value">
+              <double>1.000000000000000</double>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="0">
+            <widget class="QLabel" name="label_3">
+             <property name="text">
+              <string>Rotation</string>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="1">
+            <widget class="QDoubleSpinBox" name="spinAngle">
+             <property name="suffix">
+              <string>°</string>
+             </property>
+             <property name="decimals">
+              <number>1</number>
+             </property>
+             <property name="maximum">
+              <double>360.000000000000000</double>
+             </property>
+             <property name="singleStep">
+              <double>5.000000000000000</double>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="pageLine">
+          <layout class="QGridLayout" name="gridLayout_2">
+           <property name="margin">
+            <number>0</number>
            </property>
-          </widget>
-         </item>
-         <item row="1" column="0">
-          <widget class="QLabel" name="label_4">
-           <property name="text">
-            <string>Width</string>
+           <item row="0" column="0">
+            <widget class="QLabel" name="label_6">
+             <property name="text">
+              <string>Color</string>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="1">
+            <widget class="QgsColorButtonV2" name="btnColorLine">
+             <property name="text">
+              <string>Change</string>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="0">
+            <widget class="QLabel" name="label_4">
+             <property name="text">
+              <string>Width</string>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="1">
+            <widget class="QDoubleSpinBox" name="spinWidth">
+             <property name="decimals">
+              <number>1</number>
+             </property>
+             <property name="value">
+              <double>1.000000000000000</double>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="pageFill">
+          <layout class="QHBoxLayout" name="horizontalLayout_2">
+           <property name="margin">
+            <number>0</number>
            </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <widget class="QDoubleSpinBox" name="spinWidth">
-           <property name="decimals">
-            <number>1</number>
-           </property>
-           <property name="value">
-            <double>1.000000000000000</double>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </widget>
-       <widget class="QWidget" name="pageFill">
-        <layout class="QHBoxLayout" name="horizontalLayout_2">
-         <item>
-          <widget class="QLabel" name="label_7">
-           <property name="text">
-            <string>Color</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QgsColorButtonV2" name="btnColorFill">
-           <property name="text">
-            <string>Change</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </widget>
-      </widget>
+           <item>
+            <widget class="QLabel" name="label_7">
+             <property name="text">
+              <string>Color</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QgsColorButtonV2" name="btnColorFill">
+             <property name="text">
+              <string>Change</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </widget>
+        </widget>
+       </item>
+      </layout>
      </item>
     </layout>
    </item>
@@ -196,27 +234,13 @@
     </layout>
    </item>
    <item row="2" column="0">
-    <layout class="QHBoxLayout" name="horizontalLayout_4">
-     <item>
-      <widget class="QLabel" name="mSymbolUnitLabel">
-       <property name="text">
-        <string>Symbol Unit:</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QComboBox" name="mSymbolUnitComboBox"/>
-     </item>
-    </layout>
-   </item>
-   <item row="3" column="0">
     <widget class="QLabel" name="label">
      <property name="text">
       <string>Symbols from style:</string>
      </property>
     </widget>
    </item>
-   <item row="4" column="0">
+   <item row="3" column="0">
     <widget class="QListView" name="viewSymbols">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
@@ -244,7 +268,7 @@
      </property>
     </widget>
    </item>
-   <item row="5" column="0">
+   <item row="4" column="0">
     <widget class="QDialogButtonBox" name="buttonBox">
      <property name="orientation">
       <enum>Qt::Horizontal</enum>
@@ -264,13 +288,14 @@
   </customwidget>
  </customwidgets>
  <tabstops>
+  <tabstop>btnSymbolProperties</tabstop>
+  <tabstop>mSymbolUnitComboBox</tabstop>
+  <tabstop>btnColorFill</tabstop>
   <tabstop>btnColorMarker</tabstop>
   <tabstop>spinSize</tabstop>
   <tabstop>spinAngle</tabstop>
   <tabstop>btnColorLine</tabstop>
   <tabstop>spinWidth</tabstop>
-  <tabstop>btnColorFill</tabstop>
-  <tabstop>btnSymbolProperties</tabstop>
   <tabstop>btnAddToStyle</tabstop>
   <tabstop>viewSymbols</tabstop>
   <tabstop>buttonBox</tabstop>



More information about the QGIS-commit mailing list