ClearCase: Move to Tr::tr

Change-Id: I0f65dfab1c73315d6877cfcc8a04cf202c0a3cdf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2022-09-29 14:47:34 +02:00
parent 0a7e6ef44f
commit 7ec2e724fe
30 changed files with 191 additions and 797 deletions

View File

@@ -6,6 +6,7 @@
#include "clearcaseconstants.h"
#include "clearcaseplugin.h"
#include "clearcasesettings.h"
#include "clearcasetr.h"
#include <utils/qtcassert.h>
@@ -14,8 +15,7 @@
#include <QLabel>
#include <QToolButton>
using namespace ClearCase;
using namespace ClearCase::Internal;
namespace ClearCase::Internal {
ActivitySelector::ActivitySelector(QWidget *parent) : QWidget(parent)
{
@@ -24,7 +24,7 @@ ActivitySelector::ActivitySelector(QWidget *parent) : QWidget(parent)
auto hboxLayout = new QHBoxLayout(this);
hboxLayout->setContentsMargins(0, 0, 0, 0);
auto lblActivity = new QLabel(tr("Select &activity:"));
auto lblActivity = new QLabel(Tr::tr("Select &activity:"));
lblActivity->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
hboxLayout->addWidget(lblActivity);
@@ -32,7 +32,7 @@ ActivitySelector::ActivitySelector(QWidget *parent) : QWidget(parent)
m_cmbActivity->setMinimumSize(QSize(350, 0));
hboxLayout->addWidget(m_cmbActivity);
QString addText = tr("Add");
QString addText = Tr::tr("Add");
if (!ClearCasePlugin::settings().autoAssignActivityName)
addText.append(QLatin1String("..."));
auto btnAdd = new QToolButton;
@@ -67,7 +67,7 @@ bool ActivitySelector::refresh()
void ActivitySelector::addKeep()
{
m_cmbActivity->insertItem(0, tr("Keep item activity"), QLatin1String(Constants::KEEP_ACTIVITY));
m_cmbActivity->insertItem(0, Tr::tr("Keep item activity"), QLatin1String(Constants::KEEP_ACTIVITY));
setActivity(QLatin1String(Constants::KEEP_ACTIVITY));
}
@@ -93,3 +93,5 @@ void ActivitySelector::newActivity()
if (ClearCasePlugin::newActivity())
refresh();
}
} // ClearCase::Internal

View File

@@ -9,8 +9,7 @@ QT_BEGIN_NAMESPACE
class QComboBox;
QT_END_NAMESPACE
namespace ClearCase {
namespace Internal {
namespace ClearCase::Internal {
class ActivitySelector : public QWidget
{
@@ -33,5 +32,4 @@ private:
QComboBox *m_cmbActivity = nullptr;
};
} // namespace Internal
} // namespace ClearCase
} // ClearCase::Internal

View File

@@ -3,8 +3,7 @@
#include "annotationhighlighter.h"
using namespace ClearCase;
using namespace ClearCase::Internal;
namespace ClearCase::Internal {
ClearCaseAnnotationHighlighter::ClearCaseAnnotationHighlighter(const ChangeNumbers &changeNumbers,
QTextDocument *document) :
@@ -16,3 +15,5 @@ QString ClearCaseAnnotationHighlighter::changeNumber(const QString &block) const
const int pos = block.indexOf(m_separator);
return pos > 1 ? block.left(pos) : QString();
}
} // ClearCase::Internal

View File

@@ -5,8 +5,7 @@
#include <vcsbase/baseannotationhighlighter.h>
namespace ClearCase {
namespace Internal {
namespace ClearCase::Internal {
// Annotation highlighter for clearcase triggering on 'changenumber '
class ClearCaseAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter
@@ -22,5 +21,4 @@ private:
const QChar m_separator = QLatin1Char('|');
};
} // namespace Internal
} // namespace ClearCase
} // ClearCase::Internal

View File

