ADS: Tr::tr()

Following contexts are merged into QtC::ADS

  ADS::DockAreaTitleBar
  ADS::DockManager
  ADS::DockWidgetTab
  ADS::WorkspaceDialog
  ADS::WorkspaceModel
  ADS::WorkspaceNameInputDialog
  ADS::WorkspaceView

Change-Id: Ieb3c8240531ca94f43ec1237c27647a51f59e4f9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2023-02-10 21:14:30 +01:00
parent e9365d399f
commit 95a88ef732
11 changed files with 59 additions and 130 deletions

View File

@@ -43117,7 +43117,7 @@ You might find further explanations in the Application Output view.</source>
</message> </message>
</context> </context>
<context> <context>
<name>ADS::WorkspaceDialog</name> <name>QtC::ADS</name>
<message> <message>
<source>&amp;New</source> <source>&amp;New</source>
<translation>&amp;Neu</translation> <translation>&amp;Neu</translation>
@@ -43744,7 +43744,7 @@ Doppelklicken Sie einen Eintrag um ihn zu ändern.</translation>
</message> </message>
</context> </context>
<context> <context>
<name>ADS::DockWidgetTab</name> <name>QtC::ADS</name>
<message> <message>
<source>Detach</source> <source>Detach</source>
<translation>Ablösen</translation> <translation>Ablösen</translation>
@@ -43757,9 +43757,6 @@ Doppelklicken Sie einen Eintrag um ihn zu ändern.</translation>
<source>Close Others</source> <source>Close Others</source>
<translation>Andere schließen</translation> <translation>Andere schließen</translation>
</message> </message>
</context>
<context>
<name>ADS::WorkspaceModel</name>
<message> <message>
<source>Workspace</source> <source>Workspace</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -43792,10 +43789,6 @@ Doppelklicken Sie einen Eintrag um ihn zu ändern.</translation>
<source>Rename Workspace</source> <source>Rename Workspace</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>&amp;Rename</source>
<translation>&amp;Umbenennen</translation>
</message>
<message> <message>
<source>Rename and &amp;Open</source> <source>Rename and &amp;Open</source>
<translation>Umbenennen und ö&amp;ffnen</translation> <translation>Umbenennen und ö&amp;ffnen</translation>
@@ -49952,7 +49945,7 @@ Teilnamen können verwendet werden, sofern sie eindeutig sind.</translation>
</message> </message>
</context> </context>
<context> <context>
<name>ADS::DockAreaTitleBar</name> <name>QtC::ADS</name>
<message> <message>
<source>Detach Area</source> <source>Detach Area</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -49965,9 +49958,6 @@ Teilnamen können verwendet werden, sofern sie eindeutig sind.</translation>
<source>Close Other Areas</source> <source>Close Other Areas</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>ADS::DockManager</name>
<message> <message>
<source>Cannot Save Workspace</source> <source>Cannot Save Workspace</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -50001,16 +49991,10 @@ Teilnamen können verwendet werden, sofern sie eindeutig sind.</translation>
<source>Could not restore workspace %1</source> <source>Could not restore workspace %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>ADS::WorkspaceNameInputDialog</name>
<message> <message>
<source>Enter the name of the workspace:</source> <source>Enter the name of the workspace:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>ADS::WorkspaceView</name>
<message> <message>
<source>Import Workspace</source> <source>Import Workspace</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>

View File

