[QGIS Commit] r12663 - in trunk/qgis: images images/themes/default src/app src/core src/ui

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Jan 2 09:39:00 EST 2010


Author: mhugent
Date: 2010-01-02 09:39:00 -0500 (Sat, 02 Jan 2010)
New Revision: 12663

Added:
   trunk/qgis/images/themes/default/mActionMeasureAngle.png
   trunk/qgis/src/app/qgsdisplayangle.cpp
   trunk/qgis/src/app/qgsdisplayangle.h
   trunk/qgis/src/app/qgsmaptoolmeasureangle.cpp
   trunk/qgis/src/app/qgsmaptoolmeasureangle.h
   trunk/qgis/src/ui/qgsdisplayanglebase.ui
Modified:
   trunk/qgis/images/images.qrc
   trunk/qgis/src/app/CMakeLists.txt
   trunk/qgis/src/app/qgisapp.cpp
   trunk/qgis/src/app/qgisapp.h
   trunk/qgis/src/app/qgsoptions.cpp
   trunk/qgis/src/core/qgsdistancearea.cpp
   trunk/qgis/src/ui/qgsoptionsbase.ui
Log:
[FEATURE]: A tool to measure angles

Modified: trunk/qgis/images/images.qrc
===================================================================
--- trunk/qgis/images/images.qrc	2010-01-02 07:02:31 UTC (rev 12662)
+++ trunk/qgis/images/images.qrc	2010-01-02 14:39:00 UTC (rev 12663)
@@ -156,6 +156,7 @@
     <file>themes/default/mActionLowerItems.png</file>
     <file>themes/default/mActionMapTips.png</file>
     <file>themes/default/mActionMeasure.png</file>
+    <file>themes/default/mActionMeasureAngle.png</file>
     <file>themes/default/mActionMeasureArea.png</file>
     <file>themes/default/mActionMergeFeatures.png</file>
     <file>themes/default/mActionMoveFeature.png</file>

Added: trunk/qgis/images/themes/default/mActionMeasureAngle.png
===================================================================
(Binary files differ)


Property changes on: trunk/qgis/images/themes/default/mActionMeasureAngle.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: trunk/qgis/src/app/CMakeLists.txt
===================================================================
--- trunk/qgis/src/app/CMakeLists.txt	2010-01-02 07:02:31 UTC (rev 12662)
+++ trunk/qgis/src/app/CMakeLists.txt	2010-01-02 14:39:00 UTC (rev 12663)
@@ -21,6 +21,7 @@
   qgsspatialitefilterproxymodel.cpp
   qgsspatialitetablemodel.cpp
   qgsdelattrdialog.cpp
+  qgsdisplayangle.cpp
   qgsfieldcalculator.cpp
   qgsnewvectorlayerdialog.cpp
   qgsgraduatedsymboldialog.cpp
@@ -37,6 +38,7 @@
   qgsmaptooldeletevertex.cpp
   qgsmaptooledit.cpp
   qgsmaptoolidentify.cpp
+  qgsmaptoolmeasureangle.cpp
   qgsmaptoolmovefeature.cpp
   qgsmaptoolmovevertex.cpp
   qgsmaptoolnodetool.cpp
@@ -128,6 +130,7 @@
   qgscustomprojectiondialog.h
   qgsdelattrdialog.h
   qgsfieldcalculator.h
+  qgsmaptoolmeasureangle.h
   qgsnewvectorlayerdialog.h
   qgsgraduatedsymboldialog.h
   qgshelpviewer.h

Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp	2010-01-02 07:02:31 UTC (rev 12662)
+++ trunk/qgis/src/app/qgisapp.cpp	2010-01-02 14:39:00 UTC (rev 12663)
@@ -169,6 +169,7 @@
 #include "qgsmaptooldeletepart.h"
 #include "qgsmaptooldeletevertex.h"
 #include "qgsmaptoolidentify.h"
+#include "qgsmaptoolmeasureangle.h"
 #include "qgsmaptoolmovefeature.h"
 #include "qgsmaptoolmovevertex.h"
 #include "qgsmaptoolnodetool.h"
