diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 2de31700a86..dc28901b705 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -405,17 +405,17 @@ void PerforcePlugin::extensionsInitialized() void PerforcePlugin::openCurrentFile() { - runP4Cmd(QStringList() << QLatin1String("edit") << currentFileName(), QStringList(), true); + vcsOpen(currentFileName()); } void PerforcePlugin::addCurrentFile() { - runP4Cmd(QStringList() << QLatin1String("add") << currentFileName(), QStringList(), true); + vcsAdd(currentFileName()); } void PerforcePlugin::deleteCurrentFile() { - runP4Cmd(QStringList() << QLatin1String("delete") << currentFileName(), QStringList(), true); + vcsDelete(currentFileName()); } void PerforcePlugin::revertCurrentFile() @@ -426,7 +426,7 @@ void PerforcePlugin::revertCurrentFile() QTextCodec *codec = VCSBase::VCSBaseEditor::getCodec(m_coreInstance, fileName); QStringList args; args << QLatin1String("diff") << QLatin1String("-sa"); - PerforceResponse result = runP4Cmd(args, QStringList(), false, true, codec); + PerforceResponse result = runP4Cmd(args, QStringList(), CommandToWindow|StdErrToWindow|ErrorToWindow, codec); if (result.error) return; @@ -444,7 +444,7 @@ void PerforcePlugin::revertCurrentFile() foreach (Core::IFile *file, files) { fm->blockFileChange(file); } - PerforceResponse result2 = runP4Cmd(QStringList() << QLatin1String("revert") << fileName, QStringList(), true); + PerforceResponse result2 = runP4Cmd(QStringList() << QLatin1String("revert") << fileName, QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow); Core::IFile::ReloadBehavior tempBehavior = Core::IFile::ReloadAll; foreach (Core::IFile *file, files) { @@ -489,7 +489,7 @@ void PerforcePlugin::printOpenedFileList() Core::IEditor *e = m_coreInstance->editorManager()->currentEditor(); if (e) e->widget()->setFocus(); - PerforceResponse result = runP4Cmd(QStringList() << QLatin1String("opened"), QStringList(), true); + PerforceResponse result = runP4Cmd(QStringList() << QLatin1String("opened"), QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow); } #ifdef USE_P4_API @@ -522,7 +522,8 @@ void PerforcePlugin::submit() return; } - PerforceResponse result = runP4Cmd(QStringList()<< QLatin1String("change") << QLatin1String("-o"), QStringList(), false); + PerforceResponse result = runP4Cmd(QStringList()<< QLatin1String("change") << QLatin1String("-o"), QStringList(), + CommandToWindow|StdErrToWindow|ErrorToWindow); if (result.error) { delete m_changeTmpFile; m_changeTmpFile = 0; @@ -550,7 +551,8 @@ void PerforcePlugin::submit() foreach (const QString &f, files) nativeFiles << QDir::toNativeSeparators(f); - PerforceResponse result2 = runP4Cmd(QStringList(QLatin1String("fstat")), nativeFiles, false); + PerforceResponse result2 = runP4Cmd(QStringList(QLatin1String("fstat")), nativeFiles, + CommandToWindow|StdErrToWindow|ErrorToWindow); if (result2.error) { delete m_changeTmpFile; m_changeTmpFile = 0; @@ -597,8 +599,10 @@ void PerforcePlugin::printPendingChanges() PendingChangesDialog dia(pendingChangesData(), m_coreInstance->mainWindow()); qApp->restoreOverrideCursor(); if (dia.exec() == QDialog::Accepted) { - int i = dia.changeNumber(); - PerforceResponse result = runP4Cmd(QStringList()<<"submit"<<"-c"<append(response.message, true); - - + if (response.error) { + if (Perforce::Constants::debug) + qDebug() << response.message; + if (logFlags & ErrorToWindow) + m_perforceOutputWindow->append(response.message, true); + } return response; } @@ -923,7 +937,7 @@ void PerforcePlugin::p4Diff(const QStringList &files, QString diffname) } } - const PerforceResponse result = runP4Cmd(QStringList() << QLatin1String("diff") << QLatin1String("-du"), files, false, codec); + const PerforceResponse result = runP4Cmd(QStringList() << QLatin1String("diff") << QLatin1String("-du"), files, CommandToWindow|StdErrToWindow|ErrorToWindow, codec); if (result.error) return; @@ -948,7 +962,7 @@ void PerforcePlugin::describe(const QString & source, const QString &n) QTextCodec *codec = source.isEmpty() ? static_cast(0) : VCSBase::VCSBaseEditor::getCodec(m_coreInstance, source); QStringList args; args << QLatin1String("describe") << QLatin1String("-du") << n; - const PerforceResponse result = runP4Cmd(args, QStringList(), codec); + const PerforceResponse result = runP4Cmd(args, QStringList(), CommandToWindow|StdErrToWindow|ErrorToWindow, codec); if (!result.error) showOutputInEditor(tr("p4 describe %1").arg(n), result.stdOut, VCSBase::DiffOutput, codec); } diff --git a/src/plugins/perforce/perforceplugin.h b/src/plugins/perforce/perforceplugin.h index 4c088563324..7a4e2307779 100644 --- a/src/plugins/perforce/perforceplugin.h +++ b/src/plugins/perforce/perforceplugin.h @@ -86,7 +86,6 @@ private: struct PerforceResponse { bool error; - QString command; QString stdOut; QString stdErr; QString message; @@ -161,12 +160,15 @@ private: Core::IEditor *showOutputInEditor(const QString& title, const QString output, int editorType, QTextCodec *codec = 0); + + // Verbosity flags for runP4Cmd. + enum RunLogFlags { CommandToWindow = 0x1, StdOutToWindow = 0x2, StdErrToWindow = 0x4, ErrorToWindow = 0x8 }; + // args are passed as command line arguments // extra args via a tempfile and the option -x "temp-filename" PerforceResponse runP4Cmd(const QStringList &args, const QStringList &extraArgs = QStringList(), - bool showStdOutInOutputWindow = false, - bool showStdErrInOutputWindow = true, + unsigned logFlags = CommandToWindow|StdErrToWindow|ErrorToWindow, QTextCodec *outputCodec = 0) const; void openFiles(const QStringList &files); diff --git a/src/plugins/qt4projectmanager/wizards/consoleappwizarddialog.cpp b/src/plugins/qt4projectmanager/wizards/consoleappwizarddialog.cpp index 14965f50187..1090673284f 100644 --- a/src/plugins/qt4projectmanager/wizards/consoleappwizarddialog.cpp +++ b/src/plugins/qt4projectmanager/wizards/consoleappwizarddialog.cpp @@ -35,6 +35,7 @@ #include "consoleappwizard.h" #include "modulespage.h" +#include #include namespace Qt4ProjectManager { @@ -51,13 +52,11 @@ ConsoleAppWizardDialog::ConsoleAppWizardDialog(const QString &templateName, setWindowIcon(icon); setWindowTitle(templateName); Core::BaseFileWizard::setupWizard(this); - setOptions(QWizard::IndependentPages | QWizard::HaveNextButtonOnLastPage); m_introPage->setDescription(tr("This wizard generates a Qt4 console application " "project. The application derives from QCoreApplication and does not " "present a GUI. You can press 'Finish' at any point in time.")); - m_introPage->setFinalPage(true); addPage(m_introPage); m_modulesPage->setModuleSelected(QLatin1String("core")); diff --git a/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp b/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp index 7b1ba073d34..621a3b6ba92 100644 --- a/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp +++ b/src/plugins/qt4projectmanager/wizards/guiappwizarddialog.cpp @@ -63,7 +63,6 @@ GuiAppWizardDialog::GuiAppWizardDialog(const QString &templateName, setWindowIcon(icon); setWindowTitle(templateName); Core::BaseFileWizard::setupWizard(this); - setOptions(QWizard::IndependentPages); m_introPage->setDescription(tr("This wizard generates a Qt4 GUI application " "project. The application derives by default from QApplication "