[QGIS Commit] r13744 - in trunk/qgis: python/core src/app src/core src/core/symbology-ng src/gui src/gui/symbology-ng

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Jun 17 16:43:18 EDT 2010


Author: jef
Date: 2010-06-17 20:43:18 +0000 (Thu, 17 Jun 2010)
New Revision: 13744

Modified:
   trunk/qgis/python/core/symbology-ng-core.sip
   trunk/qgis/src/app/qgisapp.cpp
   trunk/qgis/src/app/qgscustomprojectiondialog.cpp
   trunk/qgis/src/app/qgsrasterlayerproperties.cpp
   trunk/qgis/src/app/qgssinglesymboldialog.cpp
   trunk/qgis/src/core/CMakeLists.txt
   trunk/qgis/src/core/qgsapplication.cpp
   trunk/qgis/src/core/qgsmaplayer.cpp
   trunk/qgis/src/core/qgssearchtreenode.cpp
   trunk/qgis/src/core/qgsvectordataprovider.cpp
   trunk/qgis/src/core/qgsvectordataprovider.h
   trunk/qgis/src/core/qgsvectorlayer.cpp
   trunk/qgis/src/core/symbology-ng/qgssymbollayerv2registry.cpp
   trunk/qgis/src/core/symbology-ng/qgssymbollayerv2registry.h
   trunk/qgis/src/gui/CMakeLists.txt
   trunk/qgis/src/gui/qgscomposerview.cpp
   trunk/qgis/src/gui/qgsencodingfiledialog.cpp
   trunk/qgis/src/gui/qgstextannotationitem.cpp
   trunk/qgis/src/gui/symbology-ng/characterwidget.cpp
   trunk/qgis/src/gui/symbology-ng/qgsbrushstylecombobox.cpp
   trunk/qgis/src/gui/symbology-ng/qgsbrushstylecombobox.h
   trunk/qgis/src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp
   trunk/qgis/src/gui/symbology-ng/qgspenstylecombobox.cpp
   trunk/qgis/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
   trunk/qgis/src/gui/symbology-ng/qgssymbolv2propertiesdialog.cpp
   trunk/qgis/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp
Log:
fix #2815 - including more missing translation strings

Modified: trunk/qgis/python/core/symbology-ng-core.sip
===================================================================
--- trunk/qgis/python/core/symbology-ng-core.sip	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/python/core/symbology-ng-core.sip	2010-06-17 20:43:18 UTC (rev 13744)
@@ -774,9 +774,10 @@
 
   public:
     /** construct metadata */
-    QgsSymbolLayerV2AbstractMetadata( QString name, QgsSymbolV2::SymbolType type );
+    QgsSymbolLayerV2AbstractMetadata( QString name, QString visibleName, QgsSymbolV2::SymbolType type );
 
     QString name() const;
+    QString visibleName() const;
     QgsSymbolV2::SymbolType type() const;
 
     /** create a symbol layer of this type given the map of properties. */

Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/app/qgisapp.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -3760,7 +3760,7 @@
   QgsMapLayer* layer = activeLayer();
   if ( layer == NULL || layer->type() != QgsMapLayer::VectorLayer )
   {
-    QMessageBox::warning( this, "Labeling", "Please select a vector layer first." );
+    QMessageBox::warning( this, tr( "Labeling" ), tr( "Please select a vector layer first." ) );
     return;
   }
   QgsVectorLayer* vlayer = dynamic_cast<QgsVectorLayer*>( layer );
@@ -4190,7 +4190,7 @@
   const QgsFeatureIds& featureIdSet = vl->selectedFeaturesIds();
   if ( featureIdSet.size() < 2 )
   {
-    QMessageBox::information( 0, "Not enough features selected", tr( "The merge tool requires at least two selected features" ) );
+    QMessageBox::information( 0, tr( "Not enough features selected" ), tr( "The merge tool requires at least two selected features" ) );
     return;
   }
 
@@ -4212,7 +4212,7 @@
   QGis::WkbType newType = unionGeom->wkbType();
   if ( providerChecksTypeStrictly && unionGeom->wkbType() != vl->wkbType() )
   {
-    QMessageBox::critical( 0, "Union operation canceled", tr( "The union operation would result in a geometry type that is not compatible with the current layer and therefore is canceled" ) );
+    QMessageBox::critical( 0, tr( "Union operation canceled" ), tr( "The union operation would result in a geometry type that is not compatible with the current layer and therefore is canceled" ) );
     delete unionGeom;
     return;
   }