@@ -811,6 +812,10 @@
   mActionMeasureArea->setStatusTip( tr( "Measure an Area" ) );
   connect( mActionMeasureArea, SIGNAL( triggered() ), this, SLOT( measureArea() ) );
 
+  mActionMeasureAngle = new QAction( getThemeIcon( "mActionMeasureAngle.png" ), tr( "Measure Angle" ), this );
+  mActionMeasureAngle->setStatusTip( tr( "Measure Angle" ) );
+  connect( mActionMeasureAngle, SIGNAL( triggered() ), this, SLOT( measureAngle() ) );
+
   mActionZoomFullExtent = new QAction( getThemeIcon( "mActionZoomFullExtent.png" ), tr( "Zoom Full" ), this );
   shortcuts->registerAction( mActionZoomFullExtent, tr( "Ctrl+Shift+F", "Zoom to Full Extents" ) );
   mActionZoomFullExtent->setStatusTip( tr( "Zoom to Full Extents" ) );
@@ -1110,6 +1115,8 @@
   mMapToolGroup->addAction( mActionMeasure );
   mActionMeasureArea->setCheckable( true );
   mMapToolGroup->addAction( mActionMeasureArea );
+  mActionMeasureAngle->setCheckable( true );
+  mMapToolGroup->addAction( mActionMeasureAngle );
   mActionCaptureLine->setCheckable( true );
   mMapToolGroup->addAction( mActionCaptureLine );
   mActionCapturePoint->setCheckable( true );
@@ -1272,6 +1279,7 @@
   mViewMenu->addAction( mActionIdentify );
   mViewMenu->addAction( mActionMeasure );
   mViewMenu->addAction( mActionMeasureArea );
+  mViewMenu->addAction( mActionMeasureAngle );
   mActionViewSeparator1 = mViewMenu->addSeparator();
 
   mViewMenu->addAction( mActionZoomFullExtent );
@@ -1490,6 +1498,7 @@
   mAttributesToolBar->addAction( mActionOpenTable );
   mAttributesToolBar->addAction( mActionMeasure );
   mAttributesToolBar->addAction( mActionMeasureArea );
+  mAttributesToolBar->addAction( mActionMeasureAngle );
   mAttributesToolBar->addAction( mActionMapTips );
   mAttributesToolBar->addAction( mActionShowBookmarks );
   mAttributesToolBar->addAction( mActionNewBookmark );
@@ -1734,6 +1743,7 @@
   mActionOpenTable->setIcon( getThemeIcon( "/mActionOpenTable.png" ) );
   mActionMeasure->setIcon( getThemeIcon( "/mActionMeasure.png" ) );
   mActionMeasureArea->setIcon( getThemeIcon( "/mActionMeasureArea.png" ) );
+  mActionMeasureAngle->setIcon( getThemeIcon( "/mActionMeasureAngle.png" ) );
   mActionMapTips->setIcon( getThemeIcon( "/mActionMapTips.png" ) );
   mActionShowBookmarks->setIcon( getThemeIcon( "/mActionShowBookmarks.png" ) );
   mActionNewBookmark->setIcon( getThemeIcon( "/mActionNewBookmark.png" ) );
@@ -1835,6 +1845,8 @@
   mMapTools.mMeasureDist->setAction( mActionMeasure );
   mMapTools.mMeasureArea = new QgsMeasureTool( mMapCanvas, TRUE /* area */ );
   mMapTools.mMeasureArea->setAction( mActionMeasureArea );
+  mMapTools.mMeasureAngle = new QgsMapToolMeasureAngle( mMapCanvas );
+  mMapTools.mMeasureAngle->setAction( mActionMeasureAngle );
   mMapTools.mCapturePoint = new QgsMapToolAddFeature( mMapCanvas, QgsMapToolCapture::CapturePoint );
   mMapTools.mCapturePoint->setAction( mActionCapturePoint );
   mActionCapturePoint->setVisible( false );
