[QGIS Commit] r9214 - trunk/qgis/src/plugins/interpolation

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Aug 30 06:14:29 EDT 2008


Author: timlinux
Date: 2008-08-30 06:14:29 -0400 (Sat, 30 Aug 2008)
New Revision: 9214

Added:
   trunk/qgis/src/plugins/interpolation/interpolation.png
   trunk/qgis/src/plugins/interpolation/interpolator.qrc
   trunk/qgis/src/plugins/interpolation/options.png
Removed:
   trunk/qgis/src/plugins/interpolation/mIconInterpolation.xpm
Modified:
   trunk/qgis/src/plugins/interpolation/CMakeLists.txt
   trunk/qgis/src/plugins/interpolation/qgsinterpolationdialogbase.ui
   trunk/qgis/src/plugins/interpolation/qgsinterpolationplugin.cpp
Log:
Gui cleanups for interopolation plugin: use labels formatting compliant with qgis ui guide. Get rid of extra layouts. Improve layout. Use qrc file for resources. Make plugin icon consistent with requirements for docu team.

Modified: trunk/qgis/src/plugins/interpolation/CMakeLists.txt
===================================================================
--- trunk/qgis/src/plugins/interpolation/CMakeLists.txt	2008-08-30 09:28:54 UTC (rev 9213)
+++ trunk/qgis/src/plugins/interpolation/CMakeLists.txt	2008-08-30 10:14:29 UTC (rev 9214)
@@ -36,6 +36,7 @@
      qgsinterpolationdialog.h
 )
 
+SET (INTERPOLATION_RCCS  interpolator.qrc)
 ########################################################
 # Build
 
@@ -43,12 +44,21 @@
 
 QT4_WRAP_CPP (INTERPOLATION_MOC_SRCS  ${INTERPOLATION_MOC_HDRS})
 
-ADD_LIBRARY (interpolationplugin MODULE ${INTERPOLATION_SRCS} ${INTERPOLATION_MOC_SRCS} ${INTERPOLATION_RCC_SRCS} ${INTERPOLATION_UIS_H})
+QT4_ADD_RESOURCES(INTERPOLATION_RCC_SRCS ${INTERPOLATION_RCCS})
 