@@ -4229,7 +4229,7 @@
 
   if ( featureListAfter.size() < 2 )
   {
-    QMessageBox::information( 0, "Not enough features selected", tr( "The merge tool requires at least two selected features" ) );
+    QMessageBox::information( 0, tr( "Not enough features selected" ), tr( "The merge tool requires at least two selected features" ) );
     delete unionGeom;
     return;
   }

Modified: trunk/qgis/src/app/qgscustomprojectiondialog.cpp
===================================================================
--- trunk/qgis/src/app/qgscustomprojectiondialog.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/app/qgscustomprojectiondialog.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -344,7 +344,7 @@
       //cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId));
       leParameters->setText( QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 4 ) ) );
       mCurrentRecordLong = 1;
-      lblRecordNo->setText( QString::number( mCurrentRecordLong ) + " of " + QString::number( mRecordCountLong ) );
+      lblRecordNo->setText( tr( "%1 of %2" ).arg( mCurrentRecordLong ).arg( mRecordCountLong ) );
     }
   }
   else
@@ -416,7 +416,7 @@
       //cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId));
       leParameters->setText( QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 4 ) ) ),
       --mCurrentRecordLong;
-      lblRecordNo->setText( QString::number( mCurrentRecordLong ) + " of " + QString::number( mRecordCountLong ) );
+      lblRecordNo->setText( tr( "%1 of %2" ).arg( mCurrentRecordLong ).arg( mRecordCountLong ) );
     }
   }
   else
@@ -489,7 +489,7 @@
       //cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId));
       leParameters->setText( QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 4 ) ) );
       ++mCurrentRecordLong;
-      lblRecordNo->setText( QString::number( mCurrentRecordLong ) + " of " + QString::number( mRecordCountLong ) );
+      lblRecordNo->setText( tr( "%1 of %2" ).arg( mCurrentRecordLong ).arg( mRecordCountLong ) );
     }
   }
   else
@@ -558,7 +558,7 @@
       //cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId));
       leParameters->setText( QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 4 ) ) );
       mCurrentRecordLong = mRecordCountLong;
-      lblRecordNo->setText( QString::number( mCurrentRecordLong ) + " of " + QString::number( mRecordCountLong ) );
+      lblRecordNo->setText( tr( "%1 of %2" ).arg( mCurrentRecordLong ).arg( mRecordCountLong ) );
     }
   }
   else
@@ -620,7 +620,7 @@
     leParameters->setText( "" );
     //cboProjectionFamily->setCurrentItem(0);
     //cboEllipsoid->setCurrentItem(0);
-    lblRecordNo->setText( "* of " + QString::number( mRecordCountLong ) );
+    lblRecordNo->setText( tr( "* of %1" ).arg( mRecordCountLong ) );
     //remember the rec we are on in case the user aborts
     mLastRecordLong = mCurrentRecordLong;
     mCurrentRecordId = "";
@@ -898,8 +898,8 @@
   int projResult = pj_transform( wgs84Proj, myProj, 1, 0, &easthing, &northing, &z );
   if ( projResult != 0 )
   {
-    projectedX->setText( "Error" );
-    projectedY->setText( "Error" );
+    projectedX->setText( tr( "Error" ) );
+    projectedY->setText( tr( "Error" ) );
     QgsDebugMsg( pj_strerrno( projResult ) );
   }
   else

Modified: trunk/qgis/src/app/qgsrasterlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsrasterlayerproperties.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/app/qgsrasterlayerproperties.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -145,9 +145,9 @@
   //cboxClassificationMode->addItem( tr( "Quantiles" ) );
 
   QStringList headerLabels;
-  headerLabels << "Value";
-  headerLabels << "Color";
-  headerLabels << "Label";
+  headerLabels << tr( "Value" );
+  headerLabels << tr( "Color" );
+  headerLabels << tr( "Label" );
   mColormapTreeWidget->setHeaderLabels( headerLabels );
 
   //disable colormap tab completely until 'Colormap' is selected (and only for type GrayOrUndefined)