@@ -4,11 +4,10 @@
#include "checkoutdialog.h"
#include "activityselector.h"
#include "clearcasetr.h"
#include <utils/layoutbuilder.h>
#include <QPushButton>
#include <QAbstractButton>
#include <QApplication>
#include <QCheckBox>
@@ -17,6 +16,7 @@
#include <QHBoxLayout>
#include <QLabel>
#include <QPlainTextEdit>
#include <QPushButton>
#include <QVBoxLayout>
namespace ClearCase::Internal {
@@ -26,7 +26,7 @@ CheckOutDialog::CheckOutDialog(const QString &fileName, bool isUcm, bool showCom
QDialog(parent)
{
resize(352, 317);
setWindowTitle(tr("Check Out"));
setWindowTitle(Tr::tr("Check Out"));
auto lblFileName = new QLabel(fileName);
lblFileName->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse);
@@ -34,17 +34,17 @@ CheckOutDialog::CheckOutDialog(const QString &fileName, bool isUcm, bool showCom
m_txtComment = new QPlainTextEdit(this);
m_txtComment->setTabChangesFocus(true);
m_lblComment = new QLabel(tr("&Checkout comment:"));
m_lblComment = new QLabel(Tr::tr("&Checkout comment:"));
m_lblComment->setBuddy(m_txtComment);
m_chkReserved = new QCheckBox(tr("&Reserved"));
m_chkReserved = new QCheckBox(Tr::tr("&Reserved"));
m_chkReserved->setChecked(true);
m_chkUnreserved = new QCheckBox(tr("&Unreserved if already reserved"));
m_chkUnreserved = new QCheckBox(Tr::tr("&Unreserved if already reserved"));
m_chkPTime = new QCheckBox(tr("&Preserve file modification time"));
m_chkPTime = new QCheckBox(Tr::tr("&Preserve file modification time"));
m_hijackedCheckBox = new QCheckBox(tr("Use &Hijacked file"));
m_hijackedCheckBox = new QCheckBox(Tr::tr("Use &Hijacked file"));
m_hijackedCheckBox->setChecked(true);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);

View File

@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "clearcaseeditor.h"
#include "clearcasetr.h"
#include "annotationhighlighter.h"
@@ -9,8 +10,7 @@
#include <QTextCursor>
using namespace ClearCase;
using namespace ClearCase::Internal;
namespace ClearCase::Internal {
ClearCaseEditorWidget::ClearCaseEditorWidget() :
m_versionNumberPattern(QLatin1String("[\\\\/]main[\\\\/][^ \t\n\"]*"))
@@ -21,7 +21,7 @@ ClearCaseEditorWidget::ClearCaseEditorWidget() :
// "+++ D:\depot\...\mainwindow.cpp[TAB]Sun May 01 14:22:37 2011" (local)
setDiffFilePattern("^[-+]{3} ([^\\t]+?)(?:@@|\\t)");
setLogEntryPattern("version \"([^\"]+)\"");
setAnnotateRevisionTextFormat(tr("Annotate version \"%1\""));
setAnnotateRevisionTextFormat(Tr::tr("Annotate version \"%1\""));
setAnnotationEntryPattern("([^|]*)\\|[^\\n]*\\n");
setAnnotationSeparatorPattern("\\n-{30}");
}
@@ -46,3 +46,5 @@ VcsBase::BaseAnnotationHighlighter *ClearCaseEditorWidget::createAnnotationHighl
{
return new ClearCaseAnnotationHighlighter(changes);
}
} // ClearCase::Internal

View File

@@ -7,8 +7,7 @@
#include <QRegularExpression>
namespace ClearCase {
namespace Internal {
namespace ClearCase::Internal {
class ClearCaseEditorWidget : public VcsBase::VcsBaseEditorWidget
{
@@ -25,5 +24,4 @@ private:
const QRegularExpression m_versionNumberPattern;
};
} // namespace Internal
} // namespace ClearCase
} // ClearCase::Internal

View File

@@ -11,6 +11,7 @@
#include "clearcasesubmiteditor.h"
#include "clearcasesubmiteditorwidget.h"
#include "clearcasesync.h"
#include "clearcasetr.h"
#include "settingspage.h"
#include "versionselector.h"
@@ -421,7 +422,7 @@ void ClearCasePluginPrivate::updateEditDerivedObjectWarning(const QString &fileN
return;
infoBar->addInfo(InfoBarEntry(derivedObjectWarning,
tr("Editing Derived Object: %1").arg(fileName)));
Tr::tr("Editing Derived Object: %1").arg(fileName)));
} else {
infoBar->removeInfo(derivedObjectWarning);
}
@@ -620,82 +621,82 @@ ClearCasePluginPrivate::ClearCasePluginPrivate()
const QString prefix = QLatin1String("cc");
// register cc prefix in Locator
m_commandLocator = new CommandLocator("cc", description, prefix, this);
m_commandLocator->setDescription(tr("Triggers a ClearCase version control operation."));
m_commandLocator->setDescription(Tr::tr("Triggers a ClearCase version control operation."));
//register actions
ActionContainer *toolsContainer = ActionManager::actionContainer(M_TOOLS);
ActionContainer *clearcaseMenu = ActionManager::createMenu(CMD_ID_CLEARCASE_MENU);
clearcaseMenu->menu()->setTitle(tr("C&learCase"));
clearcaseMenu->menu()->setTitle(Tr::tr("C&learCase"));
toolsContainer->addMenu(clearcaseMenu);
m_menuAction = clearcaseMenu->menu()->menuAction();
Command *command;
m_checkOutAction = new ParameterAction(tr("Check Out..."), tr("Check &Out \"%1\"..."), ParameterAction::AlwaysEnabled, this);
m_checkOutAction = new ParameterAction(Tr::tr("Check Out..."), Tr::tr("Check &Out \"%1\"..."), ParameterAction::AlwaysEnabled, this);
command = ActionManager::registerAction(m_checkOutAction, CMD_ID_CHECKOUT,
context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+O") : tr("Alt+L,Alt+O")));
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+L,Meta+O") : Tr::tr("Alt+L,Alt+O")));
connect(m_checkOutAction, &QAction::triggered, this, &ClearCasePluginPrivate::checkOutCurrentFile);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
m_checkInCurrentAction = new ParameterAction(tr("Check &In..."), tr("Check &In \"%1\"..."), ParameterAction::AlwaysEnabled, this);
m_checkInCurrentAction = new ParameterAction(Tr::tr("Check &In..."), Tr::tr("Check &In \"%1\"..."), ParameterAction::AlwaysEnabled, this);
command = ActionManager::registerAction(m_checkInCurrentAction, CMD_ID_CHECKIN, context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+I") : tr("Alt+L,Alt+I")));
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+L,Meta+I") : Tr::tr("Alt+L,Alt+I")));
connect(m_checkInCurrentAction, &QAction::triggered, this, &ClearCasePluginPrivate::startCheckInCurrentFile);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
m_undoCheckOutAction = new ParameterAction(tr("Undo Check Out"), tr("&Undo Check Out \"%1\""), ParameterAction::AlwaysEnabled, this);
m_undoCheckOutAction = new ParameterAction(Tr::tr("Undo Check Out"), Tr::tr("&Undo Check Out \"%1\""), ParameterAction::AlwaysEnabled, this);
command = ActionManager::registerAction(m_undoCheckOutAction, CMD_ID_UNDOCHECKOUT, context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+U") : tr("Alt+L,Alt+U")));
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+L,Meta+U") : Tr::tr("Alt+L,Alt+U")));
connect(m_undoCheckOutAction, &QAction::triggered, this, &ClearCasePluginPrivate::undoCheckOutCurrent);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
m_undoHijackAction = new ParameterAction(tr("Undo Hijack"), tr("Undo Hi&jack \"%1\""), ParameterAction::AlwaysEnabled, this);
m_undoHijackAction = new ParameterAction(Tr::tr("Undo Hijack"), Tr::tr("Undo Hi&jack \"%1\""), ParameterAction::AlwaysEnabled, this);
command = ActionManager::registerAction(m_undoHijackAction, CMD_ID_UNDOHIJACK, context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+R") : tr("Alt+L,Alt+R")));
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+L,Meta+R") : Tr::tr("Alt+L,Alt+R")));
connect(m_undoHijackAction, &QAction::triggered, this, &ClearCasePluginPrivate::undoHijackCurrent);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
clearcaseMenu->addSeparator(context);
m_diffCurrentAction = new ParameterAction(tr("Diff Current File"), tr("&Diff \"%1\""), ParameterAction::EnabledWithParameter, this);
m_diffCurrentAction = new ParameterAction(Tr::tr("Diff Current File"), Tr::tr("&Diff \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_diffCurrentAction,
CMD_ID_DIFF_CURRENT, context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+D") : tr("Alt+L,Alt+D")));
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+L,Meta+D") : Tr::tr("Alt+L,Alt+D")));
connect(m_diffCurrentAction, &QAction::triggered, this, &ClearCasePluginPrivate::diffCurrentFile);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
m_historyCurrentAction = new ParameterAction(tr("History Current File"), tr("&History \"%1\""), ParameterAction::EnabledWithParameter, this);
m_historyCurrentAction = new ParameterAction(Tr::tr("History Current File"), Tr::tr("&History \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_historyCurrentAction,
CMD_ID_HISTORY_CURRENT, context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+H") : tr("Alt+L,Alt+H")));
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+L,Meta+H") : Tr::tr("Alt+L,Alt+H")));
connect(m_historyCurrentAction, &QAction::triggered, this,
&ClearCasePluginPrivate::historyCurrentFile);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
m_annotateCurrentAction = new ParameterAction(tr("Annotate Current File"), tr("&Annotate \"%1\""), ParameterAction::EnabledWithParameter, this);
m_annotateCurrentAction = new ParameterAction(Tr::tr("Annotate Current File"), Tr::tr("&Annotate \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_annotateCurrentAction,
CMD_ID_ANNOTATE, context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+A") : tr("Alt+L,Alt+A")));
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+L,Meta+A") : Tr::tr("Alt+L,Alt+A")));
connect(m_annotateCurrentAction, &QAction::triggered, this,
&ClearCasePluginPrivate::annotateCurrentFile);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
m_addFileAction = new ParameterAction(tr("Add File..."), tr("Add File \"%1\""), ParameterAction::EnabledWithParameter, this);
m_addFileAction = new ParameterAction(Tr::tr("Add File..."), Tr::tr("Add File \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_addFileAction, CMD_ID_ADD_FILE, context);
command->setAttribute(Command::CA_UpdateText);
connect(m_addFileAction, &QAction::triggered, this, &ClearCasePluginPrivate::addCurrentFile);
@@ -703,14 +704,14 @@ ClearCasePluginPrivate::ClearCasePluginPrivate()
clearcaseMenu->addSeparator(context);
m_diffActivityAction = new QAction(tr("Diff A&ctivity..."), this);
m_diffActivityAction = new QAction(Tr::tr("Diff A&ctivity..."), this);
m_diffActivityAction->setEnabled(false);
command = ActionManager::registerAction(m_diffActivityAction, CMD_ID_DIFF_ACTIVITY, context);
connect(m_diffActivityAction, &QAction::triggered, this, &ClearCasePluginPrivate::diffActivity);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
m_checkInActivityAction = new ParameterAction(tr("Ch&eck In Activity"), tr("Chec&k In Activity \"%1\"..."), ParameterAction::EnabledWithParameter, this);
m_checkInActivityAction = new ParameterAction(Tr::tr("Ch&eck In Activity"), Tr::tr("Chec&k In Activity \"%1\"..."), ParameterAction::EnabledWithParameter, this);
m_checkInActivityAction->setEnabled(false);
command = ActionManager::registerAction(m_checkInActivityAction, CMD_ID_CHECKIN_ACTIVITY, context);
connect(m_checkInActivityAction, &QAction::triggered, this, &ClearCasePluginPrivate::startCheckInActivity);
@@ -720,12 +721,12 @@ ClearCasePluginPrivate::ClearCasePluginPrivate()
clearcaseMenu->addSeparator(context);
m_updateIndexAction = new QAction(tr("Update Index"), this);
m_updateIndexAction = new QAction(Tr::tr("Update Index"), this);
command = ActionManager::registerAction(m_updateIndexAction, CMD_ID_UPDATEINDEX, context);
connect(m_updateIndexAction, &QAction::triggered, this, &ClearCasePluginPrivate::updateIndex);
clearcaseMenu->addAction(command);
m_updateViewAction = new ParameterAction(tr("Update View"), tr("U&pdate View \"%1\""), ParameterAction::EnabledWithParameter, this);
m_updateViewAction = new ParameterAction(Tr::tr("Update View"), Tr::tr("U&pdate View \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_updateViewAction, CMD_ID_UPDATE_VIEW, context);
connect(m_updateViewAction, &QAction::triggered, this, &ClearCasePluginPrivate::updateView);
command->setAttribute(Command::CA_UpdateText);
@@ -733,16 +734,16 @@ ClearCasePluginPrivate::ClearCasePluginPrivate()
clearcaseMenu->addSeparator(context);
m_checkInAllAction = new QAction(tr("Check In All &Files..."), this);
m_checkInAllAction = new QAction(Tr::tr("Check In All &Files..."), this);
command = ActionManager::registerAction(m_checkInAllAction, CMD_ID_CHECKIN_ALL, context);
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+F") : tr("Alt+L,Alt+F")));
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+L,Meta+F") : Tr::tr("Alt+L,Alt+F")));
connect(m_checkInAllAction, &QAction::triggered, this, &ClearCasePluginPrivate::startCheckInAll);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
m_statusAction = new QAction(tr("View &Status"), this);
m_statusAction = new QAction(Tr::tr("View &Status"), this);
command = ActionManager::registerAction(m_statusAction, CMD_ID_STATUS, context);
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+L,Meta+S") : tr("Alt+L,Alt+S")));
command->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+L,Meta+S") : Tr::tr("Alt+L,Alt+S")));
connect(m_statusAction, &QAction::triggered, this, &ClearCasePluginPrivate::viewStatus);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
@@ -995,7 +996,7 @@ void ClearCasePluginPrivate::updateActions(VcsBasePluginPrivate::ActionState as)
QString ClearCasePluginPrivate::commitDisplayName() const
{
return tr("Check In");
return Tr::tr("Check In");
}
void ClearCasePluginPrivate::checkOutCurrentFile()
@@ -1024,14 +1025,12 @@ void ClearCasePluginPrivate::setStatus(const QString &file, FileStatus::Status s
class UndoCheckOutDialog : public QDialog
{
Q_DECLARE_TR_FUNCTIONS(ClearCase::Internal::UndoCheckOut)
public:
UndoCheckOutDialog()
{
resize(323, 105);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
setWindowTitle(tr("Dialog"));
setWindowTitle(Tr::tr("Dialog"));
lblMessage = new QLabel(this);
@@ -1044,10 +1043,10 @@ public:
brush1.setStyle(Qt::SolidPattern);
palette.setBrush(QPalette::Disabled, QPalette::WindowText, brush1);
auto lblModified = new QLabel(tr("The file was changed."));
auto lblModified = new QLabel(Tr::tr("The file was changed."));
lblModified->setPalette(palette);
chkKeep = new QCheckBox(tr("&Save copy of the file with a '.keep' extension"));
chkKeep = new QCheckBox(Tr::tr("&Save copy of the file with a '.keep' extension"));
chkKeep->setChecked(true);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::No|QDialogButtonBox::Yes);
@@ -1086,7 +1085,7 @@ void ClearCasePluginPrivate::undoCheckOutCurrent()
bool keep = false;
if (result.exitCode()) { // return value is 1 if there is any difference
UndoCheckOutDialog dialog;
dialog.lblMessage->setText(tr("Do you want to undo the check out of \"%1\"?").arg(fileName));
dialog.lblMessage->setText(Tr::tr("Do you want to undo the check out of \"%1\"?").arg(fileName));
dialog.chkKeep->setChecked(m_settings.keepFileUndoCheckout);
if (dialog.exec() != QDialog::Accepted)
return;
@@ -1168,8 +1167,8 @@ void ClearCasePluginPrivate::undoHijackCurrent()
}
if (askKeep) {
UndoCheckOutDialog unhijackDlg;
unhijackDlg.setWindowTitle(tr("Undo Hijack File"));
unhijackDlg.lblMessage->setText(tr("Do you want to undo hijack of \"%1\"?")
unhijackDlg.setWindowTitle(Tr::tr("Undo Hijack File"));
unhijackDlg.lblMessage->setText(Tr::tr("Do you want to undo hijack of \"%1\"?")
.arg(QDir::toNativeSeparators(fileName)));
if (unhijackDlg.exec() != QDialog::Accepted)
return;
@@ -1208,7 +1207,7 @@ void ClearCasePluginPrivate::ccDiffWithPred(const FilePath &workingDir, const QS
return; // done here, diff is opened in a new window
}
if (!m_settings.extDiffAvailable) {
VcsOutputWindow::appendError(tr("External diff is required to compare multiple files."));
VcsOutputWindow::appendError(Tr::tr("External diff is required to compare multiple files."));
return;
}
QString result;
@@ -1280,12 +1279,12 @@ void ClearCasePluginPrivate::diffActivity()
if (Constants::debug)
qDebug() << Q_FUNC_INFO;
if (!m_settings.extDiffAvailable) {
VcsOutputWindow::appendError(tr("External diff is required to compare multiple files."));
VcsOutputWindow::appendError(Tr::tr("External diff is required to compare multiple files."));
return;
}
FilePath topLevel = state.topLevel();
QString activity = QInputDialog::getText(ICore::dialogParent(), tr("Enter Activity"),
tr("Activity Name"), QLineEdit::Normal, m_activity);
QString activity = QInputDialog::getText(ICore::dialogParent(), Tr::tr("Enter Activity"),
Tr::tr("Activity Name"), QLineEdit::Normal, m_activity);
if (activity.isEmpty())
return;
const QStringList versions = ccGetActivityVersions(topLevel, activity);
@@ -1383,7 +1382,7 @@ void ClearCasePluginPrivate::startCheckInActivity()
connect(buttonBox, &QDialogButtonBox::rejected, &dlg, &QDialog::reject);
layout->addWidget(actSelector);
layout->addWidget(buttonBox);
dlg.setWindowTitle(tr("Check In Activity"));
dlg.setWindowTitle(Tr::tr("Check In Activity"));
if (!dlg.exec())
return;
@@ -1417,13 +1416,13 @@ void ClearCasePluginPrivate::startCheckIn(const FilePath &workingDir, const QStr
return;
if (isCheckInEditorOpen()) {
VcsOutputWindow::appendWarning(tr("Another check in is currently being executed."));
VcsOutputWindow::appendWarning(Tr::tr("Another check in is currently being executed."));
return;
}
// Get list of added/modified/deleted files
if (files.empty()) {
VcsOutputWindow::appendWarning(tr("There are no modified files."));
VcsOutputWindow::appendWarning(Tr::tr("There are no modified files."));
return;
}
// Create a new submit change file containing the submit template
@@ -1659,7 +1658,7 @@ CommandResult ClearCasePluginPrivate::runCleartool(const FilePath &workingDir,
QTextCodec *outputCodec) const
{
if (m_settings.ccBinaryPath.isEmpty())
return CommandResult(ProcessResult::StartFailed, tr("No ClearCase executable specified."));
return CommandResult(ProcessResult::StartFailed, Tr::tr("No ClearCase executable specified."));
std::unique_ptr<VcsCommand> command;
command.reset(VcsBaseClient::createVcsCommand(workingDir, Environment::systemEnvironment()));
@@ -1727,8 +1726,8 @@ bool ClearCasePluginPrivate::vcsOpen(const FilePath &workingDir, const QString &
(fi.isWritable() || vcsStatus(absPath).status == FileStatus::Unknown))
runAsync(sync, QStringList(absPath)).waitForFinished();
if (vcsStatus(absPath).status == FileStatus::CheckedOut) {
QMessageBox::information(ICore::dialogParent(), tr("ClearCase Checkout"),
tr("File is already checked out."));
QMessageBox::information(ICore::dialogParent(), Tr::tr("ClearCase Checkout"),
Tr::tr("File is already checked out."));
return true;
}
@@ -1823,7 +1822,7 @@ bool ClearCasePluginPrivate::vcsSetActivity(const FilePath &workingDir, const QS
const CommandResult result =
runCleartool(workingDir, args, m_settings.timeOutS, VcsCommand::ShowStdOut);
if (result.result() != ProcessResult::FinishedWithSuccess) {
QMessageBox::warning(ICore::dialogParent(), title, tr("Set current activity failed: %1")
QMessageBox::warning(ICore::dialogParent(), title, Tr::tr("Set current activity failed: %1")
.arg(result.exitMessage()), QMessageBox::Ok);
return false;
}
@@ -1903,7 +1902,7 @@ bool ClearCasePluginPrivate::ccFileOp(const FilePath &workingDir, const QString
verticalLayout->addWidget(actSelector);
}
auto commentLabel = new QLabel(tr("Enter &comment:"));
auto commentLabel = new QLabel(Tr::tr("Enter &comment:"));
verticalLayout->addWidget(commentLabel);
auto commentEdit = new QTextEdit;
@@ -1976,24 +1975,24 @@ static QString baseName(const QString &fileName)
bool ClearCasePluginPrivate::vcsAdd(const FilePath &workingDir, const QString &fileName)
{
return ccFileOp(workingDir, tr("ClearCase Add File %1").arg(baseName(fileName)),
return ccFileOp(workingDir, Tr::tr("ClearCase Add File %1").arg(baseName(fileName)),
QStringList({"mkelem", "-ci"}), fileName);
}
bool ClearCasePluginPrivate::vcsDelete(const FilePath &workingDir, const QString &fileName)
{
const QString title(tr("ClearCase Remove Element %1").arg(baseName(fileName)));
if (QMessageBox::warning(ICore::dialogParent(), title, tr("This operation is irreversible. Are you sure?"),
const QString title(Tr::tr("ClearCase Remove Element %1").arg(baseName(fileName)));
if (QMessageBox::warning(ICore::dialogParent(), title, Tr::tr("This operation is irreversible. Are you sure?"),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::No)
return true;
return ccFileOp(workingDir, tr("ClearCase Remove File %1").arg(baseName(fileName)),
return ccFileOp(workingDir, Tr::tr("ClearCase Remove File %1").arg(baseName(fileName)),
QStringList({"rmname", "-force"}), fileName);
}
bool ClearCasePluginPrivate::vcsMove(const FilePath &workingDir, const QString &from, const QString &to)
{
return ccFileOp(workingDir, tr("ClearCase Rename File %1 -> %2")
return ccFileOp(workingDir, Tr::tr("ClearCase Rename File %1 -> %2")
.arg(baseName(from)).arg(baseName(to)),
QStringList("move"), from, to);
}
@@ -2094,8 +2093,8 @@ bool ClearCasePluginPrivate::newActivity()
QStringList args;
args << QLatin1String("mkactivity") << QLatin1String("-f");
if (!m_settings.autoAssignActivityName) {
QString headline = QInputDialog::getText(ICore::dialogParent(), tr("Activity Headline"),
tr("Enter activity headline"));
QString headline = QInputDialog::getText(ICore::dialogParent(), Tr::tr("Activity Headline"),
Tr::tr("Enter activity headline"));
if (headline.isEmpty())
return false;
args << QLatin1String("-headline") << headline;
@@ -2213,7 +2212,7 @@ void ClearCasePluginPrivate::updateIndex()
m_statusMap->clear();
QFuture<void> result = runAsync(sync, transform(project->files(Project::SourceFiles), &FilePath::toString));
if (!m_settings.disableIndexer)
ProgressManager::addTask(result, tr("Updating ClearCase Index"), ClearCase::Constants::TASK_INDEX);
ProgressManager::addTask(result, Tr::tr("Updating ClearCase Index"), ClearCase::Constants::TASK_INDEX);
}
/*! retrieve a \a file (usually of the form path\to\filename.cpp@@\main\ver)
@@ -2461,14 +2460,14 @@ void ClearCasePluginPrivate::vcsAnnotate(const FilePath &filePath, int line)
QString ClearCasePluginPrivate::vcsOpenText() const
{
return tr("Check &Out");
return Tr::tr("Check &Out");
}
QString ClearCasePluginPrivate::vcsMakeWritableText() const
{
if (isDynamic())
return {};
return tr("&Hijack");
return Tr::tr("&Hijack");
}
QString ClearCasePluginPrivate::vcsTopic(const FilePath &directory)

View File

@@ -10,8 +10,7 @@
#include <QStringList>
#include <QSharedPointer>
namespace ClearCase {
namespace Internal {
namespace ClearCase::Internal {
class ClearCaseSettings;
@@ -91,5 +90,4 @@ private slots:
#endif
};
} // namespace Internal
} // namespace ClearCase
} // ClearCase::Internal

View File

@@ -7,23 +7,25 @@
#include <QSettings>
static const char groupC[] = "ClearCase";
static const char commandKeyC[] = "Command";
namespace ClearCase::Internal {
static const char historyCountKeyC[] = "HistoryCount";
static const char timeOutKeyC[] = "TimeOut";
static const char autoCheckOutKeyC[] = "AutoCheckOut";
static const char noCommentKeyC[] = "NoComment";
static const char keepFileUndoCheckoutKeyC[] = "KeepFileUnDoCheckout";
static const char diffTypeKeyC[] = "DiffType";
static const char diffArgsKeyC[] = "DiffArgs";
static const char autoAssignActivityKeyC[] = "AutoAssignActivityName";
static const char promptToCheckInKeyC[] = "PromptToCheckIn";
static const char disableIndexerKeyC[] = "DisableIndexer";
static const char totalFilesKeyC[] = "TotalFiles";
static const char indexOnlyVOBsC[] = "IndexOnlyVOBs";
const char groupC[] = "ClearCase";
const char commandKeyC[] = "Command";
static const char defaultDiffArgs[] = "-ubp";
const char historyCountKeyC[] = "HistoryCount";
const char timeOutKeyC[] = "TimeOut";
const char autoCheckOutKeyC[] = "AutoCheckOut";
const char noCommentKeyC[] = "NoComment";
const char keepFileUndoCheckoutKeyC[] = "KeepFileUnDoCheckout";
const char diffTypeKeyC[] = "DiffType";
const char diffArgsKeyC[] = "DiffArgs";
const char autoAssignActivityKeyC[] = "AutoAssignActivityName";
const char promptToCheckInKeyC[] = "PromptToCheckIn";
const char disableIndexerKeyC[] = "DisableIndexer";
const char totalFilesKeyC[] = "TotalFiles";
const char indexOnlyVOBsC[] = "IndexOnlyVOBs";
const char defaultDiffArgs[] = "-ubp";
enum { defaultTimeOutS = 30, defaultHistoryCount = 50 };
@@ -32,8 +34,6 @@ static QString defaultCommand()
return QLatin1String("cleartool" QTC_HOST_EXE_SUFFIX);
}
using namespace ClearCase::Internal;
ClearCaseSettings::ClearCaseSettings() :
ccCommand(defaultCommand()),
diffArgs(QLatin1String(defaultDiffArgs)),
@@ -118,3 +118,5 @@ bool ClearCaseSettings::equals(const ClearCaseSettings &s) const
&& indexOnlyVOBs == s.indexOnlyVOBs
&& totalFiles == s.totalFiles;
}
} // ClearCase::Internal

View File

@@ -12,8 +12,7 @@ QT_BEGIN_NAMESPACE
class QSettings;
QT_END_NAMESPACE
namespace ClearCase {
namespace Internal {
namespace ClearCase::Internal {
enum DiffType
{
@@ -55,5 +54,4 @@ public:
int timeOutS;
};
} // namespace Internal
} // namespace ClearCase
} // ClearCase::Internal

View File

@@ -4,17 +4,18 @@
#include "clearcasesubmiteditor.h"
#include "clearcasesubmiteditorwidget.h"
#include "clearcasetr.h"
#include <coreplugin/idocument.h>
#include <vcsbase/submitfilemodel.h>
using namespace ClearCase::Internal;
namespace ClearCase::Internal {
ClearCaseSubmitEditor::ClearCaseSubmitEditor() :
VcsBase::VcsBaseSubmitEditor(new ClearCaseSubmitEditorWidget)
{
document()->setPreferredDisplayName(tr("ClearCase Check In"));
document()->setPreferredDisplayName(Tr::tr("ClearCase Check In"));
}
ClearCaseSubmitEditorWidget *ClearCaseSubmitEditor::submitEditorWidget()
@@ -45,3 +46,5 @@ QByteArray ClearCaseSubmitEditor::fileContents() const
{
return VcsBase::VcsBaseSubmitEditor::fileContents().trimmed();
}
} // ClearCase::Internal

View File

@@ -5,8 +5,7 @@
#include <vcsbase/vcsbasesubmiteditor.h>
namespace ClearCase {
namespace Internal {
namespace ClearCase::Internal {
class ClearCaseSubmitEditorWidget;
@@ -28,5 +27,4 @@ protected:
QByteArray fileContents() const override;
};
} // namespace Internal
} // namespace ClearCase
} // ClearCase::Internal

View File

@@ -4,13 +4,14 @@
#include "clearcasesubmiteditorwidget.h"
#include "activityselector.h"
#include "clearcasetr.h"
#include <utils/layoutbuilder.h>
#include <QCheckBox>
#include <QVBoxLayout>
using namespace ClearCase::Internal;
namespace ClearCase::Internal {
ClearCaseSubmitEditorWidget::ClearCaseSubmitEditorWidget()
{
@@ -19,10 +20,10 @@ ClearCaseSubmitEditorWidget::ClearCaseSubmitEditorWidget()
m_verticalLayout = new QVBoxLayout(checkInWidget);
m_chkIdentical = new QCheckBox(tr("Chec&k in even if identical to previous version"));
m_chkIdentical = new QCheckBox(Tr::tr("Chec&k in even if identical to previous version"));
m_verticalLayout->addWidget(m_chkIdentical);
m_chkPTime = new QCheckBox(tr("&Preserve file modification time"));
m_chkPTime = new QCheckBox(Tr::tr("&Preserve file modification time"));
m_verticalLayout->addWidget(m_chkPTime);
insertTopWidget(checkInWidget);
@@ -73,5 +74,7 @@ void ClearCaseSubmitEditorWidget::addActivitySelector(bool isUcm)
QString ClearCaseSubmitEditorWidget::commitName() const
{
return tr("&Check In");
return Tr::tr("&Check In");
}
} // ClearCase::Internal

View File

@@ -10,8 +10,7 @@ class QCheckBox;
class QVBoxLayout;
QT_END_NAMESPACE
namespace ClearCase {
namespace Internal {
namespace ClearCase::Internal {
class ActivitySelector;
@@ -40,5 +39,4 @@ private:
QVBoxLayout *m_verticalLayout;
};
} // namespace Internal
} // namespace ClearCase
} // ClearCase::Internal

View File

@@ -20,8 +20,7 @@
using namespace Utils;
namespace ClearCase {
namespace Internal {
namespace ClearCase::Internal {
static void runProcess(QFutureInterface<void> &future,
const ClearCaseSettings &settings,
@@ -333,6 +332,4 @@ void ClearCaseSync::verifyFileNotManagedDynamicView()
#endif
} // namespace Internal
} // namespace ClearCase
} // ClearCase::Internal

View File

@@ -11,8 +11,7 @@ template <typename T>
class QFutureInterface;
QT_END_NAMESPACE
namespace ClearCase {
namespace Internal {
namespace ClearCase::Internal {
class ClearCaseSync : public QObject
{
@@ -53,5 +52,4 @@ public slots:
#endif
};
} // namespace Internal
} // namespace ClearCase
} // ClearCase::Internal

View File

@@ -6,6 +6,7 @@
#include "clearcaseconstants.h"
#include "clearcaseplugin.h"
#include "clearcasesettings.h"
#include "clearcasetr.h"
#include <vcsbase/vcsbaseconstants.h>
@@ -27,8 +28,6 @@ namespace ClearCase::Internal {
class SettingsPageWidget final : public Core::IOptionsPageWidget
{
Q_DECLARE_TR_FUNCTIONS(ClearCase::Internal::SettingsPageWidget)
public:
SettingsPageWidget();
@@ -54,17 +53,17 @@ SettingsPageWidget::SettingsPageWidget()
resize(512, 589);
commandPathChooser = new PathChooser;
commandPathChooser->setPromptDialogTitle(tr("ClearCase Command"));
commandPathChooser->setPromptDialogTitle(Tr::Tr::tr("ClearCase Command"));
commandPathChooser->setExpectedKind(PathChooser::ExistingCommand);
commandPathChooser->setHistoryCompleter("ClearCase.Command.History");
graphicalDiffRadioButton = new QRadioButton(tr("&Graphical (single file only)"));
graphicalDiffRadioButton = new QRadioButton(Tr::tr("&Graphical (single file only)"));
graphicalDiffRadioButton->setChecked(true);
auto diffWidget = new QWidget;
diffWidget->setEnabled(false);
externalDiffRadioButton = new QRadioButton(tr("&External"));
externalDiffRadioButton = new QRadioButton(Tr::tr("&External"));
QObject::connect(externalDiffRadioButton, &QRadioButton::toggled, diffWidget, &QWidget::setEnabled);
diffArgsEdit = new QLineEdit(diffWidget);
@@ -86,44 +85,44 @@ SettingsPageWidget::SettingsPageWidget()
historyCountSpinBox->setMaximum(10000);
timeOutSpinBox = new QSpinBox;
timeOutSpinBox->setSuffix(tr("s", nullptr));
timeOutSpinBox->setSuffix(Tr::tr("s", nullptr));
timeOutSpinBox->setRange(1, 360);
timeOutSpinBox->setValue(30);
autoCheckOutCheckBox = new QCheckBox(tr("&Automatically check out files on edit"));
autoCheckOutCheckBox = new QCheckBox(Tr::tr("&Automatically check out files on edit"));
promptCheckBox = new QCheckBox(tr("&Prompt on check-in"));
promptCheckBox = new QCheckBox(Tr::tr("&Prompt on check-in"));
disableIndexerCheckBox = new QCheckBox(tr("Di&sable indexer"));
disableIndexerCheckBox = new QCheckBox(Tr::tr("Di&sable indexer"));
indexOnlyVOBsEdit = new QLineEdit;
indexOnlyVOBsEdit->setToolTip(tr("VOBs list, separated by comma. Indexer will only traverse "
indexOnlyVOBsEdit->setToolTip(Tr::tr("VOBs list, separated by comma. Indexer will only traverse "
"the specified VOBs. If left blank, all active VOBs will be indexed."));
autoAssignActivityCheckBox = new QCheckBox(tr("Aut&o assign activity names"));
autoAssignActivityCheckBox->setToolTip(tr("Check this if you have a trigger that renames "
autoAssignActivityCheckBox = new QCheckBox(Tr::tr("Aut&o assign activity names"));
autoAssignActivityCheckBox->setToolTip(Tr::tr("Check this if you have a trigger that renames "
"the activity automatically. You will not be prompted for activity name."));
noCommentCheckBox = new QCheckBox(tr("Do &not prompt for comment during checkout or check-in"));
noCommentCheckBox->setToolTip(tr("Check out or check in files with no comment (-nc/omment)."));
noCommentCheckBox = new QCheckBox(Tr::tr("Do &not prompt for comment during checkout or check-in"));
noCommentCheckBox->setToolTip(Tr::tr("Check out or check in files with no comment (-nc/omment)."));
using namespace Layouting;
Row {
tr("Arg&uments:"),
Tr::tr("Arg&uments:"),
diffArgsEdit
}.attachTo(diffWidget, WithoutMargins);
Column {
Group {
title(tr("Configuration")),
title(Tr::tr("Configuration")),
Form {
tr("&Command:"), commandPathChooser
Tr::tr("&Command:"), commandPathChooser
}
},
Group {
title(tr("Diff")),
title(Tr::tr("Diff")),
Form {
graphicalDiffRadioButton, br,
externalDiffRadioButton, diffWidget, br,
@@ -132,16 +131,16 @@ SettingsPageWidget::SettingsPageWidget()
},
Group {
title(tr("Miscellaneous")),
title(Tr::tr("Miscellaneous")),
Form {
tr("&History count:"), historyCountSpinBox, br,
tr("&Timeout:"), timeOutSpinBox, br,
Tr::tr("&History count:"), historyCountSpinBox, br,
Tr::tr("&Timeout:"), timeOutSpinBox, br,
autoCheckOutCheckBox, br,
autoAssignActivityCheckBox, br,
noCommentCheckBox, br,
promptCheckBox, br,
disableIndexerCheckBox, br,
tr("&Index only VOBs:"), indexOnlyVOBsEdit,
Tr::tr("&Index only VOBs:"), indexOnlyVOBsEdit,
}
},
st
@@ -158,12 +157,12 @@ SettingsPageWidget::SettingsPageWidget()
if (extDiffAvailable) {
diffWarningLabel->setVisible(false);
} else {
QString diffWarning = tr("In order to use External diff, \"diff\" command needs to be accessible.");
QString diffWarning = Tr::tr("In order to use External diff, \"diff\" command needs to be accessible.");
if (HostOsInfo::isWindowsHost()) {
diffWarning += QLatin1Char(' ');
diffWarning.append(tr("DiffUtils is available for free download at "
"http://gnuwin32.sourceforge.net/packages/diffutils.htm. "
"Extract it to a directory in your PATH."));
diffWarning.append(Tr::tr("DiffUtils is available for free download at "
"http://gnuwin32.sourceforge.net/packages/diffutils.htm. "
"Extract it to a directory in your PATH."));
}
diffWarningLabel->setText(diffWarning);
externalDiffRadioButton->setEnabled(false);
@@ -206,7 +205,7 @@ void SettingsPageWidget::apply()
ClearCaseSettingsPage::ClearCaseSettingsPage()
{
setId(ClearCase::Constants::VCS_ID_CLEARCASE);
setDisplayName(SettingsPageWidget::tr("ClearCase"));
setDisplayName(Tr::tr("ClearCase"));
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
setWidgetCreator([] { return new SettingsPageWidget; });
}

View File

@@ -3,11 +3,11 @@
#include "versionselector.h"
#include "clearcasetr.h"
#include <utils/layoutbuilder.h>
#include <QApplication>
#include <QDialogButtonBox>
#include <QFormLayout>
#include <QLabel>
#include <QPlainTextEdit>
#include <QRadioButton>
@@ -22,14 +22,14 @@ VersionSelector::VersionSelector(const QString &fileName, const QString &message
QDialog(parent)
{
resize(413, 435);
setWindowTitle(tr("Confirm Version to Check Out"));
setWindowTitle(Tr::tr("Confirm Version to Check Out"));
auto headerLabel = new QLabel(tr("Multiple versions of \"%1\" can be checked out. "
auto headerLabel = new QLabel(Tr::tr("Multiple versions of \"%1\" can be checked out. "
"Select the version to check out:").arg(fileName));
headerLabel->setWordWrap(true);
headerLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse);
auto loadedRadioButton = new QRadioButton(tr("&Loaded version"));
auto loadedRadioButton = new QRadioButton(Tr::tr("&Loaded version"));
loadedRadioButton->setChecked(true);
auto loadedLabel = new QLabel;
@@ -42,13 +42,13 @@ VersionSelector::VersionSelector(const QString &fileName, const QString &message
auto updatedText = new QPlainTextEdit;
updatedText->setReadOnly(true);
m_updatedRadioButton = new QRadioButton(tr("Version after &update"));
m_updatedRadioButton = new QRadioButton(Tr::tr("Version after &update"));
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
auto loadedText = new QTextEdit;
loadedText->setHtml("<html><head/><body><p><b>"
+ tr("Note: You will not be able to check in this file without merging "
+ Tr::tr("Note: You will not be able to check in this file without merging "
"the changes (not supported by the plugin)")
+ "</b></p></body></html>");
m_stream = new QTextStream(message.toLocal8Bit(), QIODevice::ReadOnly | QIODevice::Text);
@@ -76,14 +76,14 @@ VersionSelector::VersionSelector(const QString &fileName, const QString &message
headerLabel,
Form {
loadedRadioButton, loadedLabel, br,
tr("Created by:"), loadedCreatedByLabel, br,
tr("Created on:"), loadedCreatedOnLabel, br,
Tr::tr("Created by:"), loadedCreatedByLabel, br,
Tr::tr("Created on:"), loadedCreatedOnLabel, br,
Span(2, loadedText),
},
Form {
m_updatedRadioButton, updatedLabel, br,
tr("Created by:"), updatedCreatedByLabel, br,
tr("Created on:"), updatedCreatedOnLabel, br,
Tr::tr("Created by:"), updatedCreatedByLabel, br,
Tr::tr("Created on:"), updatedCreatedOnLabel, br,
Span(2, updatedText)
},
buttonBox,