GUI: merge: option »one new merge tab for each dropped input file«

Implements #1380.
This commit is contained in:
Moritz Bunkus 2015-09-18 09:08:33 +02:00
parent f160324250
commit deb76a6364
7 changed files with 48 additions and 14 deletions

View File

@ -1,3 +1,10 @@
2015-09-18 Moritz Bunkus <moritz@bunkus.org>
* MKVToolNix GUI: merge tool enhancement: when dragging & dropping
files onto merge settings already containing a file the dialog
asking the user what to do has received a new option for creating
one new merge tab for each of the dropped files. Implements #1380.
2015-09-17 Moritz Bunkus <moritz@bunkus.org>
* mkvmerge: bug fix: the pixel dimensions reported for VC-1 in

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>485</width>
<height>303</height>
<width>560</width>
<height>315</height>
</rect>
</property>
<property name="windowTitle">
@ -76,6 +76,13 @@
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbAddEachToNew">
<property name="text">
<string>Create new merge settings for &amp;each file</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">

View File

@ -35,11 +35,12 @@ AddingAppendingFilesDialog::~AddingAppendingFilesDialog() {
AddingAppendingFilesDialog::Decision
AddingAppendingFilesDialog::decision()
const {
return ui->rbAdd->isChecked() ? Decision::Add
: ui->rbAlwaysAdd->isChecked() ? Decision::AlwaysAdd
: ui->rbAppend->isChecked() ? Decision::Append
: ui->rbAddToNew->isChecked() ? Decision::AddToNew
: Decision::AddAdditionalParts;
return ui->rbAdd->isChecked() ? Decision::Add
: ui->rbAlwaysAdd->isChecked() ? Decision::AlwaysAdd
: ui->rbAppend->isChecked() ? Decision::Append
: ui->rbAddToNew->isChecked() ? Decision::AddToNew
: ui->rbAddEachToNew->isChecked() ? Decision::AddEachToNew
: Decision::AddAdditionalParts;
}
int

View File

@ -22,6 +22,7 @@ public:
Append,
AddAdditionalParts,
AddToNew,
AddEachToNew,
};
protected:

View File

@ -1145,7 +1145,10 @@ Tab::addOrAppendDroppedFiles(QStringList const &fileNames) {
m_filesModel->addAdditionalParts(fileIdx, fileNames);
else if (AddingAppendingFilesDialog::Decision::AddToNew == decision)
MainWindow::mergeTool()->addMultipleFilesToNewSettings(fileNames);
MainWindow::mergeTool()->addMultipleFilesToNewSettings(fileNames, false);
else if (AddingAppendingFilesDialog::Decision::AddEachToNew == decision)
MainWindow::mergeTool()->addMultipleFilesToNewSettings(fileNames, true);
else {
if (AddingAppendingFilesDialog::Decision::AlwaysAdd == decision) {

View File

@ -309,13 +309,28 @@ Tool::openMultipleConfigFilesFromCommandLine(QStringList const &fileNames) {
}
void
Tool::addMultipleFilesToNewSettings(QStringList const &fileNames) {
newConfig();
Tool::addMultipleFilesToNewSettings(QStringList const &fileNames,
bool newSettingsForEachFile) {
auto toProcess = fileNames;
auto tab = currentTab();
Q_ASSERT(!!tab);
while (!toProcess.isEmpty()) {
auto fileNamesToAdd = QStringList{};
tab->addFilesToBeAddedOrAppendedDelayed(fileNames);
if (newSettingsForEachFile)
fileNamesToAdd << toProcess.takeFirst();
else {
fileNamesToAdd = toProcess;
toProcess.clear();
}
newConfig();
auto tab = currentTab();
Q_ASSERT(!!tab);
tab->addFilesToBeAddedOrAppendedDelayed(fileNamesToAdd);
}
}
void

View File

@ -63,7 +63,7 @@ public slots:
virtual void addMultipleFiles(QStringList const &fileNames);
virtual void addMultipleFilesFromCommandLine(QStringList const &fileNames);
virtual void openMultipleConfigFilesFromCommandLine(QStringList const &fileNames);
virtual void addMultipleFilesToNewSettings(QStringList const &fileNames);
virtual void addMultipleFilesToNewSettings(QStringList const &fileNames, bool newSettingsForEachFile);
virtual void setupTabPositions();