Modified: trunk/qgis/src/app/qgssinglesymboldialog.cpp
===================================================================
--- trunk/qgis/src/app/qgssinglesymboldialog.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/app/qgssinglesymboldialog.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -256,9 +256,10 @@
 //should this method have a different name?
 void QgsSingleSymbolDialog::selectTextureImage()
 {
-  QString fileName = QFileDialog::getOpenFileName( this, "Open File",
+  QString fileName = QFileDialog::getOpenFileName( this,
+                     tr( "Open File" ),
                      mTexturePath,
-                     "Images (*.png *.xpm *.jpg)" ); //should we allow other types of images?
+                     tr( "Images (*.png *.xpm *.jpg)" ) ); //should we allow other types of images?
 
   if ( !fileName.isNull() )
   { //only process the string if the user clicked OK

Modified: trunk/qgis/src/core/CMakeLists.txt
===================================================================
--- trunk/qgis/src/core/CMakeLists.txt	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/core/CMakeLists.txt	2010-06-17 20:43:18 UTC (rev 13744)
@@ -238,6 +238,7 @@
   qgsvectorlayer.h
   qgsrasterdataprovider.h
   qgsnetworkaccessmanager.h
+  qgsvectordataprovider.h
 
   composer/qgscomposerlegend.h
   composer/qgscomposermap.h

Modified: trunk/qgis/src/core/qgsapplication.cpp
===================================================================
--- trunk/qgis/src/core/qgsapplication.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/core/qgsapplication.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -91,7 +91,7 @@
   }
   catch ( ... )
   {
-    QMessageBox::critical( activeWindow(), tr( "Exception" ), "unknown exception" );
+    QMessageBox::critical( activeWindow(), tr( "Exception" ), tr( "unknown exception" ) );
   }
   return done;
 }

Modified: trunk/qgis/src/core/qgsmaplayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsmaplayer.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/core/qgsmaplayer.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -582,7 +582,7 @@
   QDomElement myRoot = myDocument.firstChildElement( "qgis" );
   if ( myRoot.isNull() )
   {
-    myErrorMessage = "Error: qgis element could not be found in " + theURI;
+    myErrorMessage = tr( "Error: qgis element could not be found in %1" ).arg( theURI );
     theResultFlag = false;
     return myErrorMessage;
   }

Modified: trunk/qgis/src/core/qgssearchtreenode.cpp
===================================================================
--- trunk/qgis/src/core/qgssearchtreenode.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/core/qgssearchtreenode.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -289,7 +289,7 @@
   // this error should be caught when checking syntax, but for sure...
   if ( mType != tOperator )
   {
-    mError = "Expected operator, got scalar value!";
+    mError = QObject::tr( "Expected operator, got scalar value!" );
     return false;
   }
 
@@ -352,7 +352,7 @@
         case opGE: return ( res >= 0 );
         case opLE: return ( res <= 0 );
         default:
-          mError = "Unexpected state when evaluating operator!";
+          mError = QObject::tr( "Unexpected state when evaluating operator!" );
           return false;
       }
 
@@ -392,8 +392,7 @@
     }
 
     default:
-      mError = "Unknown operator: ";
-      mError += QString::number( mOp );
+      mError = QObject::tr( "Unknown operator: %1" ).arg( mOp );
       return false;
   }
 }
@@ -414,15 +413,13 @@
 
         // these should never happen (no need to translate)
       case 3:
-        mError = "Unknown operator: ";
-        mError += value.string();
+        mError = QObject::tr( "Unknown operator: %1" ).arg( value.string() );
         break;
       case 4:
-        mError = "Unknown token: ";
-        mError += value.string();
+        mError = QObject::tr( "Unknown token: %1" ).arg( value.string() );
         break;
       default:
-        mError = "Unknown error!";
+        mError = QObject::tr( "Unknown error!" );
         break;
     }
     return false;

