Skip to content
Permalink
Browse files

some translation string fixes in road graph plugin

git-svn-id: http://svn.osgeo.org/qgis/trunk@15098 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Jan 28, 2011
1 parent 7714612 commit b9676ba3c96dd99539a9091c3c4d791679084080
@@ -35,7 +35,7 @@ RgExportDlg::RgExportDlg( QWidget* parent, Qt::WFlags fl )
QVBoxLayout *v = new QVBoxLayout( this );

QHBoxLayout *h = new QHBoxLayout();
QLabel *l = new QLabel( tr( "Select destination layer:" ), this );
QLabel *l = new QLabel( tr( "Select destination layer" ), this );
h->addWidget( l );
mcbLayers = new QComboBox( this );
h->addWidget( mcbLayers );
@@ -47,7 +47,7 @@ RgExportDlg::RgExportDlg( QWidget* parent, Qt::WFlags fl )
v->addWidget( bb );

//fill list of layers
mcbLayers->insertItem( 0, tr( "new temporary layer" ), QVariant( "-1" ) );
mcbLayers->insertItem( 0, tr( "New temporary layer" ), QVariant( "-1" ) );

QMap<QString, QgsMapLayer*> mapLayers = QgsMapLayerRegistry::instance()->mapLayers();
QMap<QString, QgsMapLayer*>::iterator layer_it = mapLayers.begin();
@@ -32,14 +32,14 @@
#include <iostream>