+ADD_LIBRARY (interpolationplugin MODULE 
+  ${INTERPOLATION_SRCS}
+  ${INTERPOLATION_MOC_SRCS} 
+  ${INTERPOLATION_RCC_SRCS} 
+  ${INTERPOLATION_UIS_H})
+
 INCLUDE_DIRECTORIES(
      ${CMAKE_CURRENT_BINARY_DIR}
      ${GEOS_INCLUDE_DIR}
-     ../../core ../../core/raster ../../core/renderer ../../core/symbology
+     ../../core 
+     ../../core/raster 
+     ../../core/renderer 
+     ../../core/symbology
      ../../gui
      ..
      .
@@ -65,4 +75,5 @@
 
 INSTALL(TARGETS interpolationplugin
   RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
-  LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
+  LIBRARY DESTINATION ${QGIS_PLUGIN_DIR}
+  )

Added: trunk/qgis/src/plugins/interpolation/interpolation.png
===================================================================
(Binary files differ)


Property changes on: trunk/qgis/src/plugins/interpolation/interpolation.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/qgis/src/plugins/interpolation/interpolator.qrc
===================================================================
--- trunk/qgis/src/plugins/interpolation/interpolator.qrc	                        (rev 0)
+++ trunk/qgis/src/plugins/interpolation/interpolator.qrc	2008-08-30 10:14:29 UTC (rev 9214)
@@ -0,0 +1,6 @@
+<RCC>
+    <qresource prefix="/interpolator" >
+        <file>options.png</file>
+        <file>interpolation.png</file>
+    </qresource>
+</RCC>

Deleted: trunk/qgis/src/plugins/interpolation/mIconInterpolation.xpm
===================================================================
--- trunk/qgis/src/plugins/interpolation/mIconInterpolation.xpm	2008-08-30 09:28:54 UTC (rev 9213)
+++ trunk/qgis/src/plugins/interpolation/mIconInterpolation.xpm	2008-08-30 10:14:29 UTC (rev 9214)
@@ -1,33 +0,0 @@
-/* XPM */
-static const char *mIconInterpolation[]={
-"32 28 2 1",
-". c None",
-"# c #000000",
-"................................",
-"................................",
-"..............##................",
-"..............##................",
-"..............##................",
-"..............##................",
-"..............##................",
-"..............##................",
-"..............##................",
-"..............##................",
-"..............###............#..",
-"..............###............#..",
-".......#.....####............#..",
-".......#.....#####...........#..",
-".......#....######..........##..",
-".......#....######..........##..",
-".......#....#######.........##..",
-"......##....#######.........##..",
-"...#..##....########.......###..",
-"...#..##....########.......###..",
-"..###.##....#########.....####..",
-"..######...###########....####..",
-"..#######..###################..",
-"..########.###################..",
-".##############################.",
-".##############################.",
-"################################",
-"################################"};

Added: trunk/qgis/src/plugins/interpolation/options.png
===================================================================
(Binary files differ)


Property changes on: trunk/qgis/src/plugins/interpolation/options.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/qgis/src/plugins/interpolation/qgsinterpolationdialogbase.ui
===================================================================
--- trunk/qgis/src/plugins/interpolation/qgsinterpolationdialogbase.ui	2008-08-30 09:28:54 UTC (rev 9213)
+++ trunk/qgis/src/plugins/interpolation/qgsinterpolationdialogbase.ui	2008-08-30 10:14:29 UTC (rev 9214)
@@ -6,7 +6,7 @@
     <x>0</x>
     <y>0</y>
     <width>485</width>
-    <height>538</height>
+    <height>372</height>
    </rect>
   </property>
   <property name="sizePolicy" >
@@ -16,7 +16,7 @@
    </sizepolicy>
   </property>
   <property name="windowTitle" >
-   <string>Dialog</string>
+   <string>Interpolation plugin</string>
   </property>
   <layout class="QGridLayout" >
    <item row="0" column="0" >
@@ -32,20 +32,33 @@
      </property>
      <layout class="QGridLayout" >
       <item row="0" column="0" >
-       <layout class="QHBoxLayout" >
-        <item>
-         <widget class="QLabel" name="mInputVectorLayerLabel" >
-          <property name="text" >
-           <string>Input vector layer:</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QComboBox" name="mInputLayerComboBox" />
-        </item>
-       </layout>
+       <widget class="QLabel" name="mInputVectorLayerLabel" >
+        <property name="text" >
+         <string>Input vector layer</string>
+        </property>
+        <property name="buddy" >
+         <cstring>mInputLayerComboBox</cstring>
+        </property>
+       </widget>
       </item>
+      <item row="0" column="1" >
+       <widget class="QComboBox" name="mInputLayerComboBox" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
+      </item>
       <item row="1" column="0" >
+       <widget class="QLabel" name="label" >
+        <property name="text" >
+         <string/>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1" >
        <widget class="QCheckBox" name="mUseZCoordCheckBox" >
         <property name="text" >
          <string>Use z-Coordinate for interpolation</string>
@@ -53,19 +66,25 @@
        </widget>
       </item>
       <item row="2" column="0" >
-       <layout class="QHBoxLayout" >
-        <item>
-         <widget class="QLabel" name="mInterpolationAttributeLabel" >
-          <property name="text" >
-           <string>Interpolation attribute: </string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QComboBox" name="mInterpolationAttributeComboBox" />
-        </item>
-       </layout>
+       <widget class="QLabel" name="mInterpolationAttributeLabel" >
+        <property name="text" >
+         <string>Interpolation attribute </string>
+        </property>
+        <property name="buddy" >
+         <cstring>mInterpolationAttributeComboBox</cstring>
+        </property>
+       </widget>
       </item>
+      <item row="2" column="1" >
+       <widget class="QComboBox" name="mInterpolationAttributeComboBox" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
@@ -81,97 +100,83 @@
       <string>Output</string>
      </property>
      <layout class="QGridLayout" >
-      <item row="0" column="0" colspan="2" >
-       <layout class="QHBoxLayout" >
-        <item>
-         <widget class="QLabel" name="mInterpolationLabel" >
-          <property name="text" >
-           <string>Interpolation method:</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QComboBox" name="mInterpolationMethodComboBox" />
-        </item>
-       </layout>
+      <item row="0" column="0" >
+       <widget class="QLabel" name="mInterpolationLabel" >
+        <property name="text" >
+         <string>Interpolation method</string>
+        </property>
+        <property name="buddy" >
+         <cstring>mInterpolationMethodComboBox</cstring>
+        </property>
+       </widget>
       </item>
+      <item row="0" column="1" >
+       <widget class="QComboBox" name="mInterpolationMethodComboBox" />
+      </item>
+      <item row="0" column="2" >
+       <widget class="QToolButton" name="mConfigureInterpolationButton" >
+        <property name="text" >
+         <string>...</string>
+        </property>
+        <property name="icon" >
+         <iconset resource="interpolator.qrc" >:/interpolator/options.png</iconset>
+        </property>
+       </widget>
+      </item>
       <item row="1" column="0" >
-       <widget class="QPushButton" name="mConfigureInterpolationButton" >
+       <widget class="QLabel" name="mNumberOfColumnsLabel" >
         <property name="text" >
-         <string>Configure interpolation method...</string>
+         <string>Number of columns</string>
         </property>
+        <property name="buddy" >
+         <cstring>mNumberOfColumnsSpinBox</cstring>
+        </property>
        </widget>
       </item>
-      <item row="1" column="1" >
-       <spacer>
-        <property name="orientation" >
-         <enum>Qt::Horizontal</enum>
+      <item row="1" column="1" colspan="2" >
+       <widget class="QSpinBox" name="mNumberOfColumnsSpinBox" >
+        <property name="maximum" >
+         <number>10000000</number>
         </property>
-        <property name="sizeHint" stdset="0" >
-         <size>
-          <width>51</width>
-          <height>20</height>
-         </size>
+       </widget>
+      </item>
+      <item row="2" column="0" >
+       <widget class="QLabel" name="mNumberOfRowsLabel" >
+        <property name="text" >
+         <string>Number of rows</string>
         </property>
-       </spacer>
+        <property name="buddy" >
+         <cstring>mNumberOfRowsSpinBox</cstring>
+        </property>
+       </widget>
       </item>
-      <item row="2" column="0" colspan="2" >
-       <layout class="QHBoxLayout" >
-        <item>
-         <widget class="QLabel" name="mNumberOfColumnsLabel" >
-          <property name="text" >
-           <string>Number of columns:</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QSpinBox" name="mNumberOfColumnsSpinBox" >
-          <property name="maximum" >
-           <number>10000000</number>
-          </property>
-         </widget>
-        </item>
-       </layout>
+      <item row="2" column="1" colspan="2" >
+       <widget class="QSpinBox" name="mNumberOfRowsSpinBox" >
+        <property name="maximum" >
+         <number>10000000</number>
+        </property>
+       </widget>
       </item>
-      <item row="3" column="0" colspan="2" >
-       <layout class="QHBoxLayout" >
-        <item>
-         <widget class="QLabel" name="mNumberOfRowsLabel" >
-          <property name="text" >
-           <string>Number of rows:</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QSpinBox" name="mNumberOfRowsSpinBox" >
-          <property name="maximum" >
-           <number>10000000</number>
-          </property>
-         </widget>
-        </item>
-       </layout>
+      <item row="3" column="0" >
+       <widget class="QLabel" name="mOutputFileLabel" >
+        <property name="text" >
+         <string>Output file </string>
+        </property>
+        <property name="buddy" >
+         <cstring>mOutputFileLineEdit</cstring>
+        </property>
+       </widget>
       </item>
-      <item row="4" column="0" colspan="2" >
-       <layout class="QHBoxLayout" >
-        <item>
-         <widget class="QLabel" name="mOutputFileLabel" >
-          <property name="text" >
-           <string>Output File: </string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="mOutputFileLineEdit" />
-        </item>
-        <item>
-         <widget class="QPushButton" name="mOutputFileButton" >
-          <property name="text" >
-           <string>...</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
+      <item row="3" column="1" >
+       <widget class="QLineEdit" name="mOutputFileLineEdit" />
       </item>
+      <item row="3" column="2" >
+       <widget class="QToolButton" name="mOutputFileButton" >
+        <property name="text" >
+         <string>...</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
@@ -181,13 +186,27 @@
       <enum>Qt::Horizontal</enum>
      </property>
      <property name="standardButtons" >
-      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
      </property>
     </widget>
    </item>
   </layout>
  </widget>
- <resources/>
+ <tabstops>
+  <tabstop>mInputLayerComboBox</tabstop>
+  <tabstop>mUseZCoordCheckBox</tabstop>
+  <tabstop>mInterpolationAttributeComboBox</tabstop>
+  <tabstop>mInterpolationMethodComboBox</tabstop>
+  <tabstop>mConfigureInterpolationButton</tabstop>
+  <tabstop>mNumberOfColumnsSpinBox</tabstop>
+  <tabstop>mNumberOfRowsSpinBox</tabstop>
+  <tabstop>mOutputFileLineEdit</tabstop>
+  <tabstop>mOutputFileButton</tabstop>
+  <tabstop>buttonBox</tabstop>
+ </tabstops>
+ <resources>
+  <include location="interpolator.qrc" />
+ </resources>
  <connections>
   <connection>
    <sender>buttonBox</sender>
@@ -196,8 +215,8 @@
    <slot>accept()</slot>
    <hints>
     <hint type="sourcelabel" >
-     <x>248</x>
-     <y>254</y>
+     <x>257</x>
+     <y>362</y>
     </hint>
     <hint type="destinationlabel" >
      <x>157</x>
@@ -212,8 +231,8 @@
    <slot>reject()</slot>
    <hints>
     <hint type="sourcelabel" >
-     <x>316</x>
-     <y>260</y>
+     <x>325</x>
+     <y>362</y>
     </hint>
     <hint type="destinationlabel" >
      <x>286</x>

Modified: trunk/qgis/src/plugins/interpolation/qgsinterpolationplugin.cpp
===================================================================
--- trunk/qgis/src/plugins/interpolation/qgsinterpolationplugin.cpp	2008-08-30 09:28:54 UTC (rev 9213)
+++ trunk/qgis/src/plugins/interpolation/qgsinterpolationplugin.cpp	2008-08-30 10:14:29 UTC (rev 9214)
@@ -19,8 +19,6 @@
 #include "qgisinterface.h"
 #include "qgsinterpolationdialog.h"
 
-#include "mIconInterpolation.xpm"
-
 static const QString name_ = QObject::tr( "Interpolation plugin" );
 static const QString description_ = QObject::tr( "A plugin for interpolation based on vertices of a vector layer" );
 static const QString version_ = QObject::tr( "Version 0.001" );
@@ -39,7 +37,7 @@
 {
   if ( mIface )
   {
-    mInterpolationAction = new QAction( QIcon( mIconInterpolation ), tr( "&Interpolation" ), 0 );
+    mInterpolationAction = new QAction( QIcon( ":/interpolator/interpolation.png"), tr( "&Interpolation" ), 0 );
     QObject::connect( mInterpolationAction, SIGNAL( triggered() ), this, SLOT( showInterpolationDialog() ) );
     mIface->addToolBarIcon( mInterpolationAction );
     mIface->addPluginMenu( tr( "&Interpolation" ), mInterpolationAction );



More information about the QGIS-commit mailing list