Modified: trunk/qgis/src/core/qgsvectordataprovider.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectordataprovider.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/core/qgsvectordataprovider.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -163,50 +163,50 @@
 
   if ( abilities & QgsVectorDataProvider::AddFeatures )
   {
-    abilitiesList += "Add Features";
+    abilitiesList += tr( "Add Features" );
     QgsDebugMsg( "Capability: Add Features" );
   }
 
   if ( abilities & QgsVectorDataProvider::DeleteFeatures )
   {
-    abilitiesList += "Delete Features";
+    abilitiesList += tr( "Delete Features" );
     QgsDebugMsg( "Capability: Delete Features" );
   }
 
   if ( abilities & QgsVectorDataProvider::ChangeAttributeValues )
   {
-    abilitiesList += "Change Attribute Values";
+    abilitiesList += tr( "Change Attribute Values" );
     QgsDebugMsg( "Capability: Change Attribute Values" );
   }
 
   if ( abilities & QgsVectorDataProvider::AddAttributes )
   {
-    abilitiesList += "Add Attributes";
+    abilitiesList += tr( "Add Attributes" );
     QgsDebugMsg( "Capability: Add Attributes" );
   }
 
   if ( abilities & QgsVectorDataProvider::DeleteAttributes )
   {
-    abilitiesList += "Delete Attributes";
+    abilitiesList += tr( "Delete Attributes" );
     QgsDebugMsg( "Capability: Delete Attributes" );
   }
 
   if ( abilities & QgsVectorDataProvider::CreateSpatialIndex )
   {
     // TODO: Tighten up this test.  See QgsOgrProvider for details.
-    abilitiesList += "Create Spatial Index";
+    abilitiesList += tr( "Create Spatial Index" );
     QgsDebugMsg( "Capability: Create Spatial Index" );
   }
 
   if ( abilities & QgsVectorDataProvider::SelectAtId )
   {
-    abilitiesList += "Fast Access to Features at ID";
+    abilitiesList += tr( "Fast Access to Features at ID" );
     QgsDebugMsg( "Capability: Select at ID" );
   }
 
   if ( abilities & QgsVectorDataProvider::ChangeGeometries )
   {
-    abilitiesList += "Change Geometries";
+    abilitiesList += tr( "Change Geometries" );
     QgsDebugMsg( "Capability: Change Geometries" );
   }
 

Modified: trunk/qgis/src/core/qgsvectordataprovider.h
===================================================================
--- trunk/qgis/src/core/qgsvectordataprovider.h	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/core/qgsvectordataprovider.h	2010-06-17 20:43:18 UTC (rev 13744)
@@ -38,6 +38,8 @@
  */
 class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
 {
+    Q_OBJECT
+
   public:
 
     // If you add to this, please also add to capabilitiesString()

Modified: trunk/qgis/src/core/qgsvectorlayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/core/qgsvectorlayer.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -2844,14 +2844,14 @@
     {
       if ( !myRenderer->writeXML( node, doc, *this ) )
       {
-        errorMessage = "renderer failed to save";
+        errorMessage = tr( "renderer failed to save" );
         return false;
       }
     }
     else
     {
       QgsDebugMsg( "no renderer" );
-      errorMessage = "no renderer";
+      errorMessage = tr( "no renderer" );
       return false;
     }
   }

Modified: trunk/qgis/src/core/symbology-ng/qgssymbollayerv2registry.cpp
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgssymbollayerv2registry.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/core/symbology-ng/qgssymbollayerv2registry.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -10,23 +10,23 @@
 QgsSymbolLayerV2Registry::QgsSymbolLayerV2Registry()
 {
   // init registry with known symbol layers
-  addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SimpleLine", QgsSymbolV2::Line,
+  addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SimpleLine", QObject::tr( "Simple line" ), QgsSymbolV2::Line,
                       QgsSimpleLineSymbolLayerV2::create ) );
-  addSymbolLayerType( new QgsSymbolLayerV2Metadata( "MarkerLine", QgsSymbolV2::Line,
+  addSymbolLayerType( new QgsSymbolLayerV2Metadata( "MarkerLine", QObject::tr( "Marker line" ), QgsSymbolV2::Line,
                       QgsMarkerLineSymbolLayerV2::create ) );
-  addSymbolLayerType( new QgsSymbolLayerV2Metadata( "LineDecoration", QgsSymbolV2::Line,
+  addSymbolLayerType( new QgsSymbolLayerV2Metadata( "LineDecoration", QObject::tr( "Line decoration" ), QgsSymbolV2::Line,
                       QgsLineDecorationSymbolLayerV2::create ) );
 
-  addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SimpleMarker", QgsSymbolV2::Marker,
+  addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SimpleMarker", QObject::tr( "Simple marker" ), QgsSymbolV2::Marker,
                       QgsSimpleMarkerSymbolLayerV2::create ) );
-  addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SvgMarker", QgsSymbolV2::Marker,
+  addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SvgMarker", QObject::tr( "SVG marker" ), QgsSymbolV2::Marker,
                       QgsSvgMarkerSymbolLayerV2::create ) );
