Skip to content

Commit

Permalink
some translation string fixes in road graph plugin
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@15098 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jan 28, 2011
1 parent 7714612 commit b9676ba
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 45 deletions.
4 changes: 2 additions & 2 deletions src/plugins/roadgraph/exportdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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();
Expand Down
16 changes: 8 additions & 8 deletions src/plugins/roadgraph/linevectorlayerdirector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions src/plugins/roadgraph/linevectorlayerdirector.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand All @@ -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;
Expand All @@ -73,7 +73,7 @@ class RgLineVectorLayerDirector : public RgGraphDirector
QString mReverseDirectionValue;

QString mBothDirectionValue;

//FIXME: need enum
int mDefaultDirection;
};
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/roadgraph/linevectorlayerwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
32 changes: 16 additions & 16 deletions src/plugins/roadgraph/roadgraphplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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>" ) ) );
Expand Down Expand Up @@ -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 )
Expand All @@ -292,7 +292,7 @@ void RoadGraphPlugin::render( QPainter *painter )
return;

const RgGraphDirector *graphDirector = director();

if ( graphDirector == NULL )
return;

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/roadgraph/settingsdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
16 changes: 8 additions & 8 deletions src/plugins/roadgraph/shortestpathwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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 );
Expand All @@ -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" ) );
Expand All @@ -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 );
Expand Down Expand Up @@ -228,7 +228,7 @@ bool RgShortestPathWidget::getPath( AdjacencyMatrix& matrix, QgsPoint& p1, QgsPo
{
const RgGraphDirector *director = mPlugin->director();
director->makeGraph( &builder );

// not need
delete director;
}
Expand All @@ -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();
Expand Down

0 comments on commit b9676ba

Please sign in to comment.