@@ -3508,6 +3520,11 @@
   mMapCanvas->setMapTool( mMapTools.mMeasureArea );
 }
 
+void QgisApp::measureAngle()
+{
+  mMapCanvas->setMapTool( mMapTools.mMeasureAngle );
+}
+
 void QgisApp::attributeTable()
 {
   if ( mMapCanvas && mMapCanvas->isDrawing() )

Modified: trunk/qgis/src/app/qgisapp.h
===================================================================
--- trunk/qgis/src/app/qgisapp.h	2010-01-02 07:02:31 UTC (rev 12662)
+++ trunk/qgis/src/app/qgisapp.h	2010-01-02 14:39:00 UTC (rev 12663)
@@ -591,6 +591,8 @@
     void measure();
     //! Measure area
     void measureArea();
+    //! Measure angle
+    void measureAngle();
 
     //! show the attribute table for the currently selected layer
     void attributeTable();
@@ -798,6 +800,7 @@
     QAction *mActionDeselectAll;
     QAction *mActionIdentify;
     QAction *mActionMeasure;
+    QAction *mActionMeasureAngle;
     QAction *mActionMeasureArea;
     QAction *mActionViewSeparator1;
     QAction *mActionZoomFullExtent;
@@ -900,6 +903,7 @@
         QgsMapTool* mIdentify;
         QgsMapTool* mMeasureDist;
         QgsMapTool* mMeasureArea;
+        QgsMapTool* mMeasureAngle;
         QgsMapTool* mCapturePoint;
         QgsMapTool* mCaptureLine;
         QgsMapTool* mCapturePolygon;

Added: trunk/qgis/src/app/qgsdisplayangle.cpp
===================================================================
--- trunk/qgis/src/app/qgsdisplayangle.cpp	                        (rev 0)
+++ trunk/qgis/src/app/qgsdisplayangle.cpp	2010-01-02 14:39:00 UTC (rev 12663)
@@ -0,0 +1,52 @@
+/***************************************************************************
+    qgsdisplayangle.cpp
+    ------------------------
+    begin                : January 2010
+    copyright            : (C) 2010 by Marco Hugentobler
+    email                : marco at hugis dot net
+ ***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "qgsdisplayangle.h"
+#include <QSettings>
+
+#ifndef Q_OS_MACX
+#include <cmath>
+#else
+#include <math.h>
+#endif
+
+QgsDisplayAngle::QgsDisplayAngle( QWidget * parent, Qt::WindowFlags f ): QDialog( parent, f )
+{
+  setupUi( this );
+}
+
+QgsDisplayAngle::~QgsDisplayAngle()
+{
+
+}
+
+void QgsDisplayAngle::setValueInRadians( double value )
+{
+  QSettings settings;
+  QString unitString = settings.value( "/qgis/measure/angleunits", "degrees" ).toString();
+  if ( unitString == "degrees" )
+  {
+    mAngleLineEdit->setText( tr( "%1 degrees" ).arg( value * 180 / M_PI ) );
+  }
+  else if ( unitString == "radians" )
+  {
+    mAngleLineEdit->setText( tr( "%1 radians" ).arg( value ) );
+  }
+  else if ( unitString == "gon" )
+  {
+    mAngleLineEdit->setText( tr( "%1 gon" ).arg( value / M_PI * 200 ) );
+  }
+}
+

Added: trunk/qgis/src/app/qgsdisplayangle.h
===================================================================
--- trunk/qgis/src/app/qgsdisplayangle.h	                        (rev 0)
+++ trunk/qgis/src/app/qgsdisplayangle.h	2010-01-02 14:39:00 UTC (rev 12663)
@@ -0,0 +1,32 @@
+/***************************************************************************
+    qgsdisplayangle.h
+    ------------------------
+    begin                : January 2010
+    copyright            : (C) 2010 by Marco Hugentobler
+    email                : marco at hugis dot net
+ ***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef QGSDISPLAYANGLE_H
+#define QGSDISPLAYANGLE_H
+
+#include "ui_qgsdisplayanglebase.h"
+
+/**A class that displays results of angle measurements with the proper unit*/
+class QgsDisplayAngle: public QDialog, private Ui::QgsDisplayAngleBase
+{
+  public:
+    QgsDisplayAngle( QWidget * parent = 0, Qt::WindowFlags f = 0 );
+    ~QgsDisplayAngle();
+    /**Sets the measured angle value (in radians). The value is going to
+      be converted to degrees / gon automatically if necessary*/
+    void setValueInRadians( double value );
+};
+
+#endif // QGSDISPLAYANGLE_H

Added: trunk/qgis/src/app/qgsmaptoolmeasureangle.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolmeasureangle.cpp	                        (rev 0)
+++ trunk/qgis/src/app/qgsmaptoolmeasureangle.cpp	2010-01-02 14:39:00 UTC (rev 12663)
@@ -0,0 +1,154 @@
+/***************************************************************************
+    qgsmaptoolmeasureangle.cpp
+    --------------------------
+    begin                : December 2009
+    copyright            : (C) 2009 by Marco Hugentobler
+    email                : marco at hugis dot net
+ ***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "qgsmaptoolmeasureangle.h"
+#include "qgsdisplayangle.h"
+#include "qgsdistancearea.h"
+#include "qgslogger.h"
+#include "qgsmapcanvas.h"
+#include "qgsmaptopixel.h"
+#include "qgsrubberband.h"
+#include <QMouseEvent>
+#include <QSettings>
+
+#ifndef Q_OS_MACX
+#include <cmath>
+#else
+#include <math.h>
+#endif
+
+QgsMapToolMeasureAngle::QgsMapToolMeasureAngle( QgsMapCanvas* canvas ): QgsMapTool( canvas ), mRubberBand( 0 ), mResultDisplay( 0 )
+{
+  mSnapper.setMapCanvas( canvas );
+}
+
+QgsMapToolMeasureAngle::~QgsMapToolMeasureAngle()
+{
+  stopMeasuring();
+}
+
+void QgsMapToolMeasureAngle::canvasMoveEvent( QMouseEvent * e )
+{
+  if ( !mRubberBand || mAnglePoints.size() < 1 || mAnglePoints.size() > 2 || !mRubberBand )
+  {
+    return;
+  }
+
+  QgsPoint point = snapPoint( e->pos() );
+  mRubberBand->movePoint( point );
+  if ( mAnglePoints.size() == 2 )
+  {
+    //do angle calculation
+    QgsDistanceArea* distArea = mCanvas->mapRenderer()->distanceArea();
+    if ( distArea )
+    {
+      double azimutOne = distArea->bearing( mAnglePoints.at( 1 ), mAnglePoints.at( 0 ) );
+      double azimutTwo = distArea->bearing( mAnglePoints.at( 1 ), point );
+      double resultAngle = azimutTwo - azimutOne;
+      QgsDebugMsg( QString::number( fabs( resultAngle ) ) );
+      QgsDebugMsg( QString::number( M_PI ) );
+      if ( fabs( resultAngle ) > M_PI )
+      {
+        if ( resultAngle < 0 )
+        {
+          resultAngle = M_PI + ( resultAngle + M_PI );
+        }
+        else
+        {
+          resultAngle = -M_PI + ( resultAngle - M_PI );
+        }
+      }
+
+      //show angle in dialog
+      if ( !mResultDisplay )
+      {
+        mResultDisplay = new QgsDisplayAngle( mCanvas->topLevelWidget() );
+        QObject::connect( mResultDisplay, SIGNAL( rejected() ), this, SLOT( stopMeasuring() ) );
+        mResultDisplay->move( e->pos() - QPoint( 100, 100 ) );
+      }
+      mResultDisplay->show();
+      mResultDisplay->setValueInRadians( resultAngle );
+    }
+  }
+}
+
+void QgsMapToolMeasureAngle::canvasReleaseEvent( QMouseEvent * e )
+{
+  //add points until we have three
+  if ( mAnglePoints.size() == 3 )
+  {
+    mAnglePoints.clear();
+  }
+
+  if ( mAnglePoints.size() < 1 )
+  {
+    createRubberBand();
+  }
+
+  if ( mAnglePoints.size() < 3 )
+  {
+    QgsPoint newPoint = snapPoint( e->pos() );
+    mAnglePoints.push_back( newPoint );
+    mRubberBand->addPoint( newPoint );
+  }
+}
+
+void QgsMapToolMeasureAngle::stopMeasuring()
+{
+  delete mRubberBand;
+  mRubberBand = 0;
+  delete mResultDisplay;
+  mResultDisplay = 0;
+  mAnglePoints.clear();
+}
+
+void QgsMapToolMeasureAngle::activate()
+{
+  QgsMapTool::activate();
+}
+
+void QgsMapToolMeasureAngle::deactivate()
+{
+  stopMeasuring();
+  QgsMapTool::deactivate();
+}
+
+void QgsMapToolMeasureAngle::createRubberBand()
+{
+  delete mRubberBand;
+  mRubberBand = new QgsRubberBand( mCanvas, false );
+
+  QSettings settings;
+  int myRed = settings.value( "/qgis/default_measure_color_red", 180 ).toInt();
+  int myGreen = settings.value( "/qgis/default_measure_color_green", 180 ).toInt();
+  int myBlue = settings.value( "/qgis/default_measure_color_blue", 180 ).toInt();
+  mRubberBand->setColor( QColor( myRed, myGreen, myBlue ) );
+}
+
+QgsPoint QgsMapToolMeasureAngle::snapPoint( const QPoint& p )
+{
+  QList<QgsSnappingResult> snappingResults;
+  if ( mSnapper.snapToBackgroundLayers( p, snappingResults ) != 0 || snappingResults.size() < 1 )
+  {
+    return mCanvas->getCoordinateTransform()->toMapCoordinates( p );
+  }
+  else
+  {
+    return snappingResults.constBegin()->snappedVertex;
+  }
+}
+
+
+

Added: trunk/qgis/src/app/qgsmaptoolmeasureangle.h
===================================================================
--- trunk/qgis/src/app/qgsmaptoolmeasureangle.h	                        (rev 0)
+++ trunk/qgis/src/app/qgsmaptoolmeasureangle.h	2010-01-02 14:39:00 UTC (rev 12663)
@@ -0,0 +1,64 @@
+/***************************************************************************
+    qgsmaptoolmeasureangle.h
+    ------------------------
+    begin                : December 2009
+    copyright            : (C) 2009 by Marco Hugentobler
+    email                : marco at hugis dot net
+ ***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef QGSMAPTOOLMEASUREANGLE_H
+#define QGSMAPTOOLMEASUREANGLE_H
+
+#include "qgsmaptool.h"
+#include "qgsmapcanvassnapper.h"
+#include "qgspoint.h"
+
+class QgsDisplayAngle;
+class QgsRubberBand;
+
+/**Map tool to measure angle between two segments*/
+class QgsMapToolMeasureAngle: public QgsMapTool
+{
+    Q_OBJECT
+  public:
+    QgsMapToolMeasureAngle( QgsMapCanvas* canvas );
+    ~QgsMapToolMeasureAngle();
+
+    //! Mouse move event for overriding
+    void canvasMoveEvent( QMouseEvent * e );
+
+    //! Mouse release event for overriding
+    void canvasReleaseEvent( QMouseEvent * e );
+
+    //! called when set as currently active map tool
+    void activate();
+
+    //! called when map tool is being deactivated
+    void deactivate();
+
+  private:
+    /**Points defining the angle (three for measuring)*/
+    QList<QgsPoint> mAnglePoints;
+    QgsRubberBand* mRubberBand;
+    QgsDisplayAngle* mResultDisplay;
+    QgsMapCanvasSnapper mSnapper;
+
+    /**Creates a new rubber band and deletes the old one*/
+    void createRubberBand();
+    /**Snaps point to background layers*/
+    QgsPoint snapPoint( const QPoint& p );
+
+  private slots:
+    /**Deletes the rubber band and the dialog*/
+    void stopMeasuring();
+
+};
+
+#endif // QGSMAPTOOLMEASUREANGLE_H

Modified: trunk/qgis/src/app/qgsoptions.cpp
===================================================================
--- trunk/qgis/src/app/qgsoptions.cpp	2010-01-02 07:02:31 UTC (rev 12662)
+++ trunk/qgis/src/app/qgsoptions.cpp	2010-01-02 14:39:00 UTC (rev 12663)
@@ -151,7 +151,26 @@
     radMeters->setChecked( true );
   }
 
