forked from qt-creator/qt-creator
VcsBase: Use static pattern for VcsBaseOutputWindow
Also rename to VcsOutputWindow. Change-Id: I79547b1154603a8c7b3604eadc5b460930c6109c Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
#include "constants.h"
|
||||
|
||||
#include <vcsbase/vcsbaseplugin.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <vcsbase/vcsbaseeditorparameterwidget.h>
|
||||
#include <utils/synchronousprocess.h>
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
#include <QTextStream>
|
||||
#include <QDebug>
|
||||
|
||||
using namespace VcsBase;
|
||||
|
||||
namespace Bazaar {
|
||||
namespace Internal {
|
||||
|
||||
@@ -117,7 +119,7 @@ bool BazaarClient::synchronousUncommit(const QString &workingDir,
|
||||
QByteArray stdOut;
|
||||
const bool success = vcsFullySynchronousExec(workingDir, args, &stdOut);
|
||||
if (!stdOut.isEmpty())
|
||||
VcsBase::VcsBaseOutputWindow::instance()->append(QString::fromUtf8(stdOut));
|
||||
VcsOutputWindow::append(QString::fromUtf8(stdOut));
|
||||
return success;
|
||||
}
|
||||
|
||||
|
@@ -59,7 +59,7 @@
|
||||
#include <vcsbase/vcsbasesubmiteditor.h>
|
||||
#include <vcsbase/vcsbaseconstants.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
|
||||
#include <QtPlugin>
|
||||
#include <QAction>
|
||||
@@ -574,13 +574,12 @@ void BazaarPlugin::commit()
|
||||
|
||||
void BazaarPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &status)
|
||||
{
|
||||
VcsBaseOutputWindow *outputWindow = VcsBaseOutputWindow::instance();
|
||||
//Once we receive our data release the connection so it can be reused elsewhere
|
||||
disconnect(m_client, SIGNAL(parsedStatus(QList<VcsBaseClient::StatusItem>)),
|
||||
this, SLOT(showCommitWidget(QList<VcsBaseClient::StatusItem>)));
|
||||
|
||||
if (status.isEmpty()) {
|
||||
outputWindow->appendError(tr("There are no changes to commit."));
|
||||
VcsOutputWindow::appendError(tr("There are no changes to commit."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -589,20 +588,20 @@ void BazaarPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &stat
|
||||
// Keep the file alive, else it removes self and forgets its name
|
||||
saver.setAutoRemove(false);
|
||||
if (!saver.finalize()) {
|
||||
VcsBaseOutputWindow::instance()->appendError(saver.errorString());
|
||||
VcsOutputWindow::appendError(saver.errorString());
|
||||
return;
|
||||
}
|
||||
|
||||
IEditor *editor = EditorManager::openEditor(saver.fileName(), COMMIT_ID);
|
||||
if (!editor) {
|
||||
outputWindow->appendError(tr("Unable to create an editor for the commit."));
|
||||
VcsOutputWindow::appendError(tr("Unable to create an editor for the commit."));
|
||||
return;
|
||||
}
|
||||
|
||||
CommitEditor *commitEditor = qobject_cast<CommitEditor *>(editor);
|
||||
|
||||
if (!commitEditor) {
|
||||
outputWindow->appendError(tr("Unable to create a commit editor."));
|
||||
VcsOutputWindow::appendError(tr("Unable to create a commit editor."));
|
||||
return;
|
||||
}
|
||||
setSubmitEditor(commitEditor);
|
||||
|
@@ -67,7 +67,7 @@
|
||||
#include <vcsbase/basevcssubmiteditorfactory.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/vcsbaseeditorparameterwidget.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <vcsbase/vcsbasesubmiteditor.h>
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
|
||||
using namespace Core;
|
||||
using namespace ProjectExplorer;
|
||||
using VcsBase::VcsOutputWindow;
|
||||
|
||||
namespace ClearCase {
|
||||
namespace Internal {
|
||||
@@ -1033,8 +1034,7 @@ void ClearCasePlugin::ccDiffWithPred(const QString &workingDir, const QStringLis
|
||||
return; // done here, diff is opened in a new window
|
||||
}
|
||||
if (!m_settings.extDiffAvailable) {
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(
|
||||
tr("External diff is required to compare multiple files."));
|
||||
VcsOutputWindow::appendError(tr("External diff is required to compare multiple files."));
|
||||
return;
|
||||
}
|
||||
QString result;
|
||||
@@ -1106,8 +1106,7 @@ void ClearCasePlugin::diffActivity()
|
||||
if (Constants::debug)
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
if (!m_settings.extDiffAvailable) {
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(
|
||||
tr("External diff is required to compare multiple files."));
|
||||
VcsOutputWindow::appendError(tr("External diff is required to compare multiple files."));
|
||||
return;
|
||||
}
|
||||
QString topLevel = state.topLevel();
|
||||
@@ -1238,16 +1237,15 @@ void ClearCasePlugin::startCheckIn(const QString &workingDir, const QStringList
|
||||
{
|
||||
if (raiseSubmitEditor())
|
||||
return;
|
||||
VcsBase::VcsBaseOutputWindow *outputwindow = VcsBase::VcsBaseOutputWindow::instance();
|
||||
|
||||
if (isCheckInEditorOpen()) {
|
||||
outputwindow->appendWarning(tr("Another check in is currently being executed."));
|
||||
VcsOutputWindow::appendWarning(tr("Another check in is currently being executed."));
|
||||
return;
|
||||
}
|
||||
|
||||
// Get list of added/modified/deleted files
|
||||
if (files.empty()) {
|
||||
outputwindow->appendWarning(tr("There are no modified files."));
|
||||
VcsOutputWindow::appendWarning(tr("There are no modified files."));
|
||||
return;
|
||||
}
|
||||
// Create a new submit change file containing the submit template
|
||||
@@ -1258,7 +1256,7 @@ void ClearCasePlugin::startCheckIn(const QString &workingDir, const QStringList
|
||||
// Create a submit
|
||||
saver.write(submitTemplate.toUtf8());
|
||||
if (!saver.finalize()) {
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(saver.errorString());
|
||||
VcsOutputWindow::appendError(saver.errorString());
|
||||
return;
|
||||
}
|
||||
m_checkInMessageFileName = saver.fileName();
|
||||
@@ -1331,8 +1329,7 @@ void ClearCasePlugin::viewStatus()
|
||||
if (m_viewData.name.isEmpty())
|
||||
m_viewData = ccGetView(m_topLevel);
|
||||
QTC_ASSERT(!m_viewData.name.isEmpty() && !m_settings.disableIndexer, return);
|
||||
VcsBase::VcsBaseOutputWindow *outputwindow = VcsBase::VcsBaseOutputWindow::instance();
|
||||
outputwindow->appendCommand(QLatin1String("Indexed files status (C=Checked Out, "
|
||||
VcsBase::VcsOutputWindow::appendCommand(QLatin1String("Indexed files status (C=Checked Out, "
|
||||
"H=Hijacked, ?=Missing)"));
|
||||
bool anymod = false;
|
||||
for (StatusMap::ConstIterator it = m_statusMap->constBegin();
|
||||
@@ -1347,14 +1344,14 @@ void ClearCasePlugin::viewStatus()
|
||||
default: break;
|
||||
}
|
||||
if (cstat) {
|
||||
outputwindow->append(QString::fromLatin1("%1 %2\n")
|
||||
VcsOutputWindow::append(QString::fromLatin1("%1 %2\n")
|
||||
.arg(cstat)
|
||||
.arg(QDir::toNativeSeparators(it.key())));
|
||||
anymod = true;
|
||||
}
|
||||
}
|
||||
if (!anymod)
|
||||
outputwindow->appendWarning(QLatin1String("No modified files found."));
|
||||
VcsOutputWindow::appendWarning(QLatin1String("No modified files found."));
|
||||
}
|
||||
|
||||
void ClearCasePlugin::ccUpdate(const QString &workingDir, const QStringList &relativePaths)
|
||||
@@ -1637,9 +1634,8 @@ bool ClearCasePlugin::vcsOpen(const QString &workingDir, const QString &fileName
|
||||
ShowStdOutInLogWindow | FullySynchronously);
|
||||
}
|
||||
} else {
|
||||
VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance();
|
||||
outputWindow->append(response.stdOut);
|
||||
outputWindow->appendError(response.stdErr);
|
||||
VcsOutputWindow::append(response.stdOut);
|
||||
VcsOutputWindow::appendError(response.stdErr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -40,7 +40,7 @@
|
||||
#include <vcsbase/vcsbaseconstants.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/basevcssubmiteditorfactory.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <vcsbase/vcsbaseeditorparameterwidget.h>
|
||||
#include <utils/synchronousprocess.h>
|
||||
#include <utils/parameteraction.h>
|
||||
@@ -673,7 +673,7 @@ void CvsPlugin::startCommit(const QString &workingDir, const QString &file)
|
||||
if (raiseSubmitEditor())
|
||||
return;
|
||||
if (isCommitEditorOpen()) {
|
||||
VcsBaseOutputWindow::instance()->appendWarning(tr("Another commit is currently being executed."));
|
||||
VcsOutputWindow::appendWarning(tr("Another commit is currently being executed."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -696,7 +696,7 @@ void CvsPlugin::startCommit(const QString &workingDir, const QString &file)
|
||||
}
|
||||
}
|
||||
if (statusOutput.empty()) {
|
||||
VcsBaseOutputWindow::instance()->appendWarning(tr("There are no modified files."));
|
||||
VcsOutputWindow::appendWarning(tr("There are no modified files."));
|
||||
return;
|
||||
}
|
||||
m_commitRepository = workingDir;
|
||||
@@ -709,7 +709,7 @@ void CvsPlugin::startCommit(const QString &workingDir, const QString &file)
|
||||
// Create a submit
|
||||
saver.write(submitTemplate.toUtf8());
|
||||
if (!saver.finalize()) {
|
||||
VcsBaseOutputWindow::instance()->appendError(saver.errorString());
|
||||
VcsOutputWindow::appendError(saver.errorString());
|
||||
return;
|
||||
}
|
||||
m_commitMessageFileName = saver.fileName();
|
||||
@@ -983,7 +983,7 @@ void CvsPlugin::slotDescribe(const QString &source, const QString &changeNr)
|
||||
{
|
||||
QString errorMessage;
|
||||
if (!describe(source, changeNr, &errorMessage))
|
||||
VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
}
|
||||
|
||||
bool CvsPlugin::describe(const QString &file, const QString &changeNr, QString *errorMessage)
|
||||
|
@@ -39,7 +39,7 @@
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/execmenu.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <coreplugin/documentmanager.h>
|
||||
|
||||
#include <QAction>
|
||||
@@ -50,6 +50,8 @@
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
using namespace VcsBase;
|
||||
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
@@ -99,7 +101,7 @@ void BranchDialog::refresh(const QString &repository, bool force)
|
||||
m_ui->repositoryLabel->setText(StashDialog::msgRepositoryLabel(m_repository));
|
||||
QString errorMessage;
|
||||
if (!m_model->refresh(m_repository, &errorMessage))
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
|
||||
m_ui->branchView->expandAll();
|
||||
}
|
||||
|
@@ -31,11 +31,13 @@
|
||||
#include "gitclient.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <vcsbase/vcsbaseplugin.h>
|
||||
|
||||
#include <QFont>
|
||||
|
||||
using namespace VcsBase;
|
||||
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
@@ -310,7 +312,7 @@ bool BranchModel::setData(const QModelIndex &index, const QVariant &value, int r
|
||||
<< newFullName.last(),
|
||||
&output, &errorMessage)) {
|
||||
node->name = oldFullName.last();
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -354,7 +356,7 @@ bool BranchModel::refresh(const QString &workingDirectory, QString *errorMessage
|
||||
args << QLatin1String("--format=%(objectname)\t%(refname)\t%(upstream:short)\t%(*objectname)");
|
||||
QString output;
|
||||
if (!m_client->synchronousForEachRefCmd(workingDirectory, args, &output, errorMessage))
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(*errorMessage);
|
||||
VcsOutputWindow::appendError(*errorMessage);
|
||||
|
||||
m_workingDirectory = workingDirectory;
|
||||
const QStringList lines = output.split(QLatin1Char('\n'));
|
||||
@@ -393,7 +395,7 @@ void BranchModel::renameBranch(const QString &oldName, const QString &newName)
|
||||
if (!m_client->synchronousBranchCmd(m_workingDirectory,
|
||||
QStringList() << QLatin1String("-m") << oldName << newName,
|
||||
&output, &errorMessage))
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
else
|
||||
refresh(m_workingDirectory, &errorMessage);
|
||||
}
|
||||
@@ -407,7 +409,7 @@ void BranchModel::renameTag(const QString &oldName, const QString &newName)
|
||||
|| !m_client->synchronousTagCmd(m_workingDirectory,
|
||||
QStringList() << QLatin1String("-d") << oldName,
|
||||
&output, &errorMessage)) {
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
} else {
|
||||
refresh(m_workingDirectory, &errorMessage);
|
||||
}
|
||||
@@ -497,7 +499,7 @@ void BranchModel::removeBranch(const QModelIndex &idx)
|
||||
|
||||
args << QLatin1String("-D") << branch;
|
||||
if (!m_client->synchronousBranchCmd(m_workingDirectory, args, &output, &errorMessage)) {
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
return;
|
||||
}
|
||||
removeNode(idx);
|
||||
@@ -515,7 +517,7 @@ void BranchModel::removeTag(const QModelIndex &idx)
|
||||
|
||||
args << QLatin1String("-d") << tag;
|
||||
if (!m_client->synchronousTagCmd(m_workingDirectory, args, &output, &errorMessage)) {
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
return;
|
||||
}
|
||||
removeNode(idx);
|
||||
@@ -544,7 +546,7 @@ bool BranchModel::branchIsMerged(const QModelIndex &idx)
|
||||
|
||||
args << QLatin1String("-a") << QLatin1String("--contains") << sha(idx);
|
||||
if (!m_client->synchronousBranchCmd(m_workingDirectory, args, &output, &errorMessage))
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
|
||||
QStringList lines = output.split(QLatin1Char('\n'), QString::SkipEmptyParts);
|
||||
foreach (const QString &l, lines) {
|
||||
@@ -589,7 +591,7 @@ QModelIndex BranchModel::addBranch(const QString &name, bool track, const QModel
|
||||
}
|
||||
|
||||
if (!m_client->synchronousBranchCmd(m_workingDirectory, args, &output, &errorMessage)) {
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
return QModelIndex();
|
||||
}
|
||||
|
||||
|
@@ -34,7 +34,7 @@
|
||||
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
#include <coreplugin/progressmanager/futureprogress.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <utils/synchronousprocess.h>
|
||||
|
||||
#include <QStringList>
|
||||
@@ -59,6 +59,8 @@
|
||||
|
||||
enum { debug = 0 };
|
||||
|
||||
using namespace VcsBase;
|
||||
|
||||
namespace Gerrit {
|
||||
namespace Internal {
|
||||
|
||||
@@ -314,7 +316,7 @@ void QueryContext::startQuery(const QString &query)
|
||||
{
|
||||
QStringList arguments = m_baseArguments;
|
||||
arguments.push_back(query);
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendCommand(
|
||||
VcsBase::VcsOutputWindow::appendCommand(
|
||||
m_process.workingDirectory(), Utils::FileName::fromString(m_binary), arguments);
|
||||
m_timer.start();
|
||||
m_process.start(m_binary, arguments);
|
||||
@@ -325,7 +327,7 @@ void QueryContext::errorTermination(const QString &msg)
|
||||
{
|
||||
m_progress.reportCanceled();
|
||||
m_progress.reportFinished();
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(msg);
|
||||
VcsBase::VcsOutputWindow::appendError(msg);
|
||||
emit finished();
|
||||
}
|
||||
|
||||
@@ -335,7 +337,7 @@ void QueryContext::processError(QProcess::ProcessError e)
|
||||
if (e == QProcess::FailedToStart)
|
||||
errorTermination(msg);
|
||||
else
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(msg);
|
||||
VcsBase::VcsOutputWindow::appendError(msg);
|
||||
}
|
||||
|
||||
void QueryContext::processFinished(int exitCode, QProcess::ExitStatus es)
|
||||
@@ -363,7 +365,7 @@ void QueryContext::processFinished(int exitCode, QProcess::ExitStatus es)
|
||||
|
||||
void QueryContext::readyReadStandardError()
|
||||
{
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(QString::fromLocal8Bit(m_process.readAllStandardError()));
|
||||
VcsBase::VcsOutputWindow::appendError(QString::fromLocal8Bit(m_process.readAllStandardError()));
|
||||
}
|
||||
|
||||
void QueryContext::readyReadStandardOutput()
|
||||
@@ -601,7 +603,7 @@ static bool parseOutput(const QSharedPointer<GerritParameters> ¶meters,
|
||||
.arg(QString::fromLocal8Bit(line))
|
||||
.arg(error.errorString());
|
||||
qWarning() << errorMessage;
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsBase::VcsOutputWindow::appendError(errorMessage);
|
||||
res = false;
|
||||
continue;
|
||||
}
|
||||
@@ -649,8 +651,7 @@ static bool parseOutput(const QSharedPointer<GerritParameters> ¶meters,
|
||||
result.push_back(change);
|
||||
} else {
|
||||
qWarning("%s: Parse error: '%s'.", Q_FUNC_INFO, line.constData());
|
||||
VcsBase::VcsBaseOutputWindow::instance()
|
||||
->appendError(GerritModel::tr("Parse error: \"%1\"")
|
||||
VcsOutputWindow::appendError(GerritModel::tr("Parse error: \"%1\"")
|
||||
.arg(QString::fromLocal8Bit(line)));
|
||||
res = false;
|
||||
}
|
||||
@@ -747,7 +748,7 @@ static bool parseOutput(const QSharedPointer<GerritParameters> ¶meters,
|
||||
QString errorMessage = GerritModel::tr("Parse error: \"%1\"")
|
||||
.arg(QString::fromLocal8Bit(line));
|
||||
qWarning() << errorMessage;
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsBase::VcsOutputWindow::appendError(errorMessage);
|
||||
res = false;
|
||||
continue;
|
||||
}
|
||||
@@ -817,7 +818,7 @@ static bool parseOutput(const QSharedPointer<GerritParameters> ¶meters,
|
||||
} else {
|
||||
QString errorMessage = GerritModel::tr("Parse error in line \"%1\"")
|
||||
.arg(QString::fromLocal8Bit(line));
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsBase::VcsOutputWindow::appendError(errorMessage);
|
||||
qWarning("%s: Parse error in line '%s'.", Q_FUNC_INFO, line.constData());
|
||||
res = false;
|
||||
}
|
||||
|
@@ -53,7 +53,7 @@
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/locator/commandlocator.h>
|
||||
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
|
||||
#include <utils/synchronousprocess.h>
|
||||
|
||||
@@ -178,7 +178,7 @@ void FetchContext::start()
|
||||
m_progress.reportStarted();
|
||||
// Order: initialize future before starting the process in case error handling is invoked.
|
||||
const QStringList args = m_change->gitFetchArguments(m_parameters);
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendCommand(m_repository, m_git, args);
|
||||
VcsBase::VcsOutputWindow::appendCommand(m_repository, m_git, args);
|
||||
m_process.start(m_git.toString(), args);
|
||||
m_process.closeWriteChannel();
|
||||
}
|
||||
@@ -213,21 +213,21 @@ void FetchContext::processReadyReadStandardError()
|
||||
// Note: fetch displays progress on stderr.
|
||||
const QString errorOutput = QString::fromLocal8Bit(m_process.readAllStandardError());
|
||||
if (m_state == FetchState)
|
||||
VcsBase::VcsBaseOutputWindow::instance()->append(errorOutput);
|
||||
VcsBase::VcsOutputWindow::append(errorOutput);
|
||||
else
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorOutput);
|
||||
VcsBase::VcsOutputWindow::appendError(errorOutput);
|
||||
}
|
||||
|
||||
void FetchContext::processReadyReadStandardOutput()
|
||||
{
|
||||
const QByteArray output = m_process.readAllStandardOutput();
|
||||
VcsBase::VcsBaseOutputWindow::instance()->append(QString::fromLocal8Bit(output));
|
||||
VcsBase::VcsOutputWindow::append(QString::fromLocal8Bit(output));
|
||||
}
|
||||
|
||||
void FetchContext::handleError(const QString &e)
|
||||
{
|
||||
m_state = ErrorState;
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(e);
|
||||
VcsBase::VcsOutputWindow::appendError(e);
|
||||
m_progress.reportCanceled();
|
||||
m_progress.reportFinished();
|
||||
deleteLater();
|
||||
@@ -239,7 +239,7 @@ void FetchContext::processError(QProcess::ProcessError e)
|
||||
if (e == QProcess::FailedToStart)
|
||||
handleError(msg);
|
||||
else
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(msg);
|
||||
VcsBase::VcsOutputWindow::appendError(msg);
|
||||
}
|
||||
|
||||
void FetchContext::show()
|
||||
@@ -252,7 +252,7 @@ void FetchContext::show()
|
||||
void FetchContext::cherryPick()
|
||||
{
|
||||
// Point user to errors.
|
||||
VcsBase::VcsBaseOutputWindow::instance()->popup(IOutputPane::ModeSwitch
|
||||
VcsBase::VcsOutputWindow::instance()->popup(IOutputPane::ModeSwitch
|
||||
| IOutputPane::WithFocus);
|
||||
gitClient()->synchronousCherryPick(m_repository, QLatin1String("FETCH_HEAD"));
|
||||
}
|
||||
@@ -394,7 +394,7 @@ Utils::FileName GerritPlugin::gitBinary()
|
||||
bool ok;
|
||||
const Utils::FileName git = gitClient()->gitExecutable(&ok);
|
||||
if (!ok) {
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(tr("Git is not available."));
|
||||
VcsBase::VcsOutputWindow::appendError(tr("Git is not available."));
|
||||
return Utils::FileName();
|
||||
}
|
||||
return git;
|
||||
|
@@ -56,7 +56,7 @@
|
||||
#include <vcsbase/command.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/vcsbaseeditorparameterwidget.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <vcsbase/vcsbaseplugin.h>
|
||||
|
||||
#include <diffeditor/diffeditorconstants.h>
|
||||
@@ -87,6 +87,7 @@ static const char noColorOption[] = "--no-color";
|
||||
static const char decorateOption[] = "--decorate";
|
||||
|
||||
using namespace Core;
|
||||
using namespace VcsBase;
|
||||
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
@@ -682,11 +683,6 @@ static inline QStringList commandOutputLinesFromLocal8Bit(const QByteArray &a)
|
||||
return output.split(newLine);
|
||||
}
|
||||
|
||||
static inline VcsBase::VcsBaseOutputWindow *outputWindow()
|
||||
{
|
||||
return VcsBase::VcsBaseOutputWindow::instance();
|
||||
}
|
||||
|
||||
static inline QString msgRepositoryNotFound(const QString &dir)
|
||||
{
|
||||
return GitClient::tr("Cannot determine the repository for \"%1\".").arg(dir);
|
||||
@@ -720,7 +716,7 @@ static inline void msgCannotRun(const QString &message, QString *errorMessage)
|
||||
if (errorMessage)
|
||||
*errorMessage = message;
|
||||
else
|
||||
outputWindow()->appendError(message);
|
||||
VcsOutputWindow::appendError(message);
|
||||
}
|
||||
|
||||
static inline void msgCannotRun(const QStringList &args, const QString &workingDirectory,
|
||||
@@ -908,8 +904,6 @@ void GitClient::slotUnstageChunk()
|
||||
|
||||
void GitClient::stage(const QString &patch, bool revert)
|
||||
{
|
||||
VcsBase::VcsBaseOutputWindow *outwin =
|
||||
VcsBase::VcsBaseOutputWindow::instance();
|
||||
QTemporaryFile patchFile;
|
||||
if (!patchFile.open())
|
||||
return;
|
||||
@@ -929,15 +923,15 @@ void GitClient::stage(const QString &patch, bool revert)
|
||||
&errorMessage, args)) {
|
||||
if (errorMessage.isEmpty()) {
|
||||
if (revert)
|
||||
outwin->append(tr("Chunk successfully unstaged"));
|
||||
VcsOutputWindow::append(tr("Chunk successfully unstaged"));
|
||||
else
|
||||
outwin->append(tr("Chunk successfully staged"));
|
||||
VcsOutputWindow::append(tr("Chunk successfully staged"));
|
||||
} else {
|
||||
outwin->append(errorMessage);
|
||||
VcsOutputWindow::append(errorMessage);
|
||||
}
|
||||
m_contextController->requestReload();
|
||||
} else {
|
||||
outwin->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1090,10 +1084,9 @@ void GitClient::status(const QString &workingDirectory)
|
||||
{
|
||||
QStringList statusArgs = statusArguments();
|
||||
statusArgs << QLatin1String("-u");
|
||||
VcsBase::VcsBaseOutputWindow *outwin = outputWindow();
|
||||
outwin->setRepository(workingDirectory);
|
||||
VcsOutputWindow::setRepository(workingDirectory);
|
||||
VcsBase::Command *command = executeGit(workingDirectory, statusArgs, 0, true);
|
||||
connect(command, SIGNAL(finished(bool,int,QVariant)), outwin, SLOT(clearRepository()),
|
||||
connect(command, SIGNAL(finished(bool,int,QVariant)), VcsOutputWindow::instance(), SLOT(clearRepository()),
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
@@ -1174,7 +1167,7 @@ static inline QString msgCannotShow(const QString &sha)
|
||||
void GitClient::show(const QString &source, const QString &id, const QString &name)
|
||||
{
|
||||
if (!canShow(id)) {
|
||||
outputWindow()->appendError(msgCannotShow(id));
|
||||
VcsOutputWindow::appendError(msgCannotShow(id));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1272,7 +1265,7 @@ bool GitClient::synchronousCheckout(const QString &workingDirectory,
|
||||
QStringList arguments = setupCheckoutArguments(workingDirectory, ref);
|
||||
const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText,
|
||||
VcsBasePlugin::ExpectRepoChanges);
|
||||
outputWindow()->append(commandOutputFromLocal8Bit(outputText));
|
||||
VcsOutputWindow::append(commandOutputFromLocal8Bit(outputText));
|
||||
if (!rc) {
|
||||
msgCannotRun(arguments, workingDirectory, errorText, errorMessage);
|
||||
return false;
|
||||
@@ -1453,7 +1446,7 @@ bool GitClient::synchronousReset(const QString &workingDirectory,
|
||||
arguments << QLatin1String(HEAD) << QLatin1String("--") << files;
|
||||
const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText);
|
||||
const QString output = commandOutputFromLocal8Bit(outputText);
|
||||
outputWindow()->append(output);
|
||||
VcsOutputWindow::append(output);
|
||||
// Note that git exits with 1 even if the operation is successful
|
||||
// Assume real failure if the output does not contain "foo.cpp modified"
|
||||
// or "Unstaged changes after reset" (git 1.7.0).
|
||||
@@ -1480,9 +1473,9 @@ bool GitClient::synchronousInit(const QString &workingDirectory)
|
||||
const QStringList arguments(QLatin1String("init"));
|
||||
const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText);
|
||||
// '[Re]Initialized...'
|
||||
outputWindow()->append(commandOutputFromLocal8Bit(outputText));
|
||||
VcsOutputWindow::append(commandOutputFromLocal8Bit(outputText));
|
||||
if (!rc) {
|
||||
outputWindow()->appendError(commandOutputFromLocal8Bit(errorText));
|
||||
VcsOutputWindow::appendError(commandOutputFromLocal8Bit(errorText));
|
||||
} else {
|
||||
// TODO: Turn this into a VcsBaseClient and use resetCachedVcsInfo(...)
|
||||
VcsManager::resetVersionControlForDirectory(workingDirectory);
|
||||
@@ -1849,8 +1842,7 @@ QString GitClient::synchronousShortDescription(const QString &workingDirectory,
|
||||
<< QLatin1String("--max-count=1") << revision;
|
||||
const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputTextData, &errorText);
|
||||
if (!rc) {
|
||||
VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance();
|
||||
outputWindow->appendSilently(tr("Cannot describe revision \"%1\" in \"%2\": %3")
|
||||
VcsOutputWindow::appendSilently(tr("Cannot describe revision \"%1\" in \"%2\": %3")
|
||||
.arg(revision, workingDirectory, commandOutputFromLocal8Bit(errorText)));
|
||||
return revision;
|
||||
}
|
||||
@@ -1910,10 +1902,10 @@ QString GitClient::synchronousStash(const QString &workingDirectory, const QStri
|
||||
if (unchanged)
|
||||
*unchanged = true;
|
||||
if (!(flags & StashIgnoreUnchanged))
|
||||
outputWindow()->appendWarning(msgNoChangedFiles());
|
||||
VcsOutputWindow::appendWarning(msgNoChangedFiles());
|
||||
break;
|
||||
case StatusFailed:
|
||||
outputWindow()->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
break;
|
||||
}
|
||||
if (!success)
|
||||
@@ -2234,7 +2226,7 @@ VcsBase::Command *GitClient::executeGit(const QString &workingDirectory,
|
||||
unsigned additionalFlags,
|
||||
int editorLineNumber)
|
||||
{
|
||||
outputWindow()->appendCommand(workingDirectory,
|
||||
VcsOutputWindow::appendCommand(workingDirectory,
|
||||
Utils::FileName::fromUserInput(settings()->stringValue(GitSettings::binaryPathKey)),
|
||||
arguments);
|
||||
VcsBase::Command *command = createCommand(workingDirectory, editor, useOutputToWindow, editorLineNumber);
|
||||
@@ -2603,7 +2595,7 @@ void GitClient::launchGitK(const QString &workingDirectory, const QString &fileN
|
||||
return;
|
||||
|
||||
QString gitkPath = foundBinDir.path() + QLatin1String("/gitk");
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendSilently(msgCannotLaunch(gitkPath));
|
||||
VcsOutputWindow::appendSilently(msgCannotLaunch(gitkPath));
|
||||
|
||||
if (foundBinDirIsCmdDir) {
|
||||
foundBinDir.cdUp();
|
||||
@@ -2612,7 +2604,7 @@ void GitClient::launchGitK(const QString &workingDirectory, const QString &fileN
|
||||
return;
|
||||
}
|
||||
gitkPath = foundBinDir.path() + QLatin1String("/gitk");
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendSilently(msgCannotLaunch(gitkPath));
|
||||
VcsOutputWindow::appendSilently(msgCannotLaunch(gitkPath));
|
||||
}
|
||||
|
||||
Utils::Environment sysEnv = Utils::Environment::systemEnvironment();
|
||||
@@ -2623,7 +2615,7 @@ void GitClient::launchGitK(const QString &workingDirectory, const QString &fileN
|
||||
return;
|
||||
}
|
||||
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(msgCannotLaunch(QLatin1String("gitk")));
|
||||
VcsOutputWindow::appendError(msgCannotLaunch(QLatin1String("gitk")));
|
||||
}
|
||||
|
||||
void GitClient::launchRepositoryBrowser(const QString &workingDirectory)
|
||||
@@ -2648,13 +2640,12 @@ bool GitClient::tryLauchingGitK(const QProcessEnvironment &env,
|
||||
binary = wish;
|
||||
}
|
||||
}
|
||||
VcsBase::VcsBaseOutputWindow *outwin = VcsBase::VcsBaseOutputWindow::instance();
|
||||
const QString gitkOpts = settings()->stringValue(GitSettings::gitkOptionsKey);
|
||||
if (!gitkOpts.isEmpty())
|
||||
arguments.append(Utils::QtcProcess::splitArgs(gitkOpts, Utils::HostOsInfo::hostOs()));
|
||||
if (!fileName.isEmpty())
|
||||
arguments << QLatin1String("--") << fileName;
|
||||
outwin->appendCommand(workingDirectory, Utils::FileName::fromString(binary), arguments);
|
||||
VcsOutputWindow::appendCommand(workingDirectory, Utils::FileName::fromString(binary), arguments);
|
||||
// This should always use QProcess::startDetached (as not to kill
|
||||
// the child), but that does not have an environment parameter.
|
||||
bool success = false;
|
||||
@@ -2684,7 +2675,7 @@ bool GitClient::launchGitGui(const QString &workingDirectory) {
|
||||
}
|
||||
|
||||
if (!success)
|
||||
outputWindow()->appendError(msgCannotLaunch(QLatin1String("git gui")));
|
||||
VcsOutputWindow::appendError(msgCannotLaunch(QLatin1String("git gui")));
|
||||
|
||||
return success;
|
||||
}
|
||||
@@ -2991,10 +2982,10 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
|
||||
const bool rc = fullySynchronousGit(repositoryDirectory, args, &outputText, &errorText);
|
||||
const QString stdErr = commandOutputFromLocal8Bit(errorText);
|
||||
if (rc) {
|
||||
outputWindow()->appendMessage(msgCommitted(amendSHA1, commitCount));
|
||||
outputWindow()->appendError(stdErr);
|
||||
VcsOutputWindow::appendMessage(msgCommitted(amendSHA1, commitCount));
|
||||
VcsOutputWindow::appendError(stdErr);
|
||||
} else {
|
||||
outputWindow()->appendError(tr("Cannot commit %n file(s): %1\n", 0, commitCount).arg(stdErr));
|
||||
VcsOutputWindow::appendError(tr("Cannot commit %n file(s): %1\n", 0, commitCount).arg(stdErr));
|
||||
}
|
||||
|
||||
return rc;
|
||||
@@ -3100,11 +3091,11 @@ void GitClient::revert(const QStringList &files, bool revertStaging)
|
||||
break;
|
||||
case RevertUnchanged: {
|
||||
const QString msg = (isDirectory || files.size() > 1) ? msgNoChangedFiles() : tr("The file is not modified.");
|
||||
outputWindow()->appendWarning(msg);
|
||||
VcsOutputWindow::appendWarning(msg);
|
||||
}
|
||||
break;
|
||||
case RevertFailed:
|
||||
outputWindow()->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3165,16 +3156,15 @@ void GitClient::synchronousAbortCommand(const QString &workingDir, const QString
|
||||
QStringList(), QString(), 0, false);
|
||||
return;
|
||||
}
|
||||
VcsBase::VcsBaseOutputWindow *outwin = VcsBase::VcsBaseOutputWindow::instance();
|
||||
QStringList arguments;
|
||||
arguments << abortCommand << QLatin1String("--abort");
|
||||
QByteArray stdOut;
|
||||
QByteArray stdErr;
|
||||
const bool rc = fullySynchronousGit(workingDir, arguments, &stdOut, &stdErr,
|
||||
VcsBasePlugin::ExpectRepoChanges);
|
||||
outwin->append(commandOutputFromLocal8Bit(stdOut));
|
||||
VcsOutputWindow::append(commandOutputFromLocal8Bit(stdOut));
|
||||
if (!rc)
|
||||
outwin->appendError(commandOutputFromLocal8Bit(stdErr));
|
||||
VcsOutputWindow::appendError(commandOutputFromLocal8Bit(stdErr));
|
||||
}
|
||||
|
||||
QString GitClient::synchronousTrackingBranch(const QString &workingDirectory, const QString &branch)
|
||||
@@ -3309,7 +3299,7 @@ bool GitClient::canRebase(const QString &workingDirectory) const
|
||||
const QString gitDir = findGitDirForRepository(workingDirectory);
|
||||
if (QFileInfo(gitDir + QLatin1String("/rebase-apply")).exists()
|
||||
|| QFileInfo(gitDir + QLatin1String("/rebase-merge")).exists()) {
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(
|
||||
VcsOutputWindow::appendError(
|
||||
tr("Rebase, merge or am is in progress. Finish "
|
||||
"or abort it and then try again."));
|
||||
return false;
|
||||
@@ -3340,7 +3330,7 @@ void GitClient::asyncCommand(const QString &workingDirectory, const QStringList
|
||||
// Git might request an editor, so this must be done asynchronously
|
||||
// and without timeout
|
||||
QString gitCommand = arguments.first();
|
||||
outputWindow()->appendCommand(workingDirectory, settings()->binaryPath(), arguments);
|
||||
VcsOutputWindow::appendCommand(workingDirectory, settings()->binaryPath(), arguments);
|
||||
VcsBase::Command *command = createCommand(workingDirectory, 0, true);
|
||||
new ConflictHandler(command, workingDirectory, gitCommand);
|
||||
if (hasProgress)
|
||||
@@ -3386,7 +3376,7 @@ void GitClient::interactiveRebase(const QString &workingDirectory, const QString
|
||||
if (fixup)
|
||||
arguments << QLatin1String("--autosquash");
|
||||
arguments << commit + QLatin1Char('^');
|
||||
outputWindow()->appendCommand(workingDirectory, settings()->binaryPath(), arguments);
|
||||
VcsOutputWindow::appendCommand(workingDirectory, settings()->binaryPath(), arguments);
|
||||
if (fixup)
|
||||
m_disableEditor = true;
|
||||
asyncCommand(workingDirectory, arguments, true);
|
||||
@@ -3448,7 +3438,7 @@ bool GitClient::synchronousStashRemove(const QString &workingDirectory,
|
||||
if (rc) {
|
||||
const QString output = commandOutputFromLocal8Bit(outputText);
|
||||
if (!output.isEmpty())
|
||||
outputWindow()->append(output);
|
||||
VcsOutputWindow::append(output);
|
||||
} else {
|
||||
msgCannotRun(arguments, workingDirectory, errorText, errorMessage);
|
||||
}
|
||||
@@ -3646,7 +3636,7 @@ bool GitClient::StashInfo::init(const QString &workingDirectory, const QString &
|
||||
}
|
||||
|
||||
if (m_stashResult == StashFailed)
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
return !stashingFailed();
|
||||
}
|
||||
|
||||
|
@@ -39,7 +39,7 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <texteditor/basetextdocument.h>
|
||||
|
||||
#include <QFileInfo>
|
||||
@@ -55,6 +55,8 @@
|
||||
|
||||
#define CHANGE_PATTERN "[a-f0-9]{7,40}"
|
||||
|
||||
using namespace VcsBase;
|
||||
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
@@ -255,7 +257,6 @@ void GitEditorWidget::unstageDiffChunk()
|
||||
|
||||
void GitEditorWidget::applyDiffChunk(const VcsBase::DiffChunk& chunk, bool revert)
|
||||
{
|
||||
VcsBase::VcsBaseOutputWindow *outwin = VcsBase::VcsBaseOutputWindow::instance();
|
||||
QTemporaryFile patchFile;
|
||||
if (!patchFile.open())
|
||||
return;
|
||||
@@ -272,15 +273,15 @@ void GitEditorWidget::applyDiffChunk(const VcsBase::DiffChunk& chunk, bool rever
|
||||
QString errorMessage;
|
||||
if (client->synchronousApplyPatch(baseDir, patchFile.fileName(), &errorMessage, args)) {
|
||||
if (errorMessage.isEmpty())
|
||||
outwin->append(tr("Chunk successfully staged"));
|
||||
VcsOutputWindow::append(tr("Chunk successfully staged"));
|
||||
else
|
||||
outwin->append(errorMessage);
|
||||
VcsOutputWindow::append(errorMessage);
|
||||
if (revert)
|
||||
emit diffChunkReverted(chunk);
|
||||
else
|
||||
emit diffChunkApplied(chunk);
|
||||
} else {
|
||||
outwin->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,7 +341,7 @@ QStringList GitEditorWidget::annotationPreviousVersions(const QString &revision)
|
||||
// Get the SHA1's of the file.
|
||||
if (!client->synchronousParentRevisions(workingDirectory, QStringList(fi.fileName()),
|
||||
revision, &revisions, &errorMessage)) {
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendSilently(errorMessage);
|
||||
VcsOutputWindow::appendSilently(errorMessage);
|
||||
return QStringList();
|
||||
}
|
||||
return revisions;
|
||||
|
@@ -70,7 +70,7 @@
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/vcsbaseconstants.h>
|
||||
#include <vcsbase/basevcssubmiteditorfactory.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <vcsbase/cleandialog.h>
|
||||
#include <coreplugin/locator/commandlocator.h>
|
||||
|
||||
@@ -950,7 +950,7 @@ void GitPlugin::startCommit(CommitType commitType)
|
||||
if (raiseSubmitEditor())
|
||||
return;
|
||||
if (isCommitEditorOpen()) {
|
||||
VcsBaseOutputWindow::instance()->appendWarning(tr("Another submit is currently being executed."));
|
||||
VcsOutputWindow::appendWarning(tr("Another submit is currently being executed."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -960,7 +960,7 @@ void GitPlugin::startCommit(CommitType commitType)
|
||||
QString errorMessage, commitTemplate;
|
||||
CommitData data(commitType);
|
||||
if (!m_gitClient->getCommitData(state.topLevel(), &commitTemplate, data, &errorMessage)) {
|
||||
VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -974,7 +974,7 @@ void GitPlugin::startCommit(CommitType commitType)
|
||||
saver.setAutoRemove(false);
|
||||
saver.write(commitTemplate.toLocal8Bit());
|
||||
if (!saver.finalize()) {
|
||||
VcsBaseOutputWindow::instance()->appendError(saver.errorString());
|
||||
VcsOutputWindow::appendError(saver.errorString());
|
||||
return;
|
||||
}
|
||||
m_commitMessageFileName = saver.fileName();
|
||||
@@ -1261,15 +1261,14 @@ void GitPlugin::applyPatch(const QString &workingDirectory, QString file)
|
||||
}
|
||||
}
|
||||
// Run!
|
||||
VcsBaseOutputWindow *outwin = VcsBaseOutputWindow::instance();
|
||||
QString errorMessage;
|
||||
if (m_gitClient->synchronousApplyPatch(workingDirectory, file, &errorMessage)) {
|
||||
if (errorMessage.isEmpty())
|
||||
outwin->appendMessage(tr("Patch %1 successfully applied to %2").arg(file, workingDirectory));
|
||||
VcsOutputWindow::appendMessage(tr("Patch %1 successfully applied to %2").arg(file, workingDirectory));
|
||||
else
|
||||
outwin->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
} else {
|
||||
outwin->appendError(errorMessage);
|
||||
VcsOutputWindow::appendError(errorMessage);
|
||||
}
|
||||
m_gitClient->endStashScope(workingDirectory);
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <vcsbase/submitfilemodel.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
@@ -46,6 +46,8 @@
|
||||
|
||||
static const char TASK_UPDATE_COMMIT[] = "Git.UpdateCommit";
|
||||
|
||||
using namespace VcsBase;
|
||||
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
@@ -251,7 +253,7 @@ void GitSubmitEditor::commitDataRetrieved(bool success)
|
||||
w->setEnabled(true);
|
||||
} else {
|
||||
// Nothing to commit left!
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(m_commitDataFetcher->errorMessage());
|
||||
VcsOutputWindow::appendError(m_commitDataFetcher->errorMessage());
|
||||
m_model->clear();
|
||||
w->setEnabled(false);
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#include "gitplugin.h"
|
||||
#include "gitclient.h"
|
||||
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <vcsbase/vcsbaseplugin.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -82,7 +82,7 @@ bool LogChangeWidget::init(const QString &repository, const QString &commit, Log
|
||||
if (m_model->rowCount() > 0)
|
||||
return true;
|
||||
if (!(flags & Silent)) {
|
||||
VcsBaseOutputWindow::instance()->appendError(
|
||||
VcsOutputWindow::appendError(
|
||||
GitPlugin::instance()->gitClient()->msgNoCommits(flags & IncludeRemotes));
|
||||
}
|
||||
return false;
|
||||
|
@@ -34,12 +34,14 @@
|
||||
|
||||
#include <coreplugin/documentmanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QProcess>
|
||||
#include <QPushButton>
|
||||
|
||||
using namespace VcsBase;
|
||||
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
@@ -47,8 +49,7 @@ class MergeToolProcess : public QProcess
|
||||
{
|
||||
public:
|
||||
MergeToolProcess(QObject *parent = 0) :
|
||||
QProcess(parent),
|
||||
m_window(VcsBase::VcsBaseOutputWindow::instance())
|
||||
QProcess(parent)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -57,19 +58,16 @@ protected:
|
||||
{
|
||||
qint64 res = QProcess::readData(data, maxlen);
|
||||
if (res > 0)
|
||||
m_window->append(QString::fromLocal8Bit(data, res));
|
||||
VcsOutputWindow::append(QString::fromLocal8Bit(data, res));
|
||||
return res;
|
||||
}
|
||||
|
||||
qint64 writeData(const char *data, qint64 len)
|
||||
{
|
||||
if (len > 0)
|
||||
m_window->append(QString::fromLocal8Bit(data, len));
|
||||
VcsOutputWindow::append(QString::fromLocal8Bit(data, len));
|
||||
return QProcess::writeData(data, len);
|
||||
}
|
||||
|
||||
private:
|
||||
VcsBase::VcsBaseOutputWindow *m_window;
|
||||
};
|
||||
|
||||
MergeTool::MergeTool(QObject *parent) :
|
||||
@@ -103,7 +101,7 @@ bool MergeTool::start(const QString &workingDirectory, const QStringList &files)
|
||||
m_process = new MergeToolProcess(this);
|
||||
m_process->setWorkingDirectory(workingDirectory);
|
||||
const Utils::FileName binary = m_gitClient->gitExecutable();
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendCommand(workingDirectory, binary, arguments);
|
||||
VcsOutputWindow::appendCommand(workingDirectory, binary, arguments);
|
||||
m_process->start(binary.toString(), arguments);
|
||||
if (m_process->waitForStarted()) {
|
||||
connect(m_process, SIGNAL(finished(int)), this, SLOT(done()));
|
||||
@@ -266,13 +264,12 @@ void MergeTool::readData()
|
||||
|
||||
void MergeTool::done()
|
||||
{
|
||||
VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance();
|
||||
const QString workingDirectory = m_process->workingDirectory();
|
||||
int exitCode = m_process->exitCode();
|
||||
if (!exitCode) {
|
||||
outputWindow->appendMessage(tr("Merge tool process finished successfully."));
|
||||
VcsOutputWindow::appendMessage(tr("Merge tool process finished successfully."));
|
||||
} else {
|
||||
outputWindow->appendError(tr("Merge tool process terminated with exit code %1")
|
||||
VcsOutputWindow::appendError(tr("Merge tool process terminated with exit code %1")
|
||||
.arg(exitCode));
|
||||
}
|
||||
m_gitClient->continueCommandIfNeeded(workingDirectory, exitCode == 0);
|
||||
|
@@ -37,7 +37,7 @@
|
||||
#include "ui_remoteadditiondialog.h"
|
||||
|
||||
#include <utils/headerviewstretcher.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
@@ -125,7 +125,7 @@ void RemoteDialog::refresh(const QString &repository, bool force)
|
||||
} else {
|
||||
QString errorMessage;
|
||||
if (!m_remoteModel->refresh(repository, &errorMessage))
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
|
||||
VcsBase::VcsOutputWindow::appendError(errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#include "constants.h"
|
||||
|
||||
#include <vcsbase/command.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <vcsbase/vcsbaseplugin.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/vcsbaseeditorparameterwidget.h>
|
||||
@@ -46,6 +46,8 @@
|
||||
#include <QTextStream>
|
||||
#include <QVariant>
|
||||
|
||||
using namespace VcsBase;
|
||||
|
||||
namespace Mercurial {
|
||||
namespace Internal {
|
||||
|
||||
@@ -111,7 +113,7 @@ bool MercurialClient::synchronousClone(const QString &workingDir,
|
||||
const QString hgrc = QLatin1String("[paths]\ndefault = ") + dstLocation + QLatin1Char('\n');
|
||||
saver.write(hgrc.toUtf8());
|
||||
if (!saver.finalize()) {
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(saver.errorString());
|
||||
VcsBase::VcsOutputWindow::appendError(saver.errorString());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -197,15 +199,14 @@ changeset: 0:031a48610fba
|
||||
user: ...
|
||||
\endcode */
|
||||
// Obtain first line and split by blank-delimited tokens
|
||||
VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance();
|
||||
const QStringList lines = output.split(QLatin1Char('\n'));
|
||||
if (lines.size() < 1) {
|
||||
outputWindow->appendSilently(msgParentRevisionFailed(workingDirectory, revision, msgParseParentsOutputFailed(output)));
|
||||
VcsOutputWindow::appendSilently(msgParentRevisionFailed(workingDirectory, revision, msgParseParentsOutputFailed(output)));
|
||||
return QStringList();
|
||||
}
|
||||
QStringList changeSets = lines.front().simplified().split(QLatin1Char(' '));
|
||||
if (changeSets.size() < 2) {
|
||||
outputWindow->appendSilently(msgParentRevisionFailed(workingDirectory, revision, msgParseParentsOutputFailed(output)));
|
||||
VcsOutputWindow::appendSilently(msgParentRevisionFailed(workingDirectory, revision, msgParseParentsOutputFailed(output)));
|
||||
return QStringList();
|
||||
}
|
||||
// Remove revision numbers
|
||||
|
@@ -58,7 +58,7 @@
|
||||
#include <vcsbase/basevcssubmiteditorfactory.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/vcsbaseconstants.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
|
||||
#include <QtPlugin>
|
||||
#include <QAction>
|
||||
@@ -558,13 +558,12 @@ void MercurialPlugin::commit()
|
||||
|
||||
void MercurialPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &status)
|
||||
{
|
||||
VcsBaseOutputWindow *outputWindow = VcsBaseOutputWindow::instance();
|
||||
//Once we receive our data release the connection so it can be reused elsewhere
|
||||
disconnect(m_client, SIGNAL(parsedStatus(QList<VcsBase::VcsBaseClient::StatusItem>)),
|
||||
this, SLOT(showCommitWidget(QList<VcsBase::VcsBaseClient::StatusItem>)));
|
||||
|
||||
if (status.isEmpty()) {
|
||||
outputWindow->appendError(tr("There are no changes to commit."));
|
||||
VcsOutputWindow::appendError(tr("There are no changes to commit."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -573,14 +572,14 @@ void MercurialPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &s
|
||||
// Keep the file alive, else it removes self and forgets its name
|
||||
saver.setAutoRemove(false);
|
||||
if (!saver.finalize()) {
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(saver.errorString());
|
||||
VcsBase::VcsOutputWindow::appendError(saver.errorString());
|
||||
return;
|
||||
}
|
||||
|
||||
Core::IEditor *editor = Core::EditorManager::openEditor(saver.fileName(),
|
||||
Constants::COMMIT_ID);
|
||||
if (!editor) {
|
||||
outputWindow->appendError(tr("Unable to create an editor for the commit."));
|
||||
VcsOutputWindow::appendError(tr("Unable to create an editor for the commit."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -56,7 +56,7 @@
|
||||
#include <vcsbase/basevcseditorfactory.h>
|
||||
#include <vcsbase/basevcssubmiteditorfactory.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <vcsbase/vcsbaseeditorparameterwidget.h>
|
||||
|
||||
#include <QAction>
|
||||
@@ -584,7 +584,6 @@ void PerforcePlugin::printOpenedFileList()
|
||||
return;
|
||||
// reformat "//depot/file.cpp#1 - description" into "file.cpp # - description"
|
||||
// for context menu opening to work. This produces absolute paths, then.
|
||||
VcsBaseOutputWindow *outWin = VcsBaseOutputWindow::instance();
|
||||
QString errorMessage;
|
||||
QString mapped;
|
||||
const QChar delimiter = QLatin1Char('#');
|
||||
@@ -594,11 +593,11 @@ void PerforcePlugin::printOpenedFileList()
|
||||
if (delimiterPos > 0)
|
||||
mapped = fileNameFromPerforceName(line.left(delimiterPos), true, &errorMessage);
|
||||
if (mapped.isEmpty())
|
||||
outWin->appendSilently(line);
|
||||
VcsOutputWindow::appendSilently(line);
|
||||
else
|
||||
outWin->appendSilently(mapped + QLatin1Char(' ') + line.mid(delimiterPos));
|
||||
VcsOutputWindow::appendSilently(mapped + QLatin1Char(' ') + line.mid(delimiterPos));
|
||||
}
|
||||
outWin->popup(IOutputPane::ModeSwitch | IOutputPane::WithFocus);
|
||||
VcsOutputWindow::instance()->popup(IOutputPane::ModeSwitch | IOutputPane::WithFocus);
|
||||
}
|
||||
|
||||
void PerforcePlugin::startSubmitProject()
|
||||
@@ -608,7 +607,7 @@ void PerforcePlugin::startSubmitProject()
|
||||
return;
|
||||
|
||||
if (isCommitEditorOpen()) {
|
||||
VcsBaseOutputWindow::instance()->appendWarning(tr("Another submit is currently executed."));
|
||||
VcsOutputWindow::appendWarning(tr("Another submit is currently executed."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -633,7 +632,7 @@ void PerforcePlugin::startSubmitProject()
|
||||
saver.setAutoRemove(false);
|
||||
saver.write(result.stdOut.toLatin1());
|
||||
if (!saver.finalize()) {
|
||||
VcsBaseOutputWindow::instance()->appendError(saver.errorString());
|
||||
VcsOutputWindow::appendError(saver.errorString());
|
||||
cleanCommitMessageFile();
|
||||
return;
|
||||
}
|
||||
@@ -656,7 +655,7 @@ void PerforcePlugin::startSubmitProject()
|
||||
depotFileNames.append(line.mid(14));
|
||||
}
|
||||
if (depotFileNames.isEmpty()) {
|
||||
VcsBaseOutputWindow::instance()->appendWarning(tr("Project has no files"));
|
||||
VcsOutputWindow::appendWarning(tr("Project has no files"));
|
||||
cleanCommitMessageFile();
|
||||
return;
|
||||
}
|
||||
@@ -1007,7 +1006,7 @@ PerforceResponse PerforcePlugin::synchronousProcess(const QString &workingDir,
|
||||
{
|
||||
QTC_ASSERT(stdInput.isEmpty(), return PerforceResponse()); // Not supported here
|
||||
|
||||
VcsBaseOutputWindow *outputWindow = VcsBaseOutputWindow::instance();
|
||||
VcsOutputWindow *outputWindow = VcsOutputWindow::instance();
|
||||
// Run, connect stderr to the output window
|
||||
SynchronousProcess process;
|
||||
const int timeOut = (flags & LongTimeOut) ? settings().longTimeOutMS() : settings().timeOutMS();
|
||||
@@ -1129,11 +1128,10 @@ PerforceResponse PerforcePlugin::fullySynchronousProcess(const QString &workingD
|
||||
response.stdErr.remove(cr);
|
||||
response.stdOut.remove(cr);
|
||||
// Logging
|
||||
VcsBaseOutputWindow *outputWindow = VcsBaseOutputWindow::instance();
|
||||
if ((flags & StdErrToWindow) && !response.stdErr.isEmpty())
|
||||
outputWindow->appendError(response.stdErr);
|
||||
VcsOutputWindow::appendError(response.stdErr);
|
||||
if ((flags & StdOutToWindow) && !response.stdOut.isEmpty())
|
||||
outputWindow->append(response.stdOut, VcsBaseOutputWindow::None, flags & SilentStdOut);
|
||||
VcsOutputWindow::append(response.stdOut, VcsOutputWindow::None, flags & SilentStdOut);
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -1147,12 +1145,11 @@ PerforceResponse PerforcePlugin::runP4Cmd(const QString &workingDir,
|
||||
if (Perforce::Constants::debug)
|
||||
qDebug() << "PerforcePlugin::runP4Cmd [" << workingDir << ']' << args << extraArgs << stdInput << debugCodec(outputCodec);
|
||||
|
||||
VcsBaseOutputWindow *outputWindow = VcsBaseOutputWindow::instance();
|
||||
if (!settings().isValid()) {
|
||||
PerforceResponse invalidConfigResponse;
|
||||
invalidConfigResponse.error = true;
|
||||
invalidConfigResponse.message = tr("Perforce is not correctly configured.");
|
||||
outputWindow->appendError(invalidConfigResponse.message);
|
||||
VcsOutputWindow::appendError(invalidConfigResponse.message);
|
||||
return invalidConfigResponse;
|
||||
}
|
||||
QStringList actualArgs = settings().commonP4Arguments(workingDir);
|
||||
@@ -1169,7 +1166,7 @@ PerforceResponse PerforcePlugin::runP4Cmd(const QString &workingDir,
|
||||
actualArgs.append(args);
|
||||
|
||||
if (flags & CommandToWindow)
|
||||
outputWindow->appendCommand(workingDir, FileName::fromString(settings().p4BinaryPath()), actualArgs);
|
||||
VcsOutputWindow::appendCommand(workingDir, FileName::fromString(settings().p4BinaryPath()), actualArgs);
|
||||
|
||||
if (flags & ShowBusyCursor)
|
||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
@@ -1185,7 +1182,7 @@ PerforceResponse PerforcePlugin::runP4Cmd(const QString &workingDir,
|
||||
if (Perforce::Constants::debug)
|
||||
qDebug() << response.message;
|
||||
if (flags & ErrorToWindow)
|
||||
outputWindow->appendError(response.message);
|
||||
VcsOutputWindow::appendError(response.message);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
@@ -1382,7 +1379,7 @@ bool PerforcePlugin::submitEditorAboutToClose()
|
||||
// Pipe file into p4 submit -i
|
||||
FileReader reader;
|
||||
if (!reader.fetch(m_commitMessageFileName, QIODevice::Text)) {
|
||||
VcsBaseOutputWindow::instance()->appendError(reader.errorString());
|
||||
VcsOutputWindow::appendError(reader.errorString());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1392,10 +1389,10 @@ bool PerforcePlugin::submitEditorAboutToClose()
|
||||
LongTimeOut|RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow|ShowBusyCursor,
|
||||
QStringList(), reader.data());
|
||||
if (submitResponse.error) {
|
||||
VcsBaseOutputWindow::instance()->appendError(tr("p4 submit failed: %1").arg(submitResponse.message));
|
||||
VcsOutputWindow::appendError(tr("p4 submit failed: %1").arg(submitResponse.message));
|
||||
return false;
|
||||
}
|
||||
VcsBaseOutputWindow::instance()->append(submitResponse.stdOut);
|
||||
VcsOutputWindow::append(submitResponse.stdOut);
|
||||
if (submitResponse.stdOut.contains(QLatin1String("Out of date files must be resolved or reverted)")))
|
||||
QMessageBox::warning(perforceEditor->widget(), tr("Pending change"), tr("Could not submit the change, because your workspace was out of date. Created a pending submit instead."));
|
||||
|
||||
@@ -1521,14 +1518,14 @@ void PerforcePlugin::slotTopLevelFound(const QString &t)
|
||||
m_settings.setTopLevel(t);
|
||||
const QString msg = tr("Perforce repository: %1").
|
||||
arg(QDir::toNativeSeparators(t));
|
||||
VcsBaseOutputWindow::instance()->appendSilently(msg);
|
||||
VcsOutputWindow::appendSilently(msg);
|
||||
if (Perforce::Constants::debug)
|
||||
qDebug() << "P4: " << t;
|
||||
}
|
||||
|
||||
void PerforcePlugin::slotTopLevelFailed(const QString &errorMessage)
|
||||
{
|
||||
VcsBaseOutputWindow::instance()->appendSilently(tr("Perforce: Unable to determine the repository: %1").arg(errorMessage));
|
||||
VcsOutputWindow::appendSilently(tr("Perforce: Unable to determine the repository: %1").arg(errorMessage));
|
||||
if (Perforce::Constants::debug)
|
||||
qDebug() << errorMessage;
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/basevcssubmiteditorfactory.h>
|
||||
#include <vcsbase/vcsbaseconstants.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <vcsbase/vcsbaseeditorparameterwidget.h>
|
||||
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
@@ -680,7 +680,7 @@ void SubversionPlugin::startCommit(const QString &workingDir, const QStringList
|
||||
if (raiseSubmitEditor())
|
||||
return;
|
||||
if (isCommitEditorOpen()) {
|
||||
VcsBaseOutputWindow::instance()->appendWarning(tr("Another commit is currently being executed."));
|
||||
VcsOutputWindow::appendWarning(tr("Another commit is currently being executed."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -695,7 +695,7 @@ void SubversionPlugin::startCommit(const QString &workingDir, const QStringList
|
||||
// Get list of added/modified/deleted files
|
||||
const StatusList statusOutput = parseStatusOutput(response.stdOut);
|
||||
if (statusOutput.empty()) {
|
||||
VcsBaseOutputWindow::instance()->appendWarning(tr("There are no modified files."));
|
||||
VcsOutputWindow::appendWarning(tr("There are no modified files."));
|
||||
return;
|
||||
}
|
||||
m_commitRepository = workingDir;
|
||||
@@ -707,7 +707,7 @@ void SubversionPlugin::startCommit(const QString &workingDir, const QStringList
|
||||
// Create a submit
|
||||
saver.write(submitTemplate.toUtf8());
|
||||
if (!saver.finalize()) {
|
||||
VcsBaseOutputWindow::instance()->appendError(saver.errorString());
|
||||
VcsOutputWindow::appendError(saver.errorString());
|
||||
return;
|
||||
}
|
||||
m_commitMessageFileName = saver.fileName();
|
||||
@@ -783,11 +783,10 @@ void SubversionPlugin::svnStatus(const QString &workingDir, const QString &relat
|
||||
QStringList args(QLatin1String("status"));
|
||||
if (!relativePath.isEmpty())
|
||||
args.append(relativePath);
|
||||
VcsBaseOutputWindow *outwin = VcsBaseOutputWindow::instance();
|
||||
outwin->setRepository(workingDir);
|
||||
VcsOutputWindow::setRepository(workingDir);
|
||||
runSvn(workingDir, args, m_settings.timeOutMs(),
|
||||
ShowStdOutInLogWindow|ShowSuccessMessage);
|
||||
outwin->clearRepository();
|
||||
VcsOutputWindow::clearRepository();
|
||||
}
|
||||
|
||||
void SubversionPlugin::filelog(const QString &workingDir,
|
||||
|
@@ -29,7 +29,7 @@
|
||||
|
||||
#include "cleandialog.h"
|
||||
#include "ui_cleandialog.h"
|
||||
#include "vcsbaseoutputwindow.h"
|
||||
#include "vcsoutputwindow.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
@@ -262,7 +262,7 @@ bool CleanDialog::promptToDelete()
|
||||
// Remove in background
|
||||
Internal::CleanFilesTask *cleanTask = new Internal::CleanFilesTask(d->m_workingDirectory, selectedFiles);
|
||||
connect(cleanTask, SIGNAL(error(QString)),
|
||||
VcsBase::VcsBaseOutputWindow::instance(), SLOT(appendSilently(QString)),
|
||||
VcsOutputWindow::instance(), SLOT(appendSilently(QString)),
|
||||
Qt::QueuedConnection);
|
||||
|
||||
QFuture<void> task = QtConcurrent::run(cleanTask, &Internal::CleanFilesTask::run);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
#include <coreplugin/vcsmanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <utils/synchronousprocess.h>
|
||||
#include <utils/runextensions.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -100,7 +100,6 @@ public:
|
||||
QTextCodec *m_codec;
|
||||
const QString m_sshPasswordPrompt;
|
||||
ProgressParser *m_progressParser;
|
||||
VcsBase::VcsBaseOutputWindow *m_outputWindow;
|
||||
bool m_progressiveOutput;
|
||||
bool m_hadOutput;
|
||||
bool m_preventRepositoryChanged;
|
||||
@@ -124,7 +123,6 @@ CommandPrivate::CommandPrivate(const Utils::FileName &binary,
|
||||
m_codec(0),
|
||||
m_sshPasswordPrompt(VcsBasePlugin::sshPrompt()),
|
||||
m_progressParser(0),
|
||||
m_outputWindow(VcsBase::VcsBaseOutputWindow::instance()),
|
||||
m_progressiveOutput(false),
|
||||
m_hadOutput(false),
|
||||
m_preventRepositoryChanged(false),
|
||||
@@ -315,7 +313,7 @@ public:
|
||||
{
|
||||
// Users of this class can either be in the GUI thread or in other threads.
|
||||
// Use Qt::AutoConnection to always append in the GUI thread (directly or queued)
|
||||
VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance();
|
||||
VcsOutputWindow *outputWindow = VcsOutputWindow::instance();
|
||||
connect(this, SIGNAL(append(QString)), outputWindow, SLOT(append(QString)));
|
||||
connect(this, SIGNAL(appendSilently(QString)), outputWindow, SLOT(appendSilently(QString)));
|
||||
connect(this, SIGNAL(appendError(QString)), outputWindow, SLOT(appendError(QString)));
|
||||
@@ -561,7 +559,7 @@ void Command::bufferedOutput(const QString &text)
|
||||
if (d->m_progressParser)
|
||||
d->m_progressParser->parseProgress(text);
|
||||
if (d->m_flags & VcsBasePlugin::ShowStdOutInLogWindow)
|
||||
d->m_outputWindow->append(text);
|
||||
VcsOutputWindow::append(text);
|
||||
if (d->m_progressiveOutput) {
|
||||
emit output(text);
|
||||
d->m_hadOutput = true;
|
||||
@@ -571,7 +569,7 @@ void Command::bufferedOutput(const QString &text)
|
||||
void Command::bufferedError(const QString &text)
|
||||
{
|
||||
if (!(d->m_flags & VcsBasePlugin::SuppressStdErrInLogWindow))
|
||||
d->m_outputWindow->appendError(text);
|
||||
VcsOutputWindow::appendError(text);
|
||||
if (d->m_progressiveOutput)
|
||||
emit errorText(text);
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ HEADERS += vcsbase_global.h \
|
||||
basecheckoutwizard.h \
|
||||
checkoutprogresswizardpage.h \
|
||||
basecheckoutwizardpage.h \
|
||||
vcsbaseoutputwindow.h \
|
||||
vcsoutputwindow.h \
|
||||
cleandialog.h \
|
||||
vcsbaseoptionspage.h \
|
||||
command.h \
|
||||
@@ -50,7 +50,7 @@ SOURCES += vcsplugin.cpp \
|
||||
basecheckoutwizard.cpp \
|
||||
checkoutprogresswizardpage.cpp \
|
||||
basecheckoutwizardpage.cpp \
|
||||
vcsbaseoutputwindow.cpp \
|
||||
vcsoutputwindow.cpp \
|
||||
cleandialog.cpp \
|
||||
vcsbaseoptionspage.cpp \
|
||||
command.cpp \
|
||||
|
@@ -70,14 +70,14 @@ QtcPlugin {
|
||||
"vcsbaseeditorparameterwidget.h",
|
||||
"vcsbaseoptionspage.cpp",
|
||||
"vcsbaseoptionspage.h",
|
||||
"vcsbaseoutputwindow.cpp",
|
||||
"vcsbaseoutputwindow.h",
|
||||
"vcsbaseplugin.cpp",
|
||||
"vcsbaseplugin.h",
|
||||
"vcsbasesubmiteditor.cpp",
|
||||
"vcsbasesubmiteditor.h",
|
||||
"vcsconfigurationpage.cpp",
|
||||
"vcsconfigurationpage.h",
|
||||
"vcsoutputwindow.cpp",
|
||||
"vcsoutputwindow.h",
|
||||
"vcsplugin.cpp",
|
||||
"vcsplugin.h",
|
||||
"images/diff.png",
|
||||
|
@@ -38,7 +38,7 @@
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/synchronousprocess.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsoutputwindow.h>
|
||||
#include <vcsbase/vcsbaseplugin.h>
|
||||
|
||||
#include <QStringList>
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
Q_DECLARE_METATYPE(QVariant)
|
||||
|
||||
inline Core::IEditor *locateEditor(const char *property, const QString &entry)
|
||||
static Core::IEditor *locateEditor(const char *property, const QString &entry)
|
||||
{
|
||||
foreach (Core::IDocument *document, Core::DocumentModel::openedDocuments())
|
||||
if (document->property(property).toString() == entry)
|
||||
@@ -73,15 +73,6 @@ inline Core::IEditor *locateEditor(const char *property, const QString &entry)
|
||||
return 0;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
VcsBase::VcsBaseOutputWindow *vcsOutputWindow()
|
||||
{
|
||||
return VcsBase::VcsBaseOutputWindow::instance();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace VcsBase {
|
||||
|
||||
class VcsBaseClientPrivate
|
||||
@@ -191,7 +182,7 @@ bool VcsBaseClient::synchronousCreateRepository(const QString &workingDirectory,
|
||||
QByteArray outputData;
|
||||
if (!vcsFullySynchronousExec(workingDirectory, args, &outputData))
|
||||
return false;
|
||||
::vcsOutputWindow()->append(
|
||||
VcsOutputWindow::append(
|
||||
Utils::SynchronousProcess::normalizeNewlines(QString::fromLocal8Bit(outputData)));
|
||||
|
||||
resetCachedVcsInfo(workingDirectory);
|
||||
@@ -285,12 +276,12 @@ bool VcsBaseClient::vcsFullySynchronousExec(const QString &workingDir,
|
||||
|
||||
const Utils::FileName binary = settings()->binaryPath();
|
||||
|
||||
::vcsOutputWindow()->appendCommand(workingDir, binary, args);
|
||||
VcsOutputWindow::appendCommand(workingDir, binary, args);
|
||||
|
||||
vcsProcess.start(binary.toString(), args);
|
||||
|
||||
if (!vcsProcess.waitForStarted()) {
|
||||
::vcsOutputWindow()->appendError(tr("Unable to start process \"%1\": %2")
|
||||
VcsOutputWindow::appendError(tr("Unable to start process \"%1\": %2")
|
||||
.arg(binary.toUserOutput(), vcsProcess.errorString()));
|
||||
return false;
|
||||
}
|
||||
@@ -302,12 +293,12 @@ bool VcsBaseClient::vcsFullySynchronousExec(const QString &workingDir,
|
||||
if (!Utils::SynchronousProcess::readDataFromProcess(vcsProcess, timeoutSec * 1000,
|
||||
output, &stdErr, true)) {
|
||||
Utils::SynchronousProcess::stopProcess(vcsProcess);
|
||||
::vcsOutputWindow()->appendError(tr("Timed out after %1s waiting for the process %2 to finish.")
|
||||
VcsOutputWindow::appendError(tr("Timed out after %1s waiting for the process %2 to finish.")
|
||||
.arg(timeoutSec).arg(binary.toUserOutput()));
|
||||
return false;
|
||||
}
|
||||
if (!stdErr.isEmpty())
|
||||
::vcsOutputWindow()->appendError(QString::fromLocal8Bit(stdErr));
|
||||
VcsOutputWindow::appendError(QString::fromLocal8Bit(stdErr));
|
||||
|
||||
return vcsProcess.exitStatus() == QProcess::NormalExit && vcsProcess.exitCode() == 0;
|
||||
}
|
||||
@@ -429,9 +420,9 @@ void VcsBaseClient::status(const QString &workingDir, const QString &file,
|
||||
{
|
||||
QStringList args(vcsCommandString(StatusCommand));
|
||||
args << extraOptions << file;
|
||||
::vcsOutputWindow()->setRepository(workingDir);
|
||||
VcsOutputWindow::setRepository(workingDir);
|
||||
Command *cmd = createCommand(workingDir, 0, VcsWindowOutputBind);
|
||||
connect(cmd, SIGNAL(finished(bool,int,QVariant)), ::vcsOutputWindow(), SLOT(clearRepository()),
|
||||
connect(cmd, SIGNAL(finished(bool,int,QVariant)), VcsOutputWindow::instance(), SLOT(clearRepository()),
|
||||
Qt::QueuedConnection);
|
||||
enqueueJob(cmd, args);
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#include "vcsbasesubmiteditor.h"
|
||||
#include "vcsplugin.h"
|
||||
#include "commonvcssettings.h"
|
||||
#include "vcsbaseoutputwindow.h"
|
||||
#include "vcsoutputwindow.h"
|
||||
#include "corelistener.h"
|
||||
#include "command.h"
|
||||
|
||||
|
@@ -35,7 +35,7 @@
|
||||
#include "submiteditorwidget.h"
|
||||
#include "submitfieldwidget.h"
|
||||
#include "submitfilemodel.h"
|
||||
#include "vcsbaseoutputwindow.h"
|
||||
#include "vcsoutputwindow.h"
|
||||
#include "vcsplugin.h"
|
||||
|
||||
#include <aggregation/aggregate.h>
|
||||
@@ -677,8 +677,7 @@ bool VcsBaseSubmitEditor::runSubmitMessageCheckScript(const QString &checkScript
|
||||
if (!saver.finalize(errorMessage))
|
||||
return false;
|
||||
// Run check process
|
||||
VcsBaseOutputWindow *outputWindow = VcsBaseOutputWindow::instance();
|
||||
outputWindow->appendCommand(msgCheckScript(d->m_checkScriptWorkingDirectory, checkScript));
|
||||
VcsOutputWindow::appendCommand(msgCheckScript(d->m_checkScriptWorkingDirectory, checkScript));
|
||||
QProcess checkProcess;
|
||||
if (!d->m_checkScriptWorkingDirectory.isEmpty())
|
||||
checkProcess.setWorkingDirectory(d->m_checkScriptWorkingDirectory);
|
||||
@@ -702,15 +701,15 @@ bool VcsBaseSubmitEditor::runSubmitMessageCheckScript(const QString &checkScript
|
||||
return false;
|
||||
}
|
||||
if (!stdOutData.isEmpty())
|
||||
outputWindow->appendSilently(QString::fromLocal8Bit(stdOutData));
|
||||
VcsOutputWindow::appendSilently(QString::fromLocal8Bit(stdOutData));
|
||||
const QString stdErr = QString::fromLocal8Bit(stdErrData);
|
||||
if (!stdErr.isEmpty())
|
||||
outputWindow->appendSilently(stdErr);
|
||||
VcsOutputWindow::appendSilently(stdErr);
|
||||
const int exitCode = checkProcess.exitCode();
|
||||
if (exitCode != 0) {
|
||||
const QString exMessage = tr("The check script returned exit code %1.").
|
||||
arg(exitCode);
|
||||
outputWindow->appendError(exMessage);
|
||||
VcsOutputWindow::appendError(exMessage);
|
||||
*errorMessage = stdErr;
|
||||
if (errorMessage->isEmpty())
|
||||
*errorMessage = exMessage;
|
||||
|
@@ -27,7 +27,7 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "vcsbaseoutputwindow.h"
|
||||
#include "vcsoutputwindow.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
|
||||
@@ -67,7 +67,6 @@
|
||||
*/
|
||||
|
||||
namespace VcsBase {
|
||||
|
||||
namespace Internal {
|
||||
|
||||
// Store repository along with text blocks
|
||||
@@ -90,13 +89,13 @@ public:
|
||||
~OutputWindowPlainTextEdit();
|
||||
|
||||
void appendLines(QString const& s, const QString &repository = QString());
|
||||
void appendLinesWithStyle(QString const& s, enum VcsBaseOutputWindow::MessageStyle style, const QString &repository = QString());
|
||||
void appendLinesWithStyle(QString const& s, enum VcsOutputWindow::MessageStyle style, const QString &repository = QString());
|
||||
|
||||
protected:
|
||||
virtual void contextMenuEvent(QContextMenuEvent *event);
|
||||
|
||||
private:
|
||||
void setFormat(enum VcsBaseOutputWindow::MessageStyle style);
|
||||
void setFormat(enum VcsOutputWindow::MessageStyle style);
|
||||
QString identifierUnderCursor(const QPoint &pos, QString *repository = 0) const;
|
||||
|
||||
const QTextCharFormat m_defaultFormat;
|
||||
@@ -184,14 +183,14 @@ void OutputWindowPlainTextEdit::contextMenuEvent(QContextMenuEvent *event)
|
||||
fi = QFileInfo(repository + QLatin1Char('/') + token);
|
||||
if (fi.isFile()) {
|
||||
menu->addSeparator();
|
||||
openAction = menu->addAction(VcsBaseOutputWindow::tr("Open \"%1\"").
|
||||
openAction = menu->addAction(VcsOutputWindow::tr("Open \"%1\"").
|
||||
arg(QDir::toNativeSeparators(fi.fileName())));
|
||||
openAction->setData(fi.absoluteFilePath());
|
||||
}
|
||||
}
|
||||
// Add 'clear'
|
||||
menu->addSeparator();
|
||||
QAction *clearAction = menu->addAction(VcsBaseOutputWindow::tr("Clear"));
|
||||
QAction *clearAction = menu->addAction(VcsOutputWindow::tr("Clear"));
|
||||
|
||||
// Run
|
||||
QAction *action = menu->exec(event->globalPos());
|
||||
@@ -231,11 +230,11 @@ void OutputWindowPlainTextEdit::appendLines(QString const& s, const QString &rep
|
||||
}
|
||||
}
|
||||
|
||||
void OutputWindowPlainTextEdit::appendLinesWithStyle(QString const& s, enum VcsBaseOutputWindow::MessageStyle style, const QString &repository)
|
||||
void OutputWindowPlainTextEdit::appendLinesWithStyle(QString const& s, enum VcsOutputWindow::MessageStyle style, const QString &repository)
|
||||
{
|
||||
setFormat(style);
|
||||
|
||||
if (style == VcsBaseOutputWindow::Command) {
|
||||
if (style == VcsOutputWindow::Command) {
|
||||
const QString timeStamp = QTime::currentTime().toString(QLatin1String("\nHH:mm "));
|
||||
appendLines(timeStamp + s, repository);
|
||||
}
|
||||
@@ -246,23 +245,23 @@ void OutputWindowPlainTextEdit::appendLinesWithStyle(QString const& s, enum VcsB
|
||||
setCurrentCharFormat(m_defaultFormat);
|
||||
}
|
||||
|
||||
void OutputWindowPlainTextEdit::setFormat(enum VcsBaseOutputWindow::MessageStyle style)
|
||||
void OutputWindowPlainTextEdit::setFormat(enum VcsOutputWindow::MessageStyle style)
|
||||
{
|
||||
switch (style) {
|
||||
case VcsBaseOutputWindow::Warning:
|
||||
case VcsOutputWindow::Warning:
|
||||
setCurrentCharFormat(m_warningFormat);
|
||||
break;
|
||||
case VcsBaseOutputWindow::Error:
|
||||
case VcsOutputWindow::Error:
|
||||
setCurrentCharFormat(m_errorFormat);
|
||||
break;
|
||||
case VcsBaseOutputWindow::Message:
|
||||
case VcsOutputWindow::Message:
|
||||
setCurrentCharFormat(m_messageFormat);
|
||||
break;
|
||||
case VcsBaseOutputWindow::Command:
|
||||
case VcsOutputWindow::Command:
|
||||
setCurrentCharFormat(m_commandFormat);
|
||||
break;
|
||||
default:
|
||||
case VcsBaseOutputWindow::None:
|
||||
case VcsOutputWindow::None:
|
||||
setCurrentCharFormat(m_defaultFormat);
|
||||
break;
|
||||
}
|
||||
@@ -271,10 +270,9 @@ void OutputWindowPlainTextEdit::setFormat(enum VcsBaseOutputWindow::MessageStyle
|
||||
} // namespace Internal
|
||||
|
||||
// ------------------- VcsBaseOutputWindowPrivate
|
||||
class VcsBaseOutputWindowPrivate
|
||||
class VcsOutputWindowPrivate
|
||||
{
|
||||
public:
|
||||
static VcsBaseOutputWindow *instance;
|
||||
Internal::OutputWindowPlainTextEdit *plainTextEdit();
|
||||
|
||||
QPointer<Internal::OutputWindowPlainTextEdit> m_plainTextEdit;
|
||||
@@ -285,24 +283,25 @@ public:
|
||||
// Create log editor on demand. Some errors might be logged
|
||||
// before CorePlugin::extensionsInitialized() pulls up the windows.
|
||||
|
||||
Internal::OutputWindowPlainTextEdit *VcsBaseOutputWindowPrivate::plainTextEdit()
|
||||
Internal::OutputWindowPlainTextEdit *VcsOutputWindowPrivate::plainTextEdit()
|
||||
{
|
||||
if (!m_plainTextEdit)
|
||||
m_plainTextEdit = new Internal::OutputWindowPlainTextEdit();
|
||||
return m_plainTextEdit;
|
||||
}
|
||||
|
||||
VcsBaseOutputWindow *VcsBaseOutputWindowPrivate::instance = 0;
|
||||
static VcsOutputWindow *m_instance = 0;
|
||||
static VcsOutputWindowPrivate *d = 0;
|
||||
|
||||
VcsBaseOutputWindow::VcsBaseOutputWindow() :
|
||||
d(new VcsBaseOutputWindowPrivate)
|
||||
VcsOutputWindow::VcsOutputWindow()
|
||||
{
|
||||
d = new VcsOutputWindowPrivate;
|
||||
d->passwordRegExp = QRegExp(QLatin1String("://([^@:]+):([^@]+)@"));
|
||||
Q_ASSERT(d->passwordRegExp.isValid());
|
||||
VcsBaseOutputWindowPrivate::instance = this;
|
||||
m_instance = this;
|
||||
}
|
||||
|
||||
QString VcsBaseOutputWindow::filterPasswordFromUrls(const QString &input)
|
||||
static QString filterPasswordFromUrls(const QString &input)
|
||||
{
|
||||
int pos = 0;
|
||||
QString result = input;
|
||||
@@ -316,13 +315,13 @@ QString VcsBaseOutputWindow::filterPasswordFromUrls(const QString &input)
|
||||
return result;
|
||||
}
|
||||
|
||||
VcsBaseOutputWindow::~VcsBaseOutputWindow()
|
||||
VcsOutputWindow::~VcsOutputWindow()
|
||||
{
|
||||
VcsBaseOutputWindowPrivate::instance = 0;
|
||||
m_instance = 0;
|
||||
delete d;
|
||||
}
|
||||
|
||||
QWidget *VcsBaseOutputWindow::outputWidget(QWidget *parent)
|
||||
QWidget *VcsOutputWindow::outputWidget(QWidget *parent)
|
||||
{
|
||||
if (d->m_plainTextEdit) {
|
||||
if (parent != d->m_plainTextEdit->parent())
|
||||
@@ -333,99 +332,99 @@ QWidget *VcsBaseOutputWindow::outputWidget(QWidget *parent)
|
||||
return d->m_plainTextEdit;
|
||||
}
|
||||
|
||||
QWidgetList VcsBaseOutputWindow::toolBarWidgets() const
|
||||
QWidgetList VcsOutputWindow::toolBarWidgets() const
|
||||
{
|
||||
return QWidgetList();
|
||||
}
|
||||
|
||||
QString VcsBaseOutputWindow::displayName() const
|
||||
QString VcsOutputWindow::displayName() const
|
||||
{
|
||||
return tr("Version Control");
|
||||
}
|
||||
|
||||
int VcsBaseOutputWindow::priorityInStatusBar() const
|
||||
int VcsOutputWindow::priorityInStatusBar() const
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
void VcsBaseOutputWindow::clearContents()
|
||||
void VcsOutputWindow::clearContents()
|
||||
{
|
||||
if (d->m_plainTextEdit)
|
||||
d->m_plainTextEdit->clear();
|
||||
}
|
||||
|
||||
void VcsBaseOutputWindow::visibilityChanged(bool visible)
|
||||
void VcsOutputWindow::visibilityChanged(bool visible)
|
||||
{
|
||||
if (visible && d->m_plainTextEdit)
|
||||
d->m_plainTextEdit->setFocus();
|
||||
}
|
||||
|
||||
void VcsBaseOutputWindow::setFocus()
|
||||
void VcsOutputWindow::setFocus()
|
||||
{
|
||||
}
|
||||
|
||||
bool VcsBaseOutputWindow::hasFocus() const
|
||||
bool VcsOutputWindow::hasFocus() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VcsBaseOutputWindow::canFocus() const
|
||||
bool VcsOutputWindow::canFocus() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VcsBaseOutputWindow::canNavigate() const
|
||||
bool VcsOutputWindow::canNavigate() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VcsBaseOutputWindow::canNext() const
|
||||
bool VcsOutputWindow::canNext() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VcsBaseOutputWindow::canPrevious() const
|
||||
bool VcsOutputWindow::canPrevious() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void VcsBaseOutputWindow::goToNext()
|
||||
void VcsOutputWindow::goToNext()
|
||||
{
|
||||
}
|
||||
|
||||
void VcsBaseOutputWindow::goToPrev()
|
||||
void VcsOutputWindow::goToPrev()
|
||||
{
|
||||
}
|
||||
|
||||
void VcsBaseOutputWindow::setText(const QString &text)
|
||||
void VcsOutputWindow::setText(const QString &text)
|
||||
{
|
||||
d->plainTextEdit()->setPlainText(text);
|
||||
}
|
||||
|
||||
void VcsBaseOutputWindow::setData(const QByteArray &data)
|
||||
void VcsOutputWindow::setData(const QByteArray &data)
|
||||
{
|
||||
setText(QTextCodec::codecForLocale()->toUnicode(data));
|
||||
}
|
||||
|
||||
void VcsBaseOutputWindow::appendSilently(const QString &text)
|
||||
void VcsOutputWindow::appendSilently(const QString &text)
|
||||
{
|
||||
append(text, None, true);
|
||||
}
|
||||
|
||||
void VcsBaseOutputWindow::append(const QString &text, enum MessageStyle style, bool silently)
|
||||
void VcsOutputWindow::append(const QString &text, enum MessageStyle style, bool silently)
|
||||
{
|
||||
d->plainTextEdit()->appendLinesWithStyle(text, style, d->repository);
|
||||
|
||||
if (!silently && !d->plainTextEdit()->isVisible())
|
||||
popup(Core::IOutputPane::NoModeSwitch);
|
||||
m_instance->popup(Core::IOutputPane::NoModeSwitch);
|
||||
}
|
||||
|
||||
void VcsBaseOutputWindow::appendError(const QString &text)
|
||||
void VcsOutputWindow::appendError(const QString &text)
|
||||
{
|
||||
append(text, Error, false);
|
||||
}
|
||||
|
||||
void VcsBaseOutputWindow::appendWarning(const QString &text)
|
||||
void VcsOutputWindow::appendWarning(const QString &text)
|
||||
{
|
||||
append(text, Warning, false);
|
||||
}
|
||||
@@ -453,7 +452,7 @@ static inline QString formatArguments(const QStringList &args)
|
||||
return rc;
|
||||
}
|
||||
|
||||
QString VcsBaseOutputWindow::msgExecutionLogEntry(const QString &workingDir,
|
||||
QString VcsOutputWindow::msgExecutionLogEntry(const QString &workingDir,
|
||||
const Utils::FileName &executable,
|
||||
const QStringList &arguments)
|
||||
{
|
||||
@@ -465,43 +464,41 @@ QString VcsBaseOutputWindow::msgExecutionLogEntry(const QString &workingDir,
|
||||
arg(QDir::toNativeSeparators(workingDir), nativeExecutable, args) + QLatin1Char('\n');
|
||||
}
|
||||
|
||||
void VcsBaseOutputWindow::appendCommand(const QString &text)
|
||||
void VcsOutputWindow::appendCommand(const QString &text)
|
||||
{
|
||||
append(filterPasswordFromUrls(text), Command, true);
|
||||
}
|
||||
|
||||
void VcsBaseOutputWindow::appendCommand(const QString &workingDirectory,
|
||||
void VcsOutputWindow::appendCommand(const QString &workingDirectory,
|
||||
const Utils::FileName &binary,
|
||||
const QStringList &args)
|
||||
{
|
||||
appendCommand(msgExecutionLogEntry(workingDirectory, binary, args));
|
||||
}
|
||||
|
||||
void VcsBaseOutputWindow::appendMessage(const QString &text)
|
||||
void VcsOutputWindow::appendMessage(const QString &text)
|
||||
{
|
||||
append(text, Message, true);
|
||||
}
|
||||
|
||||
VcsBaseOutputWindow *VcsBaseOutputWindow::instance()
|
||||
VcsOutputWindow *VcsOutputWindow::instance()
|
||||
{
|
||||
if (!VcsBaseOutputWindowPrivate::instance) {
|
||||
VcsBaseOutputWindow *w = new VcsBaseOutputWindow;
|
||||
Q_UNUSED(w)
|
||||
}
|
||||
return VcsBaseOutputWindowPrivate::instance;
|
||||
if (!m_instance)
|
||||
(void) new VcsOutputWindow;
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
QString VcsBaseOutputWindow::repository() const
|
||||
QString VcsOutputWindow::repository() const
|
||||
{
|
||||
return d->repository;
|
||||
}
|
||||
|
||||
void VcsBaseOutputWindow::setRepository(const QString &r)
|
||||
void VcsOutputWindow::setRepository(const QString &r)
|
||||
{
|
||||
d->repository = r;
|
||||
}
|
||||
|
||||
void VcsBaseOutputWindow::clearRepository()
|
||||
void VcsOutputWindow::clearRepository()
|
||||
{
|
||||
d->repository.clear();
|
||||
}
|
@@ -27,8 +27,8 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef VCSBASEOUTPUTWINDOW_H
|
||||
#define VCSBASEOUTPUTWINDOW_H
|
||||
#ifndef VCSOUTPUTWINDOW_H
|
||||
#define VCSOUTPUTWINDOW_H
|
||||
|
||||
#include "vcsbase_global.h"
|
||||
|
||||
@@ -38,15 +38,13 @@
|
||||
|
||||
namespace VcsBase {
|
||||
|
||||
class VcsBaseOutputWindowPrivate;
|
||||
|
||||
class VCSBASE_EXPORT VcsBaseOutputWindow : public Core::IOutputPane
|
||||
class VCSBASE_EXPORT VcsOutputWindow : public Core::IOutputPane
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QString repository READ repository WRITE setRepository)
|
||||
|
||||
public:
|
||||
~VcsBaseOutputWindow();
|
||||
~VcsOutputWindow();
|
||||
|
||||
QWidget *outputWidget(QWidget *parent);
|
||||
QList<QWidget *> toolBarWidgets() const;
|
||||
@@ -67,7 +65,7 @@ public:
|
||||
void goToNext();
|
||||
void goToPrev();
|
||||
|
||||
static VcsBaseOutputWindow *instance();
|
||||
static VcsOutputWindow *instance();
|
||||
|
||||
QString repository() const;
|
||||
|
||||
@@ -87,47 +85,43 @@ public:
|
||||
};
|
||||
|
||||
public slots:
|
||||
void setRepository(const QString &);
|
||||
void clearRepository();
|
||||
static void setRepository(const QString &);
|
||||
static void clearRepository();
|
||||
|
||||
// Set the whole text.
|
||||
void setText(const QString &text);
|
||||
static void setText(const QString &text);
|
||||
// Set text from QProcess' output data using the Locale's converter.
|
||||
void setData(const QByteArray &data);
|
||||
static void setData(const QByteArray &data);
|
||||
|
||||
// Append text with a certain style (none by default),
|
||||
// and maybe pop up (silent by default)
|
||||
void append(const QString &text, enum MessageStyle style = None, bool silently = false);
|
||||
static void append(const QString &text, enum MessageStyle style = None, bool silently = false);
|
||||
|
||||
// Silently append text, do not pop up.
|
||||
void appendSilently(const QString &text);
|
||||
static void appendSilently(const QString &text);
|
||||
|
||||
// Append red error text and pop up.
|
||||
void appendError(const QString &text);
|
||||
static void appendError(const QString &text);
|
||||
|
||||
// Append dark-yellow warning text and pop up.
|
||||
void appendWarning(const QString &text);
|
||||
static void appendWarning(const QString &text);
|
||||
|
||||
// Append a command, prepended by a log time stamp. "Executing: vcs -diff"
|
||||
// will result in "10:00 Executing: vcs -diff" in bold
|
||||
void appendCommand(const QString &text);
|
||||
static void appendCommand(const QString &text);
|
||||
// Append a standard-formatted entry for command execution
|
||||
// (see msgExecutionLogEntry).
|
||||
void appendCommand(const QString &workingDirectory,
|
||||
static void appendCommand(const QString &workingDirectory,
|
||||
const Utils::FileName &binary,
|
||||
const QStringList &args);
|
||||
|
||||
// Append a blue message text and pop up.
|
||||
void appendMessage(const QString &text);
|
||||
static void appendMessage(const QString &text);
|
||||
|
||||
private:
|
||||
VcsBaseOutputWindow();
|
||||
|
||||
QString filterPasswordFromUrls(const QString &input);
|
||||
|
||||
VcsBaseOutputWindowPrivate *d;
|
||||
VcsOutputWindow();
|
||||
};
|
||||
|
||||
} // namespace VcsBase
|
||||
|
||||
#endif // VCSBASEOUTPUTWINDOW_H
|
||||
#endif // VCSOUTPUTWINDOW_H
|
@@ -33,7 +33,7 @@
|
||||
|
||||
#include "commonsettingspage.h"
|
||||
#include "nicknamedialog.h"
|
||||
#include "vcsbaseoutputwindow.h"
|
||||
#include "vcsoutputwindow.h"
|
||||
#include "corelistener.h"
|
||||
|
||||
#include <coreplugin/iversioncontrol.h>
|
||||
@@ -79,7 +79,7 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
|
||||
m_settingsPage = new CommonOptionsPage;
|
||||
addAutoReleasedObject(m_settingsPage);
|
||||
addAutoReleasedObject(VcsBaseOutputWindow::instance());
|
||||
addAutoReleasedObject(VcsOutputWindow::instance());
|
||||
connect(m_settingsPage, SIGNAL(settingsChanged(VcsBase::Internal::CommonVcsSettings)),
|
||||
this, SIGNAL(settingsChanged(VcsBase::Internal::CommonVcsSettings)));
|
||||
connect(m_settingsPage, SIGNAL(settingsChanged(VcsBase::Internal::CommonVcsSettings)),
|
||||
|
Reference in New Issue
Block a user