Skip to content

Commit

Permalink
STYLE: Mark translatable strings in Base/QTGUI
Browse files Browse the repository at this point in the history
  • Loading branch information
mhdiop committed Dec 18, 2022
1 parent 8edac3b commit 8a8fea3
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 54 deletions.
1 change: 1 addition & 0 deletions Base/QTGUI/qSlicerExtensionsManagerWidget.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ void qSlicerExtensionsManagerWidget::onModelUpdated()
}

d->tabWidget->setTabText(manageExtensionsTabIndex,
//: %1 represents the number of managed extensions
tr("Manage Extensions (%1)").arg(managedExtensionsCount));

if (managedExtensionsCount == 0)
Expand Down
11 changes: 6 additions & 5 deletions Base/QTGUI/qSlicerModulesMenu.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ qSlicerModulesMenuPrivate::qSlicerModulesMenuPrivate(qSlicerModulesMenu& object)
this->NoModuleAction = nullptr;
this->DuplicateActions = false;
this->ShowHiddenModules = false;
this->TopLevelCategoryOrder << qSlicerModulesMenu::tr("Wizards") << qSlicerModulesMenu::tr("Informatics") << qSlicerModulesMenu::tr("Registration")
<< qSlicerModulesMenu::tr("Segmentation") << qSlicerModulesMenu::tr("Quantification") << qSlicerModulesMenu::tr("Diffusion")
<< qSlicerModulesMenu::tr("IGT") << qSlicerModulesMenu::tr("Filtering") << qSlicerModulesMenu::tr("Surface Models")
<< qSlicerModulesMenu::tr("Converters") << qSlicerModulesMenu::tr("Endoscopy") << qSlicerModulesMenu::tr("Utilities")
<< qSlicerModulesMenu::tr("Developer Tools") << qSlicerModulesMenu::tr("Legacy") << qSlicerModulesMenu::tr("Testing");
this->TopLevelCategoryOrder << qSlicerAbstractCoreModule::tr("Wizards") << qSlicerAbstractCoreModule::tr("Informatics")
<< qSlicerAbstractCoreModule::tr("Registration") << qSlicerAbstractCoreModule::tr("Segmentation") << qSlicerAbstractCoreModule::tr("Quantification")
<< qSlicerAbstractCoreModule::tr("Diffusion") << qSlicerAbstractCoreModule::tr("IGT") << qSlicerAbstractCoreModule::tr("Filtering")
<< qSlicerAbstractCoreModule::tr("Surface Models") << qSlicerAbstractCoreModule::tr("Converters") << qSlicerAbstractCoreModule::tr("Endoscopy")
<< qSlicerAbstractCoreModule::tr("Utilities") << qSlicerAbstractCoreModule::tr("Developer Tools") << qSlicerAbstractCoreModule::tr("Legacy")
<< qSlicerAbstractCoreModule::tr("Testing");
}