+  QButtonGroup* angleButtonGroup = new QButtonGroup( this );
+  angleButtonGroup->addButton( mDegreesRadioButton );
+  angleButtonGroup->addButton( mRadiansRadioButton );
+  angleButtonGroup->addButton( mGonRadioButton );
 
+  QString myAngleUnitsTxt = settings.value( "/qgis/measure/angleunits", "degrees" ).toString();
+  if ( myAngleUnitsTxt == "gon" )
+  {
+    mGonRadioButton->setChecked( true );
+  }
+  else if ( myAngleUnitsTxt == "radians" )
+  {
+    mRadiansRadioButton->setChecked( true );
+  }
+  else //degrees
+  {
+    mDegreesRadioButton->setChecked( true );
+  }
+
+
   // add the themes to the combo box on the option dialog
   QDir myThemeDir( ":/images/themes/" );
   myThemeDir.setFilter( QDir::Dirs );
@@ -500,6 +519,23 @@
     settings.setValue( "/qgis/measure/displayunits", "meters" );
   }
   settings.setValue( "/qgis/measure/ellipsoid", getEllipsoidAcronym( cmbEllipsoid->currentText() ) );
+
+  if ( mDegreesRadioButton->isChecked() )
+  {
+
+  }
+
+  QString angleUnitString = "degrees";
+  if ( mRadiansRadioButton->isChecked() )
+  {
+    angleUnitString = "radians";
+  }
+  else if ( mGonRadioButton->isChecked() )
+  {
+    angleUnitString = "gon";
+  }
+  settings.setValue( "/qgis/measure/angleunits", angleUnitString );
+
   //set the color for selections
   QColor myColor = pbnSelectionColor->color();
   settings.setValue( "/qgis/default_selection_color_red", myColor.red() );