RgLineVectorLayerDirector::RgLineVectorLayerDirector( const QString& layerId,
int directionFieldId,
const QString& directDirectionValue,
const QString& reverseDirectionValue,
const QString& bothDirectionValue,
int defaultDirection,
const QString& speedUnitName,
int speedFieldId,
double defaultSpeed)
int directionFieldId,
const QString& directDirectionValue,
const QString& reverseDirectionValue,
const QString& bothDirectionValue,
int defaultDirection,
const QString& speedUnitName,
int speedFieldId,
double defaultSpeed )
{
mLayerId = layerId;
mDirectionFieldId = directionFieldId;
@@ -33,13 +33,13 @@ class QgsVectorLayer;
class RgLineVectorLayerDirector : public RgGraphDirector
{
public:
RgLineVectorLayerDirector( const QString& layerId,
RgLineVectorLayerDirector( const QString& layerId,
int directionFiledId,
const QString& directDirectionValue,
const QString& reverseDirectionValue,
const QString& bothDirectionValue,
int defaultDirection,
const QString& speedValueUnit = QString("m/s"),
int defaultDirection,
const QString& speedValueUnit = QString( "m/s" ),
int speedFieldId = -1,
double defaultSpeed = 1.0 );

@@ -51,19 +51,19 @@ class RgLineVectorLayerDirector : public RgGraphDirector
void makeGraph( RgGraphBuilder * ) const;

QString name() const;

private:

QgsVectorLayer* myLayer() const;

private:

QString mLayerId;

int mSpeedFieldId;

double mDefaultSpeed;

QString mSpeedUnitName;

int mDirectionFieldId;
@@ -73,7 +73,7 @@ class RgLineVectorLayerDirector : public RgGraphDirector
QString mReverseDirectionValue;

QString mBothDirectionValue;

//FIXME: need enum
int mDefaultDirection;
};
@@ -103,7 +103,7 @@ RgLineVectorLayerSettingsWidget::RgLineVectorLayerSettingsWidget( RgLineVectorLa
h = new QHBoxLayout( frame );
l = new QLabel( tr( "Cost" ), frame );
h->addWidget( l );
l = new QLabel( tr( "lines length" ), frame );
l = new QLabel( tr( "Line lengths" ), frame );
h->addWidget( l );
v->addLayout( h );

@@ -53,7 +53,7 @@

static const char * const sIdent = "$Id: roadgraphplugin.cpp 9327 2009-04-20 10:09:44Z YEKST $";
static const QString sName = QObject::tr( "Road graph plugin" );
static const QString sDescription = QObject::tr( "It solve shortest path poblem." );
static const QString sDescription = QObject::tr( "It solves the shortest path problem." );
static const QString sPluginVersion = QObject::tr( "Version 0.1" );
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;

@@ -96,7 +96,7 @@ void RoadGraphPlugin::initGui()

// Create the action for tool
mQSettingsAction = new QAction( QIcon( ":/roadgraph/road.png" ), tr( "Road graph settings" ), this );
mQShowDirectionAction = new QAction( QIcon( ":/roadgraph/showdirect.png" ), tr( "Show roads direction" ), this );
mQShowDirectionAction = new QAction( QIcon( ":/roadgraph/showdirect.png" ), tr( "Show road's direction" ), this );
mInfoAction = new QAction( QIcon( ":/roadgraph/about.png" ), tr( "About" ), this );

// Set the what's this text
@@ -201,7 +201,7 @@ void RoadGraphPlugin::about()
version->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter );
lines->addWidget( title );
lines->addWidget( version );
lines->addWidget( new QLabel( tr( "Find shortest path on roads graph" ) ) );
lines->addWidget( new QLabel( tr( "Find shortest path on road's graph" ) ) );
lines->addWidget( new QLabel( tr( "<b>Developers:</b>" ) ) );
lines->addWidget( new QLabel( " Sergey Yakushev" ) );
lines->addWidget( new QLabel( tr( "<b>Homepage:</b>" ) ) );
@@ -269,21 +269,21 @@ const RgGraphDirector* RoadGraphPlugin::director() const
if ( layer == NULL )
return NULL;

QgsVectorDataProvider *provider = dynamic_cast< QgsVectorDataProvider* > ( layer->dataProvider() );
QgsVectorDataProvider *provider = dynamic_cast< QgsVectorDataProvider* >( layer->dataProvider() );
if ( provider == NULL )
return NULL;

RgLineVectorLayerDirector * director =
new RgLineVectorLayerDirector( layerId,
provider->fieldNameIndex( mSettings->mDirection ),
mSettings->mFirstPointToLastPointDirectionVal,
mSettings->mLastPointToFirstPointDirectionVal,
mSettings->mBothDirectionVal,
mSettings->mDefaultDirection,
mSettings->mSpeedUnitName,
provider->fieldNameIndex( mSettings->mSpeed ),
mSettings->mDefaultSpeed );
RgLineVectorLayerDirector * director =
new RgLineVectorLayerDirector( layerId,
provider->fieldNameIndex( mSettings->mDirection ),
mSettings->mFirstPointToLastPointDirectionVal,
mSettings->mLastPointToFirstPointDirectionVal,
mSettings->mBothDirectionVal,
mSettings->mDefaultDirection,
mSettings->mSpeedUnitName,
provider->fieldNameIndex( mSettings->mSpeed ),
mSettings->mDefaultSpeed );

return director;
}
void RoadGraphPlugin::render( QPainter *painter )
@@ -292,7 +292,7 @@ void RoadGraphPlugin::render( QPainter *painter )
return;

const RgGraphDirector *graphDirector = director();

if ( graphDirector == NULL )
return;

@@ -29,18 +29,18 @@ RgSettingsDlg::RgSettingsDlg( RgSettings *settings, QWidget* parent, Qt::WFlags
: mSettings( settings ), QDialog( parent, fl )
{
// create base widgets;
setWindowTitle( tr( "Road graph plugins settings" ) );
setWindowTitle( tr( "Road graph plugin settings" ) );
QVBoxLayout *v = new QVBoxLayout( this );

QHBoxLayout *h = new QHBoxLayout();
QLabel *l = new QLabel( tr( "Plugins time unit:" ), this );
QLabel *l = new QLabel( tr( "Time unit" ), this );
h->addWidget( l );
mcbPluginsTimeUnit = new QComboBox( this );
h->addWidget( mcbPluginsTimeUnit );
v->addLayout( h );

h = new QHBoxLayout();
l = new QLabel( tr( "Plugins distance unit:" ), this );
l = new QLabel( tr( "Distance unit" ), this );
h->addWidget( l );
mcbPluginsDistanceUnit = new QComboBox( this );
h->addWidget( mcbPluginsDistanceUnit );
@@ -62,7 +62,7 @@ RgShortestPathWidget::RgShortestPathWidget( QWidget* theParent, RoadGraphPlugin
QHBoxLayout *h = NULL;
QLabel *l = NULL;

l = new QLabel( tr( "Start:" ), myWidget );
l = new QLabel( tr( "Start" ), myWidget );
v->addWidget( l );
h = new QHBoxLayout();
mFrontPointLineEdit = new QLineEdit( myWidget );
@@ -74,7 +74,7 @@ RgShortestPathWidget::RgShortestPathWidget( QWidget* theParent, RoadGraphPlugin
h->addWidget( selectFrontPoint );
v->addLayout( h );

l = new QLabel( tr( "Stop:" ), myWidget );
l = new QLabel( tr( "Stop" ), myWidget );
v->addWidget( l );
h = new QHBoxLayout();
mBackPointLineEdit = new QLineEdit( myWidget );
@@ -87,7 +87,7 @@ RgShortestPathWidget::RgShortestPathWidget( QWidget* theParent, RoadGraphPlugin
v->addLayout( h );

h = new QHBoxLayout( this );
l = new QLabel( tr( "Criterion:" ), myWidget );
l = new QLabel( tr( "Criterion" ), myWidget );
mCriterionName = new QComboBox( myWidget );
mCriterionName->insertItem( 0, tr( "Length" ) );
mCriterionName->insertItem( 1, tr( "Time" ) );
@@ -96,15 +96,15 @@ RgShortestPathWidget::RgShortestPathWidget( QWidget* theParent, RoadGraphPlugin
v->addLayout( h );

h = new QHBoxLayout( myWidget );
l = new QLabel( tr( "Length:" ), myWidget );
l = new QLabel( tr( "Length" ), myWidget );
mPathCostLineEdit = new QLineEdit( myWidget );
mPathCostLineEdit->setReadOnly( true );
h->addWidget( l );
h->addWidget( mPathCostLineEdit );
v->addLayout( h );

h = new QHBoxLayout( myWidget );
l = new QLabel( tr( "Time:" ), myWidget );
l = new QLabel( tr( "Time" ), myWidget );
mPathTimeLineEdit = new QLineEdit( myWidget );
mPathTimeLineEdit->setReadOnly( true );
h->addWidget( l );
@@ -228,7 +228,7 @@ bool RgShortestPathWidget::getPath( AdjacencyMatrix& matrix, QgsPoint& p1, QgsPo
{
const RgGraphDirector *director = mPlugin->director();
director->makeGraph( &builder );

// not need
delete director;
}
@@ -238,13 +238,13 @@ bool RgShortestPathWidget::getPath( AdjacencyMatrix& matrix, QgsPoint& p1, QgsPo
p1 = builder.tiePoint( mFrontPoint, ok );
if ( !ok )
{
QMessageBox::critical (this, tr("Tie point failed"), tr("Start point don't tie to the road!") );
QMessageBox::critical( this, tr( "Tie point failed" ), tr( "Start point doesn't tie to the road!" ) );
return false;
}
p2 = builder.tiePoint( mBackPoint, ok );
if ( !ok )
{
QMessageBox::critical (this, tr("Tie point failed"), tr("Stop point don't tie to the road!") );
QMessageBox::critical( this, tr( "Tie point failed" ), tr( "Stop point doesn't tie to the road!" ) );
return false;
}
AdjacencyMatrix m = builder.adjacencyMatrix();

0 comments on commit b9676ba

Please sign in to comment.
You can’t perform that action at this time.