# HG changeset patch # User Sam Izzo # Date 1345994817 -36000 # Node ID db62a0cb303791f026f696bacfbb5fe26a0f56f3 # Parent f9fd48e55af16d4fe80cd425a5c2d1c76bd2a091 * Added setting to specify that diff command should be run once for each selected file, rather than passing all file names to diff command (p4merge doesn't like being given many files) diff -r f9fd48e55af1 -r db62a0cb3037 src/mainwindow.cpp --- a/src/mainwindow.cpp Mon Aug 27 01:26:05 2012 +1000 +++ b/src/mainwindow.cpp Mon Aug 27 01:26:57 2012 +1000 @@ -915,11 +915,20 @@ // Diff parent against working folder (folder diff) params << "--config" << "extensions.extdiff=" << "extdiff"; - params << "--program" << diff; - - params << "--" << files; // may be none: whole dir - - m_runner->requestAction(HgAction(ACT_FOLDERDIFF, m_workFolderPath, params)); + params << "--program" << diff << "--"; + + QSettings settings; + if (settings.value("multipleDiffInstances", false).toBool()) { + foreach (QString file, files) { + QStringList p = params; + p << file; + m_runner->requestAction(HgAction(ACT_FOLDERDIFF, m_workFolderPath, p)); + } + } + else { + params << files; // may be none: whole dir + m_runner->requestAction(HgAction(ACT_FOLDERDIFF, m_workFolderPath, params)); + } } void MainWindow::hgDiffToCurrent(QString id) diff -r f9fd48e55af1 -r db62a0cb3037 src/settingsdialog.cpp --- a/src/settingsdialog.cpp Mon Aug 27 01:26:05 2012 +1000 +++ b/src/settingsdialog.cpp Mon Aug 27 01:26:57 2012 +1000 @@ -138,7 +138,10 @@ browse = new QPushButton(tr("Browse...")); pathsLayout->addWidget(browse, row++, 1); connect(browse, SIGNAL(clicked()), this, SLOT(diffPathBrowse())); - + + m_multipleDiffInstances = new QCheckBox(tr("Multiple instances when multiple files are selected")); + pathsLayout->addWidget(m_multipleDiffInstances, row++, 2); + pathsLayout->addWidget(new QLabel(tr("External file-merge program:")), row, 0); m_mergePathLabel = new QLineEdit(); @@ -170,6 +173,7 @@ connect(m_extensionBrowse, SIGNAL(clicked()), this, SLOT(extensionPathBrowse())); pathsLayout->setRowStretch(row, 20); + pathsLayout->setColumnStretch(2, 20); reset(); // loads current defaults from settings @@ -424,6 +428,7 @@ settings.endGroup(); settings.beginGroup(""); settings.remove("useextension"); + settings.remove("multipleDiffInstances"); settings.endGroup(); } @@ -455,6 +460,7 @@ settings.beginGroup(""); m_useExtension->setChecked(settings.value("useextension", true).toBool()); useExtension(m_useExtension->isChecked()); + m_multipleDiffInstances->setChecked(settings.value("multipleDiffInstances", false).toBool()); settings.endGroup(); } @@ -507,6 +513,7 @@ settings.endGroup(); settings.beginGroup(""); settings.setValue("useextension", m_useExtension->isChecked()); + settings.setValue("multipleDiffInstances", m_multipleDiffInstances->isChecked()); settings.endGroup(); QDialog::accept(); } diff -r f9fd48e55af1 -r db62a0cb3037 src/settingsdialog.h --- a/src/settingsdialog.h Mon Aug 27 01:26:05 2012 +1000 +++ b/src/settingsdialog.h Mon Aug 27 01:26:57 2012 +1000 @@ -85,6 +85,8 @@ QComboBox *m_workHistoryArrangement; #endif + QCheckBox *m_multipleDiffInstances; + QPushButton *m_extensionBrowse; QPushButton *m_ok;