Skip to content

Commit

Permalink
Add tr() to some user visible text
Browse files Browse the repository at this point in the history
Fix a bug with the angle spinbox not displaying the correct value when
the dialog box was opened


git-svn-id: http://svn.osgeo.org/qgis/trunk@4783 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jan 31, 2006
1 parent 772d047 commit d442a45
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/plugins/north_arrow/plugin.cpp
Expand Up @@ -89,14 +89,14 @@ QgsNorthArrowPlugin::~QgsNorthArrowPlugin()
*/
void QgsNorthArrowPlugin::initGui()
{
QMenu *pluginMenu = qGisInterface->getPluginMenu("&Decorations");
menuId = pluginMenu->insertItem(QIcon(icon),"&NorthArrow", this, SLOT(run()));
QMenu *pluginMenu = qGisInterface->getPluginMenu(tr("&Decorations"));
menuId = pluginMenu->insertItem(QIcon(icon),tr("&NorthArrow"), this, SLOT(run()));

pluginMenu->setWhatsThis(menuId, "Creates a north arrow that is displayed on the map canvas");
pluginMenu->setWhatsThis(menuId, tr("Creates a north arrow that is displayed on the map canvas"));

// Create the action for tool
myQActionPointer = new QAction(QIcon(icon), "North Arrow", this);
myQActionPointer->setWhatsThis("Creates a north arrow that is displayed on the map canvas");
myQActionPointer = new QAction(QIcon(icon), tr("North Arrow"), this);
myQActionPointer->setWhatsThis(tr("Creates a north arrow that is displayed on the map canvas"));
// Connect the action to the run
connect(myQActionPointer, SIGNAL(activated()), this, SLOT(run()));
//render the arrow each time the map is rendered
Expand Down Expand Up @@ -236,7 +236,7 @@ void QgsNorthArrowPlugin::renderNorthArrow(QPainter * theQPainter)
QFont myQFont("time", 32, QFont::Bold);
theQPainter->setFont(myQFont);
theQPainter->setPen(Qt::black);
theQPainter->drawText(10, 20, QString("Pixmap Not Found"));
theQPainter->drawText(10, 20, QString(tr("Pixmap Not Found")));
}
}

Expand All @@ -245,7 +245,7 @@ void QgsNorthArrowPlugin::renderNorthArrow(QPainter * theQPainter)
void QgsNorthArrowPlugin::unload()
{
// remove the GUI
qGisInterface->removePluginMenuItem("&Decorations",menuId);
qGisInterface->removePluginMenuItem(tr("&Decorations"),menuId);
qGisInterface->removeToolBarIcon(myQActionPointer);
// remove the northarrow from the canvas
disconnect(qGisInterface->getMapCanvas(), SIGNAL(renderComplete(QPainter *)),
Expand Down
7 changes: 5 additions & 2 deletions src/plugins/north_arrow/plugingui.cpp
Expand Up @@ -58,7 +58,10 @@ void QgsNorthArrowPluginGui::on_pbnCancel_clicked()
void QgsNorthArrowPluginGui::setRotation(int theInt)
{
rotatePixmap(theInt);
sliderRotation->setValue(theInt);
//sliderRotation->setValue(theInt);
// signal/slot connection defined in 'designer' causes the slider to
// be moved to reflect the change in the spinbox.
spinAngle->setValue(theInt);
}

void QgsNorthArrowPluginGui::setPlacement(QString thePlacementQString)
Expand Down Expand Up @@ -146,7 +149,7 @@ void QgsNorthArrowPluginGui::rotatePixmap(int theRotationInt)
QFont myQFont("time", 18, QFont::Bold);
myQPainter.setFont(myQFont);
myQPainter.setPen(Qt::red);
myQPainter.drawText(10, 20, QString("Pixmap Not Found"));
myQPainter.drawText(10, 20, tr("Pixmap Not Found"));
myQPainter.end();
pixmapLabel->setPixmap(myPainterPixmap);
}
Expand Down

0 comments on commit d442a45

Please sign in to comment.