Modified: trunk/qgis/src/core/qgsdistancearea.cpp
===================================================================
--- trunk/qgis/src/core/qgsdistancearea.cpp	2010-01-02 07:02:31 UTC (rev 12662)
+++ trunk/qgis/src/core/qgsdistancearea.cpp	2010-01-02 14:39:00 UTC (rev 12663)
@@ -434,14 +434,21 @@
 double QgsDistanceArea::bearing( const QgsPoint& p1, const QgsPoint& p2 )
 {
   QgsPoint pp1 = p1, pp2 = p2;
+  double bearing;
+
   if ( mProjectionsEnabled && ( mEllipsoid != "NONE" ) )
   {
     pp1 = mCoordTransform->transform( p1 );
     pp2 = mCoordTransform->transform( p2 );
+    computeDistanceBearing( pp1, pp2, &bearing );
   }
+  else //compute simple planar azimuth
+  {
+    double dx = p2.x() - p1.x();
+    double dy = p2.y() - p1.y();
+    bearing = atan2( dx, dy );
+  }
 
-  double bearing;
-  computeDistanceBearing( pp1, pp2, &bearing );
   return bearing;
 }
 

Added: trunk/qgis/src/ui/qgsdisplayanglebase.ui
===================================================================
--- trunk/qgis/src/ui/qgsdisplayanglebase.ui	                        (rev 0)
+++ trunk/qgis/src/ui/qgsdisplayanglebase.ui	2010-01-02 14:39:00 UTC (rev 12663)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>QgsDisplayAngleBase</class>
+ <widget class="QDialog" name="QgsDisplayAngleBase">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>276</width>
+    <height>78</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Angle</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0" colspan="2">
+    <widget class="QLineEdit" name="mAngleLineEdit">
+     <property name="readOnly">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <spacer name="horizontalSpacer">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>129</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="1">
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Close</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>QgsDisplayAngleBase</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>248</x>
+     <y>254</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>157</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>QgsDisplayAngleBase</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>

