From 8a2b80e3cd454c70e4cc555737c13da2822da1b9 Mon Sep 17 00:00:00 2001 From: yangzhenghan Date: Wed, 5 Apr 2023 10:46:01 +0800 Subject: [PATCH] modify strings for localization --- qeframeworkSup/project/archive/maiaObject.cpp | 2 +- .../project/common/QEPVNameSelectDialog.cpp | 2 +- .../QEAbstractDynamicWidget.cpp | 18 +-- .../widgets/QEAnalogSlider/QAnalogSlider.cpp | 6 +- .../widgets/QEButton/QEGenericButton.cpp | 14 +- .../project/widgets/QECalcout/QECalcout.cpp | 8 +- .../project/widgets/QEComboBox/QEComboBox.cpp | 2 +- .../QEConfiguredLayout/QEConfiguredLayout.cpp | 10 +- .../widgets/QECorrelation/QECorrelation.cpp | 6 +- .../project/widgets/QEDateTime/QEDateTime.cpp | 2 +- .../widgets/QEDistribution/QEDistribution.cpp | 26 ++-- .../widgets/QEFileBrowser/QEFileBrowser.cpp | 22 +-- .../widgets/QEFileImage/QEFileImage.cpp | 2 +- .../project/widgets/QEForm/QEForm.cpp | 7 +- .../widgets/QEFormGrid/QEDynamicFormGrid.cpp | 2 +- .../project/widgets/QEImage/QEImage.cpp | 20 +-- .../widgets/QEImage/flipRotateMenu.cpp | 12 +- .../project/widgets/QEImage/imageInfo.cpp | 4 +- .../widgets/QEImage/imageProperties.cpp | 20 +-- .../widgets/QEImage/markupDisplayMenu.cpp | 40 ++--- .../project/widgets/QEImage/profilePlot.cpp | 4 +- .../widgets/QEImage/screenSelectDialog.cpp | 8 +- .../project/widgets/QEImage/selectMenu.cpp | 38 ++--- .../project/widgets/QEImage/zoomMenu.cpp | 4 +- .../widgets/QELineEdit/QEGenericEdit.cpp | 8 +- .../project/widgets/QELineEdit/QELineEdit.cpp | 4 +- .../project/widgets/QELog/QELog.cpp | 41 +++-- .../project/widgets/QELogin/QELogin.cpp | 32 ++-- .../widgets/QENumericEdit/QENumericEdit.cpp | 9 +- .../project/widgets/QEPlot/QEPlot.cpp | 6 +- .../project/widgets/QEPlotter/QEPlotter.cpp | 32 ++-- .../widgets/QEPlotter/QEPlotterMenu.cpp | 140 +++++++++--------- .../QEPVLoadSaveNameSelectDialog.cpp | 2 +- .../widgets/QEPvLoadSave/QEPvLoadSave.cpp | 72 ++++----- .../QEPvLoadSave/QEPvLoadSaveModel.cpp | 8 +- .../QEPvLoadSaveButton/QEPvLoadSaveButton.cpp | 24 +-- .../widgets/QEPvProperties/QEPvProperties.cpp | 26 ++-- .../widgets/QERadioGroup/QERadioGroup.cpp | 2 +- .../project/widgets/QERecipe/QERecipe.cpp | 52 +++---- .../widgets/QEScratchPad/QEScratchPad.cpp | 14 +- .../widgets/QEScratchPad/QEScratchPadMenu.cpp | 10 +- .../project/widgets/QEScript/QEScript.cpp | 94 ++++++------ .../project/widgets/QESpinBox/QESpinBox.cpp | 2 +- .../widgets/QEStripChart/QEStripChart.cpp | 26 ++-- .../QEStripChart/QEStripChartContextMenu.cpp | 80 +++++----- .../widgets/QEStripChart/QEStripChartItem.cpp | 6 +- .../QEStripChart/QEStripChartNames.cpp | 18 +-- .../QEStripChart/QEStripChartToolBar.cpp | 32 ++-- .../project/widgets/QETable/QENTTable.cpp | 4 +- .../project/widgets/QETable/QETable.cpp | 4 +- .../project/widgets/QEWidget/QEToolTip.cpp | 2 +- .../widgets/QEWidget/applicationLauncher.cpp | 4 +- .../project/widgets/QEWidget/contextMenu.cpp | 28 ++-- .../widgets/QEWidget/persistanceManager.cpp | 24 +-- 54 files changed, 541 insertions(+), 544 deletions(-) diff --git a/qeframeworkSup/project/archive/maiaObject.cpp b/qeframeworkSup/project/archive/maiaObject.cpp index e0f5551a..0f58b76e 100644 --- a/qeframeworkSup/project/archive/maiaObject.cpp +++ b/qeframeworkSup/project/archive/maiaObject.cpp @@ -268,7 +268,7 @@ void MaiaObject::parseResponse(QString response, QNetworkReply* reply) { int errorLine; int errorColumn; if(!doc.setContent(response, &errorMsg, &errorLine, &errorColumn)) { - emit fault(-32700, QString("parse error: response not well formed at line %1: %2").arg(errorLine).arg(errorMsg), reply); + emit fault(-32700, tr("parse error: response not well formed at line %1: %2").arg(errorLine).arg(errorMsg), reply); delete this; return; } diff --git a/qeframeworkSup/project/common/QEPVNameSelectDialog.cpp b/qeframeworkSup/project/common/QEPVNameSelectDialog.cpp index 79330648..b97485d1 100644 --- a/qeframeworkSup/project/common/QEPVNameSelectDialog.cpp +++ b/qeframeworkSup/project/common/QEPVNameSelectDialog.cpp @@ -232,7 +232,7 @@ void QEPVNameSelectDialog::helpClicked (bool /* checked */ ) // And update button text. // - const QString helpButtonText = helpIsVis ? "Hide" : "Help"; + const QString helpButtonText = helpIsVis ? tr("Hide") : tr("Help"); this->ui->helpButton->setText (helpButtonText); } diff --git a/qeframeworkSup/project/widgets/QEAbstractWidget/QEAbstractDynamicWidget.cpp b/qeframeworkSup/project/widgets/QEAbstractWidget/QEAbstractDynamicWidget.cpp index 39404656..40b72e25 100644 --- a/qeframeworkSup/project/widgets/QEAbstractWidget/QEAbstractDynamicWidget.cpp +++ b/qeframeworkSup/project/widgets/QEAbstractWidget/QEAbstractDynamicWidget.cpp @@ -193,12 +193,12 @@ QMenu* QEAbstractDynamicWidget::buildContextMenu () menu->addSeparator (); - action = new QAction ("Load Configuration", menu); + action = new QAction (tr("Load Configuration"), menu); action->setCheckable (false); action->setData (ADWCM_LOAD_WIDGET_CONFIG); menu->addAction (action); - action = new QAction ("Save Configuration", menu); + action = new QAction (tr("Save Configuration"), menu); action->setCheckable (false); action->setData (ADWCM_SAVE_WIDGET_CONFIG); menu->addAction (action); @@ -217,19 +217,19 @@ void QEAbstractDynamicWidget::addPVLabelModeContextMenu (QMenu* menu) menu->addSeparator (); - action = new QAction ("Use PV Names", menu); + action = new QAction (tr("Use PV Names"), menu); action->setCheckable (true); action->setChecked (this->pvLabelMode == usePvName); action->setData (ADWCM_SELECT_USE_PV_NAME); menu->addAction (action); - action = new QAction ("Use Alias Names (if available)", menu); + action = new QAction (tr("Use Alias Names (if available)"), menu); action->setCheckable (true); action->setChecked (this->pvLabelMode == useAliasName); action->setData (ADWCM_SELECT_USE_ALIAS_NAME); menu->addAction (action); - action = new QAction ("Use Descriptions (if available)", menu); + action = new QAction (tr("Use Descriptions (if available)"), menu); action->setCheckable (true); action->setChecked (this->pvLabelMode == useDescription); action->setData (ADWCM_SELECT_USE_DESCRIPTION); @@ -344,8 +344,8 @@ void QEAbstractDynamicWidget::saveNamedWidetConfiguration (const QString& filena void QEAbstractDynamicWidget::loadWidgetConfiguration () { QString filename = QFileDialog::getOpenFileName - (this,"Select configuration input file", this->getDefaultDir (), - "Config Files(*.xml);;All files (*)"); + (this,tr("Select configuration input file"), this->getDefaultDir (), + tr("Config Files(*.xml);;All files (*)")); // Idf user clicks on Cancel, an empty file name is returned. // This is handled by the loadNamedWidetConfiguration function. @@ -361,8 +361,8 @@ void QEAbstractDynamicWidget::saveWidgetConfiguration () // overwrite confirmation here. // QString filename = QFileDialog::getSaveFileName - (this, "Select configuration output file", this->getDefaultDir (), - "Config Files(*.xml)", 0, QFileDialog::DontConfirmOverwrite); + (this, tr("Select configuration output file"), this->getDefaultDir (), + tr("Config Files(*.xml)"), 0, QFileDialog::DontConfirmOverwrite); // Ensure name ends with .xml iff a name has been specified. // diff --git a/qeframeworkSup/project/widgets/QEAnalogSlider/QAnalogSlider.cpp b/qeframeworkSup/project/widgets/QEAnalogSlider/QAnalogSlider.cpp index 8d315903..e24f86bc 100644 --- a/qeframeworkSup/project/widgets/QEAnalogSlider/QAnalogSlider.cpp +++ b/qeframeworkSup/project/widgets/QEAnalogSlider/QAnalogSlider.cpp @@ -138,19 +138,19 @@ void QAnalogSlider::commonSetup () this->saveButton->setFixedSize (buttonSize, buttonSize); this->saveButton->setStyleSheet (QEUtilities::colourToStyle (QColor (0x00C000))); this->saveButton->setFocusPolicy (Qt::NoFocus); - this->saveButton->setToolTip (" save current value "); + this->saveButton->setToolTip (tr(" save current value ")); this->revertButton = new QPushButton ("R", this->labelFrame); this->revertButton->setFixedSize (buttonSize, buttonSize); this->revertButton->setStyleSheet (QEUtilities::colourToStyle (QColor (0x40A0FF))); this->revertButton->setFocusPolicy (Qt::NoFocus); - this->revertButton->setToolTip (" revert to saved value "); + this->revertButton->setToolTip (tr(" revert to saved value ")); this->applyButton = new QPushButton ("A", this->labelFrame); this->applyButton->setFixedSize (buttonSize, buttonSize); this->applyButton->setStyleSheet (QEUtilities::colourToStyle (QColor (0x80E880))); this->applyButton->setFocusPolicy (Qt::NoFocus); - this->applyButton->setToolTip (" apply value "); + this->applyButton->setToolTip (tr(" apply value ")); this->labelLayout->addWidget (this->saveButton); this->labelLayout->addWidget (this->revertButton); diff --git a/qeframeworkSup/project/widgets/QEButton/QEGenericButton.cpp b/qeframeworkSup/project/widgets/QEButton/QEGenericButton.cpp index c25fbf33..8fc90215 100644 --- a/qeframeworkSup/project/widgets/QEButton/QEGenericButton.cpp +++ b/qeframeworkSup/project/widgets/QEButton/QEGenericButton.cpp @@ -83,7 +83,7 @@ void QEGenericButton::dataSetup() writeOnClick = true; setAllowDrop( false ); confirmRequired = false; - confirmText = "Do you want to perform this action?"; + confirmText = QObject::tr("Do you want to perform this action?"); // Set text alignment to the default for a push button // This will make no visual difference unless the style has been changed from the default @@ -401,7 +401,7 @@ void QEGenericButton::setGenericButtonText( const QString& text, QCaAlarmInfo& a } else { QString message; - message = QString( "%1: '%2' (%3) is not one of: '%4' or '%5'" ) + message = QString( QObject::tr("%1: '%2' (%3) is not one of: '%4' or '%5'") ) .arg( getQWidget()->metaObject()->className() ) .arg( text ) .arg( state ) @@ -451,7 +451,7 @@ bool QEGenericButton::confirmAction() // Get confirmation from the user as to what to do int confirm = QMessageBox::Yes; - confirm = QMessageBox::warning( (QWidget*)getButtonQObject(), "Confirm write", confirmText, + confirm = QMessageBox::warning( (QWidget*)getButtonQObject(), QObject::tr("Confirm write"), confirmText, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes ); // Return yes/no @@ -518,7 +518,7 @@ void QEGenericButton::userReleased() QString error; if( !qca->writeStringElement( writeText, error ) ) { - QMessageBox::warning( (QWidget*)getButtonQObject(), QString( "Write failed" ), error, QMessageBox::Cancel ); + QMessageBox::warning( (QWidget*)getButtonQObject(), QString( QObject::tr("Write failed") ), error, QMessageBox::Cancel ); } } } @@ -578,7 +578,7 @@ void QEGenericButton::userClicked( bool checked ) QString error; if( !qca->writeStringElement( writeText, error ) ) { - QMessageBox::warning( (QWidget*)getButtonQObject(), QString( "Write failed" ), error, QMessageBox::Cancel ); + QMessageBox::warning( (QWidget*)getButtonQObject(), QString( QObject::tr("Write failed") ), error, QMessageBox::Cancel ); } } } @@ -689,7 +689,7 @@ bool QEGenericButton::checkPassword() // Ask the user what the password is bool ok; - QString text = QInputDialog::getText( (QWidget*)getButtonQObject(), "Password", "Password:", QLineEdit::Password, "", &ok ); + QString text = QInputDialog::getText( (QWidget*)getButtonQObject(), QObject::tr("Password"), QObject::tr("Password:"), QLineEdit::Password, "", &ok ); // If the user canceled, silently return password failure if( !ok ) @@ -698,7 +698,7 @@ bool QEGenericButton::checkPassword() // If the user entered the wrong password, show a warning, then return password failure if ( text.compare( password ) ) { - QMessageBox::warning( (QWidget*)getButtonQObject(), "Incorrect Password", "You entered the wrong password. No action will be taken" ); + QMessageBox::warning( (QWidget*)getButtonQObject(), QObject::tr("Incorrect Password"), QObject::tr("You entered the wrong password. No action will be taken") ); return false; } diff --git a/qeframeworkSup/project/widgets/QECalcout/QECalcout.cpp b/qeframeworkSup/project/widgets/QECalcout/QECalcout.cpp index f3bf9aa4..fa5b5ab8 100644 --- a/qeframeworkSup/project/widgets/QECalcout/QECalcout.cpp +++ b/qeframeworkSup/project/widgets/QECalcout/QECalcout.cpp @@ -208,7 +208,7 @@ void QECalcout::setCalc (const QString& calcIn) if (this->calc.length() > MAX_POSTFIX_SIZE) { this->calcExpressionIsValid = false; - this->calcExpressionStatus = "Expression too long"; + this->calcExpressionStatus = tr("Expression too long"); return; } @@ -223,7 +223,7 @@ void QECalcout::setCalc (const QString& calcIn) this->calcExpressionIsValid = (status == 0); if (this->calcExpressionIsValid) { - this->calcExpressionStatus = "okay"; + this->calcExpressionStatus = tr("okay"); } else { this->calcExpressionStatus = QString (calcErrorStr (error)); } @@ -257,7 +257,7 @@ void QECalcout::setOcal (const QString& ocalIn) if (this->ocal.length() > MAX_POSTFIX_SIZE) { this->ocalExpressionIsValid = false; - this->ocalExpressionStatus = "Expression too long"; + this->ocalExpressionStatus = tr("Expression too long"); return; } @@ -272,7 +272,7 @@ void QECalcout::setOcal (const QString& ocalIn) this->ocalExpressionIsValid = (status == 0); if (this->ocalExpressionIsValid) { - this->ocalExpressionStatus = "okay"; + this->ocalExpressionStatus = tr("okay"); } else { this->ocalExpressionStatus = QString (calcErrorStr (error)); } diff --git a/qeframeworkSup/project/widgets/QEComboBox/QEComboBox.cpp b/qeframeworkSup/project/widgets/QEComboBox/QEComboBox.cpp index 3483db48..066a65b8 100644 --- a/qeframeworkSup/project/widgets/QEComboBox/QEComboBox.cpp +++ b/qeframeworkSup/project/widgets/QEComboBox/QEComboBox.cpp @@ -448,7 +448,7 @@ QMenu* QEComboBox::buildContextMenu () QMenu* menu = QEWidget::buildContextMenu (); QAction* action; - action = new QAction ("Apply current selection", menu); + action = new QAction (tr("Apply current selection"), menu); action->setCheckable (false); action->setData (QECB_APPLY_CURRENT_SELECTION); diff --git a/qeframeworkSup/project/widgets/QEConfiguredLayout/QEConfiguredLayout.cpp b/qeframeworkSup/project/widgets/QEConfiguredLayout/QEConfiguredLayout.cpp index 31840e81..b194f93b 100644 --- a/qeframeworkSup/project/widgets/QEConfiguredLayout/QEConfiguredLayout.cpp +++ b/qeframeworkSup/project/widgets/QEConfiguredLayout/QEConfiguredLayout.cpp @@ -49,7 +49,7 @@ QEConfiguredLayout::QEConfiguredLayout(QWidget *pParent, bool pSubscription) : qComboBoxItemList = new QComboBox(this); qComboBoxItemList->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - qComboBoxItemList->setToolTip("Select item to be viewed/controlled"); + qComboBoxItemList->setToolTip(tr("Select item to be viewed/controlled")); QObject::connect(qComboBoxItemList, SIGNAL(currentIndexChanged(int)), this, SLOT(comboBoxItemSelected(int))); qScrollArea->setWidgetResizable(true); @@ -588,7 +588,7 @@ void QEConfiguredLayout::refreshFields() qHBoxLayout = new QHBoxLayout(); qPushButtonGroup = new _QPushButtonGroup(this, item->getName(), fieldInfo->getGroup(), ¤tFieldList); qPushButtonGroup->setText(fieldInfo->getGroup()); - qPushButtonGroup->setToolTip("Show fields of group '" + fieldInfo->getGroup() + "'"); + qPushButtonGroup->setToolTip(tr("Show fields of group '%1'").arg(fieldInfo->getGroup())); if (fieldInfo->getJoin()) { @@ -644,7 +644,7 @@ void QEConfiguredLayout::valueWritten(const QString &pNewValue, const QString &p { // if (pFieldName.isEmpty()) // { - sendMessage("The field was changed from '" + pOldValue + "' to '" + pNewValue + "'."); + sendMessage(tr("The field was changed from '%1' to '%2'").arg(pOldValue).arg(pNewValue)); // } // else // { @@ -963,8 +963,8 @@ _QDialogItem::_QDialogItem(QWidget *pParent, QString pItemName, QString pGroupNa } } - qPushButtonClose->setText("Close"); - qPushButtonClose->setToolTip("Close window"); + qPushButtonClose->setText(tr("Close")); + qPushButtonClose->setToolTip(tr("Close window")); QObject::connect(qPushButtonClose, SIGNAL(clicked()), this, SLOT(buttonCloseClicked())); qVBoxLayout->addWidget(qPushButtonClose); diff --git a/qeframeworkSup/project/widgets/QECorrelation/QECorrelation.cpp b/qeframeworkSup/project/widgets/QECorrelation/QECorrelation.cpp index d87c9684..636b5282 100644 --- a/qeframeworkSup/project/widgets/QECorrelation/QECorrelation.cpp +++ b/qeframeworkSup/project/widgets/QECorrelation/QECorrelation.cpp @@ -169,16 +169,16 @@ void QECorrelation::setup () this->contextMenu = new QMenu (this); QAction* action; - action = new QAction ("Add/Edit PV Name ", this->contextMenu); + action = new QAction (tr("Add/Edit PV Name "), this->contextMenu); action->setData (QVariant (int (maAddEdit))); this->contextMenu->addAction (action); - action = new QAction ("Paste PV Name ", this->contextMenu ); + action = new QAction (tr("Paste PV Name "), this->contextMenu ); action->setData (QVariant (int (maPaste))); this->contextMenu->addAction (action); this->pasteAction = action; // save a reference. - action = new QAction ("Clear ", this->contextMenu ); + action = new QAction (tr("Clear "), this->contextMenu ); action->setData (QVariant (int (maClear))); this->contextMenu->addAction (action); this->clearAction = action; // save a reference. diff --git a/qeframeworkSup/project/widgets/QEDateTime/QEDateTime.cpp b/qeframeworkSup/project/widgets/QEDateTime/QEDateTime.cpp index b0ab5a25..ab1b3318 100644 --- a/qeframeworkSup/project/widgets/QEDateTime/QEDateTime.cpp +++ b/qeframeworkSup/project/widgets/QEDateTime/QEDateTime.cpp @@ -80,7 +80,7 @@ QEDateTime::QEDateTime (QWidget* parent) : QLabel (parent) // Build the context menu - note unlike QEWidget paradigm, we do this only once. // this->contextMenu = new QMenu (this); - QAction* action = new QAction ("Copy time text ", this->contextMenu); + QAction* action = new QAction (tr("Copy time text "), this->contextMenu); this->contextMenu->addAction (action); QObject::connect (this->contextMenu, SIGNAL (triggered (QAction*)), diff --git a/qeframeworkSup/project/widgets/QEDistribution/QEDistribution.cpp b/qeframeworkSup/project/widgets/QEDistribution/QEDistribution.cpp index 29f918d9..8342285c 100644 --- a/qeframeworkSup/project/widgets/QEDistribution/QEDistribution.cpp +++ b/qeframeworkSup/project/widgets/QEDistribution/QEDistribution.cpp @@ -138,16 +138,16 @@ void QEDistribution::setup() this->contextMenu = new QMenu (this); QAction* action; - action = new QAction ("Add/Edit PV Name ", this->contextMenu); + action = new QAction (tr("Add/Edit PV Name "), this->contextMenu); action->setData (QVariant (int (maAddEdit))); this->contextMenu->addAction (action); - action = new QAction ("Paste PV Name ", this->contextMenu ); + action = new QAction (tr("Paste PV Name "), this->contextMenu ); action->setData (QVariant (int (maPaste))); this->contextMenu->addAction (action); this->pasteAction = action; // save a reference. - action = new QAction ("Clear ", this->contextMenu ); + action = new QAction (tr("Clear "), this->contextMenu ); action->setData (QVariant (int (maClear))); this->contextMenu->addAction (action); this->clearAction = action; // save a reference. @@ -1158,7 +1158,7 @@ void QEDistribution::createWidgets() this->pvNameLabel = new QLabel (this->resize_frame); this->pvNameLabel->setGeometry (QRect (left, 8, 420, 16)); left += 420 + sg; - this->pvNameLabel->setText ("NAME..."); + this->pvNameLabel->setText (tr("NAME...")); this->pvNameLabel->setFont (font1); this->pvNameLabel->setStyleSheet (QEUtilities::colourToStyle (QColor (155, 205, 255))); this->pvNameLabel->setIndent (6); @@ -1170,16 +1170,16 @@ void QEDistribution::createWidgets() this->valueLabel->setStyleSheet (QEUtilities::offBackgroundStyle ()); this->resetButton = new QPushButton (this->resize_frame); - this->resetButton->setToolTip (" Reset/clear all data "); - this->resetButton->setText ("Reset"); + this->resetButton->setToolTip (tr(" Reset/clear all data ")); + this->resetButton->setText (tr("Reset")); this->resetButton->setGeometry (QRect (left, 7, 52, 20)); left += 52 + sg; this->resetButton->setFont (font0); this->resetButton->setFocusPolicy (Qt::NoFocus); this->resetButton->setStyleSheet (QEUtilities::colourToStyle (QColor (255, 255, 128))); this->gaussianBox = new QCheckBox (this->resize_frame); - this->gaussianBox->setToolTip (" Show/hide gaussian curve "); - this->gaussianBox->setText ("gaussian"); + this->gaussianBox->setToolTip (tr(" Show/hide gaussian curve ")); + this->gaussianBox->setText (tr("gaussian")); this->gaussianBox->setGeometry (QRect (left, 7, 72, 20)); left += 72 + sg; this->gaussianBox->setFont (font0); this->gaussianBox->setFocusPolicy (Qt::NoFocus); @@ -1189,7 +1189,7 @@ void QEDistribution::createWidgets() left = 8; this->label_1 = new QLabel (this->resize_frame); - this->label_1->setText ("Number:"); + this->label_1->setText (tr("Number:")); this->label_1->setGeometry (QRect (left, 32, 52, 16)); left += 52 + sg; this->label_1->setFont (font2); @@ -1202,7 +1202,7 @@ void QEDistribution::createWidgets() this->countValueLabel->setIndent (6); this->label_2 = new QLabel (this->resize_frame); - this->label_2->setText ("Mean:"); + this->label_2->setText (tr("Mean:")); this->label_2->setGeometry (QRect (left, 32, 36, 16)); left += 36 + sg; this->label_2->setFont (font2); @@ -1215,7 +1215,7 @@ void QEDistribution::createWidgets() this->meanValueLabel->setIndent (6); this->label_4 = new QLabel (this->resize_frame); - this->label_4->setText ("Min:"); + this->label_4->setText (tr("Min:")); this->label_4->setGeometry (QRect (left, 32, 28, 16)); left += 28 + sg; this->label_4->setFont (font2); @@ -1227,7 +1227,7 @@ void QEDistribution::createWidgets() this->minValueLabel->setIndent (6); this->label_5 = new QLabel (this->resize_frame); - this->label_5->setText ("Max:"); + this->label_5->setText (tr("Max:")); this->label_5->setGeometry (QRect (left, 32, 28, 16)); left += 28 + sg; this->label_5->setFont (font2); @@ -1239,7 +1239,7 @@ void QEDistribution::createWidgets() this->maxValueLabel->setIndent (6); this->label_6 = new QLabel (this->resize_frame); - this->label_6->setText ("Std Dev:"); + this->label_6->setText (tr("Std Dev:")); this->label_6->setGeometry (QRect (left, 32, 48, 16)); left += 48 + sg; this->label_6->setFont (font2); diff --git a/qeframeworkSup/project/widgets/QEFileBrowser/QEFileBrowser.cpp b/qeframeworkSup/project/widgets/QEFileBrowser/QEFileBrowser.cpp index 6269ac42..f7eb16d5 100644 --- a/qeframeworkSup/project/widgets/QEFileBrowser/QEFileBrowser.cpp +++ b/qeframeworkSup/project/widgets/QEFileBrowser/QEFileBrowser.cpp @@ -51,24 +51,24 @@ QEFileBrowser::QEFileBrowser(QWidget *pParent):QWidget(pParent), QEWidget( this qPushButtonRefresh = new QPushButton(this); qTableWidgetFileBrowser = new _QTableWidgetFileBrowser(this); - qeLineEditDirectoryPath->setToolTip("Specify the directory where to browse for files"); + qeLineEditDirectoryPath->setToolTip(tr("Specify the directory where to browse for files")); QObject::connect(qeLineEditDirectoryPath, SIGNAL(textChanged(QString)), this, SLOT(lineEditDirectoryPathChanged(QString))); qPushButtonDirectoryBrowser->setText("..."); - qPushButtonDirectoryBrowser->setToolTip("Browse for a directory"); + qPushButtonDirectoryBrowser->setToolTip(tr("Browse for a directory")); QObject::connect(qPushButtonDirectoryBrowser, SIGNAL(clicked()), this, SLOT(buttonDirectoryBrowserClicked())); - qPushButtonRefresh->setText("Refresh"); - qPushButtonRefresh->setToolTip("Refresh file browse result"); + qPushButtonRefresh->setText(tr("Refresh")); + qPushButtonRefresh->setToolTip(tr("Refresh file browse result")); QObject::connect(qPushButtonRefresh, SIGNAL(clicked()), this, SLOT(buttonRefreshClicked())); qTableWidgetFileBrowser->setColumnCount(3); - qTableWidgetFileBrowser->setHorizontalHeaderItem(0, new QTableWidgetItem("Time")); - qTableWidgetFileBrowser->setHorizontalHeaderItem(1, new QTableWidgetItem("Size")); - qTableWidgetFileBrowser->setHorizontalHeaderItem(2, new QTableWidgetItem("Filename")); - qTableWidgetFileBrowser->setToolTip("Files contained in the specified directory"); + qTableWidgetFileBrowser->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Time"))); + qTableWidgetFileBrowser->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Size"))); + qTableWidgetFileBrowser->setHorizontalHeaderItem(2, new QTableWidgetItem(tr("Filename"))); + qTableWidgetFileBrowser->setToolTip(tr("Files contained in the specified directory")); qTableWidgetFileBrowser->setEditTriggers(QAbstractItemView::NoEditTriggers); qTableWidgetFileBrowser->setSelectionBehavior(QAbstractItemView::SelectRows); qTableWidgetFileBrowser->setSelectionMode(QAbstractItemView::SingleSelection); @@ -349,11 +349,11 @@ void QEFileBrowser::buttonDirectoryBrowserClicked() if (fileDialogDirectoriesOnly) { - result = QFileDialog::getExistingDirectory(this, "Select directory", qeLineEditDirectoryPath->text(), QFileDialog::ShowDirsOnly); + result = QFileDialog::getExistingDirectory(this, tr("Select directory"), qeLineEditDirectoryPath->text(), QFileDialog::ShowDirsOnly); } else { - result = QFileDialog::getOpenFileName(this, "Select file", qeLineEditDirectoryPath->text()); + result = QFileDialog::getOpenFileName(this, tr("Select file"), qeLineEditDirectoryPath->text()); } @@ -421,7 +421,7 @@ void QEFileBrowser::updateTable() qTableWidgetItem = new QTableWidgetItem(fileList.at(i).lastModified().toString("yyyy/MM/dd - hh:mm:ss")); qTableWidgetFileBrowser->setItem(j, 0, qTableWidgetItem); - qTableWidgetItem = new QTableWidgetItem(QString::number(fileList.at(i).size()) + " bytes"); + qTableWidgetItem = new QTableWidgetItem(QString::number(fileList.at(i).size()) + tr(" bytes")); qTableWidgetFileBrowser->setItem(j, 1, qTableWidgetItem); if (showFileExtension) diff --git a/qeframeworkSup/project/widgets/QEFileImage/QEFileImage.cpp b/qeframeworkSup/project/widgets/QEFileImage/QEFileImage.cpp index b4902e91..4e5bbe9b 100644 --- a/qeframeworkSup/project/widgets/QEFileImage/QEFileImage.cpp +++ b/qeframeworkSup/project/widgets/QEFileImage/QEFileImage.cpp @@ -219,7 +219,7 @@ void QEFileImage::setImageFileName(const QString& text) QPixmap emptyPixmap; this->setPixmap(emptyPixmap); this->fileName = text; - this->setText(QString("File not found: ").append(text)); + this->setText(tr("File not found: ").append(text)); return; } diff --git a/qeframeworkSup/project/widgets/QEForm/QEForm.cpp b/qeframeworkSup/project/widgets/QEForm/QEForm.cpp index b7fe8f8e..9b5a68ae 100644 --- a/qeframeworkSup/project/widgets/QEForm/QEForm.cpp +++ b/qeframeworkSup/project/widgets/QEForm/QEForm.cpp @@ -294,11 +294,10 @@ bool QEForm::readUiFile() // If the file was not found and opened, notify as appropriate if( !uiFile ) { - displayPlaceholder( QString( "Could not open " ).append( substitutedFileName ) ); + displayPlaceholder( tr( "Could not open " ).append( substitutedFileName ) ); if( alertIfUINoFound ) { - QString msg; - QTextStream(&msg) << "User interface file '" << substitutedFileName << "' could not be opened"; + QString msg = tr("User interface file '%1' could not be opened").arg(substitutedFileName); sendMessage( msg, "QEForm::readUiFile", message_types ( MESSAGE_TYPE_WARNING) ); } } @@ -400,7 +399,7 @@ bool QEForm::readUiFile() if( !ui ) { // Load a placeholder as the ui file could not be loaded - this->displayPlaceholder( QString( "Could not load " ).append( fullUiFileName ) ); + this->displayPlaceholder( tr( "Could not load " ).append( fullUiFileName ) ); } // Apply scaling. This may be re-applied if this is an embedded QEForm, but diff --git a/qeframeworkSup/project/widgets/QEFormGrid/QEDynamicFormGrid.cpp b/qeframeworkSup/project/widgets/QEFormGrid/QEDynamicFormGrid.cpp index 927eb522..befce602 100644 --- a/qeframeworkSup/project/widgets/QEFormGrid/QEDynamicFormGrid.cpp +++ b/qeframeworkSup/project/widgets/QEFormGrid/QEDynamicFormGrid.cpp @@ -104,7 +104,7 @@ SingleItemContainer (const QString& actualArgIn, this->closeButton->setFont (font); this->closeButton->setStyleSheet (QLatin1String ("background-color: rgb(105, 155, 205);\n" "color: rgb(255, 255, 255);")); - this->closeButton->setToolTip (QString (" Remove %1 from this display ").arg (this->actualArg)); + this->closeButton->setToolTip (tr (" Remove %1 from this display ").arg (this->actualArg)); this->verticalLayout->addWidget(closeButton); this->verticalSpacer = new QSpacerItem(20, 52, QSizePolicy::Minimum, QSizePolicy::Expanding); diff --git a/qeframeworkSup/project/widgets/QEImage/QEImage.cpp b/qeframeworkSup/project/widgets/QEImage/QEImage.cpp index bf44f2cb..50c71bfe 100644 --- a/qeframeworkSup/project/widgets/QEImage/QEImage.cpp +++ b/qeframeworkSup/project/widgets/QEImage/QEImage.cpp @@ -274,19 +274,19 @@ void QEImage::setup() this, SLOT( setImage( const QByteArray&, unsigned long, QCaAlarmInfo&, QCaDateTime&, const unsigned int& ) ) ); // Create vertical, horizontal, and general profile plots - vSliceLabel = new QLabel( "Vertical Profile" ); + vSliceLabel = new QLabel( tr("Vertical Profile") ); vSliceLabel->setVisible( false ); vSliceDisplay = new profilePlot( profilePlot::PROFILEPLOT_BT ); QObject::connect(vSliceDisplay, SIGNAL(destroyed(QObject*)), this, SLOT(vSliceDisplayDestroyed(QObject*))); vSliceDisplay->setVisible( false ); - hSliceLabel = new QLabel( "Horizontal Profile" ); + hSliceLabel = new QLabel( tr("Horizontal Profile") ); hSliceLabel->setVisible( false ); hSliceDisplay = new profilePlot( profilePlot::PROFILEPLOT_LR ); QObject::connect(hSliceDisplay, SIGNAL(destroyed(QObject*)), this, SLOT(hSliceDisplayDestroyed(QObject*))); hSliceDisplay->setVisible( false ); - profileLabel = new QLabel( "Arbitrary Line Profile" ); + profileLabel = new QLabel( tr("Arbitrary Line Profile") ); profileLabel->setVisible( false ); profileDisplay = new profilePlot( profilePlot::PROFILEPLOT_LR ); QObject::connect(profileDisplay, SIGNAL(destroyed(QObject*)), this, SLOT(profileDisplayDestroyed(QObject*))); @@ -313,49 +313,49 @@ void QEImage::setup() pauseButtonIcon = new QIcon( ":/qe/image/pause.png" ); playButtonIcon = new QIcon( ":/qe/image/play.png" ); pauseButton->setIcon( *pauseButtonIcon ); - pauseButton->setToolTip("Pause image display"); + pauseButton->setToolTip(tr("Pause image display")); QObject::connect(pauseButton, SIGNAL(clicked()), this, SLOT(pauseClicked())); saveButton = new QPushButton(buttonGroup); saveButton->setMinimumWidth( buttonWidth ); QIcon saveButtonIcon( ":/qe/image/save.png" ); saveButton->setIcon( saveButtonIcon ); - saveButton->setToolTip("Save displayed image"); + saveButton->setToolTip(tr("Save displayed image")); QObject::connect(saveButton, SIGNAL(clicked()), this, SLOT(saveClicked())); targetButton = new QPushButton(buttonGroup); targetButton->setMinimumWidth( buttonWidth ); QIcon targetButtonIcon( ":/qe/image/target.png" ); targetButton->setIcon( targetButtonIcon ); - targetButton->setToolTip("Move target position into beam"); + targetButton->setToolTip(tr("Move target position into beam")); QObject::connect(targetButton, SIGNAL(clicked()), this, SLOT(targetClicked())); selectModeButton = new QPushButton(buttonGroup); selectModeButton->setMinimumWidth( buttonMenuWidth ); QIcon selectModeButtonIcon( ":/qe/image/select.png" ); selectModeButton->setIcon( selectModeButtonIcon ); - selectModeButton->setToolTip("Choose selection and pan modes"); + selectModeButton->setToolTip(tr("Choose selection and pan modes")); selectModeButton->setMenu( sMenu ); markupDisplayButton = new QPushButton(buttonGroup); markupDisplayButton->setMinimumWidth( buttonMenuWidth ); QIcon markupDisplayButtonIcon( ":/qe/image/markupDisplay.png" ); markupDisplayButton->setIcon( markupDisplayButtonIcon ); - markupDisplayButton->setToolTip("Hide or reveal markups"); + markupDisplayButton->setToolTip(tr("Hide or reveal markups")); markupDisplayButton->setMenu( mdMenu ); zoomButton = new QPushButton(buttonGroup); zoomButton->setMinimumWidth( buttonMenuWidth ); QIcon zoomButtonIcon( ":/qe/image/zoom.png" ); zoomButton->setIcon( zoomButtonIcon ); - zoomButton->setToolTip("Zoom options"); + zoomButton->setToolTip(tr("Zoom options")); zoomButton->setMenu( zMenu ); flipRotateButton = new QPushButton(buttonGroup); flipRotateButton->setMinimumWidth( buttonMenuWidth ); QIcon flipRotateButtonIcon( ":/qe/image/flipRotate.png" ); flipRotateButton->setIcon( flipRotateButtonIcon ); - flipRotateButton->setToolTip("Local flip and rotate options"); + flipRotateButton->setToolTip(tr("Local flip and rotate options")); flipRotateButton->setMenu( frMenu ); diff --git a/qeframeworkSup/project/widgets/QEImage/flipRotateMenu.cpp b/qeframeworkSup/project/widgets/QEImage/flipRotateMenu.cpp index cd7af5a6..5186f17b 100644 --- a/qeframeworkSup/project/widgets/QEImage/flipRotateMenu.cpp +++ b/qeframeworkSup/project/widgets/QEImage/flipRotateMenu.cpp @@ -42,14 +42,14 @@ flipRotateMenu::flipRotateMenu( QWidget *parent) : QMenu(parent) addAction( ACTION ); // Create the buttons - NEW_FLIP_ROTATE_MENU_BUTTON( "Local Rotate 90 Clockwise", ICM_ROTATE_RIGHT, rotation90RAction ) - NEW_FLIP_ROTATE_MENU_BUTTON( "Local Rotate 90 Anticlockwise", ICM_ROTATE_LEFT, rotation90LAction ) - NEW_FLIP_ROTATE_MENU_BUTTON( "Local Rotate 180", ICM_ROTATE_180, rotation180Action ) - NEW_FLIP_ROTATE_MENU_BUTTON( "Local Flip Horizontal", ICM_FLIP_HORIZONTAL, flipHAction ) - NEW_FLIP_ROTATE_MENU_BUTTON( "Local Flip Vertical", ICM_FLIP_VERTICAL, flipVAction ) + NEW_FLIP_ROTATE_MENU_BUTTON( tr("Local Rotate 90 Clockwise"), ICM_ROTATE_RIGHT, rotation90RAction ) + NEW_FLIP_ROTATE_MENU_BUTTON( tr("Local Rotate 90 Anticlockwise"), ICM_ROTATE_LEFT, rotation90LAction ) + NEW_FLIP_ROTATE_MENU_BUTTON( tr("Local Rotate 180"), ICM_ROTATE_180, rotation180Action ) + NEW_FLIP_ROTATE_MENU_BUTTON( tr("Local Flip Horizontal"), ICM_FLIP_HORIZONTAL, flipHAction ) + NEW_FLIP_ROTATE_MENU_BUTTON( tr("Local Flip Vertical"), ICM_FLIP_VERTICAL, flipVAction ) // Set the title - setTitle( "Local Flip / Rotate" ); + setTitle( tr("Local Flip / Rotate") ); } // Get a flip/rotate option from the user. diff --git a/qeframeworkSup/project/widgets/QEImage/imageInfo.cpp b/qeframeworkSup/project/widgets/QEImage/imageInfo.cpp index 139ce0b9..e5ee3971 100644 --- a/qeframeworkSup/project/widgets/QEImage/imageInfo.cpp +++ b/qeframeworkSup/project/widgets/QEImage/imageInfo.cpp @@ -280,7 +280,7 @@ void imageInfo::infoUpdatePixel( const QPoint pos, int value ) // Update the paused information void imageInfo::infoUpdatePaused( bool paused ) { - currentPausedLabel->setText( paused?QString( "Paused" ):QString( "Waiting for an image" )); + currentPausedLabel->setText( paused?QObject::tr( "Paused" ):QObject::tr( "Waiting for an image" )); } // Update the zoom information @@ -289,7 +289,7 @@ void imageInfo::infoUpdateZoom( const int zoom, const double XStretch, const dou QString zoomText; // Format the zoom - zoomText = QString( "Zoom: %1%" ).arg( zoom ); + zoomText = QObject::tr( "Zoom: %1%" ).arg( zoom ); // Add X or Y stretch factors of present if( XStretch != 1.0 && YStretch != 1.0) diff --git a/qeframeworkSup/project/widgets/QEImage/imageProperties.cpp b/qeframeworkSup/project/widgets/QEImage/imageProperties.cpp index efb24af8..381f5582 100644 --- a/qeframeworkSup/project/widgets/QEImage/imageProperties.cpp +++ b/qeframeworkSup/project/widgets/QEImage/imageProperties.cpp @@ -121,19 +121,19 @@ QString imageProperties::getInfoText() const // Build the image information string QString about; - about.append( QString( "\nSize (bytes) of CA data array: %1" ).arg( imageData.count() )); - about.append( QString( "\nSize (bytes) of CA data elements: %1" ).arg( imageDataSize )); - about.append( QString( "\nWidth (pixels) taken from dimension variables or width variable: %1" ).arg( imageBuffWidth )); - about.append( QString( "\nHeight (pixels) taken from dimension variables or height variable: %1" ).arg( imageBuffHeight )); - about.append( QString( "\nPixel depth taken from data type variable, bit depth variable or bit depth property: %1" ).arg( bitDepth )); + about.append( QObject::tr( "\nSize (bytes) of CA data array: %1" ).arg( imageData.count() )); + about.append( QObject::tr( "\nSize (bytes) of CA data elements: %1" ).arg( imageDataSize )); + about.append( QObject::tr( "\nWidth (pixels) taken from dimension variables or width variable: %1" ).arg( imageBuffWidth )); + about.append( QObject::tr( "\nHeight (pixels) taken from dimension variables or height variable: %1" ).arg( imageBuffHeight )); + about.append( QObject::tr( "\nPixel depth taken from data type variable, bit depth variable or bit depth property: %1" ).arg( bitDepth )); QString name = imageDataFormats::getFormatInformation (formatOption); - about.append( QString( "\nExpected format: " ).append( name )); + about.append( QObject::tr( "\nExpected format: " ).append( name )); - about.append( "\n\nFirst bytes of raw image data:\n "); + about.append( QObject::tr("\n\nFirst bytes of raw image data:\n ")); if( imageData.isEmpty() ) { - about.append( "No data yet." ); + about.append( QObject::tr("No data yet.") ); } else { @@ -148,10 +148,10 @@ QString imageProperties::getInfoText() const } } - about.append( "\n\nFirst pixels of first row of image (after flipping, rotating and clipping:"); + about.append( QObject::tr("\n\nFirst pixels of first row of image (after flipping, rotating and clipping:")); if( image.isNull() ) { - about.append( "\n No image yet." ); + about.append( QObject::tr("\n No image yet.") ); } else { diff --git a/qeframeworkSup/project/widgets/QEImage/markupDisplayMenu.cpp b/qeframeworkSup/project/widgets/QEImage/markupDisplayMenu.cpp index 76015bef..8d2612d5 100644 --- a/qeframeworkSup/project/widgets/QEImage/markupDisplayMenu.cpp +++ b/qeframeworkSup/project/widgets/QEImage/markupDisplayMenu.cpp @@ -45,28 +45,28 @@ markupDisplayMenu::markupDisplayMenu( QWidget *parent) : QMenu(parent) addAction( ACTION ); // Create the buttons (with default titles - these will be overridden by changes to the markup legend properties) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Horizontal Line 1", ICM_DISPLAY_HSLICE1, hSlice1Action ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Horizontal Line 2", ICM_DISPLAY_HSLICE2, hSlice2Action ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Horizontal Line 3", ICM_DISPLAY_HSLICE3, hSlice3Action ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Horizontal Line 4", ICM_DISPLAY_HSLICE4, hSlice4Action ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Horizontal Line 5", ICM_DISPLAY_HSLICE5, hSlice5Action ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Vertical Line 1", ICM_DISPLAY_VSLICE1, vSlice1Action ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Vertical Line 2", ICM_DISPLAY_VSLICE2, vSlice2Action ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Vertical Line 3", ICM_DISPLAY_VSLICE3, vSlice3Action ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Vertical Line 4", ICM_DISPLAY_VSLICE4, vSlice4Action ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Vertical Line 5", ICM_DISPLAY_VSLICE5, vSlice5Action ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Area 1", ICM_DISPLAY_AREA1, area1Action ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Area 2", ICM_DISPLAY_AREA2, area2Action ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Area 3", ICM_DISPLAY_AREA3, area3Action ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Area 4", ICM_DISPLAY_AREA4, area4Action ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Arbitrary Line", ICM_DISPLAY_PROFILE, profileAction ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Target", ICM_DISPLAY_TARGET, targetAction ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Beam", ICM_DISPLAY_BEAM, beamAction ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Timestamp", ICM_DISPLAY_TIMESTAMP, timestampAction ) - NEW_MARKUP_DISPLAY_MENU_BUTTON( "Ellipse", ICM_DISPLAY_ELLIPSE, ellipseAction ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Horizontal Line 1"), ICM_DISPLAY_HSLICE1, hSlice1Action ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Horizontal Line 2"), ICM_DISPLAY_HSLICE2, hSlice2Action ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Horizontal Line 3"), ICM_DISPLAY_HSLICE3, hSlice3Action ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Horizontal Line 4"), ICM_DISPLAY_HSLICE4, hSlice4Action ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Horizontal Line 5"), ICM_DISPLAY_HSLICE5, hSlice5Action ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Vertical Line 1"), ICM_DISPLAY_VSLICE1, vSlice1Action ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Vertical Line 2"), ICM_DISPLAY_VSLICE2, vSlice2Action ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Vertical Line 3"), ICM_DISPLAY_VSLICE3, vSlice3Action ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Vertical Line 4"), ICM_DISPLAY_VSLICE4, vSlice4Action ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Vertical Line 5"), ICM_DISPLAY_VSLICE5, vSlice5Action ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Area 1"), ICM_DISPLAY_AREA1, area1Action ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Area 2"), ICM_DISPLAY_AREA2, area2Action ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Area 3"), ICM_DISPLAY_AREA3, area3Action ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Area 4"), ICM_DISPLAY_AREA4, area4Action ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Arbitrary Line"), ICM_DISPLAY_PROFILE, profileAction ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Target"), ICM_DISPLAY_TARGET, targetAction ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Beam"), ICM_DISPLAY_BEAM, beamAction ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Timestamp"), ICM_DISPLAY_TIMESTAMP, timestampAction ) + NEW_MARKUP_DISPLAY_MENU_BUTTON( tr("Ellipse"), ICM_DISPLAY_ELLIPSE, ellipseAction ) // Set the title - setTitle( "Markup display" ); + setTitle( tr("Markup display") ); } diff --git a/qeframeworkSup/project/widgets/QEImage/profilePlot.cpp b/qeframeworkSup/project/widgets/QEImage/profilePlot.cpp index fd32bc1d..97c9c647 100644 --- a/qeframeworkSup/project/widgets/QEImage/profilePlot.cpp +++ b/qeframeworkSup/project/widgets/QEImage/profilePlot.cpp @@ -134,7 +134,7 @@ void profilePlot::showProfileContextMenu( const QPoint& pos ) imageContextMenu menu; // Title checkable checked option - menu.addMenuItem( "Copy Plot Data", false, false, imageContextMenu::ICM_COPY_PLOT_DATA ); + menu.addMenuItem( tr("Copy Plot Data"), false, false, imageContextMenu::ICM_COPY_PLOT_DATA ); // Present the menu imageContextMenu::imageContextMenuOptions option; @@ -163,7 +163,7 @@ void profilePlot::copy() QClipboard *cb = QApplication::clipboard(); QString text; - text.append( title ).append( QString( " - Start: %1,%2 End: %3,%4 Thickness: %5\n" ).arg( start.x() ).arg( start.y() ).arg( end.x() ).arg( end.y() ).arg( thickness ) ); + text.append( title ).append( tr( " - Start: %1,%2 End: %3,%4 Thickness: %5\n" ).arg( start.x() ).arg( start.y() ).arg( end.x() ).arg( end.y() ).arg( thickness ) ); int size = data->size(); switch( plotDirection ) { diff --git a/qeframeworkSup/project/widgets/QEImage/screenSelectDialog.cpp b/qeframeworkSup/project/widgets/QEImage/screenSelectDialog.cpp index dea80dfc..5ed01240 100644 --- a/qeframeworkSup/project/widgets/QEImage/screenSelectDialog.cpp +++ b/qeframeworkSup/project/widgets/QEImage/screenSelectDialog.cpp @@ -110,12 +110,12 @@ screenSelectDialog::screenSelectDialog( int numScreens, QWidget *parent ) : ui(new Ui::screenSelectDialog) { ui->setupUi(this); - ui->comboBox->addItem( "Primary screen" ); - ui->comboBox->addItem( "This screen" ); - ui->comboBox->addItem( "All screens" ); + ui->comboBox->addItem( tr("Primary screen") ); + ui->comboBox->addItem( tr("This screen") ); + ui->comboBox->addItem( tr("All screens") ); for( int i = 0; i < numScreens; i++ ) { - ui->comboBox->addItem( QString( "Screen %1" ).arg( i+1 ) ); + ui->comboBox->addItem( tr( "Screen %1" ).arg( i+1 ) ); } } diff --git a/qeframeworkSup/project/widgets/QEImage/selectMenu.cpp b/qeframeworkSup/project/widgets/QEImage/selectMenu.cpp index 4894490b..11038012 100644 --- a/qeframeworkSup/project/widgets/QEImage/selectMenu.cpp +++ b/qeframeworkSup/project/widgets/QEImage/selectMenu.cpp @@ -47,27 +47,27 @@ selectMenu::selectMenu( QWidget *parent) : QMenu(parent) addAction( ACTION ); // Create the buttons - NEW_SELECT_MENU_BUTTON( "Pan", ICM_SELECT_PAN, actionPan ) - NEW_SELECT_MENU_BUTTON( "Horizontal Slice 1", ICM_SELECT_HSLICE1, actionHSlice1 ) - NEW_SELECT_MENU_BUTTON( "Horizontal Slice 2", ICM_SELECT_HSLICE2, actionHSlice2 ) - NEW_SELECT_MENU_BUTTON( "Horizontal Slice 3", ICM_SELECT_HSLICE3, actionHSlice3 ) - NEW_SELECT_MENU_BUTTON( "Horizontal Slice 4", ICM_SELECT_HSLICE4, actionHSlice4 ) - NEW_SELECT_MENU_BUTTON( "Horizontal Slice 5", ICM_SELECT_HSLICE5, actionHSlice5 ) - NEW_SELECT_MENU_BUTTON( "Vertical Slice 1", ICM_SELECT_VSLICE1, actionVSlice1 ) - NEW_SELECT_MENU_BUTTON( "Vertical Slice 2", ICM_SELECT_VSLICE2, actionVSlice2 ) - NEW_SELECT_MENU_BUTTON( "Vertical Slice 3", ICM_SELECT_VSLICE3, actionVSlice3 ) - NEW_SELECT_MENU_BUTTON( "Vertical Slice 4", ICM_SELECT_VSLICE4, actionVSlice4 ) - NEW_SELECT_MENU_BUTTON( "Vertical Slice 5", ICM_SELECT_VSLICE5, actionVSlice5 ) - NEW_SELECT_MENU_BUTTON( "Line Profile", ICM_SELECT_PROFILE, actionProfile ) - NEW_SELECT_MENU_BUTTON( "Select Area 1", ICM_SELECT_AREA1, actionArea1 ) - NEW_SELECT_MENU_BUTTON( "Select Area 2", ICM_SELECT_AREA2, actionArea2 ) - NEW_SELECT_MENU_BUTTON( "Select Area 3", ICM_SELECT_AREA3, actionArea3 ) - NEW_SELECT_MENU_BUTTON( "Select Area 4", ICM_SELECT_AREA4, actionArea4 ) - NEW_SELECT_MENU_BUTTON( "Mark Target", ICM_SELECT_TARGET, actionTarget ) - NEW_SELECT_MENU_BUTTON( "Mark Beam", ICM_SELECT_BEAM, actionBeam ) + NEW_SELECT_MENU_BUTTON( tr("Pan"), ICM_SELECT_PAN, actionPan ) + NEW_SELECT_MENU_BUTTON( tr("Horizontal Slice 1"), ICM_SELECT_HSLICE1, actionHSlice1 ) + NEW_SELECT_MENU_BUTTON( tr("Horizontal Slice 2"), ICM_SELECT_HSLICE2, actionHSlice2 ) + NEW_SELECT_MENU_BUTTON( tr("Horizontal Slice 3"), ICM_SELECT_HSLICE3, actionHSlice3 ) + NEW_SELECT_MENU_BUTTON( tr("Horizontal Slice 4"), ICM_SELECT_HSLICE4, actionHSlice4 ) + NEW_SELECT_MENU_BUTTON( tr("Horizontal Slice 5"), ICM_SELECT_HSLICE5, actionHSlice5 ) + NEW_SELECT_MENU_BUTTON( tr("Vertical Slice 1"), ICM_SELECT_VSLICE1, actionVSlice1 ) + NEW_SELECT_MENU_BUTTON( tr("Vertical Slice 2"), ICM_SELECT_VSLICE2, actionVSlice2 ) + NEW_SELECT_MENU_BUTTON( tr("Vertical Slice 3"), ICM_SELECT_VSLICE3, actionVSlice3 ) + NEW_SELECT_MENU_BUTTON( tr("Vertical Slice 4"), ICM_SELECT_VSLICE4, actionVSlice4 ) + NEW_SELECT_MENU_BUTTON( tr("Vertical Slice 5"), ICM_SELECT_VSLICE5, actionVSlice5 ) + NEW_SELECT_MENU_BUTTON( tr("Line Profile"), ICM_SELECT_PROFILE, actionProfile ) + NEW_SELECT_MENU_BUTTON( tr("Select Area 1"), ICM_SELECT_AREA1, actionArea1 ) + NEW_SELECT_MENU_BUTTON( tr("Select Area 2"), ICM_SELECT_AREA2, actionArea2 ) + NEW_SELECT_MENU_BUTTON( tr("Select Area 3"), ICM_SELECT_AREA3, actionArea3 ) + NEW_SELECT_MENU_BUTTON( tr("Select Area 4"), ICM_SELECT_AREA4, actionArea4 ) + NEW_SELECT_MENU_BUTTON( tr("Mark Target"), ICM_SELECT_TARGET, actionTarget ) + NEW_SELECT_MENU_BUTTON( tr("Mark Beam"), ICM_SELECT_BEAM, actionBeam ) // Set the title - setTitle( "Mode" ); + setTitle( tr("Mode") ); } // Get a selection option from the user. diff --git a/qeframeworkSup/project/widgets/QEImage/zoomMenu.cpp b/qeframeworkSup/project/widgets/QEImage/zoomMenu.cpp index d06fa955..560cbd59 100644 --- a/qeframeworkSup/project/widgets/QEImage/zoomMenu.cpp +++ b/qeframeworkSup/project/widgets/QEImage/zoomMenu.cpp @@ -37,7 +37,7 @@ zoomMenu::zoomMenu( QWidget *parent) : QMenu(parent) addAction( areaSelectedAction ); QAction* a; - a = new QAction( "Fit", this ); a->setData( imageContextMenu::ICM_ZOOM_FIT ); addAction( a ); + a = new QAction(tr("Fit"),this); a->setData( imageContextMenu::ICM_ZOOM_FIT ); addAction( a ); a = new QAction( "+", this ); a->setData( imageContextMenu::ICM_ZOOM_PLUS ); addAction( a ); a = new QAction( "-", this ); a->setData( imageContextMenu::ICM_ZOOM_MINUS ); addAction( a ); a = new QAction( "10%", this ); a->setData( imageContextMenu::ICM_ZOOM_10 ); addAction( a ); @@ -50,7 +50,7 @@ zoomMenu::zoomMenu( QWidget *parent) : QMenu(parent) a = new QAction( "300%", this ); a->setData( imageContextMenu::ICM_ZOOM_300 ); addAction( a ); a = new QAction( "400%", this ); a->setData( imageContextMenu::ICM_ZOOM_400 ); addAction( a ); - setTitle( "Local Zoom" ); + setTitle( tr("Local Zoom") ); } // Get a zoom factor from the user. diff --git a/qeframeworkSup/project/widgets/QELineEdit/QEGenericEdit.cpp b/qeframeworkSup/project/widgets/QELineEdit/QEGenericEdit.cpp index be8ae949..fe7095a6 100644 --- a/qeframeworkSup/project/widgets/QELineEdit/QEGenericEdit.cpp +++ b/qeframeworkSup/project/widgets/QELineEdit/QEGenericEdit.cpp @@ -106,7 +106,7 @@ void QEGenericEdit::setup() QMenu* QEGenericEdit::getDefaultContextMenu() { QMenu* menu = createStandardContextMenu(); - menu->setTitle( "Edit..." ); + menu->setTitle( tr("Edit...") ); return menu; } @@ -255,7 +255,7 @@ void QEGenericEdit::userEditingFinished() else { messageDialogPresent = true; - int confirm = QMessageBox::warning( this, "Value changed", "You altered a value but didn't write it.\nDo you want to write this value?", + int confirm = QMessageBox::warning( this, tr("Value changed"), tr("You altered a value but didn't write it.\nDo you want to write this value?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, QMessageBox::No ); messageDialogPresent = false; @@ -321,7 +321,7 @@ void QEGenericEdit::writeValue( qcaobject::QCaObject *, QVariant newValue ) if( confirmWrite ) { messageDialogPresent = true; - confirm = QMessageBox::warning( this, "Confirm write", "Do you want to write this value?", + confirm = QMessageBox::warning( this, tr("Confirm write"), tr("Do you want to write this value?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, QMessageBox::Yes ); messageDialogPresent = false; } @@ -342,7 +342,7 @@ void QEGenericEdit::writeValue( qcaobject::QCaObject *, QVariant newValue ) messageDialogPresent = true; writeFailMessageDialogPresent = true; // warn user - QMessageBox::warning( this, QString( "Write failed" ), error, QMessageBox::Cancel ); + QMessageBox::warning( this, tr( "Write failed" ), error, QMessageBox::Cancel ); setFocus(); // Clear flag indicating 'editing finished' signals are due to message dialog messageDialogPresent = false; diff --git a/qeframeworkSup/project/widgets/QELineEdit/QELineEdit.cpp b/qeframeworkSup/project/widgets/QELineEdit/QELineEdit.cpp index d5765cb2..22921696 100644 --- a/qeframeworkSup/project/widgets/QELineEdit/QELineEdit.cpp +++ b/qeframeworkSup/project/widgets/QELineEdit/QELineEdit.cpp @@ -159,13 +159,13 @@ bool QELineEdit::writeData (const QVariant& value, QString& message) case QEStringFormatting::APPEND: default: - message = "Invalid arrayAction property"; + message = tr("Invalid arrayAction property"); result = false; break; } } else { - message = "null qca object"; + message = tr("null qca object"); result = false; } diff --git a/qeframeworkSup/project/widgets/QELog/QELog.cpp b/qeframeworkSup/project/widgets/QELog/QELog.cpp index b0fb9fd7..d99dbfba 100644 --- a/qeframeworkSup/project/widgets/QELog/QELog.cpp +++ b/qeframeworkSup/project/widgets/QELog/QELog.cpp @@ -183,13 +183,13 @@ QELog::QELog (QWidget* parent) : QEFrame (parent) this->qPushButtonSave = new QPushButton (this); this->qTableWidgetLog->setColumnCount (3); - this->qTableWidgetLog->setHorizontalHeaderItem (0, new QTableWidgetItem ("Time")); - this->qTableWidgetLog->setHorizontalHeaderItem (1, new QTableWidgetItem ("Type")); - this->qTableWidgetLog->setHorizontalHeaderItem (2, new QTableWidgetItem ("Message")); + this->qTableWidgetLog->setHorizontalHeaderItem (0, new QTableWidgetItem (tr("Time"))); + this->qTableWidgetLog->setHorizontalHeaderItem (1, new QTableWidgetItem (tr("Type"))); + this->qTableWidgetLog->setHorizontalHeaderItem (2, new QTableWidgetItem (tr("Message"))); this->qTableWidgetLog->setColumnWidth (0, 156); this->qTableWidgetLog->setColumnWidth (1, 80); this->qTableWidgetLog->horizontalHeader()->setStretchLastSection (true); - this->qTableWidgetLog->setToolTip ("Current log messages"); + this->qTableWidgetLog->setToolTip (tr("Current log messages")); this->qTableWidgetLog->setEditTriggers (QAbstractItemView::NoEditTriggers); this->qTableWidgetLog->setSelectionBehavior (QAbstractItemView::SelectRows); this->qTableWidgetLog->setSelectionMode (QAbstractItemView::SingleSelection); @@ -198,31 +198,31 @@ QELog::QELog (QWidget* parent) : QEFrame (parent) qFont.setPointSize (9); this->qTableWidgetLog->setFont (qFont); - this->qCheckBoxInfoMessage->setText ("Info messages"); - this->qCheckBoxInfoMessage->setToolTip ("Show/hide info messages"); + this->qCheckBoxInfoMessage->setText (tr("Info messages")); + this->qCheckBoxInfoMessage->setToolTip (tr("Show/hide info messages")); this->qCheckBoxInfoMessage->setChecked (true); QObject::connect (this->qCheckBoxInfoMessage, SIGNAL (toggled (bool)), this, SLOT (checkBoxInfoToggled (bool))); - this->qCheckBoxWarningMessage->setText ("Warning messages"); - this->qCheckBoxWarningMessage->setToolTip ("Show/hide warning messages"); + this->qCheckBoxWarningMessage->setText (tr("Warning messages")); + this->qCheckBoxWarningMessage->setToolTip (tr("Show/hide warning messages")); this->qCheckBoxWarningMessage->setChecked (true); QObject::connect (this->qCheckBoxWarningMessage, SIGNAL (toggled (bool)), this, SLOT (checkBoxWarningToggled (bool))); - this->qCheckBoxErrorMessage->setText ("Error messages"); - this->qCheckBoxErrorMessage->setToolTip ("Show/hide error messages"); + this->qCheckBoxErrorMessage->setText (tr("Error messages")); + this->qCheckBoxErrorMessage->setToolTip (tr("Show/hide error messages")); this->qCheckBoxErrorMessage->setChecked (true); QObject::connect (this->qCheckBoxErrorMessage, SIGNAL (toggled (bool)), this, SLOT (checkBoxErrorToggled (bool))); - this->qPushButtonClear->setText ("Clear"); - this->qPushButtonClear->setToolTip ("Clear log messages"); + this->qPushButtonClear->setText (tr("Clear")); + this->qPushButtonClear->setToolTip (tr("Clear log messages")); QObject::connect (this->qPushButtonClear, SIGNAL (clicked ()), this, SLOT (buttonClearClicked ())); - this->qPushButtonSave->setText ("Save"); - this->qPushButtonSave->setToolTip ("Save log messages"); + this->qPushButtonSave->setText (tr("Save")); + this->qPushButtonSave->setToolTip (tr("Save log messages")); QObject::connect (this->qPushButtonSave, SIGNAL (clicked ()), this, SLOT (buttonSaveClicked ())); @@ -347,7 +347,7 @@ bool QELog::getShowClear () const void QELog::buttonClearClicked () { int answer = QMessageBox:: - question (this, "Info", "Do you want to clear the log messages?", + question (this, tr("Info"), tr("Do you want to clear the log messages?"), QMessageBox::Yes, QMessageBox::No); if (answer == QMessageBox::Yes) { this->clearLog (); @@ -570,7 +570,7 @@ void QELog::buttonSaveClicked () QString line; int i; - qFileDialog = new QFileDialog (this, "Save log messages", QString ()); + qFileDialog = new QFileDialog (this, tr("Save log messages"), QString ()); qFileDialog->setAcceptMode (QFileDialog::AcceptSave); if (qFileDialog->exec ()) { @@ -608,12 +608,11 @@ void QELog::buttonSaveClicked () } } file->close (); - QMessageBox::information (this, "Info", - "The log messages were successfully saved in file '" + - filename + "'!"); + QMessageBox::information (this, tr("Info"), + tr("The log messages were successfully saved in file '%1'!").arg(filename)); } else { - QMessageBox::critical (this, "Error", - "Unable to save log messages in file '" + filename + "'!"); + QMessageBox::critical (this, tr("Error"), + tr("Unable to save log messages in file '%1'!").arg(filename)); } } diff --git a/qeframeworkSup/project/widgets/QELogin/QELogin.cpp b/qeframeworkSup/project/widgets/QELogin/QELogin.cpp index 93732f32..fcb2010b 100644 --- a/qeframeworkSup/project/widgets/QELogin/QELogin.cpp +++ b/qeframeworkSup/project/widgets/QELogin/QELogin.cpp @@ -57,12 +57,12 @@ QELogin::QELogin(QWidget *pParent):QFrame(pParent), QEWidget( this ) setCompactStyle( true ); setStatusOnly( false ); - qLabelUserType->setToolTip("Current user"); + qLabelUserType->setToolTip(tr("Current user")); // Set up login button qPushButtonLogin->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - qPushButtonLogin->setText("Login"); - qPushButtonLogin->setToolTip("Change current user"); + qPushButtonLogin->setText(tr("Login")); + qPushButtonLogin->setToolTip(tr("Change current user")); QObject::connect(qPushButtonLogin, SIGNAL(clicked()), this, SLOT(buttonLoginClicked())); // Set initial state @@ -78,7 +78,7 @@ void QELogin::userLevelChanged( userLevelTypes::userLevels ) // Set up current level text void QELogin::setCurrentLevelText() { - qLabelUserType->setText(QString( "Current Level: " ).append( getUserTypeName( getUserLevel() ) )); + qLabelUserType->setText(tr( "Current Level: " ).append( getUserTypeName( getUserLevel() ) )); } // Compact mode property fuctions @@ -146,10 +146,10 @@ QString QELogin::getUserTypeName(userLevelTypes::userLevels type) { switch( type ) { - case userLevelTypes::USERLEVEL_USER: return "User"; - case userLevelTypes::USERLEVEL_SCIENTIST: return "Scientist"; - case userLevelTypes::USERLEVEL_ENGINEER: return "Engineer"; - default: return "Unknown"; + case userLevelTypes::USERLEVEL_USER: return tr("User"); + case userLevelTypes::USERLEVEL_SCIENTIST: return tr("Scientist"); + case userLevelTypes::USERLEVEL_ENGINEER: return tr("Engineer"); + default: return tr("Unknown"); } } @@ -193,7 +193,7 @@ bool QELogin::login( userLevelTypes::userLevels level, QString password ) // Change user level if required if( level != currentLevel ) { - sendMessage("The user type was changed from '" + getUserTypeName( currentLevel ) + "' to '" + getUserTypeName( level ) + "'"); + sendMessage( tr("The user type was changed from '%1' to '%2'").arg(getUserTypeName( currentLevel )).arg(getUserTypeName( level )) ); setUserLevel( level); setCurrentLevelText(); } @@ -271,7 +271,7 @@ loginWidget::loginWidget( QELogin* ownerIn ) qLineEditPassword = new QLineEdit(this); // Set up the widgets - qGroupBox->setTitle( "Login as:"); + qGroupBox->setTitle( tr("Login as:")); qRadioButtonUser->setText(owner->getUserTypeName(userLevelTypes::USERLEVEL_USER)); QObject::connect(qRadioButtonUser, SIGNAL(clicked()), this, SLOT(radioButtonClicked())); @@ -283,7 +283,7 @@ loginWidget::loginWidget( QELogin* ownerIn ) QObject::connect(qRadioButtonEngineer, SIGNAL(clicked()), this, SLOT(radioButtonClicked())); qLineEditPassword->setEchoMode(QLineEdit::Password); - qLineEditPassword->setToolTip("Password for the selected type"); + qLineEditPassword->setToolTip(tr("Password for the selected type")); // Layout the form QVBoxLayout* qVBoxLayout = new QVBoxLayout(); @@ -385,14 +385,14 @@ QELoginDialog::QELoginDialog(QELogin* ownerIn) qPushButtonCancel = new QPushButton(this); // Set up the widgets - setWindowTitle("Login"); + setWindowTitle(tr("Login")); - qPushButtonOk->setText("Ok"); - qPushButtonOk->setToolTip("Perform login"); + qPushButtonOk->setText(tr("Ok")); + qPushButtonOk->setToolTip(tr("Perform login")); QObject::connect(qPushButtonOk, SIGNAL(clicked()), this, SLOT(buttonOkClicked())); - qPushButtonCancel->setText("Cancel"); - qPushButtonCancel->setToolTip("Cancel login"); + qPushButtonCancel->setText(tr("Cancel")); + qPushButtonCancel->setToolTip(tr("Cancel login")); QObject::connect(qPushButtonCancel, SIGNAL(clicked()), this, SLOT(buttonCancelClicked())); // Layout the form diff --git a/qeframeworkSup/project/widgets/QENumericEdit/QENumericEdit.cpp b/qeframeworkSup/project/widgets/QENumericEdit/QENumericEdit.cpp index 65c9c841..d2a11fa8 100644 --- a/qeframeworkSup/project/widgets/QENumericEdit/QENumericEdit.cpp +++ b/qeframeworkSup/project/widgets/QENumericEdit/QENumericEdit.cpp @@ -272,8 +272,8 @@ bool QENumericEdit::isOkayToWrite (const WriteOptions writeOption) break; } this->messageDialogPresent = true; - confirm = QMessageBox::question (this, "Confirm write", - "Do you want to write this value?", + confirm = QMessageBox::question (this, tr("Confirm write"), + tr("Do you want to write this value?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, QMessageBox::Yes); this->messageDialogPresent = false; @@ -282,9 +282,8 @@ bool QENumericEdit::isOkayToWrite (const WriteOptions writeOption) case woEditingFinished: this->messageDialogPresent = true; - confirm = QMessageBox::warning (this, "Value changed", - "You altered a value but didn't write it.\n" - "Do you want to write this value?", + confirm = QMessageBox::warning (this, tr("Value changed"), + tr("You altered a value but didn't write it.\nDo you want to write this value?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, QMessageBox::No); this->messageDialogPresent = false; diff --git a/qeframeworkSup/project/widgets/QEPlot/QEPlot.cpp b/qeframeworkSup/project/widgets/QEPlot/QEPlot.cpp index 7a2c6ae9..d1ad9780 100644 --- a/qeframeworkSup/project/widgets/QEPlot/QEPlot.cpp +++ b/qeframeworkSup/project/widgets/QEPlot/QEPlot.cpp @@ -578,7 +578,7 @@ QMenu* QEPlot::buildContextMenu () menu->addSeparator (); - action = new QAction ("Archive backfill", menu); + action = new QAction (tr("Archive backfill"), menu); action->setCheckable (false); action->setData (PLOTCM_ARCHIVE_BACKFILL); menu->addAction (action); @@ -1366,10 +1366,10 @@ void QEPlot::setArchiveData (const QObject* userData, const bool okay, Trace* tr = this->traces[trace]; tr->setArchiveData (archiveData); } else { - QString message = QString ("trace: %1, pv: %3, status: %2, info: %4") + QString message = tr ("trace: %1, pv: %3, status: %2, info: %4") .arg (trace) .arg (pvName) - .arg (okay ? "okay" : "fail") + .arg (okay ? tr("okay") : tr("fail")) .arg (supplementary); this->setReadOut (message); } diff --git a/qeframeworkSup/project/widgets/QEPlotter/QEPlotter.cpp b/qeframeworkSup/project/widgets/QEPlotter/QEPlotter.cpp index 23e9d2ac..7f48856e 100644 --- a/qeframeworkSup/project/widgets/QEPlotter/QEPlotter.cpp +++ b/qeframeworkSup/project/widgets/QEPlotter/QEPlotter.cpp @@ -295,15 +295,15 @@ void QEPlotter::createInternalWidgets () this->statusLayout->setSpacing (8); this->slotIndicator = new QLabel ("", this->statusFrame); - this->minLabel = new QLabel ("Min:", this->statusFrame); + this->minLabel = new QLabel (tr("Min:"), this->statusFrame); this->minValue = new QLabel ("-", this->statusFrame); - this->maxLabel = new QLabel ("Max:", this->statusFrame); + this->maxLabel = new QLabel (tr("Max:"), this->statusFrame); this->maxValue = new QLabel ("-", this->statusFrame); - this->maxAtLabel = new QLabel ("Max At:", this->statusFrame); + this->maxAtLabel = new QLabel (tr("Max At:"), this->statusFrame); this->maxAtValue = new QLabel ("-", this->statusFrame); - this->fwhmLabel = new QLabel ("FWHM:", this->statusFrame); + this->fwhmLabel = new QLabel (tr("FWHM:"), this->statusFrame); this->fwhmValue = new QLabel ("-", this->statusFrame); - this->comLabel = new QLabel ("CoM:", this->statusFrame); + this->comLabel = new QLabel (tr("CoM:"), this->statusFrame); this->comValue = new QLabel ("-", this->statusFrame); this->slotIndicator->setFixedWidth (40); @@ -324,11 +324,11 @@ void QEPlotter::createInternalWidgets () this->nameValue->setToolTip (tip); \ } - SET_VALUE_LABEL (minValue, "Minimum Value"); - SET_VALUE_LABEL (maxValue, "Maximum Value"); - SET_VALUE_LABEL (maxAtValue, "Maximum Value X co-ordinate"); - SET_VALUE_LABEL (fwhmValue, "Full Width at Half Maximum"); - SET_VALUE_LABEL (comValue, "Centre of Mass (median position)"); + SET_VALUE_LABEL (minValue, tr("Minimum Value")); + SET_VALUE_LABEL (maxValue, tr("Maximum Value")); + SET_VALUE_LABEL (maxAtValue, tr("Maximum Value X co-ordinate")); + SET_VALUE_LABEL (fwhmValue, tr("Full Width at Half Maximum")); + SET_VALUE_LABEL (comValue, tr("Centre of Mass (median position)")); #undef SET_VALUE_LABEL @@ -349,8 +349,8 @@ void QEPlotter::createInternalWidgets () this->dataDialog = new QEPlotterItemDialog (this); this->rangeDialog = new QEStripChartRangeDialog (this); - this->rangeDialog->setWindowTitle ("Plotter Y Range"); - this->twinRangeDialog = new QETwinScaleSelectDialog ("Plotter XY Range", "X", "Y", this); + this->rangeDialog->setWindowTitle (tr("Plotter Y Range")); + this->twinRangeDialog = new QETwinScaleSelectDialog (tr("Plotter XY Range"), "X", "Y", this); } @@ -586,7 +586,7 @@ QEPlotter::QEPlotter (QWidget* parent) : QEAbstractDynamicWidget (parent) this->contextMenuIsOverGraphic = false; this->contextMenuRequestPosition = QPointF (0.0, 0.0); - this->contextMenuEmitLegend = "Emit Coordinates"; + this->contextMenuEmitLegend = tr("Emit Coordinates"); this->enableConextMenu = true; this->toolBarIsVisible = true; this->pvItemsIsVisible = true; @@ -750,7 +750,7 @@ void QEPlotter::updateLabel (const int slot) caption.append (":= "); caption.append (ds->expression); } else { - caption.append ("invalid expr."); + caption.append (tr("invalid expr.")); } break; @@ -1297,7 +1297,7 @@ void QEPlotter::menuSelected (const QEPlotterNames::MenuActions action, const in break; case QEPlotterNames::PLOTTER_MANUAL_Y_RANGE: - this->rangeDialog->setWindowTitle ("Plotter Y Range"); + this->rangeDialog->setWindowTitle (tr("Plotter Y Range")); this->rangeDialog->setRange (this->fixedMinY, this->fixedMaxY); n = this->rangeDialog->exec (wsender ? wsender : this); if (n == 1) { @@ -1333,7 +1333,7 @@ void QEPlotter::menuSelected (const QEPlotterNames::MenuActions action, const in break; case QEPlotterNames::PLOTTER_MANUAL_X_RANGE: - this->rangeDialog->setWindowTitle ("Plotter X Range"); + this->rangeDialog->setWindowTitle (tr("Plotter X Range")); this->rangeDialog->setRange (this->fixedMinX, this->fixedMaxX); n = this->rangeDialog->exec (wsender ? wsender : this); if (n == 1) { diff --git a/qeframeworkSup/project/widgets/QEPlotter/QEPlotterMenu.cpp b/qeframeworkSup/project/widgets/QEPlotter/QEPlotterMenu.cpp index 98ede581..ef16a9e7 100644 --- a/qeframeworkSup/project/widgets/QEPlotter/QEPlotterMenu.cpp +++ b/qeframeworkSup/project/widgets/QEPlotter/QEPlotterMenu.cpp @@ -47,66 +47,66 @@ QEPlotterMenu::QEPlotterMenu (QWidget* parent) : QMenu (parent) this->actionList [j] = NULL; } - this->setTitle ("Plotter General"); + this->setTitle (tr("Plotter General")); - menu = new QMenu ("General", this); + menu = new QMenu (tr("General"), this); this->addMenu (menu); - this->make (menu, "Previous state", false, QEPlotterNames::PLOTTER_PREV); - this->make (menu, "Next state", false, QEPlotterNames::PLOTTER_NEXT); + this->make (menu, tr("Previous state"), false, QEPlotterNames::PLOTTER_PREV); + this->make (menu, tr("Next state"), false, QEPlotterNames::PLOTTER_NEXT); - this->make (menu, "White background", false, QEPlotterNames::PLOTTER_NORMAL_VIDEO); - this->make (menu, "Black background", false, QEPlotterNames::PLOTTER_REVERSE_VIDEO); + this->make (menu, tr("White background"), false, QEPlotterNames::PLOTTER_NORMAL_VIDEO); + this->make (menu, tr("Black background"), false, QEPlotterNames::PLOTTER_REVERSE_VIDEO); - this->make (menu, "Play - Real time", false, QEPlotterNames::PLOTTER_PLAY); - this->make (menu, "Pause", false, QEPlotterNames::PLOTTER_PAUSE); + this->make (menu, tr("Play - Real time"), false, QEPlotterNames::PLOTTER_PLAY); + this->make (menu, tr("Pause"), false, QEPlotterNames::PLOTTER_PAUSE); - menu = new QMenu ("Y Scale", this); + menu = new QMenu (tr("Y Scale"), this); this->addMenu (menu); - this->make (menu, "Linear Y scale", false, QEPlotterNames::PLOTTER_LINEAR_Y_SCALE); - this->make (menu, "Log Y Scale", false, QEPlotterNames::PLOTTER_LOG_Y_SCALE); - this->make (menu, "Manual Y Scale...", false, QEPlotterNames::PLOTTER_MANUAL_Y_RANGE); - this->make (menu, "Y Data Range Scale", false, QEPlotterNames::PLOTTER_CURRENT_Y_RANGE); - this->make (menu, "Dynamic Y Scale", false, QEPlotterNames::PLOTTER_DYNAMIC_Y_RANGE); - this->make (menu, "Noramalised Scale", false, QEPlotterNames::PLOTTER_NORAMLISED_Y_RANGE); - this->make (menu, "Fractional Scale", false, QEPlotterNames::PLOTTER_FRACTIONAL_Y_RANGE); - - menu = new QMenu ("X Scale", this); + this->make (menu, tr("Linear Y scale"), false, QEPlotterNames::PLOTTER_LINEAR_Y_SCALE); + this->make (menu, tr("Log Y Scale"), false, QEPlotterNames::PLOTTER_LOG_Y_SCALE); + this->make (menu, tr("Manual Y Scale..."), false, QEPlotterNames::PLOTTER_MANUAL_Y_RANGE); + this->make (menu, tr("Y Data Range Scale"), false, QEPlotterNames::PLOTTER_CURRENT_Y_RANGE); + this->make (menu, tr("Dynamic Y Scale"), false, QEPlotterNames::PLOTTER_DYNAMIC_Y_RANGE); + this->make (menu, tr("Noramalised Scale"), false, QEPlotterNames::PLOTTER_NORAMLISED_Y_RANGE); + this->make (menu, tr("Fractional Scale"), false, QEPlotterNames::PLOTTER_FRACTIONAL_Y_RANGE); + + menu = new QMenu (tr("X Scale"), this); this->addMenu (menu); - this->make (menu, "Linear X scale", false, QEPlotterNames::PLOTTER_LINEAR_X_SCALE); - this->make (menu, "Log X Scale", false, QEPlotterNames::PLOTTER_LOG_X_SCALE); - this->make (menu, "Manual X Scale...", false, QEPlotterNames::PLOTTER_MANUAL_X_RANGE); - this->make (menu, "X Data Range Scale", false, QEPlotterNames::PLOTTER_CURRENT_X_RANGE); - this->make (menu, "Dynamic X Scale", false, QEPlotterNames::PLOTTER_DYNAMIC_X_RANGE); + this->make (menu, tr("Linear X scale"), false, QEPlotterNames::PLOTTER_LINEAR_X_SCALE); + this->make (menu, tr("Log X Scale"), false, QEPlotterNames::PLOTTER_LOG_X_SCALE); + this->make (menu, tr("Manual X Scale..."), false, QEPlotterNames::PLOTTER_MANUAL_X_RANGE); + this->make (menu, tr("X Data Range Scale"), false, QEPlotterNames::PLOTTER_CURRENT_X_RANGE); + this->make (menu, tr("Dynamic X Scale"), false, QEPlotterNames::PLOTTER_DYNAMIC_X_RANGE); - this->make (this, "Manual XY Scale...", false, QEPlotterNames::PLOTTER_MANUAL_XY_RANGE); + this->make (this, tr("Manual XY Scale..."), false, QEPlotterNames::PLOTTER_MANUAL_XY_RANGE); - menu = new QMenu ("Show", this); + menu = new QMenu (tr("Show"), this); this->addMenu (menu); - this->make (menu, "Show/Hide Tool Bar", true, QEPlotterNames::PLOTTER_SHOW_HIDE_TOOLBAR); - this->make (menu, "Show/Hide PV Items", true, QEPlotterNames::PLOTTER_SHOW_HIDE_PV_ITEMS); - this->make (menu, "Show/Hide Status", true, QEPlotterNames::PLOTTER_SHOW_HIDE_STATUS); - this->make (menu, "Show/Hide Crosshairs", true, QEPlotterNames::PLOTTER_SHOW_HIDE_CROSSHAIRS); + this->make (menu, tr("Show/Hide Tool Bar"), true, QEPlotterNames::PLOTTER_SHOW_HIDE_TOOLBAR); + this->make (menu, tr("Show/Hide PV Items"), true, QEPlotterNames::PLOTTER_SHOW_HIDE_PV_ITEMS); + this->make (menu, tr("Show/Hide Status"), true, QEPlotterNames::PLOTTER_SHOW_HIDE_STATUS); + this->make (menu, tr("Show/Hide Crosshairs"), true, QEPlotterNames::PLOTTER_SHOW_HIDE_CROSSHAIRS); - this->make (this, "Emit Coordinates", false, QEPlotterNames::PLOTTER_EMIT_COORDINATES ); + this->make (this, tr("Emit Coordinates"), false, QEPlotterNames::PLOTTER_EMIT_COORDINATES ); // The following menu actions reflect the standard menu items. // this->addSeparator (); - this->make (this, "Copy variable name", false, QEPlotterNames::PLOTTER_COPY_VARIABLE ); - this->make (this, "Copy data", false, QEPlotterNames::PLOTTER_COPY_DATA ); - this->make (this, "Paste to variable name", false, QEPlotterNames::PLOTTER_PASTE ); + this->make (this, tr("Copy variable name"), false, QEPlotterNames::PLOTTER_COPY_VARIABLE ); + this->make (this, tr("Copy data"), false, QEPlotterNames::PLOTTER_COPY_DATA ); + this->make (this, tr("Paste to variable name"), false, QEPlotterNames::PLOTTER_PASTE ); this->addSeparator (); - this->make (this, "Drag variable name", true, QEPlotterNames::PLOTTER_DRAG_VARIABLE ); + this->make (this, tr("Drag variable name"), true, QEPlotterNames::PLOTTER_DRAG_VARIABLE ); this->setActionChecked (QEPlotterNames::PLOTTER_DRAG_VARIABLE, true); - this->make (this, "Drag data", true, QEPlotterNames::PLOTTER_DRAG_DATA ); + this->make (this, tr("Drag data"), true, QEPlotterNames::PLOTTER_DRAG_DATA ); // Similar to QEAbstractDynamicWidget menu construction. // this->addSeparator (); - this->make (this, "Use PV Names", true, QEPlotterNames::PLOTTER_SELECT_USE_PV_NAME ); - this->make (this, "Use Alias Names (if available)", true, QEPlotterNames::PLOTTER_SELECT_USE_ALIAS_NAME); - this->make (this, "Use Descriptions (if available)", true, QEPlotterNames::PLOTTER_SELECT_USE_DESCRIPTION ); + this->make (this, tr("Use PV Names"), true, QEPlotterNames::PLOTTER_SELECT_USE_PV_NAME ); + this->make (this, tr("Use Alias Names (if available)"), true, QEPlotterNames::PLOTTER_SELECT_USE_ALIAS_NAME); + this->make (this, tr("Use Descriptions (if available)"), true, QEPlotterNames::PLOTTER_SELECT_USE_DESCRIPTION ); this->setActionChecked (QEPlotterNames::PLOTTER_SELECT_USE_ALIAS_NAME, true); QObject::connect (this, SIGNAL (triggered (QAction* ) ), @@ -127,63 +127,63 @@ QEPlotterMenu::QEPlotterMenu (const int slotIn, QWidget* parent) : QMenu (parent this->actionList [j] = NULL; } - this->setTitle ("Plotter Item"); + this->setTitle (tr("Plotter Item")); - this->make (this, "Define... ", false, QEPlotterNames::PLOTTER_DATA_DIALOG); + this->make (this, tr("Define... "), false, QEPlotterNames::PLOTTER_DATA_DIALOG); - menu = new QMenu ("Data PV", this); + menu = new QMenu (tr("Data PV"), this); this->addMenu (menu); - this->make (menu, "Examine Properties", false, QEPlotterNames::PLOTTER_SHOW_DATA_PV_PROPERTIES); - this->make (menu, "Plot in StripChart", false, QEPlotterNames::PLOTTER_ADD_DATA_PV_TO_STRIPCHART); - this->make (menu, "Show in Scratch Pad", false, QEPlotterNames::PLOTTER_ADD_DATA_PV_TO_SCRATCH_PAD); + this->make (menu, tr("Examine Properties"), false, QEPlotterNames::PLOTTER_SHOW_DATA_PV_PROPERTIES); + this->make (menu, tr("Plot in StripChart"), false, QEPlotterNames::PLOTTER_ADD_DATA_PV_TO_STRIPCHART); + this->make (menu, tr("Show in Scratch Pad"), false, QEPlotterNames::PLOTTER_ADD_DATA_PV_TO_SCRATCH_PAD); menu->addSeparator(); - this->make (menu, "Copy variable name", false, QEPlotterNames::PLOTTER_COPY_DATA_VARIABLE); - this->make (menu, "Copy data", false, QEPlotterNames::PLOTTER_COPY_DATA_DATA); - this->make (menu, "Paste to variable name", false, QEPlotterNames::PLOTTER_PASTE_DATA_PV); + this->make (menu, tr("Copy variable name"), false, QEPlotterNames::PLOTTER_COPY_DATA_VARIABLE); + this->make (menu, tr("Copy data"), false, QEPlotterNames::PLOTTER_COPY_DATA_DATA); + this->make (menu, tr("Paste to variable name"), false, QEPlotterNames::PLOTTER_PASTE_DATA_PV); menu->addSeparator(); - this->make (menu, "Edit PV", false, QEPlotterNames::PLOTTER_GENERAL_DATA_PV_EDIT); + this->make (menu, tr("Edit PV"), false, QEPlotterNames::PLOTTER_GENERAL_DATA_PV_EDIT); - menu = new QMenu ("Size PV", this); + menu = new QMenu (tr("Size PV"), this); this->addMenu (menu); - this->make (menu, "Examine Properties", false, QEPlotterNames::PLOTTER_SHOW_SIZE_PV_PROPERTIES); - this->make (menu, "Plot in StripChart", false, QEPlotterNames::PLOTTER_ADD_SIZE_PV_TO_STRIPCHART); - this->make (menu, "Show in Scratch Pad", false, QEPlotterNames::PLOTTER_ADD_SIZE_PV_TO_SCRATCH_PAD); + this->make (menu, tr("Examine Properties"), false, QEPlotterNames::PLOTTER_SHOW_SIZE_PV_PROPERTIES); + this->make (menu, tr("Plot in StripChart"), false, QEPlotterNames::PLOTTER_ADD_SIZE_PV_TO_STRIPCHART); + this->make (menu, tr("Show in Scratch Pad"), false, QEPlotterNames::PLOTTER_ADD_SIZE_PV_TO_SCRATCH_PAD); menu->addSeparator(); - this->make (menu, "Copy variable name", false, QEPlotterNames::PLOTTER_COPY_SIZE_VARIABLE); - this->make (menu, "Copy data", false, QEPlotterNames::PLOTTER_COPY_SIZE_DATA); - this->make (menu, "Paste to variable name", false, QEPlotterNames::PLOTTER_PASTE_SIZE_PV); + this->make (menu, tr("Copy variable name"), false, QEPlotterNames::PLOTTER_COPY_SIZE_VARIABLE); + this->make (menu, tr("Copy data"), false, QEPlotterNames::PLOTTER_COPY_SIZE_DATA); + this->make (menu, tr("Paste to variable name"), false, QEPlotterNames::PLOTTER_PASTE_SIZE_PV); menu->addSeparator(); - this->make (menu, "Edit PV", false, QEPlotterNames::PLOTTER_GENERAL_SIZE_PV_EDIT); + this->make (menu, tr("Edit PV"), false, QEPlotterNames::PLOTTER_GENERAL_SIZE_PV_EDIT); - menu = new QMenu ("Scale Chart to", this); + menu = new QMenu (tr("Scale Chart to"), this); this->addMenu (menu); - this->make (menu, "Min to Max value", false, QEPlotterNames::PLOTTER_SCALE_TO_MIN_MAX); - this->make (menu, "Zero to Max value ", false, QEPlotterNames::PLOTTER_SCALE_TO_ZERO_MAX); + this->make (menu, tr("Min to Max value"), false, QEPlotterNames::PLOTTER_SCALE_TO_MIN_MAX); + this->make (menu, tr("Zero to Max value "), false, QEPlotterNames::PLOTTER_SCALE_TO_ZERO_MAX); - menu = new QMenu ("Line", this); + menu = new QMenu (tr("Line"), this); this->addMenu (menu); // This only apply to Y data. // menu->setEnabled (this->slot > 0); if (this->slot > 0) { - this->make (menu, "Bold", true, QEPlotterNames::PLOTTER_LINE_BOLD); - this->make (menu, "Dashed", true, QEPlotterNames::PLOTTER_LINE_DASHED); - this->make (menu, "Dots", true, QEPlotterNames::PLOTTER_LINE_DOTS); - this->make (menu, "Visible", true, QEPlotterNames::PLOTTER_LINE_VISIBLE); + this->make (menu, tr("Bold"), true, QEPlotterNames::PLOTTER_LINE_BOLD); + this->make (menu, tr("Dashed"), true, QEPlotterNames::PLOTTER_LINE_DASHED); + this->make (menu, tr("Dots"), true, QEPlotterNames::PLOTTER_LINE_DOTS); + this->make (menu, tr("Visible"), true, QEPlotterNames::PLOTTER_LINE_VISIBLE); menu->addSeparator (); - this->make (menu, "No Filter", true, QEPlotterNames::PLOTTER_LINE_NO_MEDIAN_FILTER); - this->make (menu, "Median 3", true, QEPlotterNames::PLOTTER_LINE_MEDIAN_3_FILTER); - this->make (menu, "Median 5", true, QEPlotterNames::PLOTTER_LINE_MEDIAN_5_FILTER); + this->make (menu, tr("No Filter"), true, QEPlotterNames::PLOTTER_LINE_NO_MEDIAN_FILTER); + this->make (menu, tr("Median 3"), true, QEPlotterNames::PLOTTER_LINE_MEDIAN_3_FILTER); + this->make (menu, tr("Median 5"), true, QEPlotterNames::PLOTTER_LINE_MEDIAN_5_FILTER); menu->addSeparator (); - this->make (menu, "Colour... ", false, QEPlotterNames::PLOTTER_LINE_COLOUR)->setEnabled (slot < 16); + this->make (menu, tr("Colour... "), false, QEPlotterNames::PLOTTER_LINE_COLOUR)->setEnabled (slot < 16); } - this->make (this, "Select", false, QEPlotterNames::PLOTTER_DATA_SELECT)->setEnabled (slot > 0); + this->make (this, tr("Select"), false, QEPlotterNames::PLOTTER_DATA_SELECT)->setEnabled (slot > 0); - this->make (this, "Clear", false, QEPlotterNames::PLOTTER_DATA_CLEAR); + this->make (this, tr("Clear"), false, QEPlotterNames::PLOTTER_DATA_CLEAR); QObject::connect (this, SIGNAL (triggered (QAction* )), this, SLOT (contextMenuTriggered (QAction* ))); diff --git a/qeframeworkSup/project/widgets/QEPvLoadSave/QEPVLoadSaveNameSelectDialog.cpp b/qeframeworkSup/project/widgets/QEPvLoadSave/QEPVLoadSaveNameSelectDialog.cpp index 86389a18..a2f8cef7 100644 --- a/qeframeworkSup/project/widgets/QEPvLoadSave/QEPVLoadSaveNameSelectDialog.cpp +++ b/qeframeworkSup/project/widgets/QEPvLoadSave/QEPVLoadSaveNameSelectDialog.cpp @@ -227,7 +227,7 @@ void QEPVLoadSaveNameSelectDialog::helpClicked (bool /* checked */ ) // And update button text. // - const QString helpButtonText = helpIsVis ? "Hide" : "Help"; + const QString helpButtonText = helpIsVis ? tr("Hide") : tr("Help"); this->ui->helpButton->setText (helpButtonText); } diff --git a/qeframeworkSup/project/widgets/QEPvLoadSave/QEPvLoadSave.cpp b/qeframeworkSup/project/widgets/QEPvLoadSave/QEPvLoadSave.cpp index f3a0608b..a70523e6 100644 --- a/qeframeworkSup/project/widgets/QEPvLoadSave/QEPvLoadSave.cpp +++ b/qeframeworkSup/project/widgets/QEPvLoadSave/QEPvLoadSave.cpp @@ -148,18 +148,18 @@ QEPvLoadSave::Halves::Halves (const Sides sideIn, QEPvLoadSave* ownerIn, QBoxLay iconPathName.append (buttonSpecs[j].captionOrIcon); button->setIcon (QIcon (iconPathName)); } else { - button->setText (buttonSpecs[j].captionOrIcon); + button->setText (tr(buttonSpecs[j].captionOrIcon.toStdString().c_str())); } button->setFocusPolicy (Qt::NoFocus); - button->setToolTip (buttonSpecs[j].toolTip); + button->setToolTip (tr(buttonSpecs[j].toolTip.toStdString().c_str())); gap = buttonSpecs[j].gap; if (gap == NL) { // There is only one "newline". // if (this->side == LeftSide) { - this->checkBox = new QCheckBox ("Show 2nd tree", this->header); + this->checkBox = new QCheckBox (tr("Show 2nd tree"), this->header); this->checkBox->setGeometry (left + 2, top, 120, 26); this->checkBox->setFocusPolicy (Qt::NoFocus); @@ -189,8 +189,8 @@ QEPvLoadSave::Halves::Halves (const Sides sideIn, QEPvLoadSave* ownerIn, QBoxLay this->macroString = new QLineEdit (this->header); this->macroString->setGeometry (4, top + 32, 444, 23); - this->macroString->setToolTip (" Define macro substitions - applies to PV names, \n" - " group names and values when loaded from a file. "); + this->macroString->setToolTip (tr(" Define macro substitions - applies to PV names, \n" + " group names and values when loaded from a file. ")); this->tree = new QTreeView (this->header); @@ -379,7 +379,7 @@ QEPvLoadSave::QEPvLoadSave (QWidget* parent) : QEFrame (parent) this->loadSaveStatusFrame->setFixedHeight (76); this->overallLayout->addWidget (this->loadSaveStatusFrame); - this->loadSaveTitle = new QLabel ("Transfer to/from System or from Archive", this->loadSaveStatusFrame); + this->loadSaveTitle = new QLabel (tr("Transfer to/from System or from Archive"), this->loadSaveStatusFrame); QFont tf = this->loadSaveTitle->font (); tf.setPointSize (8); this->loadSaveTitle->setFont (tf); @@ -392,7 +392,7 @@ QEPvLoadSave::QEPvLoadSave (QWidget* parent) : QEFrame (parent) this->progressStatus->setGeometry (12, 54, 400, 16); this->abortButton = new QPushButton (this->loadSaveStatusFrame); - this->abortButton->setText ("Abort"); + this->abortButton->setText (tr("Abort")); this->abortButton->setGeometry (424, 24, 80, 26); this->abortButton->setStyleSheet (abortDisabledStyle); this->abortButton->setEnabled (false); @@ -426,18 +426,18 @@ QEPvLoadSave::QEPvLoadSave (QWidget* parent) : QEFrame (parent) // TODO - leverage of standard context menu if we can. // this->treeContextMenu = new QMenu (this); - this->createAction (this->treeContextMenu, "Create Root", false, TCM_CREATE_ROOT); - this->createAction (this->treeContextMenu, "Add Group...", false, TCM_ADD_GROUP); - this->createAction (this->treeContextMenu, "Rename Group...", false, TCM_RENAME_GROUP); - this->createAction (this->treeContextMenu, "Add PV...", false, TCM_ADD_PV); - this->createAction (this->treeContextMenu, "Examine Properties", false, TCM_SHOW_PV_PROPERTIES); - this->createAction (this->treeContextMenu, "Plot in StripChart", false, TCM_ADD_TO_STRIPCHART); - this->createAction (this->treeContextMenu, "Show in Scatch Pad", false, TCM_ADD_TO_SCRATCH_PAD); + this->createAction (this->treeContextMenu, tr("Create Root"), false, TCM_CREATE_ROOT); + this->createAction (this->treeContextMenu, tr("Add Group..."), false, TCM_ADD_GROUP); + this->createAction (this->treeContextMenu, tr("Rename Group..."), false, TCM_RENAME_GROUP); + this->createAction (this->treeContextMenu, tr("Add PV..."), false, TCM_ADD_PV); + this->createAction (this->treeContextMenu, tr("Examine Properties"), false, TCM_SHOW_PV_PROPERTIES); + this->createAction (this->treeContextMenu, tr("Plot in StripChart"), false, TCM_ADD_TO_STRIPCHART); + this->createAction (this->treeContextMenu, tr("Show in Scatch Pad"), false, TCM_ADD_TO_SCRATCH_PAD); this->treeContextMenu->addSeparator (); - this->createAction (this->treeContextMenu, "Edit PV Name...", false, TCM_EDIT_PV_NAME); - this->createAction (this->treeContextMenu, "Edit PV Value...", false, TCM_EDIT_PV_VALUE); - this->createAction (this->treeContextMenu, "Copy variable name", false, TCM_COPY_VARIABLE); - this->createAction (this->treeContextMenu, "Copy data", false, TCM_COPY_DATA); + this->createAction (this->treeContextMenu, tr("Edit PV Name..."), false, TCM_EDIT_PV_NAME); + this->createAction (this->treeContextMenu, tr("Edit PV Value..."), false, TCM_EDIT_PV_VALUE); + this->createAction (this->treeContextMenu, tr("Copy variable name"), false, TCM_COPY_VARIABLE); + this->createAction (this->treeContextMenu, tr("Copy data"), false, TCM_COPY_DATA); QObject::connect (this->treeContextMenu, SIGNAL (triggered (QAction*)), this, SLOT (treeMenuSelected (QAction*))); @@ -620,7 +620,7 @@ void QEPvLoadSave::acceptActionComplete (const QEPvLoadSaveItem*, int v = this->progressBar->value () + 1; this->progressBar->setValue (v); int n = this->progressBar->maximum(); - QString status = QString ("%1: Processed %2 of %3 items") + QString status = QString (tr("%1: Processed %2 of %3 items")) .arg (this->loadSaveAction) .arg (v).arg (n); this->progressStatus->setText (status); @@ -782,7 +782,7 @@ void QEPvLoadSave::treeMenuSelected (QAction* action) case TCM_ADD_GROUP: /// TODO - create group name dialog - re-purposing pvNameSelectDialog here for now // - this->groupNameDialog->setWindowTitle ("QEPvLoadSave - Add Group"); + this->groupNameDialog->setWindowTitle (tr("QEPvLoadSave - Add Group")); this->groupNameDialog->setGroupName (""); n = this->groupNameDialog->exec (tree); if (n == 1) { @@ -793,7 +793,7 @@ void QEPvLoadSave::treeMenuSelected (QAction* action) case TCM_RENAME_GROUP: /// TODO - create group name dialog - re-purposing pvNameSelectDialog here for now - this->groupNameDialog->setWindowTitle ("QEPvLoadSave - Rename Group"); + this->groupNameDialog->setWindowTitle (tr("QEPvLoadSave - Rename Group")); this->groupNameDialog->setGroupName (nodeName); n = this->groupNameDialog->exec (tree); if (n == 1) { @@ -803,7 +803,7 @@ void QEPvLoadSave::treeMenuSelected (QAction* action) break; case TCM_ADD_PV: - this->pvNameSelectDialog->setWindowTitle ("QEPvLoadSave - Add PV"); + this->pvNameSelectDialog->setWindowTitle (tr("QEPvLoadSave - Add PV")); this->pvNameSelectDialog->setPvNames ("", "", ""); n = this->pvNameSelectDialog->exec (tree); if (n == 1) { @@ -819,7 +819,7 @@ void QEPvLoadSave::treeMenuSelected (QAction* action) case TCM_EDIT_PV_NAME: leaf = dynamic_cast (this->contextMenuItem); if (leaf) { // sanity check - this->pvNameSelectDialog->setWindowTitle ("QEPvLoadSave - edit PV"); + this->pvNameSelectDialog->setWindowTitle (tr("QEPvLoadSave - edit PV")); this->pvNameSelectDialog->setPvNames (leaf->getSetPointPvName(), leaf->getReadBackPvName(), leaf->getArchiverPvName()); @@ -934,11 +934,11 @@ bool QEPvLoadSave::pvWriteIsPermitted () bool result; if (this->confirmRequired) { int confirm = QMessageBox::warning - (this, "PV Write Confirmation", - "You are about to write to one or more system Process\n" + (this, tr("PV Write Confirmation"), + tr("You are about to write to one or more system Process\n" "Variables. This may adversely affect the operation of\n" "the system. Are you sure you wish to processed?\n" - "Click OK to proceed or Cancel for no change.", + "Click OK to proceed or Cancel for no change."), QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Cancel); result = (confirm == QMessageBox::Ok); } else { @@ -957,7 +957,7 @@ void QEPvLoadSave::writeAllClicked (bool) const int number = model->leafCount (); if (number > 0) { if (this->pvWriteIsPermitted ()) { - this->loadSaveAction = "Apply"; + this->loadSaveAction = tr("Apply"); this->progressBar->setMaximum (MAX (1, number)); this->progressBar->setValue (0); this->abortButton->setStyleSheet (abortEnabledStyle); @@ -974,7 +974,7 @@ void QEPvLoadSave::readAllClicked (bool) VERIFY_SENDER; QEPvLoadSaveModel* model = this->half [side]->model; - this->loadSaveAction = "Extract"; + this->loadSaveAction = tr("Extract"); this->progressBar->setMaximum (MAX (1, model->leafCount ())); this->progressBar->setValue (0); this->abortButton->setStyleSheet (abortEnabledStyle); @@ -992,7 +992,7 @@ void QEPvLoadSave::writeSubsetClicked (bool) const int number = item ? item->leafCount() : 0; if (number > 0) { if (this->pvWriteIsPermitted ()) { - this->loadSaveAction = "Apply"; + this->loadSaveAction = tr("Apply"); this->progressBar->setMaximum (MAX (1, number)); this->progressBar->setValue (0); this->abortButton->setStyleSheet (abortEnabledStyle); @@ -1010,7 +1010,7 @@ void QEPvLoadSave::readSubsetClicked (bool) QEPvLoadSaveItem* item = this->half [side]->model->getSelectedItem (); if (item) { - this->loadSaveAction = "Extract"; + this->loadSaveAction = tr("Extract"); this->progressBar->setMaximum (MAX (1, item->leafCount ())); this->progressBar->setValue (0); this->abortButton->setStyleSheet (abortEnabledStyle); @@ -1042,7 +1042,7 @@ void QEPvLoadSave::archiveTimeClicked (bool) // QDateTime selectedDataTime = this->archiveTimeDialog->getDateTime (); - this->loadSaveAction = "Read Archive"; + this->loadSaveAction = tr("Read Archive"); this->progressBar->setMaximum (MAX (1, number)); this->progressBar->setValue (0); this->abortButton->setStyleSheet (abortEnabledStyle); @@ -1117,8 +1117,8 @@ void QEPvLoadSave::loadClicked (bool) filename = QFileDialog::getOpenFileName (this, - "Select input file", this->getDefaultDir (), - "PV Config Files(*.xml);;All files (*.*)"); + tr("Select input file"), this->getDefaultDir (), + tr("PV Config Files(*.xml);;All files (*.*)")); if (!filename.isEmpty()) { this->half [side]->open (filename); @@ -1148,9 +1148,9 @@ void QEPvLoadSave::saveClicked (bool) .arg (timeNow.toString ("yyyyMMdd_hhmm")); filename = QFileDialog::getSaveFileName - (this, "Select output file", + (this, tr("Select output file"), defaultDir + defaultName, - "PV Config Files(*.xml)"); + tr("PV Config Files(*.xml)")); // Ensure file has xml extension // @@ -1251,7 +1251,7 @@ void QEPvLoadSave::abortClicked (bool) this->half [0]->model->abortAction (); this->half [1]->model->abortAction (); - QString title = this->loadSaveAction + " failures"; + QString title = this->loadSaveAction + tr(" failures"); if (this->hostSlotAvailable) { // If the graphicalCompare widget already visible - skip this part // diff --git a/qeframeworkSup/project/widgets/QEPvLoadSave/QEPvLoadSaveModel.cpp b/qeframeworkSup/project/widgets/QEPvLoadSave/QEPvLoadSaveModel.cpp index 8eb05db0..c5e99f97 100644 --- a/qeframeworkSup/project/widgets/QEPvLoadSave/QEPvLoadSaveModel.cpp +++ b/qeframeworkSup/project/widgets/QEPvLoadSave/QEPvLoadSaveModel.cpp @@ -414,7 +414,7 @@ void QEPvLoadSaveModel::selectionChanged (const QItemSelection& selected, const this->selectedItem = item; if (item) { int count = item->leafCount (); - QString text = "selected "; + QString text = tr("selected "); if (item->getIsPV ()) { text.append (item->getNodeName ()); } else { @@ -622,9 +622,9 @@ QVariant QEPvLoadSaveModel::headerData (int section, Qt::Orientation orientation if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { switch (kind) { case QEPvLoadSaveCommon::NodeName: return QVariant (this->heading); - case QEPvLoadSaveCommon::LoadSave: return QVariant ("load/save"); - case QEPvLoadSaveCommon::Live: return QVariant ("live"); - case QEPvLoadSaveCommon::Delta: return QVariant ("delta"); + case QEPvLoadSaveCommon::LoadSave: return QVariant (tr("load/save")); + case QEPvLoadSaveCommon::Live: return QVariant (tr("live")); + case QEPvLoadSaveCommon::Delta: return QVariant (tr("delta")); default: return QVariant (""); } } diff --git a/qeframeworkSup/project/widgets/QEPvLoadSaveButton/QEPvLoadSaveButton.cpp b/qeframeworkSup/project/widgets/QEPvLoadSaveButton/QEPvLoadSaveButton.cpp index 3921d089..12d470e1 100644 --- a/qeframeworkSup/project/widgets/QEPvLoadSaveButton/QEPvLoadSaveButton.cpp +++ b/qeframeworkSup/project/widgets/QEPvLoadSaveButton/QEPvLoadSaveButton.cpp @@ -105,7 +105,7 @@ void QEPvLoadSaveButton::userClicked(bool) { QString configurationFile = this->getSubstitutedVariableName (0); this->rootItem = QEPvLoadSaveUtilities::readTree (configurationFile, QString()); if (!this->rootItem) { - this->sendMessage( QString ("Failed to read file %1").arg(configurationFile), message_types(MESSAGE_TYPE_ERROR));; + this->sendMessage( tr ("Failed to read file %1").arg(configurationFile), message_types(MESSAGE_TYPE_ERROR));; return; } @@ -117,10 +117,10 @@ void QEPvLoadSaveButton::userClicked(bool) { // If it has simply reset the values. // if (this->showProgressDialog) { - QString labelText = getAction() == SaveToFile ? "Saving PV values to file ..." : "Applying PV values to the system..."; + QString labelText = getAction() == SaveToFile ? tr("Saving PV values to file ...") : tr("Applying PV values to the system..."); if (this->progressDialog == NULL) { - this->progressDialog = new QProgressDialog(labelText, "Abort", 0, MAX (1, model->leafCount ()), this); - this->progressDialog->setWindowTitle("Load/Save Progress"); + this->progressDialog = new QProgressDialog(labelText, tr("Abort"), 0, MAX (1, model->leafCount ()), this); + this->progressDialog->setWindowTitle(tr("Load/Save Progress")); this->progressDialog->setWindowModality(Qt::WindowModal); this->progressDialog->setMinimumDuration(0); this->progressDialog->setAutoClose(false); @@ -129,7 +129,7 @@ void QEPvLoadSaveButton::userClicked(bool) { this->progressDialog->setMinimumWidth(300); } else { this->progressDialog->setLabelText(labelText); - this->progressDialog->setCancelButtonText("Abort"); + this->progressDialog->setCancelButtonText(tr("Abort")); this->progressDialog->setRange(0,MAX (1, model->leafCount ())); this->progressDialog->setValue(0); this->progressDialog->open(); @@ -179,19 +179,19 @@ bool QEPvLoadSaveButton::actionIsPermitted (Actions action) message = this->getConfirmText(); } else { if (action == LoadToPVs) { - message = "You are about to write to one or more system Process\n" + message = tr("You are about to write to one or more system Process\n" "Variables. This may adversely affect the operation of\n" "the system. Are you sure you wish to processed?\n" - "Click OK to proceed or Cancel for no change."; + "Click OK to proceed or Cancel for no change."); } else if (action == SaveToFile) { - message = "You are about to save the values of oneor more system\n" + message = tr("You are about to save the values of oneor more system\n" "Process Variables. This will override any previously\n" "saved values in the file. Are you sure you wish to processed?\n" - "Click OK to proceed or Cancel for no change."; + "Click OK to proceed or Cancel for no change."); } } int confirm = QMessageBox::warning - (this, QString("PV %1 Confirmation").arg(action == LoadToPVs ? "Load" : "Save"), message, + (this, tr("PV %1 Confirmation").arg(action == LoadToPVs ? tr("Load") : tr("Save")), message, QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Cancel); result = (confirm == QMessageBox::Ok); } else { @@ -210,11 +210,11 @@ void QEPvLoadSaveButton::acceptActionComplete (const QEPvLoadSaveItem*, int v = this->progressDialog->value () + 1; this->progressDialog->setValue (v); int n = this->progressDialog->maximum(); - QString status = QString ("Processed %2 of %3 items") + QString status = tr ("Processed %1 of %2 items") .arg (v).arg (n); this->progressDialog->setLabelText (status); if (v == n) { - this->progressDialog->setCancelButtonText("Done"); + this->progressDialog->setCancelButtonText(tr("Done")); } QApplication::processEvents(); } diff --git a/qeframeworkSup/project/widgets/QEPvProperties/QEPvProperties.cpp b/qeframeworkSup/project/widgets/QEPvProperties/QEPvProperties.cpp index 52dd5887..e841ea4d 100644 --- a/qeframeworkSup/project/widgets/QEPvProperties/QEPvProperties.cpp +++ b/qeframeworkSup/project/widgets/QEPvProperties/QEPvProperties.cpp @@ -196,7 +196,7 @@ void QEPvProperties::createInternalWidgets () this->topFrameVlayout->addLayout (this->hlayouts [j], 1); } - this->pvNameButton = new QPushButton ("Name", this->topFrame); + this->pvNameButton = new QPushButton (tr("Name"), this->topFrame); this->pvNameButton->setFixedSize (QSize (label_width, label_height)); this->box = new QComboBox (this->topFrame); @@ -204,7 +204,7 @@ void QEPvProperties::createInternalWidgets () this->hlayouts [1]->addWidget (this->pvNameButton, 0, Qt::AlignVCenter); this->hlayouts [1]->addWidget (this->box, 0, Qt::AlignVCenter); - this->label2 = new QLabel ("VAL", this->topFrame); + this->label2 = new QLabel (tr("VAL"), this->topFrame); this->label2->setFixedSize (QSize (label_width, label_height)); this->valueLabel = new QLabel (this->topFrame); this->valueLabel->setFixedHeight (label_height); @@ -214,26 +214,26 @@ void QEPvProperties::createInternalWidgets () this->hlayouts [2]->addWidget (this->label2); this->hlayouts [2]->addWidget (this->valueLabel); - this->label3 = new QLabel ("Host", this->topFrame); + this->label3 = new QLabel (tr("Host"), this->topFrame); this->label3->setFixedSize (QSize (label_width, label_height)); this->hostName = new QLabel (this->topFrame); this->hostName->setFixedHeight (label_height); this->hlayouts [3]->addWidget (this->label3); this->hlayouts [3]->addWidget (this->hostName); - this->label4 = new QLabel ("Time", this->topFrame); + this->label4 = new QLabel (tr("Time"), this->topFrame); this->label4->setFixedSize (QSize (label_width, label_height)); this->timeStamp = new QLabel (this->topFrame); this->timeStamp->setFixedHeight (label_height); this->hlayouts [4]->addWidget (this->label4); this->hlayouts [4]->addWidget (this->timeStamp); - this->label5 = new QLabel ("DBF", this->topFrame); + this->label5 = new QLabel (tr("DBF"), this->topFrame); this->label5->setFixedSize (QSize (label_width, label_height)); this->fieldType = new QLabel (this->topFrame); this->fieldType->setFixedHeight (label_height); - this->label6 = new QLabel (" Element Count", this->topFrame); + this->label6 = new QLabel (tr(" Element Count"), this->topFrame); this->label6->setFixedSize (QSize (112, label_height)); this->elementCount = new QLabel (this->topFrame); this->elementCount->setFixedHeight (label_height); @@ -265,7 +265,7 @@ void QEPvProperties::createInternalWidgets () ENUMERATIONS_MAX_HEIGHT, this); this->enumerationResize->setFixedHeight (ENUMERATIONS_MIN_HEIGHT); this->enumerationResize->setFrameShape (QFrame::Panel); - this->enumerationResize->setGrabberToolTip ("Re size enuerations"); + this->enumerationResize->setGrabberToolTip (tr("Re size enuerations")); this->enumerationResize->setWidget (this->enumerationScroll); // We create this with 40 rows initially - this will get expanded if/when necessary. @@ -444,13 +444,13 @@ void QEPvProperties::common_setup () enumLabel->setStyleSheet (lightGreyStyle); } - item = new QTableWidgetItem (" Field "); + item = new QTableWidgetItem (tr(" Field ")); this->table->setHorizontalHeaderItem (FIELD_COL, item); - item = new QTableWidgetItem (" Description "); + item = new QTableWidgetItem (tr(" Description ")); this->table->setHorizontalHeaderItem (DESC_COL, item); - item = new QTableWidgetItem (" Value "); + item = new QTableWidgetItem (tr(" Value ")); this->table->setHorizontalHeaderItem (VALUE_COL, item); this->table->horizontalHeader()->setDefaultSectionSize (60); @@ -1252,19 +1252,19 @@ QMenu* QEPvProperties::buildContextMenu () menu->addSeparator (); QAction* action; - action = new QAction ("Sort By Field Name", menu); + action = new QAction (tr("Sort By Field Name"), menu); action->setCheckable (false); action->setEnabled ((number > 0) && !this->fieldsAreSorted); action->setData (QEPvProperties::PVPROP_SORT_FIELD_NAMES); menu->addAction (action); - action = new QAction ("Reset Field Order", menu); + action = new QAction (tr("Reset Field Order"), menu); action->setCheckable (false); action->setEnabled ((number > 0) && this->fieldsAreSorted); action->setData (QEPvProperties::PVPROP_RESET_FIELD_NAMES); menu->addAction (action); - action = new QAction ("Process Record", menu); + action = new QAction (tr("Process Record"), menu); action->setCheckable (false); action->setEnabled (true); action->setData (QEPvProperties::PVPROP_PROCESS_RECORD); diff --git a/qeframeworkSup/project/widgets/QERadioGroup/QERadioGroup.cpp b/qeframeworkSup/project/widgets/QERadioGroup/QERadioGroup.cpp index 2913ef73..d8eca9b1 100644 --- a/qeframeworkSup/project/widgets/QERadioGroup/QERadioGroup.cpp +++ b/qeframeworkSup/project/widgets/QERadioGroup/QERadioGroup.cpp @@ -592,7 +592,7 @@ QMenu* QERadioGroup::buildContextMenu () QMenu* menu = QEWidget::buildContextMenu (); QAction* action; - action = new QAction ("Apply current selection", menu); + action = new QAction (tr("Apply current selection"), menu); action->setCheckable (false); action->setData (QERG_APPLY_CURRENT_SELECTION); diff --git a/qeframeworkSup/project/widgets/QERecipe/QERecipe.cpp b/qeframeworkSup/project/widgets/QERecipe/QERecipe.cpp index 2cb01413..f922978f 100644 --- a/qeframeworkSup/project/widgets/QERecipe/QERecipe.cpp +++ b/qeframeworkSup/project/widgets/QERecipe/QERecipe.cpp @@ -49,30 +49,30 @@ QERecipe::QERecipe(QWidget *pParent):QWidget(pParent), QEWidget(this) qComboBoxRecipeList->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - qComboBoxRecipeList->setToolTip("Select recipe"); + qComboBoxRecipeList->setToolTip(tr("Select recipe")); QObject::connect(qComboBoxRecipeList, SIGNAL(currentIndexChanged(int)), this, SLOT(comboBoxRecipeSelected(int))); - qPushButtonNew->setText("New"); - qPushButtonNew->setToolTip("Create new recipe"); + qPushButtonNew->setText(tr("New")); + qPushButtonNew->setToolTip(tr("Create new recipe")); QObject::connect(qPushButtonNew, SIGNAL(clicked()), this, SLOT(buttonNewClicked())); - qPushButtonSave->setText("Save"); - qPushButtonSave->setToolTip("Save values in the selected recipe"); + qPushButtonSave->setText(tr("Save")); + qPushButtonSave->setToolTip(tr("Save values in the selected recipe")); qPushButtonSave->setEnabled(false); QObject::connect(qPushButtonSave, SIGNAL(clicked()), this, SLOT(buttonSaveClicked())); - qPushButtonDelete->setText("Delete"); - qPushButtonDelete->setToolTip("Delete selected recipe"); + qPushButtonDelete->setText(tr("Delete")); + qPushButtonDelete->setToolTip(tr("Delete selected recipe")); qPushButtonDelete->setEnabled(false); QObject::connect(qPushButtonDelete, SIGNAL(clicked()), this, SLOT(buttonDeleteClicked())); - qPushButtonApply->setText("Apply"); - qPushButtonApply->setToolTip("Apply values to process variables"); + qPushButtonApply->setText(tr("Apply")); + qPushButtonApply->setToolTip(tr("Apply values to process variables")); qPushButtonApply->setEnabled(false); QObject::connect(qPushButtonApply, SIGNAL(clicked()), this, SLOT(buttonApplyClicked())); - qPushButtonRead->setText("Read"); - qPushButtonRead->setToolTip("Read values from process variables"); + qPushButtonRead->setText(tr("Read")); + qPushButtonRead->setToolTip(tr("Read values from process variables")); QObject::connect(qPushButtonRead, SIGNAL(clicked()), this, SLOT(buttonReadClicked())); qEConfiguredLayoutRecipeFields->setShowItemList(false); @@ -509,7 +509,7 @@ void QERecipe::buttonNewClicked() do { - name = QInputDialog::getText(this, "New Recipe", "Name:", QLineEdit::Normal , "", &flag); + name = QInputDialog::getText(this, tr("New Recipe"), tr("Name:"), QLineEdit::Normal , "", &flag); } while(flag && name.isEmpty()); @@ -569,7 +569,7 @@ void QERecipe::buttonNewClicked() } if (flag) { - flag = (QMessageBox::question(this, "Info", "Do you want to replace existing recipe '" + name + "'?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes); + flag = (QMessageBox::question(this, tr("Info"), tr("Do you want to replace existing recipe '%1'?").arg(name), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes); if (flag) { rootElement.removeChild(rootNode); @@ -577,7 +577,7 @@ void QERecipe::buttonNewClicked() } else { - QMessageBox::warning(this, "Warning", "Unable to create recipe '" + name + "' since it already exists and belongs to another user type with more priviledges!"); + QMessageBox::warning(this, tr("Warning"), tr("Unable to create recipe '%1' since it already exists and belongs to another user type with more priviledges!").arg(name)); } } else @@ -627,13 +627,13 @@ void QERecipe::buttonNewClicked() rootElement.appendChild(recipeElement); if (saveRecipeList()) { - QMessageBox::information(this, "Info", "The recipe '" + name + "' was successfully created!"); + QMessageBox::information(this, tr("Info"), tr("The recipe '%1' was successfully created!").arg(name)); } else { // TODO: restore original document if there is an error //rootElement.removeChild(recipeElement); - QMessageBox::critical(this, "Error", "Unable to create recipe '" + name + "' in file '" + filename + "'!"); + QMessageBox::critical(this, tr("Error"), tr("Unable to create recipe '%1' in file '%2'!").arg(name).arg(filename)); } } } @@ -659,7 +659,7 @@ void QERecipe::buttonSaveClicked() currentName = qComboBoxRecipeList->currentText(); - if (QMessageBox::question(this, "Info", "Do you want to save the values in recipe '" + currentName + "'?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) + if (QMessageBox::question(this, tr("Info"), tr("Do you want to save the values in recipe '%1'?").arg(currentName), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { count = 0; rootElement = document.documentElement(); @@ -722,12 +722,12 @@ void QERecipe::buttonSaveClicked() if (saveRecipeList()) { - QMessageBox::information(this, "Info", "The recipe '" + currentName + "' was successfully saved!"); + QMessageBox::information(this, tr("Info"), tr("The recipe '%1' was successfully saved!").arg(currentName)); } else { // TODO: restore original document if there is an error - QMessageBox::critical(this, "Error", "Unable to save recipe '" + currentName + "' in file '" + filename + "'!"); + QMessageBox::critical(this, tr("Error"), tr("Unable to save recipe '%1' in file '%2'!").arg(currentName).arg(filename)); } } @@ -749,7 +749,7 @@ void QERecipe::buttonDeleteClicked() currentName = qComboBoxRecipeList->currentText(); - if (QMessageBox::question(this, "Info", "Do you want to delete recipe '" + currentName + "'?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) + if (QMessageBox::question(this, tr("Info"), tr("Do you want to delete recipe '%1'?").arg(currentName), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { count = 0; rootElement = document.documentElement(); @@ -781,12 +781,12 @@ void QERecipe::buttonDeleteClicked() } if (saveRecipeList()) { - QMessageBox::information(this, "Info", "The recipe '" + currentName + "' was successfully delete!"); + QMessageBox::information(this, tr("Info"), tr("The recipe '%1' was successfully delete!").arg(currentName)); } else { // TODO: restore original document if there is an error - QMessageBox::critical(this, "Error", "Unable to delete recipe '" + currentName + "' in file '" + filename + "'!"); + QMessageBox::critical(this, tr("Error"), tr("Unable to delete recipe '%1' in file %2'!").arg(currentName).arg(filename)); } } @@ -802,7 +802,7 @@ void QERecipe::buttonApplyClicked() int i; - if (QMessageBox::question(this, "Info", "Do you want to apply recipe '" + qComboBoxRecipeList->currentText() + "' to process variables?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) + if (QMessageBox::question(this, tr("Info"), tr("Do you want to apply recipe '%1' to process variables?").arg(qComboBoxRecipeList->currentText()), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { for(i = 0; i < qEConfiguredLayoutRecipeFields->currentFieldList.size(); i++) { @@ -812,7 +812,7 @@ void QERecipe::buttonApplyClicked() fieldInfo->qeWidget->writeNow(); } } - QMessageBox::information(this, "Info", "The recipe '" + qComboBoxRecipeList->currentText() + "' was successfully applied to process variables!"); + QMessageBox::information(this, tr("Info"), tr("The recipe '%1' was successfully applied to process variables!").arg(qComboBoxRecipeList->currentText())); } } @@ -827,7 +827,7 @@ void QERecipe::buttonReadClicked() int i; - if (QMessageBox::question(this, "Info", "Do you want to read the values from process variables?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) + if (QMessageBox::question(this, tr("Info"), tr("Do you want to read the values from process variables?"), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { for(i = 0; i < qEConfiguredLayoutRecipeFields->currentFieldList.size(); i++) { @@ -837,7 +837,7 @@ void QERecipe::buttonReadClicked() fieldInfo->qeWidget->readNow(); } } - QMessageBox::information(this, "Info", "The values were successfully read from the process variables!"); + QMessageBox::information(this, tr("Info"), tr("The values were successfully read from the process variables!")); } } diff --git a/qeframeworkSup/project/widgets/QEScratchPad/QEScratchPad.cpp b/qeframeworkSup/project/widgets/QEScratchPad/QEScratchPad.cpp index bed9a8f0..c5bc8282 100644 --- a/qeframeworkSup/project/widgets/QEScratchPad/QEScratchPad.cpp +++ b/qeframeworkSup/project/widgets/QEScratchPad/QEScratchPad.cpp @@ -79,19 +79,19 @@ void QEScratchPad::createInternalWidgets () this->titleFrame->setFixedHeight (titleFrameHeight); - this->titlePvName = new QLabel ("PV Name", this->titleFrame); + this->titlePvName = new QLabel (tr("PV Name"), this->titleFrame); this->titlePvName->setIndent (indent); - this->titleDescription = new QLabel ("Description", this->titleFrame); + this->titleDescription = new QLabel (tr("Description"), this->titleFrame); this->titleDescription->setIndent (indent); - this->titleValue = new QLabel ("Value", this->titleFrame); + this->titleValue = new QLabel (tr("Value"), this->titleFrame); this->titleValue->setIndent (indent); this->loadButton = new QPushButton (this->titleFrame); this->loadButton->setIcon (QIcon (":/qe/stripchart/open_file.png")); this->loadButton->setFocusPolicy (Qt::NoFocus); - this->loadButton->setToolTip (" Load scratch pad configuration "); + this->loadButton->setToolTip (tr(" Load scratch pad configuration ")); this->loadButton->setFixedSize (26, 26); // We discard the signal bool parameter QObject::connect (this->loadButton, SIGNAL (clicked ()), @@ -100,7 +100,7 @@ void QEScratchPad::createInternalWidgets () this->saveButton = new QPushButton (this->titleFrame); this->saveButton->setIcon (QIcon (":/qe/stripchart/save_file.png")); this->saveButton->setFocusPolicy (Qt::NoFocus); - this->saveButton->setToolTip (" Save scratch pad configuration "); + this->saveButton->setToolTip (tr(" Save scratch pad configuration ")); this->saveButton->setFixedSize (26, 26); QObject::connect (this->saveButton, SIGNAL (clicked ()), this, SLOT (saveWidgetConfiguration ())); @@ -933,13 +933,13 @@ QMenu* QEScratchPad::buildContextMenu () menu->addSeparator (); - action = new QAction ("Sort By PV Name", menu); + action = new QAction (tr("Sort By PV Name"), menu); action->setCheckable (false); action->setEnabled (n >= 2); // need two or more to tango. action->setData (QEScratchPadMenu::SCRATCHPAD_SORT_PV_NAMES); menu->addAction (action); - action = new QAction ("Clear All", menu); + action = new QAction (tr("Clear All"), menu); action->setCheckable (false); action->setEnabled (n >= 1); action->setData (QEScratchPadMenu::SCRATCHPAD_CLEAR_ALL); diff --git a/qeframeworkSup/project/widgets/QEScratchPad/QEScratchPadMenu.cpp b/qeframeworkSup/project/widgets/QEScratchPad/QEScratchPadMenu.cpp index 2370a8a0..8f5e144d 100644 --- a/qeframeworkSup/project/widgets/QEScratchPad/QEScratchPadMenu.cpp +++ b/qeframeworkSup/project/widgets/QEScratchPad/QEScratchPadMenu.cpp @@ -42,12 +42,12 @@ QEScratchPadMenu::QEScratchPadMenu (const int slotIn, QWidget* parent) : QMenu ( this->actionList [j] = 0; } - this->setTitle ("ScratchPad Item"); + this->setTitle (tr("ScratchPad Item")); - this->make (this, "Add PV Name...", false, SCRATCHPAD_ADD_PV_NAME); - this->make (this, "Paste PV Name", false, SCRATCHPAD_PASTE_PV_NAME); - this->make (this, "Edit PV Name...", false, SCRATCHPAD_EDIT_PV_NAME); - this->make (this, "Clear", false, SCRATCHPAD_DATA_CLEAR); + this->make (this, tr("Add PV Name..."), false, SCRATCHPAD_ADD_PV_NAME); + this->make (this, tr("Paste PV Name"), false, SCRATCHPAD_PASTE_PV_NAME); + this->make (this, tr("Edit PV Name..."), false, SCRATCHPAD_EDIT_PV_NAME); + this->make (this, tr("Clear"), false, SCRATCHPAD_DATA_CLEAR); QObject::connect (this, SIGNAL (triggered (QAction* ) ), this, SLOT (contextMenuTriggered (QAction* ))); diff --git a/qeframeworkSup/project/widgets/QEScript/QEScript.cpp b/qeframeworkSup/project/widgets/QEScript/QEScript.cpp index 9b1a7906..51774055 100644 --- a/qeframeworkSup/project/widgets/QEScript/QEScript.cpp +++ b/qeframeworkSup/project/widgets/QEScript/QEScript.cpp @@ -74,75 +74,75 @@ QEScript::QEScript(QWidget *pParent):QWidget(pParent), QEWidget( this ) qComboBoxScriptList->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - qComboBoxScriptList->setToolTip("Select script"); + qComboBoxScriptList->setToolTip(tr("Select script")); QObject::connect(qComboBoxScriptList, SIGNAL(currentIndexChanged(int)), this, SLOT(comboBoxScriptSelected(int))); - qPushButtonNew->setText("New"); - qPushButtonNew->setToolTip("Create new script (reset table)"); + qPushButtonNew->setText(tr("New")); + qPushButtonNew->setToolTip(tr("Create new script (reset table)")); QObject::connect(qPushButtonNew, SIGNAL(clicked()), this, SLOT(buttonNewClicked())); - qPushButtonSave->setText("Save"); - qPushButtonSave->setToolTip("Save script"); + qPushButtonSave->setText(tr("Save")); + qPushButtonSave->setToolTip(tr("Save script")); QObject::connect(qPushButtonSave, SIGNAL(clicked()), this, SLOT(buttonSaveClicked())); - qPushButtonDelete->setText("Delete"); - qPushButtonDelete->setToolTip("Delete selected script"); + qPushButtonDelete->setText(tr("Delete")); + qPushButtonDelete->setToolTip(tr("Delete selected script")); QObject::connect(qPushButtonDelete, SIGNAL(clicked()), this, SLOT(buttonDeleteClicked())); - qPushButtonExecute->setText("Execute"); - qPushButtonExecute->setToolTip("Execute"); + qPushButtonExecute->setText(tr("Execute")); + qPushButtonExecute->setToolTip(tr("Execute")); QObject::connect(qPushButtonExecute, SIGNAL(clicked()), this, SLOT(buttonExecuteClicked())); - qPushButtonAbort->setText("Abort"); - qPushButtonAbort->setToolTip("Abort execution of program(s)"); + qPushButtonAbort->setText(tr("Abort")); + qPushButtonAbort->setToolTip(tr("Abort execution of program(s)")); QObject::connect(qPushButtonAbort, SIGNAL(clicked()), this, SLOT(buttonAbortClicked())); - qPushButtonAdd->setText("Add"); - qPushButtonAdd->setToolTip("Add row"); + qPushButtonAdd->setText(tr("Add")); + qPushButtonAdd->setToolTip(tr("Add row")); QObject::connect(qPushButtonAdd, SIGNAL(clicked()), this, SLOT(buttonAddClicked())); - qPushButtonRemove->setText("Remove"); - qPushButtonRemove->setToolTip("Remove selected row(s)"); + qPushButtonRemove->setText(tr("Remove")); + qPushButtonRemove->setToolTip(tr("Remove selected row(s)")); QObject::connect(qPushButtonRemove, SIGNAL(clicked()), this, SLOT(buttonRemoveClicked())); - qPushButtonUp->setText("Up"); - qPushButtonUp->setToolTip("Move selected row up"); + qPushButtonUp->setText(tr("Up")); + qPushButtonUp->setToolTip(tr("Move selected row up")); QObject::connect(qPushButtonUp, SIGNAL(clicked()), this, SLOT(buttonUpClicked())); - qPushButtonDown->setText("Down"); - qPushButtonDown->setToolTip("Move selected row down"); + qPushButtonDown->setText(tr("Down")); + qPushButtonDown->setToolTip(tr("Move selected row down")); QObject::connect(qPushButtonDown, SIGNAL(clicked()), this, SLOT(buttonDownClicked())); - qPushButtonCopy->setText("Copy"); - qPushButtonCopy->setToolTip("Copy selected row(s)"); + qPushButtonCopy->setText(tr("Copy")); + qPushButtonCopy->setToolTip(tr("Copy selected row(s)")); QObject::connect(qPushButtonCopy, SIGNAL(clicked()), this, SLOT(buttonCopyClicked())); - qPushButtonPaste->setText("Paste"); - qPushButtonPaste->setToolTip("Paste row(s)"); + qPushButtonPaste->setText(tr("Paste")); + qPushButtonPaste->setToolTip(tr("Paste row(s)")); QObject::connect(qPushButtonPaste, SIGNAL(clicked()), this, SLOT(buttonPasteClicked())); qTableWidgetScript->setColumnCount(8); qTableWidgetScript->setHorizontalHeaderItem(0, new QTableWidgetItem("#")); - qTableWidgetScript->setHorizontalHeaderItem(1, new QTableWidgetItem("Enable")); - qTableWidgetScript->setHorizontalHeaderItem(2, new QTableWidgetItem("Program")); - qTableWidgetScript->setHorizontalHeaderItem(3, new QTableWidgetItem("Parameters")); - qTableWidgetScript->setHorizontalHeaderItem(4, new QTableWidgetItem("Directory")); - qTableWidgetScript->setHorizontalHeaderItem(5, new QTableWidgetItem("Timeout")); - qTableWidgetScript->setHorizontalHeaderItem(6, new QTableWidgetItem("Stop")); - qTableWidgetScript->setHorizontalHeaderItem(7, new QTableWidgetItem("Log")); - qTableWidgetScript->setToolTip("List of programs to execute"); + qTableWidgetScript->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Enable"))); + qTableWidgetScript->setHorizontalHeaderItem(2, new QTableWidgetItem(tr("Program"))); + qTableWidgetScript->setHorizontalHeaderItem(3, new QTableWidgetItem(tr("Parameters"))); + qTableWidgetScript->setHorizontalHeaderItem(4, new QTableWidgetItem(tr("Directory"))); + qTableWidgetScript->setHorizontalHeaderItem(5, new QTableWidgetItem(tr("Timeout"))); + qTableWidgetScript->setHorizontalHeaderItem(6, new QTableWidgetItem(tr("Stop"))); + qTableWidgetScript->setHorizontalHeaderItem(7, new QTableWidgetItem(tr("Log"))); + qTableWidgetScript->setToolTip(tr("List of programs to execute")); qTableWidgetScript->setSelectionBehavior(QAbstractItemView::SelectRows); qTableWidgetScript->verticalHeader()->hide(); qFont.setPointSize(9); @@ -709,7 +709,7 @@ void QEScript::comboBoxScriptSelected(int) // void QEScript::buttonNewClicked() { - if (QMessageBox::question(this, "Info", "Do you want to create a new script (reset table)?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) + if (QMessageBox::question(this, tr("Info"), tr("Do you want to create a new script (reset table)?"), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { while (qTableWidgetScript->rowCount() > 0) { @@ -736,7 +736,7 @@ void QEScript::buttonSaveClicked() currentName = qComboBoxScriptList->currentText(); do { - name = QInputDialog::getText(this, "Script name", "Name:", QLineEdit::Normal , currentName, &flag); + name = QInputDialog::getText(this, tr("Script name"), tr("Name:"), QLineEdit::Normal , currentName, &flag); } while(flag && name.isEmpty()); @@ -762,7 +762,7 @@ void QEScript::buttonSaveClicked() } if (flag == false) { - if (QMessageBox::question(this, "Info", "Do you want to overwrite existing script '" + name + "'?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) + if (QMessageBox::question(this, tr("Info"), tr("Do you want to overwrite existing script '%1'?").arg(name), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { rootElement.removeChild(rootNode); flag = true; @@ -789,12 +789,12 @@ void QEScript::buttonSaveClicked() { i = qComboBoxScriptList->findText(name); qComboBoxScriptList->setCurrentIndex(i); - QMessageBox::information(this, "Info", "The script '" + name + "' was successfully saved!"); + QMessageBox::information(this, tr("Info"), tr("The script '%1' was successfully saved!").arg(name)); } else { // TODO: restore original document if there is an error - QMessageBox::critical(this, "Error", "Unable to save script '" + name + "' in file '" + filename + "'!"); + QMessageBox::critical(this, tr("Error"), tr("Unable to save script '%1' in file '%2'!").arg(name).arg(filename)); } } } @@ -811,7 +811,7 @@ void QEScript::buttonDeleteClicked() currentName = qComboBoxScriptList->currentText(); - if (QMessageBox::question(this, "Info", "Do you want to delete script '" + currentName + "'?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) + if (QMessageBox::question(this, tr("Info"), tr("Do you want to delete script '%1'?").arg(currentName), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { rootElement = document.documentElement(); if (rootElement.tagName() == "epicsqt") @@ -838,12 +838,12 @@ void QEScript::buttonDeleteClicked() qTableWidgetScript->removeRow(0); } qComboBoxScriptList->setCurrentIndex(-1); - QMessageBox::information(this, "Info", "The script '" + currentName + "' was successfully delete!"); + QMessageBox::information(this, tr("Info"), tr("The script '%1' was successfully delete!").arg(currentName)); } else { // TODO: restore original document if there is an error - QMessageBox::critical(this, "Error", "Unable to delete script '" + currentName + "' in file '" + filename + "'!"); + QMessageBox::critical(this, tr("Error"), tr("Unable to delete script '%1' in file '%2'!").arg(currentName).arg(filename)); } } } @@ -873,7 +873,7 @@ void QEScript::buttonExecuteClicked() qTableWidgetScript->selectRow(i); if (((QCheckBox *) qTableWidgetScript->cellWidget(i, 1))->isChecked() == false) { - sendMessage("Skipping execution of program #" + QString::number(i + 1) + " since it is disabled"); + sendMessage(tr("Skipping execution of program #%1 since it is disabled").arg(i + 1)); } else { @@ -883,7 +883,7 @@ void QEScript::buttonExecuteClicked() { if (log) { - sendMessage("Skipping execution of program #" + QString::number(i + 1) + " since it is undefined", message_types(MESSAGE_TYPE_WARNING)); + sendMessage(tr("Skipping execution of program #%1 since it is undefined").arg(i + 1), message_types(MESSAGE_TYPE_WARNING)); } } else @@ -893,7 +893,7 @@ void QEScript::buttonExecuteClicked() { if (log) { - sendMessage("Executing program #" + QString::number(i + 1) + " until it finishes"); + sendMessage(tr("Executing program #%1 until it finishes").arg(i + 1)); } j = -1; } @@ -901,7 +901,7 @@ void QEScript::buttonExecuteClicked() { if (log) { - sendMessage("Executing program #" + QString::number(i + 1) + " for " + QString::number(timeOut) + " seconds"); + sendMessage(tr("Executing program #%1 for %2 seconds").arg(i + 1).arg(timeOut)); } j = timeOut * 50; } @@ -933,13 +933,13 @@ void QEScript::buttonExecuteClicked() { if (exitCode == 0) { - sendMessage("Finished executing program #" + QString::number(i + 1) + " with exit code '" + QString::number(exitCode) + "'"); + sendMessage(tr("Finished executing program #%1 with exit code '%2'").arg(i + 1).arg(exitCode)); } else { if (((QCheckBox *) qTableWidgetScript->cellWidget(i, 6))->isChecked()) { - sendMessage("Stop execution since program #" + QString::number(i + 1) + " has finished with exit code '" + QString::number(exitCode) + "'", message_types(MESSAGE_TYPE_WARNING)); + sendMessage(tr("Stop execution since program #%1 has finished with exit code '%2'").arg(i + 1).arg(exitCode), message_types(MESSAGE_TYPE_WARNING)); isExecuting = false; } } @@ -952,7 +952,7 @@ void QEScript::buttonExecuteClicked() { if (log) { - sendMessage("Aborting execution of program #" + QString::number(i + 1) + " since " + QString::number(timeOut) + " seconds have passed", message_types(MESSAGE_TYPE_WARNING)); + sendMessage(tr("Aborting execution of program #%1 since %2 seconds have passed").arg(i + 1).arg(timeOut), message_types(MESSAGE_TYPE_WARNING)); } qProcess->kill(); break; @@ -965,7 +965,7 @@ void QEScript::buttonExecuteClicked() } else { - sendMessage("Abort execution of program(s)", message_types(MESSAGE_TYPE_WARNING)); + sendMessage(tr("Abort execution of program(s)"), message_types(MESSAGE_TYPE_WARNING)); qProcess->kill(); break; } diff --git a/qeframeworkSup/project/widgets/QESpinBox/QESpinBox.cpp b/qeframeworkSup/project/widgets/QESpinBox/QESpinBox.cpp index a45a0c88..2d972ddd 100644 --- a/qeframeworkSup/project/widgets/QESpinBox/QESpinBox.cpp +++ b/qeframeworkSup/project/widgets/QESpinBox/QESpinBox.cpp @@ -143,7 +143,7 @@ QMenu* QESpinBox::getDefaultContextMenu() edit = lineEdit(); if( edit ){ menu = edit->createStandardContextMenu(); - menu->setTitle( "Edit..." ); + menu->setTitle( tr("Edit...") ); } return menu; } diff --git a/qeframeworkSup/project/widgets/QEStripChart/QEStripChart.cpp b/qeframeworkSup/project/widgets/QEStripChart/QEStripChart.cpp index 1b4f429e..f7243de3 100644 --- a/qeframeworkSup/project/widgets/QEStripChart/QEStripChart.cpp +++ b/qeframeworkSup/project/widgets/QEStripChart/QEStripChart.cpp @@ -295,7 +295,7 @@ void QEStripChart::createInternalWidgets () this->toolBarResize = new QEResizeableFrame (QEResizeableFrame::BottomEdge, 8, 8 + this->toolBar->designHeight (), this); this->toolBarResize->setFixedHeight (8 + this->toolBar->designHeight ()); this->toolBarResize->setFrameShape (QFrame::Panel); - this->toolBarResize->setGrabberToolTip ("Re size tool bar display area"); + this->toolBarResize->setGrabberToolTip (tr("Re size tool bar display area")); this->toolBarResize->setWidget (this->toolBar); // Create PV frame and PV name labels and associated CA labels. @@ -331,7 +331,7 @@ void QEStripChart::createInternalWidgets () this->pvResizeFrame = new QEResizeableFrame (QEResizeableFrame::BottomEdge, 18, PV_SCROLL_HEIGHT + 8, this); this->pvResizeFrame->setFixedHeight (PV_DEFAULT_HEIGHT + 8); this->pvResizeFrame->setFrameShape (QFrame::Panel); - this->pvResizeFrame->setGrabberToolTip ("Re size PV display area"); + this->pvResizeFrame->setGrabberToolTip (tr("Re size PV display area")); this->pvResizeFrame->setWidget (this->pvScrollArea); // Create plotting frame and plot area. @@ -399,7 +399,7 @@ void QEStripChart::createInternalWidgets () this->yScaleMode = QEStripChartNames::linear; this->chartTimeMode = QEStripChartNames::tmRealTime; this->timeScale = 1.0; - this->timeUnits = "secs"; + this->timeUnits = tr("secs"); this->setNormalBackground (true); } @@ -571,22 +571,22 @@ void QEStripChart::plotData () d = this->getDuration (); if (d <= 1.0) { this->timeScale = 0.001; - this->timeUnits = "mSec"; + this->timeUnits = tr("mSec"); } else if (d <= 60.0) { // <= a minute this->timeScale = 1.0; - this->timeUnits = "secs"; + this->timeUnits = tr("secs"); } else if (d <= 3600.0) { // <= an hour this->timeScale = 60.0; - this->timeUnits = "mins"; + this->timeUnits = tr("mins"); } else if (d <= oneDay) { // <= a day this->timeScale = 3600.0; - this->timeUnits = "hrs"; + this->timeUnits = tr("hrs"); } else if (d <= 100.0*oneDay) { // <= a 100 days this->timeScale = oneDay; - this->timeUnits = "days"; + this->timeUnits = tr("days"); } else { this->timeScale = 7.0*oneDay; - this->timeUnits = "weeks"; + this->timeUnits = tr("weeks"); } // Get embedded canvas geometry and draw in time units. @@ -646,7 +646,7 @@ void QEStripChart::plotData () zoneTLA = QEUtilities::getTimeZoneTLA (this->timeZoneSpec, dt); times.append (dt.toString (format)).append (" ").append (zoneTLA); - times.append (" to "); + times.append (tr(" to ")); dt = this->getEndDateTime ().toTimeSpec (this->timeZoneSpec); zoneTLA = QEUtilities::getTimeZoneTLA (this->timeZoneSpec, dt); @@ -1072,7 +1072,7 @@ QEStripChart::QEStripChart (QWidget * parent) : QEAbstractDynamicWidget (parent) this->timeZoneSpec = Qt::LocalTime; this->duration = 600; // ten minutes. this->timeScale = 60.0; // minutes - this->timeUnits = "mins"; + this->timeUnits = tr("mins"); this->enableConextMenu = true; this->toolBarIsVisible = true; @@ -1784,14 +1784,14 @@ QMenu* QEStripChart::buildContextMenu () menu->addSeparator (); - action = new QAction ("Show/Hide Tool Bar", menu); + action = new QAction (tr("Show/Hide Tool Bar"), menu); action->setCheckable (true); action->setChecked(this->toolBarIsVisible); action->setEnabled (this->enableConextMenu); action->setData (QEStripChartNames::SCCM_SHOW_HIDE_TOOLBAR); menu->addAction (action); - action = new QAction ("Show/Hide PV Items", menu); + action = new QAction (tr("Show/Hide PV Items"), menu); action->setCheckable (true); action->setChecked(this->pvItemsIsVisible); action->setEnabled (this->enableConextMenu); diff --git a/qeframeworkSup/project/widgets/QEStripChart/QEStripChartContextMenu.cpp b/qeframeworkSup/project/widgets/QEStripChart/QEStripChartContextMenu.cpp index bbb928e6..6cb95c9b 100644 --- a/qeframeworkSup/project/widgets/QEStripChart/QEStripChartContextMenu.cpp +++ b/qeframeworkSup/project/widgets/QEStripChart/QEStripChartContextMenu.cpp @@ -53,67 +53,67 @@ QEStripChartContextMenu::QEStripChartContextMenu (bool inUseIn, QWidget *parent) // Note: action items are not enabled until corresponding functionallity is implemented. // if (inUseIn) { - this->make (this, "Read Archive", false, QEStripChartNames::SCCM_READ_ARCHIVE); - this->make (this, "Re Calculate", false, QEStripChartNames::SCCM_RECALCULATE); + this->make (this, tr("Read Archive"), false, QEStripChartNames::SCCM_READ_ARCHIVE); + this->make (this, tr("Re Calculate"), false, QEStripChartNames::SCCM_RECALCULATE); this->setIsCalculation (false); - menu = new QMenu ("Scale chart to this PV's", this); + menu = new QMenu (tr("Scale chart to this PV's"), this); this->addMenu (menu); - this->make (menu, "HOPR/LOPR values", false, QEStripChartNames::SCCM_SCALE_CHART_AUTO); - this->make (menu, "Plotted min/max values", false, QEStripChartNames::SCCM_SCALE_CHART_PLOTTED); - this->make (menu, "Buffered min/max values", false, QEStripChartNames::SCCM_SCALE_CHART_BUFFERED); + this->make (menu, tr("HOPR/LOPR values"), false, QEStripChartNames::SCCM_SCALE_CHART_AUTO); + this->make (menu, tr("Plotted min/max values"), false, QEStripChartNames::SCCM_SCALE_CHART_PLOTTED); + this->make (menu, tr("Buffered min/max values"), false, QEStripChartNames::SCCM_SCALE_CHART_BUFFERED); - menu = new QMenu ("Adjust/Scale this PV", this); + menu = new QMenu (tr("Adjust/Scale this PV"), this); this->addMenu (menu); - this->make (menu, "Reset", false, QEStripChartNames::SCCM_SCALE_PV_RESET); - this->make (menu, "General...", false, QEStripChartNames::SCCM_SCALE_PV_GENERAL); - this->make (menu, "HOPR/LOPR values map to chart range", false, QEStripChartNames::SCCM_SCALE_PV_AUTO); - this->make (menu, "Plotted values map to chart range", false, QEStripChartNames::SCCM_SCALE_PV_PLOTTED); - this->make (menu, "Plotted values map to upper 3rd of chart", false, QEStripChartNames::SCCM_SCALE_PV_PLOTTED_UPPER); - this->make (menu, "Plotted values map to centre 3rd of chart", false, QEStripChartNames::SCCM_SCALE_PV_PLOTTED_CENTRE); - this->make (menu, "Plotted values map to lower 3rd of chart", false, QEStripChartNames::SCCM_SCALE_PV_PLOTTED_LOWER); - this->make (menu, "Buffered values map to chart range", false, QEStripChartNames::SCCM_SCALE_PV_BUFFERED); - this->make (menu, "First value maps to chart centre", false, QEStripChartNames::SCCM_SCALE_PV_FIRST_CENTRE); - - menu = new QMenu ("Mode", this); + this->make (menu, tr("Reset"), false, QEStripChartNames::SCCM_SCALE_PV_RESET); + this->make (menu, tr("General..."), false, QEStripChartNames::SCCM_SCALE_PV_GENERAL); + this->make (menu, tr("HOPR/LOPR values map to chart range"), false, QEStripChartNames::SCCM_SCALE_PV_AUTO); + this->make (menu, tr("Plotted values map to chart range"), false, QEStripChartNames::SCCM_SCALE_PV_PLOTTED); + this->make (menu, tr("Plotted values map to upper 3rd of chart"), false, QEStripChartNames::SCCM_SCALE_PV_PLOTTED_UPPER); + this->make (menu, tr("Plotted values map to centre 3rd of chart"), false, QEStripChartNames::SCCM_SCALE_PV_PLOTTED_CENTRE); + this->make (menu, tr("Plotted values map to lower 3rd of chart"), false, QEStripChartNames::SCCM_SCALE_PV_PLOTTED_LOWER); + this->make (menu, tr("Buffered values map to chart range"), false, QEStripChartNames::SCCM_SCALE_PV_BUFFERED); + this->make (menu, tr("First value maps to chart centre"), false, QEStripChartNames::SCCM_SCALE_PV_FIRST_CENTRE); + + menu = new QMenu (tr("Mode"), this); this->addMenu (menu); - this->make (menu, "Rectangular", true, QEStripChartNames::SCCM_PLOT_RECTANGULAR); - this->make (menu, "Smooth", true, QEStripChartNames::SCCM_PLOT_SMOOTH); + this->make (menu, tr("Rectangular"), true, QEStripChartNames::SCCM_PLOT_RECTANGULAR); + this->make (menu, tr("Smooth"), true, QEStripChartNames::SCCM_PLOT_SMOOTH); - this->make (menu, "User PV Process Time", true, QEStripChartNames::SCCM_PLOT_SERVER_TIME); - this->make (menu, "Use Receive Time", true, QEStripChartNames::SCCM_PLOT_CLIENT_TIME); + this->make (menu, tr("User PV Process Time"), true, QEStripChartNames::SCCM_PLOT_SERVER_TIME); + this->make (menu, tr("Use Receive Time"), true, QEStripChartNames::SCCM_PLOT_CLIENT_TIME); menu->addSeparator(); - this->make (menu, "Linear", true, QEStripChartNames::SCCM_ARCH_LINEAR); - this->make (menu, "Plot Binning", true, QEStripChartNames::SCCM_ARCH_PLOTBIN); - this->make (menu, "Raw", true, QEStripChartNames::SCCM_ARCH_RAW); - this->make (menu, "Spread Sheet", true, QEStripChartNames::SCCM_ARCH_SHEET); - this->make (menu, "Averaged", true, QEStripChartNames::SCCM_ARCH_AVERAGED); + this->make (menu, tr("Linear"), true, QEStripChartNames::SCCM_ARCH_LINEAR); + this->make (menu, tr("Plot Binning"), true, QEStripChartNames::SCCM_ARCH_PLOTBIN); + this->make (menu, tr("Raw"), true, QEStripChartNames::SCCM_ARCH_RAW); + this->make (menu, tr("Spread Sheet"), true, QEStripChartNames::SCCM_ARCH_SHEET); + this->make (menu, tr("Averaged"), true, QEStripChartNames::SCCM_ARCH_AVERAGED); - menu = new QMenu ("Line", this); + menu = new QMenu (tr("Line"), this); this->addMenu (menu); - this->make (menu, "Hide", true, QEStripChartNames::SCCM_LINE_HIDE); - this->make (menu, "Regular", true, QEStripChartNames::SCCM_LINE_REGULAR); - this->make (menu, "Bold", true, QEStripChartNames::SCCM_LINE_BOLD); - this->make (menu, "Colour...", false, QEStripChartNames::SCCM_LINE_COLOUR); + this->make (menu, tr("Hide"), true, QEStripChartNames::SCCM_LINE_HIDE); + this->make (menu, tr("Regular"), true, QEStripChartNames::SCCM_LINE_REGULAR); + this->make (menu, tr("Bold"), true, QEStripChartNames::SCCM_LINE_BOLD); + this->make (menu, tr("Colour..."), false, QEStripChartNames::SCCM_LINE_COLOUR); - this->make (this, "Edit PV Name...", false, QEStripChartNames::SCCM_PV_EDIT_NAME); + this->make (this, tr("Edit PV Name..."), false, QEStripChartNames::SCCM_PV_EDIT_NAME); - this->make (this, "Write PV trace to file...", false, QEStripChartNames::SCCM_PV_WRITE_TRACE); + this->make (this, tr("Write PV trace to file..."), false, QEStripChartNames::SCCM_PV_WRITE_TRACE); - this->make (this, "Generate Statistics", false, QEStripChartNames::SCCM_PV_STATS); + this->make (this, tr("Generate Statistics"), false, QEStripChartNames::SCCM_PV_STATS); - this->make (this, "Add to predefined PV names", false, QEStripChartNames::SCCM_ADD_TO_PREDEFINED); + this->make (this, tr("Add to predefined PV names"), false, QEStripChartNames::SCCM_ADD_TO_PREDEFINED); - this->make (this, "Clear", false, QEStripChartNames::SCCM_PV_CLEAR); + this->make (this, tr("Clear"), false, QEStripChartNames::SCCM_PV_CLEAR); } else { - this->make (this, "Add PV Name...", false, QEStripChartNames::SCCM_PV_ADD_NAME); - this->make (this, "Paste PV Name ", false, QEStripChartNames::SCCM_PV_PASTE_NAME); - this->make (this, "Colour...", false, QEStripChartNames::SCCM_LINE_COLOUR); + this->make (this, tr("Add PV Name..."), false, QEStripChartNames::SCCM_PV_ADD_NAME); + this->make (this, tr("Paste PV Name "), false, QEStripChartNames::SCCM_PV_PASTE_NAME); + this->make (this, tr("Colour..."), false, QEStripChartNames::SCCM_LINE_COLOUR); this->addSeparator (); for (int j = 0 ; j < QEStripChartNames::NumberPrefefinedItems; j++) { diff --git a/qeframeworkSup/project/widgets/QEStripChart/QEStripChartItem.cpp b/qeframeworkSup/project/widgets/QEStripChart/QEStripChartItem.cpp index b14d852d..9bde5b2e 100644 --- a/qeframeworkSup/project/widgets/QEStripChart/QEStripChartItem.cpp +++ b/qeframeworkSup/project/widgets/QEStripChart/QEStripChartItem.cpp @@ -1105,7 +1105,7 @@ void QEStripChartItem::setArchiveData (const QObject* userData, const bool okay, } } - QString message = QString ("%1: %2 out of %3 points valid") + QString message = tr ("%1: %2 out of %3 points valid") .arg (pvName).arg (validCount).arg(count); this->chart->setReadOut (message); @@ -1989,9 +1989,9 @@ void QEStripChartItem::contextMenuSelected (const QEStripChartNames::ContextMenu // Set tool top depending on current scaling. // if (this->scaling.isScaled()) { - this->pvName->setToolTip (scaledTip); + this->pvName->setToolTip (tr(scaledTip.toStdString().c_str())); } else { - this->pvName->setToolTip (regularTip); + this->pvName->setToolTip (tr(regularTip.toStdString().c_str())); } } diff --git a/qeframeworkSup/project/widgets/QEStripChart/QEStripChartNames.cpp b/qeframeworkSup/project/widgets/QEStripChart/QEStripChartNames.cpp index 90a17a0b..4d8529da 100644 --- a/qeframeworkSup/project/widgets/QEStripChart/QEStripChartNames.cpp +++ b/qeframeworkSup/project/widgets/QEStripChart/QEStripChartNames.cpp @@ -35,13 +35,13 @@ QString QEStripChartNames::chartTimeModeStatus (const ChartTimeModes mode) switch (mode) { case tmRealTime: - result = "Real Time"; + result = tr("Real Time"); break; case tmPaused: - result = "Paused"; + result = tr("Paused"); break; case tmHistorical: - result = "Historical"; + result = tr("Historical"); break; } return result; @@ -55,22 +55,22 @@ QString QEStripChartNames::chartYRangeStatus (const ChartYRanges yRange) switch (yRange) { case manual: - result = "manual scale"; + result = tr("manual scale"); break; case operatingRange: - result = "operating range scale"; + result = tr("operating range scale"); break; case plotted: - result = "plotted scale"; + result = tr("plotted scale"); break; case buffered: - result = "buffered scale"; + result = tr("buffered scale"); break; case dynamic: - result = "dynamic scale"; + result = tr("dynamic scale"); break; case normalised: - result = "normalised scale"; + result = tr("normalised scale"); break; } return result; diff --git a/qeframeworkSup/project/widgets/QEStripChart/QEStripChartToolBar.cpp b/qeframeworkSup/project/widgets/QEStripChart/QEStripChartToolBar.cpp index 0bdea1a7..300f700b 100644 --- a/qeframeworkSup/project/widgets/QEStripChart/QEStripChartToolBar.cpp +++ b/qeframeworkSup/project/widgets/QEStripChart/QEStripChartToolBar.cpp @@ -233,11 +233,11 @@ QEStripChartToolBar::OwnTabWidget::OwnTabWidget (QEStripChartToolBar* parent) : // Create required tabs. // - this->addTab (new QWidget (this), " Standard "); - this->addTab (new QWidget (this), " Configuration "); - this->addTab (new QWidget (this), " Markers "); - this->addTab (new QWidget (this), " Lock "); - this->addTab (new QWidget (this), " PV Status "); + this->addTab (new QWidget (this), QObject::tr(" Standard ")); + this->addTab (new QWidget (this), QObject::tr(" Configuration ")); + this->addTab (new QWidget (this), QObject::tr(" Markers ")); + this->addTab (new QWidget (this), QObject::tr(" Lock ")); + this->addTab (new QWidget (this), QObject::tr(" PV Status ")); // Create toolbar widgets // @@ -254,12 +254,12 @@ QEStripChartToolBar::OwnTabWidget::OwnTabWidget (QEStripChartToolBar* parent) : iconPathName.append (buttonSpecs[j].captionOrIcon); button->setIcon (QIcon (iconPathName)); } else { - button->setText (buttonSpecs[j].captionOrIcon); + button->setText (QObject::tr(buttonSpecs[j].captionOrIcon.toStdString().c_str())); } button->setFocusPolicy (Qt::NoFocus); button->setProperty (VALUE_PROPERTY, buttonSpecs[j].value); - button->setToolTip (QString (" %1 ").arg (buttonSpecs[j].toolTip)); + button->setToolTip (QObject::tr(buttonSpecs[j].toolTip.toStdString().c_str())); gap = buttonSpecs[j].gap; button->setGeometry (left + gap, buttonTop, buttonSpecs[j].width, ICH); // left top width height left += gap + buttonSpecs[j].width; @@ -285,7 +285,7 @@ QEStripChartToolBar::OwnTabWidget::OwnTabWidget (QEStripChartToolBar* parent) : left = this->pushButtons [ARCHIVE_SLOT]->geometry().x (); this->numberOfOutandingRequests = createLabel("0", tabParent, left, labelTop, ICW, labelHeight); this->numberOfOutandingRequests->setAlignment (Qt::AlignHCenter); - this->numberOfOutandingRequests->setToolTip (" Number of outstanding archive requests "); + this->numberOfOutandingRequests->setToolTip (QObject::tr(" Number of outstanding archive requests ")); left = this->pushButtons [PLAY_SLOT]->geometry().x (); this->timeModeStatus = createLabel ("", tabParent, left, labelTop, 3*ICW, labelHeight); @@ -302,7 +302,7 @@ QEStripChartToolBar::OwnTabWidget::OwnTabWidget (QEStripChartToolBar* parent) : font = this->predefinedComboBox->font (); font.setPointSize (this->originalPointSize); this->predefinedComboBox->setFont (font); - this->predefinedComboBox->setToolTip (" Select and load predefined chart configuration "); + this->predefinedComboBox->setToolTip (QObject::tr(" Select and load predefined chart configuration ")); QObject::connect (this->predefinedComboBox, SIGNAL (activated (QString)), this->owner, SLOT (predefinedSelected (QString))); @@ -330,7 +330,7 @@ QEStripChartToolBar::OwnTabWidget::OwnTabWidget (QEStripChartToolBar* parent) : this->loadButton = new QPushButton (tabParent); this->loadButton->setIcon (QIcon (":/qe/stripchart/open_file.png")); this->loadButton->setFocusPolicy (Qt::NoFocus); - this->loadButton->setToolTip (" Load chart configuration "); + this->loadButton->setToolTip (QObject::tr(" Load chart configuration ")); this->loadButton->setGeometry (left, buttonTop, ICW, ICH); // left top width height QObject::connect (this->loadButton, SIGNAL (clicked (bool)), this->owner, SLOT (loadClicked (bool))); @@ -339,7 +339,7 @@ QEStripChartToolBar::OwnTabWidget::OwnTabWidget (QEStripChartToolBar* parent) : this->saveAsButton = new QPushButton (tabParent); this->saveAsButton->setIcon (QIcon (":/qe/stripchart/save_file.png")); this->saveAsButton->setFocusPolicy (Qt::NoFocus); - this->saveAsButton->setToolTip (" Save chart configuration "); + this->saveAsButton->setToolTip (QObject::tr(" Save chart configuration ")); this->saveAsButton->setGeometry (left, buttonTop, ICW, ICH); // left top width height QObject::connect (this->saveAsButton, SIGNAL (clicked (bool)), this->owner, SLOT (saveAsClicked (bool))); @@ -351,16 +351,16 @@ QEStripChartToolBar::OwnTabWidget::OwnTabWidget (QEStripChartToolBar* parent) : top = 4; // first row left = 4; - this->timeRefLabel = createLabel ("Time References", tabParent, left, top, 108, labelHeight); // left top width height + this->timeRefLabel = createLabel (QObject::tr("Time References"), tabParent, left, top, 108, labelHeight); // left top width height this->time1 = createLabel ("", tabParent, left, top, 224, labelHeight, true); this->time2 = createLabel ("", tabParent, left, top, 224, labelHeight, true); left += 12; - this->timeDeltaLabel = createLabel ("Delta Time", tabParent, left, top, 72, labelHeight); + this->timeDeltaLabel = createLabel (QObject::tr("Delta Time"), tabParent, left, top, 72, labelHeight); this->timeDelta = createLabel ("", tabParent, left, top, 160, labelHeight, true); top = 24; // second row left = 4; - this->valueRefLabel = createLabel ("Value References", tabParent, left, top, 108, labelHeight); + this->valueRefLabel = createLabel (QObject::tr("Value References"), tabParent, left, top, 108, labelHeight); this->value1 = createLabel ("", tabParent, left, top, 140, labelHeight, true); this->value2 = createLabel ("", tabParent, left, top, 140, labelHeight, true); this->valueDelta1 = createLabel ("", tabParent, left, top, 140, labelHeight, true); @@ -373,13 +373,13 @@ QEStripChartToolBar::OwnTabWidget::OwnTabWidget (QEStripChartToolBar* parent) : // tabParent = this->widget (LOCK_TAB); left = 4; - this->placeHolder2 = createLabel ("TBD", tabParent, left, 4, 40, labelHeight, true); + this->placeHolder2 = createLabel (QObject::tr("TBD"), tabParent, left, 4, 40, labelHeight, true); // Set up PV tab. // tabParent = this->widget (PV_STATUS_TAB); left = 4; - this->placeHolder3 = createLabel ("TBD", tabParent, left, 4, 40, labelHeight, true); + this->placeHolder3 = createLabel (QObject::tr("TBD"), tabParent, left, 4, 40, labelHeight, true); } //------------------------------------------------------------------------------ diff --git a/qeframeworkSup/project/widgets/QETable/QENTTable.cpp b/qeframeworkSup/project/widgets/QETable/QENTTable.cpp index 55d537a3..f344022d 100644 --- a/qeframeworkSup/project/widgets/QETable/QENTTable.cpp +++ b/qeframeworkSup/project/widgets/QETable/QENTTable.cpp @@ -262,13 +262,13 @@ QMenu* QENTTable::buildContextMenu () menu->addSeparator (); - action = new QAction ("Vertical table", menu); + action = new QAction (tr("Vertical table"), menu); action->setCheckable (true); action->setChecked (this->isVertical ()); action->setData (CM_VERTICAL_TABLE); menu->addAction (action); - action = new QAction ("Horizontal table", menu); + action = new QAction (tr("Horizontal table"), menu); action->setCheckable (true); action->setChecked (!this->isVertical ()); action->setData (CM_HORIZONTAL_TABLE); diff --git a/qeframeworkSup/project/widgets/QETable/QETable.cpp b/qeframeworkSup/project/widgets/QETable/QETable.cpp index 5d160c45..83a61d58 100644 --- a/qeframeworkSup/project/widgets/QETable/QETable.cpp +++ b/qeframeworkSup/project/widgets/QETable/QETable.cpp @@ -501,13 +501,13 @@ QMenu* QETable::buildContextMenu () menu->addSeparator (); - action = new QAction ("Vertical table", menu); + action = new QAction (tr("Vertical table"), menu); action->setCheckable (true); action->setChecked (this->isVertical ()); action->setData (CM_VERTICAL_TABLE); menu->addAction (action); - action = new QAction ("Horizontal table", menu); + action = new QAction (tr("Horizontal table"), menu); action->setCheckable (true); action->setChecked (!this->isVertical ()); action->setData (CM_HORIZONTAL_TABLE); diff --git a/qeframeworkSup/project/widgets/QEWidget/QEToolTip.cpp b/qeframeworkSup/project/widgets/QEWidget/QEToolTip.cpp index ec4126c3..e2264548 100644 --- a/qeframeworkSup/project/widgets/QEWidget/QEToolTip.cpp +++ b/qeframeworkSup/project/widgets/QEWidget/QEToolTip.cpp @@ -374,7 +374,7 @@ void QEToolTip::displayToolTip () } if (count == 0) { - toolTip = "No variables defined"; + toolTip = QObject::tr("No variables defined"); } if (toolTipCustom.size ()) { diff --git a/qeframeworkSup/project/widgets/QEWidget/applicationLauncher.cpp b/qeframeworkSup/project/widgets/QEWidget/applicationLauncher.cpp index 82a5f1ba..6c188198 100644 --- a/qeframeworkSup/project/widgets/QEWidget/applicationLauncher.cpp +++ b/qeframeworkSup/project/widgets/QEWidget/applicationLauncher.cpp @@ -143,7 +143,7 @@ void applicationLauncher::launchImage( const VariableNameManager* variableNameMa if( !image.save( tempFile, "TIFF") ) { QMessageBox msgBox; - msgBox.setText("Can't start application. There is no image available."); + msgBox.setText(QObject::tr("Can't start application. There is no image available.")); msgBox.exec(); return; } @@ -246,7 +246,7 @@ void applicationLauncher::launchCommon( const VariableNameManager* variableNameM } // Run the program - message.sendMessage( QString( "Launching: " ).append( substitutedProgram ), "Application launcher" ); + message.sendMessage( QObject::tr( "Launching: " ).append( substitutedProgram ), "Application launcher" ); process->start( substitutedProgram ); // Alternate (and cleaner) way to run the program without building a string containing the program and arguments. diff --git a/qeframeworkSup/project/widgets/QEWidget/contextMenu.cpp b/qeframeworkSup/project/widgets/QEWidget/contextMenu.cpp index 2500628b..5145686d 100644 --- a/qeframeworkSup/project/widgets/QEWidget/contextMenu.cpp +++ b/qeframeworkSup/project/widgets/QEWidget/contextMenu.cpp @@ -210,7 +210,7 @@ QMenu* contextMenu::buildContextMenu() // Add QE context menu QAction* a; - QString names = (numberOfItems >= 2) ? "names " : "name "; + QString names = (numberOfItems >= 2) ? QObject::tr("names ") : QObject::tr("name "); // Add menu options that require the application to provide support such as launch a strip chart. if( hasConsumer ) @@ -219,19 +219,19 @@ QMenu* contextMenu::buildContextMenu() if( menuSet.contains( CM_SHOW_PV_PROPERTIES )) { - a = new QAction( "Examine Properties", menu ); a->setCheckable( false ); a->setData( CM_SHOW_PV_PROPERTIES ); menu->addAction( a ); + a = new QAction( QObject::tr("Examine Properties"), menu ); a->setCheckable( false ); a->setData( CM_SHOW_PV_PROPERTIES ); menu->addAction( a ); addSeparator = true; } if( menuSet.contains( CM_ADD_TO_STRIPCHART )) { - a = new QAction( "Plot in StripChart", menu ); a->setCheckable( false ); a->setData( CM_ADD_TO_STRIPCHART ); menu->addAction( a ); + a = new QAction( QObject::tr("Plot in StripChart"), menu ); a->setCheckable( false ); a->setData( CM_ADD_TO_STRIPCHART ); menu->addAction( a ); addSeparator = true; } if( menuSet.contains( CM_ADD_TO_SCRATCH_PAD )) { - a = new QAction( "Show in Scratch Pad", menu ); a->setCheckable( false ); a->setData( CM_ADD_TO_SCRATCH_PAD ); menu->addAction( a ); + a = new QAction( QObject::tr("Show in Scratch Pad"), menu ); a->setCheckable( false ); a->setData( CM_ADD_TO_SCRATCH_PAD ); menu->addAction( a ); addSeparator = true; } @@ -240,19 +240,19 @@ QMenu* contextMenu::buildContextMenu() if( menuSet.contains( CM_ADD_TO_PLOTTER )) { - a = new QAction( "Show in Plotter", menu ); a->setCheckable( false ); a->setData( CM_ADD_TO_PLOTTER ); menu->addAction( a ); + a = new QAction( QObject::tr("Show in Plotter"), menu ); a->setCheckable( false ); a->setData( CM_ADD_TO_PLOTTER ); menu->addAction( a ); addSeparator = true; } if( menuSet.contains( CM_SHOW_AS_HISTOGRAM )) { - a = new QAction( "Show as Historgram", menu ); a->setCheckable( false ); a->setData( CM_SHOW_AS_HISTOGRAM ); menu->addAction( a ); + a = new QAction( QObject::tr("Show as Historgram"), menu ); a->setCheckable( false ); a->setData( CM_SHOW_AS_HISTOGRAM ); menu->addAction( a ); addSeparator = true; } if( menuSet.contains( CM_ADD_TO_TABLE )) { - a = new QAction( "Show in Table", menu ); a->setCheckable( false ); a->setData( CM_ADD_TO_TABLE ); menu->addAction( a ); + a = new QAction( QObject::tr("Show in Table"), menu ); a->setCheckable( false ); a->setData( CM_ADD_TO_TABLE ); menu->addAction( a ); addSeparator = true; } } @@ -265,19 +265,19 @@ QMenu* contextMenu::buildContextMenu() if( menuSet.contains( CM_COPY_VARIABLE )) { - a = new QAction( "Copy variable " + names, menu ); a->setCheckable( false ); a->setData( CM_COPY_VARIABLE ); menu->addAction( a ); + a = new QAction( QObject::tr("Copy variable %1").arg(names), menu ); a->setCheckable( false ); a->setData( CM_COPY_VARIABLE ); menu->addAction( a ); addSeparator = true; } if( menuSet.contains( CM_COPY_DATA )) { - a = new QAction( "Copy data", menu ); a->setCheckable( false ); a->setData( CM_COPY_DATA ); menu->addAction( a ); + a = new QAction( QObject::tr("Copy data"), menu ); a->setCheckable( false ); a->setData( CM_COPY_DATA ); menu->addAction( a ); addSeparator = true; } if( menuSet.contains( CM_PASTE )) { - a = new QAction( "Paste to variable " + names, menu ); a->setCheckable( false ); a->setData( CM_PASTE ); menu->addAction( a ); + a = new QAction( QObject::tr("Paste to variable %1").arg(names), menu ); a->setCheckable( false ); a->setData( CM_PASTE ); menu->addAction( a ); QClipboard *cb = QApplication::clipboard(); a->setEnabled( qew->getAllowDrop() && !cb->text().isEmpty() ); @@ -290,14 +290,14 @@ QMenu* contextMenu::buildContextMenu() if( menuSet.contains( CM_DRAG_VARIABLE )) { - a = new QAction( "Drag variable " + names, menu ); a->setCheckable( true ); a->setData( CM_DRAG_VARIABLE ); menu->addAction( a ); + a = new QAction( QObject::tr("Drag variable %1").arg(names), menu ); a->setCheckable( true ); a->setData( CM_DRAG_VARIABLE ); menu->addAction( a ); a->setChecked( draggingVariable ); addSeparator = true; } if( menuSet.contains( CM_DRAG_DATA )) { - a = new QAction( "Drag data", menu ); a->setCheckable( true ); a->setData( CM_DRAG_DATA ); menu->addAction( a ); + a = new QAction( QObject::tr("Drag data"), menu ); a->setCheckable( true ); a->setData( CM_DRAG_DATA ); menu->addAction( a ); a->setChecked( !draggingVariable ); addSeparator = true; } @@ -306,13 +306,13 @@ QMenu* contextMenu::buildContextMenu() if( ( qew->getUserLevel() >= editPvUserLevel ) && menuSet.contains( CM_GENERAL_PV_EDIT )) { if( addSeparator ) menu->addSeparator(); - a = new QAction( "Edit PV", menu ); + a = new QAction( QObject::tr("Edit PV"), menu ); a->setCheckable( false ); a->setData( CM_GENERAL_PV_EDIT ); menu->addAction( a ); } - menu->setTitle( "Use..." ); + menu->setTitle( QObject::tr("Use...") ); QObject::connect( menu, SIGNAL( triggered ( QAction* ) ), object, SLOT( contextMenuTriggeredSlot( QAction* )) ); diff --git a/qeframeworkSup/project/widgets/QEWidget/persistanceManager.cpp b/qeframeworkSup/project/widgets/QEWidget/persistanceManager.cpp index c5ab7203..3a9d5fd7 100644 --- a/qeframeworkSup/project/widgets/QEWidget/persistanceManager.cpp +++ b/qeframeworkSup/project/widgets/QEWidget/persistanceManager.cpp @@ -324,10 +324,10 @@ void PersistanceManager::saveEpilog( const QString fileName, const bool warnUser // Handle not writing configuration file else { - QString message = QString( "Could not save configuration. Could not open configuration file ").append( fileName ); + QString message = QObject::tr( "Could not save configuration. Could not open configuration file %1").arg( fileName ); if( warnUser ) { - QMessageBox::warning( 0, "Configuration management", message ); + QMessageBox::warning( 0, QObject::tr("Configuration management"), message ); } else { @@ -416,10 +416,10 @@ bool PersistanceManager::openRead( const QString fileName, const QString rootNam { if( fileExpected ) { - QString message = QString( "Could not open configuration file for reading: ").append( fileName ); + QString message = QObject::tr( "Could not open configuration file for reading: %1").arg( fileName ); if( warnUser ) { - QMessageBox::warning( 0, "Configuration management", message ); + QMessageBox::warning( 0, QObject::tr("Configuration management"), message ); } else { @@ -431,10 +431,10 @@ bool PersistanceManager::openRead( const QString fileName, const QString rootNam if ( !doc.setContent( &file ) ) { - QString message = QString( "Could not parse the XML in the config file: ").append( fileName ); + QString message = QObject::tr( "Could not parse the XML in the config file: %1").arg( fileName ); if( warnUser ) { - QMessageBox::warning( 0, "Configuration management", message ); + QMessageBox::warning( 0, QObject::tr("Configuration management"), message ); } else { @@ -449,10 +449,10 @@ bool PersistanceManager::openRead( const QString fileName, const QString rootNam if( docElem.nodeName().compare( rootName ) ) { - QString message = QString( "XML did not contain the expected root element " ).append( rootName ).append( " in the config file: ").append( fileName ); + QString message = QObject::tr( "XML did not contain the expected root element %1 in the config file: %2").arg(rootName).arg( fileName ); if( warnUser ) { - QMessageBox::warning( 0, "Configuration management", message ); + QMessageBox::warning( 0, QObject::tr("Configuration management"), message ); } else { @@ -545,11 +545,11 @@ void PersistanceManager::deleteConfigs( const QString fileName, const QString ro QString message; if( names.count()==1 && names.at(0) == PersistanceManager::defaultName ) { - message = QString( "The default configuration used at startup will be deleted. Do you want to continue?" ); + message = QObject::tr( "The default configuration used at startup will be deleted. Do you want to continue?" ); } else { - message = QString( "%1 configuration%2 will be deleted. Do you want to continue?" ).arg( names.count() ).arg( names.count()>1?QString("s"):QString("") ); + message = QObject::tr( "%1 configuration%2 will be deleted. Do you want to continue?" ).arg( names.count() ).arg( names.count()>1?QString("s"):QString("") ); } msgBox.setText( message ); @@ -597,10 +597,10 @@ void PersistanceManager::deleteConfigs( const QString fileName, const QString ro } else { - QString message = QString( "Could not save remaining configurations to configuration file ").append( fileName ); + QString message = QObject::tr( "Could not save remaining configurations to configuration file %1").arg( fileName ); if( warnUser ) { - QMessageBox::warning( 0, "Configuration management", message ); + QMessageBox::warning( 0, QObject::tr("Configuration management"), message ); } else {