@@ -41859,7 +41859,7 @@ Output:
</message> </message>
</context> </context>
<context> <context>
<name>ADS::WorkspaceDialog</name> <name>QtC::ADS</name>
<message> <message>
<source>&amp;New</source> <source>&amp;New</source>
<translation>(&amp;N)</translation> <translation>(&amp;N)</translation>
@@ -42538,7 +42538,7 @@ Output:
</message> </message>
</context> </context>
<context> <context>
<name>ADS::DockAreaTitleBar</name> <name>QtC::ADS</name>
<message> <message>
<source>Detach Area</source> <source>Detach Area</source>
<translation></translation> <translation></translation>
@@ -42551,9 +42551,6 @@ Output:
<source>Close Other Areas</source> <source>Close Other Areas</source>
<translation></translation> <translation></translation>
</message> </message>
</context>
<context>
<name>ADS::DockManager</name>
<message> <message>
<source>Cannot Save Workspace</source> <source>Cannot Save Workspace</source>
<translation></translation> <translation></translation>
@@ -42593,7 +42590,7 @@ Output:
<name>QtC::Utils</name> <name>QtC::Utils</name>
</context> </context>
<context> <context>
<name>ADS::DockWidgetTab</name> <name>QtC::ADS</name>
<message> <message>
<source>Detach</source> <source>Detach</source>
<translation></translation> <translation></translation>
@@ -42606,16 +42603,10 @@ Output:
<source>Close Others</source> <source>Close Others</source>
<translation></translation> <translation></translation>
</message> </message>
</context>
<context>
<name>ADS::WorkspaceNameInputDialog</name>
<message> <message>
<source>Enter the name of the workspace:</source> <source>Enter the name of the workspace:</source>
<translation>:</translation> <translation>:</translation>
</message> </message>
</context>
<context>
<name>ADS::WorkspaceModel</name>
<message> <message>
<source>Workspace</source> <source>Workspace</source>
<translation></translation> <translation></translation>
@@ -42648,17 +42639,10 @@ Output:
<source>Rename Workspace</source> <source>Rename Workspace</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<source>&amp;Rename</source>
<translation>(&amp;R)</translation>
</message>
<message> <message>
<source>Rename and &amp;Open</source> <source>Rename and &amp;Open</source>
<translation>(&amp;O)</translation> <translation>(&amp;O)</translation>
</message> </message>
</context>
<context>
<name>ADS::WorkspaceView</name>
<message> <message>
<source>Import Workspace</source> <source>Import Workspace</source>
<translation></translation> <translation></translation>

View File

@@ -2,7 +2,7 @@
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.1" language="ru"> <TS version="2.1" language="ru">
<context> <context>
<name>ADS::DockAreaTitleBar</name> <name>QtC::ADS</name>
<message> <message>
<source>Detach Area</source> <source>Detach Area</source>
<translation>Отцепить область</translation> <translation>Отцепить область</translation>
@@ -15,9 +15,6 @@
<source>Close Other Areas</source> <source>Close Other Areas</source>
<translation>Закрыть другие области</translation> <translation>Закрыть другие области</translation>
</message> </message>
</context>
<context>
<name>ADS::DockManager</name>
<message> <message>
<source>Cannot Save Workspace</source> <source>Cannot Save Workspace</source>
<translation>Не удалось сохранить сессию</translation> <translation>Не удалось сохранить сессию</translation>
@@ -52,9 +49,6 @@
<source>Could not restore workspace %1</source> <source>Could not restore workspace %1</source>
<translation>Не удалось восстановить сессию %1</translation> <translation>Не удалось восстановить сессию %1</translation>
</message> </message>
</context>
<context>
<name>ADS::DockWidgetTab</name>
<message> <message>
<source>Detach</source> <source>Detach</source>
<translation>Отцепить</translation> <translation>Отцепить</translation>
@@ -67,9 +61,6 @@
<source>Close Others</source> <source>Close Others</source>
<translation>Закрыть другие</translation> <translation>Закрыть другие</translation>
</message> </message>
</context>
<context>
<name>ADS::WorkspaceDialog</name>
<message> <message>
<source>Workspace Manager</source> <source>Workspace Manager</source>
<translation>Управление сессиями</translation> <translation>Управление сессиями</translation>
@@ -114,9 +105,6 @@
<source>Export</source> <source>Export</source>
<translation>Экспортировать</translation> <translation>Экспортировать</translation>
</message> </message>
</context>
<context>
<name>ADS::WorkspaceModel</name>
<message> <message>
<source>Workspace</source> <source>Workspace</source>
<translation>Сессия</translation> <translation>Сессия</translation>
@@ -149,24 +137,14 @@
<source>Rename Workspace</source> <source>Rename Workspace</source>
<translation>Переименование сессии</translation> <translation>Переименование сессии</translation>
</message> </message>
<message>
<source>&amp;Rename</source>
<translation>&amp;Переименовать</translation>
</message>
<message> <message>
<source>Rename and &amp;Open</source> <source>Rename and &amp;Open</source>
<translation>П&amp;ереименовать и открыть</translation> <translation>П&amp;ереименовать и открыть</translation>
</message> </message>
</context>
<context>
<name>ADS::WorkspaceNameInputDialog</name>
<message> <message>
<source>Enter the name of the workspace:</source> <source>Enter the name of the workspace:</source>
<translation>Введите название сессии:</translation> <translation>Введите название сессии:</translation>
</message> </message>
</context>
<context>
<name>ADS::WorkspaceView</name>
<message> <message>
<source>Import Workspace</source> <source>Import Workspace</source>
<translation>Импорт сессии</translation> <translation>Импорт сессии</translation>