-  addSymbolLayerType( new QgsSymbolLayerV2Metadata( "FontMarker", QgsSymbolV2::Marker,
+  addSymbolLayerType( new QgsSymbolLayerV2Metadata( "FontMarker", QObject::tr( "Font marker" ), QgsSymbolV2::Marker,
                       QgsFontMarkerSymbolLayerV2::create ) );
 
-  addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SimpleFill", QgsSymbolV2::Fill,
+  addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SimpleFill", QObject::tr( "Simple fill" ), QgsSymbolV2::Fill,
                       QgsSimpleFillSymbolLayerV2::create ) );
-  addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SVGFill", QgsSymbolV2::Fill, QgsSVGFillSymbolLayer::create ) );
+  addSymbolLayerType( new QgsSymbolLayerV2Metadata( "SVGFill", QObject::tr( "SVG fill" ), QgsSymbolV2::Fill, QgsSVGFillSymbolLayer::create ) );
 }
 
 QgsSymbolLayerV2Registry::~QgsSymbolLayerV2Registry()

Modified: trunk/qgis/src/core/symbology-ng/qgssymbollayerv2registry.h
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgssymbollayerv2registry.h	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/core/symbology-ng/qgssymbollayerv2registry.h	2010-06-17 20:43:18 UTC (rev 13744)
@@ -14,10 +14,11 @@
 class CORE_EXPORT QgsSymbolLayerV2AbstractMetadata
 {
   public:
-    QgsSymbolLayerV2AbstractMetadata( QString name, QgsSymbolV2::SymbolType type )
-        : mName( name ), mType( type ) {}
+    QgsSymbolLayerV2AbstractMetadata( QString name, QString visibleName, QgsSymbolV2::SymbolType type )
+        : mName( name ), mVisibleName( visibleName ), mType( type ) {}
 
     QString name() const { return mName; }
+    QString visibleName() const { return mVisibleName; }
     QgsSymbolV2::SymbolType type() const { return mType; }
 
     /** create a symbol layer of this type given the map of properties. */
@@ -27,6 +28,7 @@
 
   protected:
     QString mName;
+    QString mVisibleName;
     QgsSymbolV2::SymbolType mType;
 };
 