//---------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Base/QTGUI/qSlicerNodeWriter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ vtkMRMLNode* qSlicerNodeWriter::getNodeByID(const char *id)const
{
vtkMRMLSceneViewNode *svNode = vtkMRMLSceneViewNode::SafeDownCast(*it);
// skip "Master Scene View" since it contains the same nodes as the scene
if (svNode->GetName() && std::string("Master Scene View") == std::string(svNode->GetName()))
if (svNode->GetName() && std::string(/*no tr*/"Master Scene View") == std::string(svNode->GetName()))
{
continue;
}
Expand Down
6 changes: 3 additions & 3 deletions Base/QTGUI/qSlicerSettingsCachePanel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ void qSlicerSettingsCachePanel::setCacheManager(vtkCacheManager* cacheManager)
qSlicerRelativePathMapper* relativePathMapper = new qSlicerRelativePathMapper(d->CachePathButton, "directory", SIGNAL(directoryChanged(QString)));
this->registerProperty("Cache/Path", relativePathMapper, "relativePath",
SIGNAL(relativePathChanged(QString)));
this->registerProperty("Cache/Size", d->CacheSizeSpinBox, "value",
this->registerProperty("Cache/Size", d->CacheSizeSpinBox, /*no tr*/"value",
SIGNAL(valueChanged(int)));
this->registerProperty("Cache/FreeBufferSize", d->CacheFreeBufferSpinBox, "value",
this->registerProperty("Cache/FreeBufferSize", d->CacheFreeBufferSpinBox, /*no tr*/"value",
SIGNAL(valueChanged(int)));
this->registerProperty("Cache/ForceRedownload", d->ForceRedownloadCheckBox, "checked",
this->registerProperty("Cache/ForceRedownload", d->ForceRedownloadCheckBox, /*no tr*/"checked",
SIGNAL(toggled(bool)));
}

Expand Down
8 changes: 4 additions & 4 deletions Base/QTGUI/qSlicerSettingsDeveloperPanel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ void qSlicerSettingsDeveloperPanelPrivate::init()

// Register settings
q->registerProperty("Developer/DeveloperMode", this->DeveloperModeEnabledCheckBox,
"checked", SIGNAL(toggled(bool)),
/*no tr*/"checked", SIGNAL(toggled(bool)),
qSlicerSettingsDeveloperPanel::tr("Enable/Disable developer mode"), ctkSettingsPanel::OptionRequireRestart);

q->registerProperty("Developer/PreserveCLIModuleDataFiles", this->PreserveCLIModuleDataFilesCheckBox,
"checked", SIGNAL(toggled(bool)),
/*no tr*/"checked", SIGNAL(toggled(bool)),
qSlicerSettingsDeveloperPanel::tr("Preserve CLI module input/output files"), ctkSettingsPanel::OptionRequireRestart);

q->registerProperty("Developer/SelfTestDisplayMessageDelay", this->SelfTestMessageDelaySlider,
"value", SIGNAL(valueChanged(double)),
/*no tr*/"value", SIGNAL(valueChanged(double)),
qSlicerSettingsDeveloperPanel::tr("Time to wait before resuming self-test execution and hiding messages displayed to the user"));

q->registerProperty("QtTesting/Enabled", this->QtTestingEnabledCheckBox,
"checked", SIGNAL(toggled(bool)),
/*no tr*/"checked", SIGNAL(toggled(bool)),
qSlicerSettingsDeveloperPanel::tr("Enable/Disable QtTesting"), ctkSettingsPanel::OptionRequireRestart);

// Actions to propagate to the application when settings are changed
Expand Down
12 changes: 6 additions & 6 deletions Base/QTGUI/qSlicerSettingsExtensionsPanel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,23 @@ void qSlicerSettingsExtensionsPanelPrivate::init()

// Register settings
q->registerProperty("Extensions/ManagerEnabled", this->ExtensionsManagerEnabledCheckBox,
"checked", SIGNAL(toggled(bool)),
/*no tr*/"checked", SIGNAL(toggled(bool)),
qSlicerSettingsExtensionsPanel::tr("Enable/Disable extensions manager"), ctkSettingsPanel::OptionRequireRestart,
app->revisionUserSettings());
q->registerProperty("Extensions/ServerUrl", this->ExtensionsServerUrlLineEdit,
"text", SIGNAL(textChanged(QString)),
/*no tr*/"text", SIGNAL(textChanged(QString)),
QString(), ctkSettingsPanel::OptionNone,
app->revisionUserSettings());
q->registerProperty("Extensions/FrontendServerUrl", this->ExtensionsFrontendServerUrlLineEdit,
"text", SIGNAL(textChanged(QString)),
/*no tr*/"text", SIGNAL(textChanged(QString)),
QString(), ctkSettingsPanel::OptionNone,
app->revisionUserSettings());

q->registerProperty("Extensions/AutoUpdateCheck", this->AutoUpdateCheckCheckBox, "checked",
q->registerProperty("Extensions/AutoUpdateCheck", this->AutoUpdateCheckCheckBox, /*no tr*/"checked",
SIGNAL(toggled(bool)), qSlicerSettingsExtensionsPanel::tr("Automatic update check"));
q->registerProperty("Extensions/AutoUpdateInstall", this->AutoUpdateInstallCheckBox, "checked",
q->registerProperty("Extensions/AutoUpdateInstall", this->AutoUpdateInstallCheckBox, /*no tr*/"checked",
SIGNAL(toggled(bool)), qSlicerSettingsExtensionsPanel::tr("Automatic update install"));
q->registerProperty("Extensions/AutoInstallDependencies", this->AutoInstallDependenciesCheckBox, "checked",
q->registerProperty("Extensions/AutoInstallDependencies", this->AutoInstallDependenciesCheckBox, /*no tr*/"checked",
SIGNAL(toggled(bool)), qSlicerSettingsExtensionsPanel::tr("Automatic install of dependencies"));

qSlicerRelativePathMapper* relativePathMapper = new qSlicerRelativePathMapper(
Expand Down
21 changes: 11 additions & 10 deletions Base/QTGUI/qSlicerSettingsGeneralPanel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ void qSlicerSettingsGeneralPanelPrivate::init()
{
this->ApplicationUpdateServerURLLineEdit->setText("https://download.slicer.org");

q->registerProperty("ApplicationUpdate/AutoUpdateCheck", this->ApplicationAutoUpdateCheckCheckBox, "checked",
q->registerProperty("ApplicationUpdate/AutoUpdateCheck", this->ApplicationAutoUpdateCheckCheckBox, /*no tr*/"checked",
SIGNAL(toggled(bool)));

q->registerProperty("ApplicationUpdate/ServerUrl", this->ApplicationUpdateServerURLLineEdit, "text",
q->registerProperty("ApplicationUpdate/ServerUrl", this->ApplicationUpdateServerURLLineEdit, /*no tr*/"text",
SIGNAL(textChanged(QString)),
qSlicerSettingsGeneralPanel::tr("Application update server URL"));

Expand Down Expand Up @@ -150,7 +150,8 @@ void qSlicerSettingsGeneralPanelPrivate::init()
// Default values

this->DefaultScenePathButton->setDirectory(qSlicerCoreApplication::application()->defaultScenePath());
qSlicerRelativePathMapper* relativePathMapper = new qSlicerRelativePathMapper(this->DefaultScenePathButton, "directory", SIGNAL(directoryChanged(QString)));
qSlicerRelativePathMapper* relativePathMapper = new qSlicerRelativePathMapper(this->DefaultScenePathButton,
/*no tr*/"directory", SIGNAL(directoryChanged(QString)));
q->registerProperty("DefaultScenePath", relativePathMapper, "relativePath",
SIGNAL(relativePathChanged(QString)),
qSlicerSettingsGeneralPanel::tr("Default scene path"));
Expand All @@ -161,40 +162,40 @@ void qSlicerSettingsGeneralPanelPrivate::init()
this->DocumentationBaseURLLineEdit->setText("https://slicer.readthedocs.io/en/{version}");
this->ModuleDocumentationURLLineEdit->setText("{documentationbaseurl}/user_guide/modules/{lowercasemodulename}.html");

q->registerProperty("no-splash", this->ShowSplashScreenCheckBox, "checked",
q->registerProperty("no-splash", this->ShowSplashScreenCheckBox, /*no tr*/"checked",
SIGNAL(toggled(bool)));

ctkBooleanMapper* restartMapper = new ctkBooleanMapper(this->ConfirmRestartCheckBox, "checked", SIGNAL(toggled(bool)));
ctkBooleanMapper* restartMapper = new ctkBooleanMapper(this->ConfirmRestartCheckBox, /*no tr*/"checked", SIGNAL(toggled(bool)));
restartMapper->setTrueValue(static_cast<int>(QMessageBox::InvalidRole));
restartMapper->setFalseValue(static_cast<int>(QMessageBox::Ok));
q->registerProperty("MainWindow/DontConfirmRestart",
restartMapper,"valueAsInt", SIGNAL(valueAsIntChanged(int)));

ctkBooleanMapper* exitMapper = new ctkBooleanMapper(this->ConfirmExitCheckBox, "checked", SIGNAL(toggled(bool)));
ctkBooleanMapper* exitMapper = new ctkBooleanMapper(this->ConfirmExitCheckBox, /*no tr*/"checked", SIGNAL(toggled(bool)));
exitMapper->setTrueValue(static_cast<int>(QMessageBox::InvalidRole));
exitMapper->setFalseValue(static_cast<int>(QMessageBox::Ok));
q->registerProperty("MainWindow/DontConfirmExit",
exitMapper, "valueAsInt", SIGNAL(valueAsIntChanged(int)));

ctkBooleanMapper* sceneCloseMapper = new ctkBooleanMapper(this->ConfirmSceneCloseCheckBox, "checked", SIGNAL(toggled(bool)));
ctkBooleanMapper* sceneCloseMapper = new ctkBooleanMapper(this->ConfirmSceneCloseCheckBox, /*no tr*/"checked", SIGNAL(toggled(bool)));
sceneCloseMapper->setTrueValue(static_cast<int>(QMessageBox::InvalidRole));
sceneCloseMapper->setFalseValue(static_cast<int>(QMessageBox::AcceptRole));
q->registerProperty("MainWindow/DontConfirmSceneClose",
sceneCloseMapper, "valueAsInt", SIGNAL(valueAsIntChanged(int)));

q->registerProperty("DocumentationBaseURL", this->DocumentationBaseURLLineEdit, "text",
q->registerProperty("DocumentationBaseURL", this->DocumentationBaseURLLineEdit, /*no tr*/"text",
SIGNAL(textChanged(QString)),
qSlicerSettingsGeneralPanel::tr("Documentation location"),
ctkSettingsPanel::OptionRequireRestart);
q->registerProperty("ModuleDocumentationURL", this->ModuleDocumentationURLLineEdit, "text",
q->registerProperty("ModuleDocumentationURL", this->ModuleDocumentationURLLineEdit, /*no tr*/"text",
SIGNAL(textChanged(QString)),
qSlicerSettingsGeneralPanel::tr("Documentation location"),
ctkSettingsPanel::OptionRequireRestart);
q->registerProperty("language", this->LanguageComboBox, "currentLanguage",
SIGNAL(currentLanguageNameChanged(const QString&)),
qSlicerSettingsGeneralPanel::tr("Enable/Disable languages"),
ctkSettingsPanel::OptionRequireRestart);
q->registerProperty("RecentlyLoadedFiles/NumberToKeep", this->NumOfRecentlyLoadedFiles, "value",
q->registerProperty("RecentlyLoadedFiles/NumberToKeep", this->NumOfRecentlyLoadedFiles, /*no tr*/"value",
SIGNAL(valueChanged(int)),
qSlicerSettingsGeneralPanel::tr("Max. number of 'Recent' menu items"),
ctkSettingsPanel::OptionRequireRestart);
Expand Down
4 changes: 2 additions & 2 deletions Base/QTGUI/qSlicerSettingsInternationalizationPanel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ void qSlicerSettingsInternationalizationPanelPrivate::init()
// Register settings
q->registerProperty("Internationalization/Enabled",
this->InternationalizationEnabledCheckBox,
"checked", SIGNAL(toggled(bool)),
"Enable/Disable Internationalization",
/*no tr*/"checked", SIGNAL(toggled(bool)),
qSlicerSettingsInternationalizationPanel::tr("Enable/Disable Internationalization"),
ctkSettingsPanel::OptionRequireRestart);

// Actions to propagate to the application when settings are changed
Expand Down
16 changes: 8 additions & 8 deletions Base/QTGUI/qSlicerSettingsModulesPanel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,18 @@ void qSlicerSettingsModulesPanelPrivate::init()

// Register settings
q->registerProperty("disable-loadable-modules", this->LoadLoadableModulesCheckBox,
"checked", SIGNAL(toggled(bool)));
/*no tr*/"checked", SIGNAL(toggled(bool)));
q->registerProperty("disable-scripted-loadable-modules", this->LoadScriptedLoadableModulesCheckBox,
"checked", SIGNAL(toggled(bool)));
/*no tr*/"checked", SIGNAL(toggled(bool)));
q->registerProperty("disable-cli-modules", this->LoadCommandLineModulesCheckBox,
"checked", SIGNAL(toggled(bool)));
/*no tr*/"checked", SIGNAL(toggled(bool)));

q->registerProperty("disable-builtin-loadable-modules", this->LoadBuiltInLoadableModulesCheckBox,
"checked", SIGNAL(toggled(bool)));
/*no tr*/"checked", SIGNAL(toggled(bool)));
q->registerProperty("disable-builtin-scripted-loadable-modules", this->LoadBuiltInScriptedLoadableModulesCheckBox,
"checked", SIGNAL(toggled(bool)));
/*no tr*/"checked", SIGNAL(toggled(bool)));
q->registerProperty("disable-builtin-cli-modules", this->LoadBuiltInCommandLineModulesCheckBox,
"checked", SIGNAL(toggled(bool)));
/*no tr*/"checked", SIGNAL(toggled(bool)));

q->registerProperty("Modules/HomeModule", this->ModulesMenu,
"currentModule", SIGNAL(currentModuleChanged(QString)));
Expand All @@ -168,11 +168,11 @@ void qSlicerSettingsModulesPanelPrivate::init()
q, SIGNAL(favoriteModulesChanged()));

qSlicerRelativePathMapper* relativePathMapper = new qSlicerRelativePathMapper(
this->TemporaryDirectoryButton, "directory", SIGNAL(directoryChanged(QString)));
this->TemporaryDirectoryButton, /*no tr*/"directory", SIGNAL(directoryChanged(QString)));
q->registerProperty("TemporaryPath", relativePathMapper,
"relativePath", SIGNAL(relativePathChanged(QString)));
q->registerProperty("Modules/ShowHiddenModules", this->ShowHiddenModulesCheckBox,
"checked", SIGNAL(toggled(bool)));
/*no tr*/"checked", SIGNAL(toggled(bool)));
qSlicerRelativePathMapper* relativePathMapper2 = new qSlicerRelativePathMapper(
this->AdditionalModulePathsView, "directoryList", SIGNAL(directoryListChanged()));
q->registerProperty("Modules/AdditionalPaths", relativePathMapper2,
Expand Down
2 changes: 1 addition & 1 deletion Base/QTGUI/qSlicerSettingsPythonPanel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void qSlicerSettingsPythonPanelPrivate::init()
//

q->registerProperty("Python/DockableWindow", this->DockableWindowCheckBox,
"checked", SIGNAL(toggled(bool)),
/*no tr*/"checked", SIGNAL(toggled(bool)),
qSlicerSettingsPythonPanel::tr("Display Python console in a window that can be placed inside the main window."),
ctkSettingsPanel::OptionRequireRestart);

Expand Down
6 changes: 3 additions & 3 deletions Base/QTGUI/qSlicerSettingsStylesPanel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ void qSlicerSettingsStylesPanelPrivate::init()
QObject::connect(this->ShowToolButtonTextCheckBox, SIGNAL(toggled(bool)),
q, SLOT(onShowToolButtonTextToggled(bool)));

q->registerProperty("no-tooltip", this->ShowToolTipsCheckBox, "checked",
q->registerProperty("no-tooltip", this->ShowToolTipsCheckBox, /*no tr*/"checked",
SIGNAL(toggled(bool)));
q->registerProperty("font", this->FontButton, "currentFont",
SIGNAL(currentFontChanged(QFont)));
q->registerProperty("MainWindow/ShowToolButtonText", this->ShowToolButtonTextCheckBox,
"checked", SIGNAL(toggled(bool)));
q->registerProperty("MainWindow/RestoreGeometry", this->RestoreUICheckBox, "checked",
/*no tr*/"checked", SIGNAL(toggled(bool)));
q->registerProperty("MainWindow/RestoreGeometry", this->RestoreUICheckBox, /*no tr*/"checked",
SIGNAL(toggled(bool)));

// Additional Style paths
Expand Down
Loading

0 comments on commit 8a8fea3

Please sign in to comment.