View File

@@ -2,7 +2,7 @@
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.1" language="zh_CN"> <TS version="2.1" language="zh_CN">
<context> <context>
<name>ADS::DockAreaTitleBar</name> <name>QtC::ADS</name>
<message> <message>
<source>Detach Area</source> <source>Detach Area</source>
<translation></translation> <translation></translation>
@@ -15,9 +15,6 @@
<source>Close Other Areas</source> <source>Close Other Areas</source>
<translation></translation> <translation></translation>
</message> </message>
</context>
<context>
<name>ADS::DockManager</name>
<message> <message>
<source>Cannot Save Workspace</source> <source>Cannot Save Workspace</source>
<translation></translation> <translation></translation>
@@ -52,9 +49,6 @@
<source>Could not restore workspace %1</source> <source>Could not restore workspace %1</source>
<translation> %1 </translation> <translation> %1 </translation>
</message> </message>
</context>
<context>
<name>ADS::DockWidgetTab</name>
<message> <message>
<source>Detach</source> <source>Detach</source>
<translation></translation> <translation></translation>
@@ -67,9 +61,6 @@
<source>Close Others</source> <source>Close Others</source>
<translation></translation> <translation></translation>
</message> </message>
</context>
<context>
<name>ADS::WorkspaceDialog</name>
<message> <message>
<source>Workspace Manager</source> <source>Workspace Manager</source>
<translation></translation> <translation></translation>
@@ -114,9 +105,6 @@
<source>&lt;a href=&quot;qthelp://org.qt-project.qtcreator/doc/creator-project-managing-workspaces.html&quot;&gt;What is a Workspace?&lt;/a&gt;</source> <source>&lt;a href=&quot;qthelp://org.qt-project.qtcreator/doc/creator-project-managing-workspaces.html&quot;&gt;What is a Workspace?&lt;/a&gt;</source>
<translation>&lt;a href=&quot;qthelp://org.qt-project.qtcreator/doc/creator-project-managing-workspaces.html&quot;&gt;什么是工作区?&lt;/a&gt;</translation> <translation>&lt;a href=&quot;qthelp://org.qt-project.qtcreator/doc/creator-project-managing-workspaces.html&quot;&gt;什么是工作区?&lt;/a&gt;</translation>
</message> </message>
</context>
<context>
<name>ADS::WorkspaceModel</name>
<message> <message>
<source>Workspace</source> <source>Workspace</source>
<translation></translation> <translation></translation>
@@ -149,24 +137,14 @@
<source>Rename Workspace</source> <source>Rename Workspace</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<source>&amp;Rename</source>
<translation>(&amp;R)</translation>
</message>
<message> <message>
<source>Rename and &amp;Open</source> <source>Rename and &amp;Open</source>
<translation>(&amp;O)</translation> <translation>(&amp;O)</translation>
</message> </message>
</context>
<context>
<name>ADS::WorkspaceNameInputDialog</name>
<message> <message>
<source>Enter the name of the workspace:</source> <source>Enter the name of the workspace:</source>
<translation></translation> <translation></translation>
</message> </message>
</context>
<context>
<name>ADS::WorkspaceView</name>
<message> <message>
<source>Import Workspace</source> <source>Import Workspace</source>
<translation></translation> <translation></translation>