Modified: trunk/qgis/src/ui/qgsoptionsbase.ui
===================================================================
--- trunk/qgis/src/ui/qgsoptionsbase.ui	2010-01-02 07:02:31 UTC (rev 12662)
+++ trunk/qgis/src/ui/qgsoptionsbase.ui	2010-01-02 14:39:00 UTC (rev 12663)
@@ -374,73 +374,7 @@
       </layout>
      </widget>
      <widget class="QWidget" name="stackedWidgetPage3">
-      <layout class="QGridLayout">
-       <property name="margin">
-        <number>0</number>
-       </property>
-       <item row="2" column="0">
-        <widget class="QGroupBox" name="groupBox_10">
-         <property name="title">
-          <string>Panning and zooming</string>
-         </property>
-         <layout class="QGridLayout">
-          <property name="margin">
-           <number>11</number>
-          </property>
-          <item row="0" column="1">
-           <widget class="QComboBox" name="cmbWheelAction">
-            <item>
-             <property name="text">
-              <string>Zoom</string>
-             </property>
-            </item>
-            <item>
-             <property name="text">
-              <string>Zoom and recenter</string>
-             </property>
-            </item>
-            <item>
-             <property name="text">
-              <string>Zoom to mouse cursor</string>
-             </property>
-            </item>
-            <item>
-             <property name="text">
-              <string>Nothing</string>
-             </property>
-            </item>
-           </widget>
-          </item>
-          <item row="1" column="0">
-           <widget class="QLabel" name="label_3">
-            <property name="text">
-             <string>Zoom factor</string>
-            </property>
-           </widget>
-          </item>
-          <item row="0" column="0">
-           <widget class="QLabel" name="label_2">
-            <property name="text">
-             <string>Mouse wheel action</string>
-            </property>
-           </widget>
-          </item>
-          <item row="1" column="1">
-           <widget class="QDoubleSpinBox" name="spinZoomFactor">
-            <property name="decimals">
-             <number>1</number>
-            </property>
-            <property name="minimum">
-             <double>1.100000000000000</double>
-            </property>
-            <property name="value">
-             <double>2.000000000000000</double>
-            </property>
-           </widget>
-          </item>
-         </layout>
-        </widget>
-       </item>
+      <layout class="QGridLayout" name="gridLayout_4">
        <item row="0" column="0">
         <widget class="QGroupBox" name="groupBox_7">
          <property name="title">