@@ -39,10 +41,11 @@
 class CORE_EXPORT QgsSymbolLayerV2Metadata : public QgsSymbolLayerV2AbstractMetadata
 {
   public:
-    QgsSymbolLayerV2Metadata( QString name, QgsSymbolV2::SymbolType type,
+    QgsSymbolLayerV2Metadata( QString name, QString visibleName,
+                              QgsSymbolV2::SymbolType type,
                               QgsSymbolLayerV2CreateFunc pfCreate,
                               QgsSymbolLayerV2WidgetFunc pfWidget = NULL )
-        : QgsSymbolLayerV2AbstractMetadata( name, type ), mCreateFunc( pfCreate ), mWidgetFunc( pfWidget ) {}
+        : QgsSymbolLayerV2AbstractMetadata( name, visibleName, type ), mCreateFunc( pfCreate ), mWidgetFunc( pfWidget ) {}
 
     QgsSymbolLayerV2CreateFunc createFunction() const { return mCreateFunc; }
     QgsSymbolLayerV2WidgetFunc widgetFunction() const { return mWidgetFunc; }

Modified: trunk/qgis/src/gui/CMakeLists.txt
===================================================================
--- trunk/qgis/src/gui/CMakeLists.txt	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/gui/CMakeLists.txt	2010-06-17 20:43:18 UTC (rev 13744)
@@ -74,6 +74,7 @@
 symbology-ng/qgsvectorcolorbrewercolorrampv2dialog.h
 symbology-ng/characterwidget.h
 symbology-ng/qgspenstylecombobox.h
+symbology-ng/qgsbrushstylecombobox.h
 
 qgsattributeeditor.h
 qgscomposerview.h

Modified: trunk/qgis/src/gui/qgscomposerview.cpp
===================================================================
--- trunk/qgis/src/gui/qgscomposerview.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/gui/qgscomposerview.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -127,7 +127,7 @@
     case AddLabel:
     {
       QgsComposerLabel* newLabelItem = new QgsComposerLabel( composition() );
-      newLabelItem->setText( "Quantum GIS" );
+      newLabelItem->setText( tr( "Quantum GIS" ) );
       newLabelItem->adjustSizeToText();
       newLabelItem->setSceneRect( QRectF( snappedScenePoint.x(), snappedScenePoint.y(), newLabelItem->rect().width(), newLabelItem->rect().height() ) );
       addComposerLabel( newLabelItem );

Modified: trunk/qgis/src/gui/qgsencodingfiledialog.cpp
===================================================================
--- trunk/qgis/src/gui/qgsencodingfiledialog.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/gui/qgsencodingfiledialog.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -90,7 +90,7 @@
 {
   if ( ! mCancelAllButton )
   {
-    mCancelAllButton = new QPushButton( "Cancel &All", NULL );
+    mCancelAllButton = new QPushButton( tr( "Cancel &All" ), NULL );
     layout()->addWidget( mCancelAllButton ); // Ownership transfered, no need to delete later on
     connect( mCancelAllButton, SIGNAL( clicked() ), this, SLOT( pbnCancelAll_clicked() ) );
   }

Modified: trunk/qgis/src/gui/qgstextannotationitem.cpp
===================================================================
--- trunk/qgis/src/gui/qgstextannotationitem.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/gui/qgstextannotationitem.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -61,8 +61,8 @@
   mDocument->setTextWidth( mFrameSize.width() );
 
   painter->save();
-  painter->translate( mOffsetFromReferencePoint.x() + frameWidth / 2.0, mOffsetFromReferencePoint.y() + \
-                      frameWidth / 2.0 );
+  painter->translate( mOffsetFromReferencePoint.x() + frameWidth / 2.0,
+                      mOffsetFromReferencePoint.y() + frameWidth / 2.0 );
 
   //draw text document
   mDocument->drawContents( painter, QRectF( 0, 0, mFrameSize.width() - frameWidth / 2.0, mFrameSize.height() - frameWidth / 2.0 ) );
@@ -93,7 +93,7 @@
 {
   delete mDocument;
   mDocument = new QTextDocument;
-  mDocument->setHtml( itemElem.attribute( "document", "<html>QGIS rocks!</html>" ) );
+  mDocument->setHtml( itemElem.attribute( "document", QObject::tr( "<html>QGIS rocks!</html>" ) ) );
   QDomElement annotationElem = itemElem.firstChildElement( "AnnotationItem" );
   if ( !annotationElem.isNull() )
   {

Modified: trunk/qgis/src/gui/symbology-ng/characterwidget.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/characterwidget.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/gui/symbology-ng/characterwidget.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -108,10 +108,10 @@
   QPoint widgetPosition = mapFromGlobal( event->globalPos() );
   uint key = ( widgetPosition.y() / squareSize ) * columns + widgetPosition.x() / squareSize;
 
-  QString text = QString::fromLatin1( "<p>Character: <span style=\"font-size: 24pt; font-family: %1\">" ).arg( displayFont.family() )
-                 + QChar( key )
-                 + QString::fromLatin1( "</span><p>Value: 0x" )
-                 + QString::number( key, 16 );
+  QString text = tr( "<p>Character: <span style=\"font-size: 24pt; font-family: %1%2</span><p>Value: 0x%3\">" )
+                 .arg( displayFont.family() )
+                 .arg( QChar( key ) )
+                 .arg( key, 16 );
   QToolTip::showText( event->globalPos(), text, this );
 }
 //! [4]

Modified: trunk/qgis/src/gui/symbology-ng/qgsbrushstylecombobox.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgsbrushstylecombobox.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/gui/symbology-ng/qgsbrushstylecombobox.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -12,21 +12,21 @@
     : QComboBox( parent )
 {
   QList < QPair<Qt::BrushStyle, QString> > styles;
-  styles << qMakePair( Qt::SolidPattern, QString( "Solid" ) )
-  << qMakePair( Qt::HorPattern, QString( "Horizontal" ) )
-  << qMakePair( Qt::VerPattern, QString( "Vertical" ) )
-  << qMakePair( Qt::CrossPattern, QString( "Cross" ) )
-  << qMakePair( Qt::BDiagPattern, QString( "BDiagonal" ) )
-  << qMakePair( Qt::FDiagPattern, QString( "FDiagonal" ) )
-  << qMakePair( Qt::DiagCrossPattern, QString( "Diagonal X" ) )
-  << qMakePair( Qt::Dense1Pattern, QString( "Dense 1" ) )
-  << qMakePair( Qt::Dense2Pattern, QString( "Dense 2" ) )
-  << qMakePair( Qt::Dense3Pattern, QString( "Dense 3" ) )
-  << qMakePair( Qt::Dense4Pattern, QString( "Dense 4" ) )
-  << qMakePair( Qt::Dense5Pattern, QString( "Dense 5" ) )
-  << qMakePair( Qt::Dense6Pattern, QString( "Dense 6" ) )
-  << qMakePair( Qt::Dense7Pattern, QString( "Dense 7" ) )
-  << qMakePair( Qt::NoBrush, QString( "No Brush" ) );
+  styles << qMakePair( Qt::SolidPattern, tr( "Solid" ) )
+  << qMakePair( Qt::HorPattern, tr( "Horizontal" ) )
+  << qMakePair( Qt::VerPattern, tr( "Vertical" ) )
+  << qMakePair( Qt::CrossPattern, tr( "Cross" ) )
+  << qMakePair( Qt::BDiagPattern, tr( "BDiagonal" ) )
+  << qMakePair( Qt::FDiagPattern, tr( "FDiagonal" ) )
+  << qMakePair( Qt::DiagCrossPattern, tr( "Diagonal X" ) )
+  << qMakePair( Qt::Dense1Pattern, tr( "Dense 1" ) )
+  << qMakePair( Qt::Dense2Pattern, tr( "Dense 2" ) )
+  << qMakePair( Qt::Dense3Pattern, tr( "Dense 3" ) )
+  << qMakePair( Qt::Dense4Pattern, tr( "Dense 4" ) )
+  << qMakePair( Qt::Dense5Pattern, tr( "Dense 5" ) )
+  << qMakePair( Qt::Dense6Pattern, tr( "Dense 6" ) )
+  << qMakePair( Qt::Dense7Pattern, tr( "Dense 7" ) )
+  << qMakePair( Qt::NoBrush, tr( "No Brush" ) );
 
   setIconSize( QSize( 32, 16 ) );
 

Modified: trunk/qgis/src/gui/symbology-ng/qgsbrushstylecombobox.h
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgsbrushstylecombobox.h	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/gui/symbology-ng/qgsbrushstylecombobox.h	2010-06-17 20:43:18 UTC (rev 13744)
@@ -6,6 +6,8 @@
 
 class GUI_EXPORT QgsBrushStyleComboBox : public QComboBox
 {
+    Q_OBJECT
+
   public:
     QgsBrushStyleComboBox( QWidget* parent = NULL );
 

Modified: trunk/qgis/src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -48,7 +48,7 @@
   populateColorRamps();
   QStandardItemModel* mg = new QStandardItemModel( this );
   QStringList labels;
-  labels << "Range" << "Label";
+  labels << tr( "Range" ) << tr( "Label" );
   mg->setHorizontalHeaderLabels( labels );
   viewGraduated->setModel( mg );
 
@@ -218,7 +218,7 @@
   mRowSelected = -1;
 
   QStringList labels;
-  labels << "Symbol" << "Range" << "Label";
+  labels << tr( "Symbol" ) << tr( "Range" ) << tr( "Label" );
   m->setHorizontalHeaderLabels( labels );
 
   QSize iconSize( 16, 16 );

Modified: trunk/qgis/src/gui/symbology-ng/qgspenstylecombobox.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgspenstylecombobox.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/gui/symbology-ng/qgspenstylecombobox.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -13,12 +13,12 @@
     : QComboBox( parent )
 {
   QList < QPair<Qt::PenStyle, QString> > styles;
-  styles << qMakePair( Qt::SolidLine, QString( "Solid Line" ) )
-  << qMakePair( Qt::DashLine, QString( "Dash Line" ) )
-  << qMakePair( Qt::DotLine, QString( "Dot Line" ) )
-  << qMakePair( Qt::DashDotLine, QString( "Dash Dot Line" ) )
-  << qMakePair( Qt::DashDotDotLine, QString( "Dash Dot Dot Line" ) )
-  << qMakePair( Qt::NoPen, QString( "No Pen" ) );
+  styles << qMakePair( Qt::SolidLine, tr( "Solid Line" ) )
+  << qMakePair( Qt::DashLine, tr( "Dash Line" ) )
+  << qMakePair( Qt::DotLine, tr( "Dot Line" ) )
+  << qMakePair( Qt::DashDotLine, tr( "Dash Dot Line" ) )
+  << qMakePair( Qt::DashDotDotLine, tr( "Dash Dot Dot Line" ) )
+  << qMakePair( Qt::NoPen, tr( "No Pen" ) );
 
   setIconSize( QSize( 32, 12 ) );
 

Modified: trunk/qgis/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -421,7 +421,7 @@
     if ( txt.isEmpty() ) txt = tr( "(no filter)" );
     if ( rule.dependsOnScale() )
     {
-      txt += QString( ", scale " ) + formatScaleRange( rule.scaleMinDenom(), rule.scaleMaxDenom() );
+      txt += tr( ", scale " ) + formatScaleRange( rule.scaleMinDenom(), rule.scaleMaxDenom() );
     }
 
     item->setText( 0, txt );
@@ -447,9 +447,9 @@
     {
       QString txt;
       if ( rule.dependsOnScale() )
-        txt = QString( "scale " ) + formatScaleRange( rule.scaleMinDenom(), rule.scaleMaxDenom() );
+        txt = tr( "scale " ) + formatScaleRange( rule.scaleMinDenom(), rule.scaleMaxDenom() );
       else
-        txt = "any scale";
+        txt = tr( "any scale" );
 
       QTreeWidgetItem* scale_item = new QTreeWidgetItem;
       scale_item->setText( 0, txt );

Modified: trunk/qgis/src/gui/symbology-ng/qgssymbolv2propertiesdialog.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgssymbolv2propertiesdialog.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/gui/symbology-ng/qgssymbolv2propertiesdialog.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -43,7 +43,7 @@
     QVariant data( int role ) const
     {
       if ( role == Qt::DisplayRole )
-        return QVariant( mLayer->layerType() );
+        return QgsSymbolLayerV2Registry::instance()->symbolLayerMetadata( mLayer->layerType() )->visibleName();
       if ( role == Qt::SizeHintRole )
         return QVariant( QSize( 32, 32 ) );
       if ( role == Qt::CheckStateRole )
@@ -162,7 +162,7 @@
 
   cboLayerType->clear();
   for ( int i = 0; i < types.count(); i++ )
-    cboLayerType->addItem( types[i] );
+    cboLayerType->addItem( QgsSymbolLayerV2Registry::instance()->symbolLayerMetadata( types[i] )->visibleName(), types[i] );
 }
 
 
@@ -285,7 +285,7 @@
     return;
 
   // update layer type combo box
-  int idx = cboLayerType->findText( layer->layerType() );
+  int idx = cboLayerType->findData( layer->layerType() );
   cboLayerType->setCurrentIndex( idx );
 
   updateSymbolLayerWidget( layer );
@@ -308,7 +308,7 @@
   QgsSymbolLayerV2* layer = currentLayer();
   if ( layer == NULL ) return;
 
-  QString newLayerType = cboLayerType->currentText();
+  QString newLayerType = cboLayerType->itemData( cboLayerType->currentIndex() ).toString();
   if ( layer->layerType() == newLayerType )
     return;
 

Modified: trunk/qgis/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp	2010-06-17 19:54:47 UTC (rev 13743)
+++ trunk/qgis/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp	2010-06-17 20:43:18 UTC (rev 13744)
@@ -210,8 +210,8 @@
 void QgsSymbolV2SelectorDialog::addSymbolToStyle()
 {
   bool ok;
-  QString name = QInputDialog::getText( this, "Symbol name",
-                                        "Please enter name for the symbol:", QLineEdit::Normal, "New symbol", &ok );
+  QString name = QInputDialog::getText( this, tr( "Symbol name" ),
+                                        tr( "Please enter name for the symbol:" ) , QLineEdit::Normal, tr( "New symbol" ), &ok );
   if ( !ok || name.isEmpty() )
     return;
 



More information about the QGIS-commit mailing list