View File

@@ -5,11 +5,11 @@
#include <QCoreApplication> #include <QCoreApplication>
namespace AdvancedDockingSystem { namespace ADS {
struct Tr struct Tr
{ {
Q_DECLARE_TR_FUNCTIONS(QtC::AdvancedDockingSystem) Q_DECLARE_TR_FUNCTIONS(QtC::ADS)
}; };
} // AdvancedDockingSystem } // AdvancedDockingSystem

View File

@@ -4,8 +4,10 @@
#include "dockareatitlebar.h" #include "dockareatitlebar.h"
#include "ads_globals.h" #include "ads_globals.h"
#include "advanceddockingsystemtr.h"
#include "dockareatabbar.h" #include "dockareatabbar.h"
#include "dockareawidget.h" #include "dockareawidget.h"
#include "dockcomponentsfactory.h"
#include "dockmanager.h" #include "dockmanager.h"
#include "dockoverlay.h" #include "dockoverlay.h"
#include "dockwidget.h" #include "dockwidget.h"
@@ -13,7 +15,6 @@
#include "floatingdockcontainer.h" #include "floatingdockcontainer.h"
#include "floatingdragpreview.h" #include "floatingdragpreview.h"
#include "iconprovider.h" #include "iconprovider.h"
#include "dockcomponentsfactory.h"
#include <QBoxLayout> #include <QBoxLayout>
#include <QLoggingCategory> #include <QLoggingCategory>
@@ -119,7 +120,7 @@ namespace ADS
#endif #endif
QObject::connect(tabsMenu, &QMenu::aboutToShow, q, &DockAreaTitleBar::onTabsMenuAboutToShow); QObject::connect(tabsMenu, &QMenu::aboutToShow, q, &DockAreaTitleBar::onTabsMenuAboutToShow);
m_tabsMenuButton->setMenu(tabsMenu); m_tabsMenuButton->setMenu(tabsMenu);
internal::setToolTip(m_tabsMenuButton, QObject::tr("List All Tabs")); internal::setToolTip(m_tabsMenuButton, Tr::tr("List All Tabs"));
m_tabsMenuButton->setSizePolicy(sizePolicy); m_tabsMenuButton->setSizePolicy(sizePolicy);
m_tabsMenuButton->setIconSize(iconSize); m_tabsMenuButton->setIconSize(iconSize);
m_tabsMenuButton->setFixedSize(buttonSize); m_tabsMenuButton->setFixedSize(buttonSize);
@@ -133,7 +134,7 @@ namespace ADS
m_undockButton = new TitleBarButton(testConfigFlag(DockManager::DockAreaHasUndockButton)); m_undockButton = new TitleBarButton(testConfigFlag(DockManager::DockAreaHasUndockButton));
m_undockButton->setObjectName("detachGroupButton"); m_undockButton->setObjectName("detachGroupButton");
//m_undockButton->setAutoRaise(true); //m_undockButton->setAutoRaise(true);
internal::setToolTip(m_undockButton, QObject::tr("Detach Group")); internal::setToolTip(m_undockButton, Tr::tr("Detach Group"));
internal::setButtonIcon(m_undockButton, internal::setButtonIcon(m_undockButton,
QStyle::SP_TitleBarNormalButton, QStyle::SP_TitleBarNormalButton,
ADS::DockAreaUndockIcon); ADS::DockAreaUndockIcon);
@@ -154,9 +155,9 @@ namespace ADS
QStyle::SP_TitleBarCloseButton, QStyle::SP_TitleBarCloseButton,
ADS::DockAreaCloseIcon); ADS::DockAreaCloseIcon);
if (testConfigFlag(DockManager::DockAreaCloseButtonClosesTab)) if (testConfigFlag(DockManager::DockAreaCloseButtonClosesTab))
internal::setToolTip(m_closeButton, QObject::tr("Close Active Tab")); internal::setToolTip(m_closeButton, Tr::tr("Close Active Tab"));
else else
internal::setToolTip(m_closeButton, QObject::tr("Close Group")); internal::setToolTip(m_closeButton, Tr::tr("Close Group"));
m_closeButton->setSizePolicy(sizePolicy); m_closeButton->setSizePolicy(sizePolicy);
m_closeButton->setIconSize(iconSize); m_closeButton->setIconSize(iconSize);
@@ -532,14 +533,14 @@ namespace ADS
return; return;
QMenu menu(this); QMenu menu(this);
auto action = menu.addAction(tr("Detach Area"), auto action = menu.addAction(Tr::tr("Detach Area"),
this, this,
&DockAreaTitleBar::onUndockButtonClicked); &DockAreaTitleBar::onUndockButtonClicked);
action->setEnabled(d->m_dockArea->features().testFlag(DockWidget::DockWidgetFloatable)); action->setEnabled(d->m_dockArea->features().testFlag(DockWidget::DockWidgetFloatable));
menu.addSeparator(); menu.addSeparator();
action = menu.addAction(tr("Close Area"), this, &DockAreaTitleBar::onCloseButtonClicked); action = menu.addAction(Tr::tr("Close Area"), this, &DockAreaTitleBar::onCloseButtonClicked);
action->setEnabled(d->m_dockArea->features().testFlag(DockWidget::DockWidgetClosable)); action->setEnabled(d->m_dockArea->features().testFlag(DockWidget::DockWidgetClosable));
menu.addAction(tr("Close Other Areas"), d->m_dockArea, &DockAreaWidget::closeOtherAreas); menu.addAction(Tr::tr("Close Other Areas"), d->m_dockArea, &DockAreaWidget::closeOtherAreas);
menu.exec(event->globalPos()); menu.exec(event->globalPos());
} }