@@ -503,40 +437,28 @@
          </layout>
         </widget>
        </item>
-       <item row="3" column="0">
-        <spacer>
-         <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 row="1" column="0">
         <widget class="QGroupBox" name="groupBox_6">
          <property name="title">
           <string>Measure tool</string>
          </property>
-         <layout class="QGridLayout">
-          <property name="margin">
-           <number>11</number>
-          </property>
-          <item row="1" column="2">
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
+         <layout class="QGridLayout" name="gridLayout">
+          <item row="0" column="0">
+           <widget class="QLabel" name="textLabel1_8">
+            <property name="text">
+             <string>Ellipsoid for distance calculations</string>
             </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>191</width>
-              <height>20</height>
-             </size>
+           </widget>
+          </item>
+          <item row="0" column="1">
+           <widget class="QComboBox" name="cmbEllipsoid"/>
+          </item>
+          <item row="1" column="0">
+           <widget class="QLabel" name="textLabel1_10">
+            <property name="text">
+             <string>Rubberband color</string>
             </property>
-           </spacer>
+           </widget>
           </item>
           <item row="1" column="1">
            <widget class="QgsColorButton" name="pbnMeasureColor">
@@ -551,22 +473,18 @@
             </property>
            </widget>
           </item>
-          <item row="0" column="1" colspan="2">
-           <widget class="QComboBox" name="cmbEllipsoid"/>
-          </item>
-          <item row="1" column="0">
-           <widget class="QLabel" name="textLabel1_10">
-            <property name="text">
-             <string>Rubberband color</string>
+          <item row="1" column="2" colspan="2">
+           <spacer>
+            <property name="orientation">
+             <enum>Qt::Horizontal</enum>
             </property>
-           </widget>
-          </item>
-          <item row="0" column="0">
-           <widget class="QLabel" name="textLabel1_8">
-            <property name="text">
-             <string>Ellipsoid for distance calculations</string>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>191</width>
+              <height>20</height>
+             </size>
             </property>
-           </widget>
+           </spacer>
           </item>
           <item row="2" column="0">
            <widget class="QLabel" name="textLabel1_11">
@@ -589,9 +507,113 @@
             </property>
            </widget>
           </item>
+          <item row="3" column="0">
+           <widget class="QLabel" name="mAngleUnitsLabel">
+            <property name="text">
+             <string>Preferred angle units</string>
+            </property>
+           </widget>
+          </item>
+          <item row="3" column="1">
+           <widget class="QRadioButton" name="mDegreesRadioButton">
+            <property name="text">
+             <string>Degrees</string>
+            </property>
+           </widget>
+          </item>
+          <item row="3" column="2">
+           <widget class="QRadioButton" name="mRadiansRadioButton">
+            <property name="text">
+             <string>Radians</string>
+            </property>
+           </widget>
+          </item>
+          <item row="3" column="3">
+           <widget class="QRadioButton" name="mGonRadioButton">
+            <property name="text">
+             <string>Gon</string>
+            </property>
+           </widget>
+          </item>
          </layout>
         </widget>
        </item>
+       <item row="2" column="0">
+        <widget class="QGroupBox" name="groupBox_10">
+         <property name="title">
+          <string>Panning and zooming</string>
+         </property>
+         <layout class="QGridLayout">
+          <property name="margin">
+           <number>11</number>
+          </property>
+          <item row="0" column="1">
+           <widget class="QComboBox" name="cmbWheelAction">
+            <item>
+             <property name="text">
+              <string>Zoom</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>Zoom and recenter</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>Zoom to mouse cursor</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>Nothing</string>
+             </property>
+            </item>
+           </widget>
+          </item>
+          <item row="1" column="0">
+           <widget class="QLabel" name="label_3">
+            <property name="text">
+             <string>Zoom factor</string>
+            </property>
+           </widget>
+          </item>
+          <item row="0" column="0">
+           <widget class="QLabel" name="label_2">
+            <property name="text">
+             <string>Mouse wheel action</string>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="1">
+           <widget class="QDoubleSpinBox" name="spinZoomFactor">
+            <property name="decimals">
+             <number>1</number>
+            </property>
+            <property name="minimum">
+             <double>1.100000000000000</double>
+            </property>
+            <property name="value">
+             <double>2.000000000000000</double>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item row="3" column="0">
+        <spacer>
+         <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 class="QWidget" name="stackedWidgetPage4">
@@ -1470,8 +1492,8 @@
    <slot>reject()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>186</x>
-     <y>574</y>
+     <x>190</x>
+     <y>532</y>
     </hint>
     <hint type="destinationlabel">
      <x>730</x>
@@ -1486,8 +1508,8 @@
    <slot>accept()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>186</x>
-     <y>574</y>
+     <x>190</x>
+     <y>532</y>
     </hint>
     <hint type="destinationlabel">
      <x>731</x>
@@ -1502,12 +1524,12 @@
    <slot>setCurrentIndex(int)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>136</x>
-     <y>21</y>
+     <x>113</x>
+     <y>25</y>
     </hint>
     <hint type="destinationlabel">
-     <x>864</x>
-     <y>14</y>
+     <x>808</x>
+     <y>18</y>
     </hint>
    </hints>
   </connection>



More information about the QGIS-commit mailing list