View File

@@ -576,8 +576,8 @@ namespace ADS
d->m_workspaceDateTimes.insert(activeWorkspace(), QDateTime::currentDateTime()); d->m_workspaceDateTimes.insert(activeWorkspace(), QDateTime::currentDateTime());
else else
QMessageBox::warning(parentWidget(), QMessageBox::warning(parentWidget(),
tr("Cannot Save Workspace"), Tr::tr("Cannot Save Workspace"),
tr("Could not save workspace to file %1") Tr::tr("Could not save workspace to file %1")
.arg(workspaceNameToFilePath(d->m_workspaceName) .arg(workspaceNameToFilePath(d->m_workspaceName)
.toUserOutput())); .toUserOutput()));
@@ -684,8 +684,8 @@ namespace ADS
emit workspaceListChanged(); emit workspaceListChanged();
} else { } else {
QMessageBox::warning(parentWidget(), QMessageBox::warning(parentWidget(),
tr("Cannot Save Workspace"), Tr::tr("Cannot Save Workspace"),
tr("Could not save workspace to file %1") Tr::tr("Could not save workspace to file %1")
.arg(workspaceNameToFilePath(d->m_workspaceName) .arg(workspaceNameToFilePath(d->m_workspaceName)
.toUserOutput())); .toUserOutput()));
} }
@@ -752,11 +752,11 @@ namespace ADS
*/ */
bool DockManager::confirmWorkspaceDelete(const QStringList &workspace) bool DockManager::confirmWorkspaceDelete(const QStringList &workspace)
{ {
const QString title = workspace.size() == 1 ? tr("Delete Workspace") const QString title = workspace.size() == 1 ? Tr::tr("Delete Workspace")
: tr("Delete Workspaces"); : Tr::tr("Delete Workspaces");
const QString question = workspace.size() == 1 const QString question = workspace.size() == 1
? tr("Delete workspace %1?").arg(workspace.first()) ? Tr::tr("Delete workspace %1?").arg(workspace.first())
: tr("Delete these workspaces?\n %1") : Tr::tr("Delete these workspaces?\n %1")
.arg(workspace.join("\n ")); .arg(workspace.join("\n "));
return QMessageBox::question(parentWidget(), return QMessageBox::question(parentWidget(),
title, title,
@@ -964,8 +964,8 @@ namespace ADS
if (!data) { if (!data) {
QMessageBox::warning(parentWidget(), QMessageBox::warning(parentWidget(),
tr("Cannot Restore Workspace"), Tr::tr("Cannot Restore Workspace"),
tr("Could not restore workspace %1") Tr::tr("Could not restore workspace %1")
.arg(fileName.toUserOutput())); .arg(fileName.toUserOutput()));
qCWarning(adsLog) << QString("Could not restore workspace %1: %2") qCWarning(adsLog) << QString("Could not restore workspace %1: %2")

View File

@@ -4,6 +4,7 @@
#include "dockwidgettab.h" #include "dockwidgettab.h"
#include "ads_globals.h" #include "ads_globals.h"
#include "advanceddockingsystemtr.h"
#include "dockareawidget.h" #include "dockareawidget.h"
#include "dockmanager.h" #include "dockmanager.h"
#include "dockoverlay.h" #include "dockoverlay.h"
@@ -158,7 +159,7 @@ namespace ADS
m_closeButton->setIconSize(QSize(11, 11)); m_closeButton->setIconSize(QSize(11, 11));
m_closeButton->setFixedSize(QSize(17, 17)); m_closeButton->setFixedSize(QSize(17, 17));
q->onDockWidgetFeaturesChanged(); q->onDockWidgetFeaturesChanged();
internal::setToolTip(m_closeButton, QObject::tr("Close Tab")); internal::setToolTip(m_closeButton, Tr::tr("Close Tab"));
QObject::connect(m_closeButton, QObject::connect(m_closeButton,
&QAbstractButton::clicked, &QAbstractButton::clicked,
q, q,
@@ -410,12 +411,12 @@ namespace ADS
const bool isNotOnlyTabInContainer = !d->m_dockArea->dockContainer()->hasTopLevelDockWidget(); const bool isNotOnlyTabInContainer = !d->m_dockArea->dockContainer()->hasTopLevelDockWidget();
const bool isDetachable = isFloatable && isNotOnlyTabInContainer; const bool isDetachable = isFloatable && isNotOnlyTabInContainer;
auto action = menu.addAction(tr("Detach"), this, &DockWidgetTab::detachDockWidget); auto action = menu.addAction(Tr::tr("Detach"), this, &DockWidgetTab::detachDockWidget);
action->setEnabled(isDetachable); action->setEnabled(isDetachable);
menu.addSeparator(); menu.addSeparator();
action = menu.addAction(tr("Close"), this, &DockWidgetTab::closeRequested); action = menu.addAction(Tr::tr("Close"), this, &DockWidgetTab::closeRequested);
action->setEnabled(isClosable()); action->setEnabled(isClosable());
menu.addAction(tr("Close Others"), this, &DockWidgetTab::closeOtherTabsRequested); menu.addAction(Tr::tr("Close Others"), this, &DockWidgetTab::closeOtherTabsRequested);
menu.exec(event->globalPos()); menu.exec(event->globalPos());
} }

View File

@@ -3,6 +3,7 @@
#include "workspacedialog.h" #include "workspacedialog.h"
#include "advanceddockingsystemtr.h"
#include "dockmanager.h" #include "dockmanager.h"
#include "workspaceview.h" #include "workspaceview.h"
@@ -65,7 +66,7 @@ WorkspaceNameInputDialog::WorkspaceNameInputDialog(DockManager *manager, QWidget
: QDialog(parent) : QDialog(parent)
, m_manager(manager) , m_manager(manager)
{ {
auto label = new QLabel(tr("Enter the name of the workspace:"), this); auto label = new QLabel(Tr::tr("Enter the name of the workspace:"), this);
m_newWorkspaceLineEdit = new QLineEdit(this); m_newWorkspaceLineEdit = new QLineEdit(this);
m_newWorkspaceLineEdit->setValidator(new WorkspaceValidator(this, m_manager->workspaces())); m_newWorkspaceLineEdit->setValidator(new WorkspaceValidator(this, m_manager->workspaces()));
auto buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, auto buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
@@ -113,21 +114,21 @@ WorkspaceDialog::WorkspaceDialog(DockManager *manager, QWidget *parent)
: QDialog(parent) : QDialog(parent)
, m_manager(manager) , m_manager(manager)
, m_workspaceView(new WorkspaceView(manager)) , m_workspaceView(new WorkspaceView(manager))
, m_btCreateNew(new QPushButton(tr("&New"))) , m_btCreateNew(new QPushButton(Tr::tr("&New")))
, m_btRename(new QPushButton(tr("&Rename"))) , m_btRename(new QPushButton(Tr::tr("&Rename")))
, m_btClone(new QPushButton(tr("C&lone"))) , m_btClone(new QPushButton(Tr::tr("C&lone")))
, m_btDelete(new QPushButton(tr("&Delete"))) , m_btDelete(new QPushButton(Tr::tr("&Delete")))
, m_btReset(new QPushButton(tr("Reset"))) , m_btReset(new QPushButton(Tr::tr("Reset")))
, m_btSwitch(new QPushButton(tr("&Switch To"))) , m_btSwitch(new QPushButton(Tr::tr("&Switch To")))
, m_btImport(new QPushButton(tr("Import"))) , m_btImport(new QPushButton(Tr::tr("Import")))
, m_btExport(new QPushButton(tr("Export"))) , m_btExport(new QPushButton(Tr::tr("Export")))
, m_autoLoadCheckBox(new QCheckBox(tr("Restore last workspace on startup"))) , m_autoLoadCheckBox(new QCheckBox(Tr::tr("Restore last workspace on startup")))
{ {
setWindowTitle(tr("Workspace Manager")); setWindowTitle(Tr::tr("Workspace Manager"));
m_workspaceView->setActivationMode(Utils::DoubleClickActivation); m_workspaceView->setActivationMode(Utils::DoubleClickActivation);
QLabel *whatsAWorkspaceLabel = new QLabel(tr("<a href=\"qthelp://org.qt-project.qtcreator/doc/" QLabel *whatsAWorkspaceLabel = new QLabel(Tr::tr("<a href=\"qthelp://org.qt-project.qtcreator/doc/"
"creator-project-managing-workspaces.html\">What is a Workspace?</a>")); "creator-project-managing-workspaces.html\">What is a Workspace?</a>"));
whatsAWorkspaceLabel->setOpenExternalLinks(true); whatsAWorkspaceLabel->setOpenExternalLinks(true);

View File

@@ -3,6 +3,7 @@
#include "workspacemodel.h" #include "workspacemodel.h"
#include "advanceddockingsystemtr.h"
#include "dockmanager.h" #include "dockmanager.h"
#include "workspacedialog.h" #include "workspacedialog.h"
@@ -42,10 +43,10 @@ QVariant WorkspaceModel::headerData(int section, Qt::Orientation orientation, in
case Qt::DisplayRole: case Qt::DisplayRole:
switch (section) { switch (section) {
case 0: case 0:
result = tr("Workspace"); result = Tr::tr("Workspace");
break; break;
case 1: case 1:
result = tr("Last Modified"); result = Tr::tr("Last Modified");
break; break;
} // switch (section) } // switch (section)
break; break;
@@ -162,8 +163,8 @@ void WorkspaceModel::resetWorkspaces()
void WorkspaceModel::newWorkspace(QWidget *parent) void WorkspaceModel::newWorkspace(QWidget *parent)
{ {
WorkspaceNameInputDialog workspaceInputDialog(m_manager, parent); WorkspaceNameInputDialog workspaceInputDialog(m_manager, parent);
workspaceInputDialog.setWindowTitle(tr("New Workspace Name")); workspaceInputDialog.setWindowTitle(Tr::tr("New Workspace Name"));
workspaceInputDialog.setActionText(tr("&Create"), tr("Create and &Open")); workspaceInputDialog.setActionText(Tr::tr("&Create"), Tr::tr("Create and &Open"));
runWorkspaceNameInputDialog(&workspaceInputDialog, [this](const QString &newName) { runWorkspaceNameInputDialog(&workspaceInputDialog, [this](const QString &newName) {
m_manager->createWorkspace(newName); m_manager->createWorkspace(newName);
@@ -173,8 +174,8 @@ void WorkspaceModel::newWorkspace(QWidget *parent)
void WorkspaceModel::cloneWorkspace(QWidget *parent, const QString &workspace) void WorkspaceModel::cloneWorkspace(QWidget *parent, const QString &workspace)
{ {
WorkspaceNameInputDialog workspaceInputDialog(m_manager, parent); WorkspaceNameInputDialog workspaceInputDialog(m_manager, parent);
workspaceInputDialog.setWindowTitle(tr("New Workspace Name")); workspaceInputDialog.setWindowTitle(Tr::tr("New Workspace Name"));
workspaceInputDialog.setActionText(tr("&Clone"), tr("Clone and &Open")); workspaceInputDialog.setActionText(Tr::tr("&Clone"), Tr::tr("Clone and &Open"));
workspaceInputDialog.setValue(workspace + " (2)"); workspaceInputDialog.setValue(workspace + " (2)");
runWorkspaceNameInputDialog(&workspaceInputDialog, [this, workspace](const QString &newName) { runWorkspaceNameInputDialog(&workspaceInputDialog, [this, workspace](const QString &newName) {
@@ -195,8 +196,8 @@ void WorkspaceModel::deleteWorkspaces(const QStringList &workspaces)
void WorkspaceModel::renameWorkspace(QWidget *parent, const QString &workspace) void WorkspaceModel::renameWorkspace(QWidget *parent, const QString &workspace)
{ {
WorkspaceNameInputDialog workspaceInputDialog(m_manager, parent); WorkspaceNameInputDialog workspaceInputDialog(m_manager, parent);
workspaceInputDialog.setWindowTitle(tr("Rename Workspace")); workspaceInputDialog.setWindowTitle(Tr::tr("Rename Workspace"));
workspaceInputDialog.setActionText(tr("&Rename"), tr("Rename and &Open")); workspaceInputDialog.setActionText(Tr::tr("&Rename"), Tr::tr("Rename and &Open"));
workspaceInputDialog.setValue(workspace); workspaceInputDialog.setValue(workspace);
runWorkspaceNameInputDialog(&workspaceInputDialog, [this, workspace](const QString &newName) { runWorkspaceNameInputDialog(&workspaceInputDialog, [this, workspace](const QString &newName) {

View File

@@ -4,6 +4,7 @@
#include "workspaceview.h" #include "workspaceview.h"
#include "dockmanager.h" #include "dockmanager.h"
#include "advanceddockingsystemtr.h"
#include <utils/algorithm.h> #include <utils/algorithm.h>
@@ -95,7 +96,7 @@ void WorkspaceView::importWorkspace()
static QString lastDir; static QString lastDir;
const QString currentDir = lastDir.isEmpty() ? "" : lastDir; const QString currentDir = lastDir.isEmpty() ? "" : lastDir;
const auto fileName = QFileDialog::getOpenFileName(this, const auto fileName = QFileDialog::getOpenFileName(this,
tr("Import Workspace"), Tr::tr("Import Workspace"),
currentDir, currentDir,
"Workspaces (*" + m_manager->workspaceFileExtension() + ")"); "Workspaces (*" + m_manager->workspaceFileExtension() + ")");
@@ -112,7 +113,7 @@ void WorkspaceView::exportCurrentWorkspace()
QFileInfo fileInfo(currentDir, m_manager->workspaceNameToFileName(currentWorkspace())); QFileInfo fileInfo(currentDir, m_manager->workspaceNameToFileName(currentWorkspace()));
const auto fileName = QFileDialog::getSaveFileName(this, const auto fileName = QFileDialog::getSaveFileName(this,
tr("Export Workspace"), Tr::tr("Export Workspace"),
fileInfo.absoluteFilePath(), fileInfo.absoluteFilePath(),
"Workspaces (*" + m_manager->workspaceFileExtension() + ")"); "Workspaces (*" + m_manager->workspaceFileExtension() + ")");