Added option for "Overwrite Mode" (keep both, skip file, replace) to "Advanced Options" tab. Does not do anything yet.

This commit is contained in:
LoRd_MuldeR 2012-11-08 00:42:55 +01:00
parent f3e14e02d2
commit 4d3bce8fc3
19 changed files with 1479 additions and 803 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1958,6 +1958,42 @@
<source>Show Help</source>
<translation>Hilfethemen anzeigen</translation>
</message>
<message>
<source> Overwrite Mode </source>
<translation> Überschreiben Modus </translation>
</message>
<message>
<source>Overwrite Existing File</source>
<translation>Zieldatei ersetzen</translation>
</message>
<message>
<source>Skip File</source>
<translation>Überspringen</translation>
</message>
<message>
<source>Keep Both Files (Default)</source>
<translation>Beide erhalten (Standard)</translation>
</message>
<message>
<source>If Target File Already Exists:</source>
<translation>Bei existierender Zieldatei:</translation>
</message>
<message>
<source>Overwrite Mode</source>
<translation>Überschreiben Modus</translation>
</message>
<message>
<source>Warning: This mode may overwrite existing files with no way to revert!</source>
<translation>Achtung: Dieser Modus überschreibt möglicherweise existierende Dateien!</translation>
</message>
<message>
<source>Continue</source>
<translation>Fortfahren</translation>
</message>
<message>
<source>Revert</source>
<translation>Zurück</translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1957,6 +1957,42 @@
<source>Show Help</source>
<translation>Mostar ayuda</translation>
</message>
<message>
<source> Overwrite Mode </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Overwrite Existing File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Skip File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Keep Both Files (Default)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>If Target File Already Exists:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Overwrite Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning: This mode may overwrite existing files with no way to revert!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Continue</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Revert</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1967,6 +1967,42 @@ Ouvrir le dossier récursivement...</translation>
<source>Show Help</source>
<translation type="unfinished"></translation>
</message>
<message>
<source> Overwrite Mode </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Overwrite Existing File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Skip File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Keep Both Files (Default)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>If Target File Already Exists:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Overwrite Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning: This mode may overwrite existing files with no way to revert!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Continue</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Revert</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1958,6 +1958,42 @@
<source>Show Help</source>
<translation type="unfinished"></translation>
</message>
<message>
<source> Overwrite Mode </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Overwrite Existing File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Skip File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Keep Both Files (Default)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>If Target File Already Exists:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Overwrite Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning: This mode may overwrite existing files with no way to revert!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Continue</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Revert</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1957,6 +1957,42 @@
<source>Show Help</source>
<translation type="unfinished"> </translation>
</message>
<message>
<source> Overwrite Mode </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Overwrite Existing File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Skip File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Keep Both Files (Default)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>If Target File Already Exists:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Overwrite Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning: This mode may overwrite existing files with no way to revert!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Continue</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Revert</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

File diff suppressed because it is too large Load Diff

View File

@ -1963,6 +1963,42 @@
<source>Show Help</source>
<translation type="unfinished">Справка</translation>
</message>
<message>
<source> Overwrite Mode </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Overwrite Existing File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Skip File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Keep Both Files (Default)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>If Target File Already Exists:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Overwrite Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning: This mode may overwrite existing files with no way to revert!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Continue</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Revert</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

File diff suppressed because it is too large Load Diff

View File

@ -1957,6 +1957,42 @@
<source>Show Help</source>
<translation></translation>
</message>
<message>
<source> Overwrite Mode </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Overwrite Existing File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Skip File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Keep Both Files (Default)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>If Target File Already Exists:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Overwrite Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning: This mode may overwrite existing files with no way to revert!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Continue</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Revert</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1958,6 +1958,42 @@
<source>Show Help</source>
<translation>Відобразити допоміжну інформацію</translation>
</message>
<message>
<source> Overwrite Mode </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Overwrite Existing File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Skip File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Keep Both Files (Default)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>If Target File Already Exists:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Overwrite Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning: This mode may overwrite existing files with no way to revert!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Continue</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Revert</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1957,6 +1957,42 @@
<source>Show Help</source>
<translation></translation>
</message>
<message>
<source> Overwrite Mode </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Overwrite Existing File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Skip File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Keep Both Files (Default)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>If Target File Already Exists:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Overwrite Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning: This mode may overwrite existing files with no way to revert!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Continue</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Revert</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1398,7 +1398,7 @@
<x>0</x>
<y>0</y>
<width>607</width>
<height>1668</height>
<height>1762</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_22">
@ -2511,7 +2511,7 @@
</layout>
</widget>
</item>
<item row="9" column="0">
<item row="10" column="0">
<widget class="QGroupBox" name="groupBox_11">
<property name="font">
<font>
@ -2850,7 +2850,7 @@
</layout>
</widget>
</item>
<item row="10" column="0">
<item row="11" column="0">
<widget class="QGroupBox" name="groupBox_12">
<property name="font">
<font>
@ -3014,7 +3014,7 @@
</layout>
</widget>
</item>
<item row="11" column="0">
<item row="12" column="0">
<widget class="QGroupBox" name="groupBox_13">
<property name="font">
<font>
@ -3876,6 +3876,175 @@
</layout>
</widget>
</item>
<item row="9" column="0">
<widget class="QGroupBox" name="groupBox_17">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="title">
<string> Overwrite Mode </string>
</property>
<layout class="QGridLayout" name="gridLayout_42">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_41">
<item row="1" column="4">
<spacer name="horizontalSpacer_63">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="7">
<widget class="QRadioButton" name="radioButtonOverwriteModeReplaces">
<property name="text">
<string>Overwrite Existing File</string>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QRadioButton" name="radioButtonOverwriteModeSkipFile">
<property name="text">
<string>Skip File</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QRadioButton" name="radioButtonOverwriteModeKeepBoth">
<property name="text">
<string>Keep Both Files (Default)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_24">
<property name="text">
<string>If Target File Already Exists:</string>
</property>
</widget>
</item>
<item row="1" column="6">
<spacer name="horizontalSpacer_64">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_65">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" colspan="7">
<spacer name="verticalSpacer_37">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>6</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1" colspan="7">
<spacer name="verticalSpacer_36">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>6</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="9" rowspan="3">
<spacer name="horizontalSpacer_62">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" rowspan="3">
<spacer name="horizontalSpacer_61">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="8">
<spacer name="horizontalSpacer_66">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item row="6" column="0">

Binary file not shown.

View File

@ -27,10 +27,10 @@
#define VER_LAMEXP_MAJOR 4
#define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 6
#define VER_LAMEXP_TYPE Final
#define VER_LAMEXP_MINOR_LO 7
#define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 1
#define VER_LAMEXP_BUILD 1170
#define VER_LAMEXP_BUILD 1172
///////////////////////////////////////////////////////////////////////////////
// Tool versions (minimum expected versions!)

View File

@ -407,6 +407,15 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
helpCustomParamAften->installEventFilter(m_evenFilterCustumParamsHelp);
helpCustomParamOpus->installEventFilter(m_evenFilterCustumParamsHelp);
m_overwriteButtonGroup = new QButtonGroup(this);
m_overwriteButtonGroup->addButton(radioButtonOverwriteModeKeepBoth, SettingsModel::Overwrite_KeepBoth);
m_overwriteButtonGroup->addButton(radioButtonOverwriteModeSkipFile, SettingsModel::Overwrite_SkipFile);
m_overwriteButtonGroup->addButton(radioButtonOverwriteModeReplaces, SettingsModel::Overwrite_Replaces);
radioButtonOverwriteModeKeepBoth->setChecked(m_settings->overwriteMode() == SettingsModel::Overwrite_KeepBoth);
radioButtonOverwriteModeSkipFile->setChecked(m_settings->overwriteMode() == SettingsModel::Overwrite_SkipFile);
radioButtonOverwriteModeReplaces->setChecked(m_settings->overwriteMode() == SettingsModel::Overwrite_Replaces);
connect(sliderLameAlgoQuality, SIGNAL(valueChanged(int)), this, SLOT(updateLameAlgoQuality(int)));
connect(checkBoxBitrateManagement, SIGNAL(clicked(bool)), this, SLOT(bitrateManagementEnabledChanged(bool)));
connect(spinBoxBitrateManagementMin, SIGNAL(valueChanged(int)), this, SLOT(bitrateManagementMinChanged(int)));
@ -446,6 +455,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
connect(comboBoxOpusFramesize, SIGNAL(currentIndexChanged(int)), this, SLOT(opusSettingsChanged()));
connect(spinBoxOpusComplexity, SIGNAL(valueChanged(int)), this, SLOT(opusSettingsChanged()));
connect(checkBoxOpusExpAnalysis, SIGNAL(clicked(bool)), this, SLOT(opusSettingsChanged()));
connect(m_overwriteButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(overwriteModeChanged(int)));
connect(m_evenFilterCustumParamsHelp, SIGNAL(eventOccurred(QWidget*, QEvent*)), this, SLOT(customParamsHelpRequested(QWidget*, QEvent*)));
//--------------------------------
@ -632,7 +642,8 @@ MainWindow::~MainWindow(void)
LAMEXP_DELETE(m_delayedFileTimer);
LAMEXP_DELETE(m_metaInfoModel);
LAMEXP_DELETE(m_encoderButtonGroup);
LAMEXP_DELETE(m_encoderButtonGroup);
LAMEXP_DELETE(m_modeButtonGroup);
LAMEXP_DELETE(m_overwriteButtonGroup);
LAMEXP_DELETE(m_sourceFilesContextMenu);
LAMEXP_DELETE(m_outputFolderFavoritesMenu);
LAMEXP_DELETE(m_outputFolderContextMenu);
@ -3942,6 +3953,23 @@ void MainWindow::showCustomParamsHelpScreen(const QString &toolName, const QStri
LAMEXP_DELETE(dialog);
}
void MainWindow::overwriteModeChanged(int id)
{
qWarning("overwriteModeChanged: %d", id);
if((id == SettingsModel::Overwrite_Replaces) && (m_settings->overwriteMode() != SettingsModel::Overwrite_Replaces))
{
if(QMessageBox::warning(this, tr("Overwrite Mode"), tr("Warning: This mode may overwrite existing files with no way to revert!"), tr("Continue"), tr("Revert"), QString(), 1) != 0)
{
radioButtonOverwriteModeKeepBoth->setChecked(m_settings->overwriteMode() == SettingsModel::Overwrite_KeepBoth);
radioButtonOverwriteModeSkipFile->setChecked(m_settings->overwriteMode() == SettingsModel::Overwrite_SkipFile);
return;
}
}
m_settings->overwriteMode(id);
}
/*
* Reset all advanced options to their defaults
*/
@ -3979,6 +4007,9 @@ void MainWindow::resetAdvancedOptionsButtonClicked(void)
lineEditCustomParamOpus->setText(m_settings->customParametersFLACDefault());
lineEditCustomTempFolder->setText(QDir::toNativeSeparators(m_settings->customTempPathDefault()));
lineEditRenamePattern->setText(m_settings->renameOutputFilesPatternDefault());
if(m_settings->overwriteModeDefault() == SettingsModel::Overwrite_KeepBoth) radioButtonOverwriteModeKeepBoth->click();
if(m_settings->overwriteModeDefault() == SettingsModel::Overwrite_SkipFile) radioButtonOverwriteModeSkipFile->click();
if(m_settings->overwriteModeDefault() == SettingsModel::Overwrite_Replaces) radioButtonOverwriteModeReplaces->click();
customParamsChanged();
scrollArea->verticalScrollBar()->setValue(0);
}

View File

@ -119,6 +119,7 @@ private slots:
void outputFolderRowsInserted(const QModelIndex &parent, int start, int end);
void outputFolderViewClicked(const QModelIndex &index);
void outputFolderViewMoved(const QModelIndex &index);
void overwriteModeChanged(int id);
void playlistEnabledChanged(void);
void prependRelativePathChanged(void);
void previewContextActionTriggered(void);
@ -212,6 +213,7 @@ private:
QActionGroup *m_tabActionGroup;
QButtonGroup *m_encoderButtonGroup;
QButtonGroup *m_modeButtonGroup;
QButtonGroup *m_overwriteButtonGroup;
CustomEventFilter *m_evenFilterCustumParamsHelp;
CustomEventFilter *m_evenFilterOutputFolderMouse;

View File

@ -119,6 +119,7 @@ LAMEXP_MAKE_ID(customParametersFLAC, "AdvancedOptions/CustomParameters/FLAC");
LAMEXP_MAKE_ID(customParametersOpus, "AdvancedOptions/CustomParameters/OpusEnc");
LAMEXP_MAKE_ID(renameOutputFilesEnabled, "AdvancedOptions/RenameOutputFiles/Enabled");
LAMEXP_MAKE_ID(renameOutputFilesPattern, "AdvancedOptions/RenameOutputFiles/Pattern");
LAMEXP_MAKE_ID(overwriteMode, "AdvancedOptions/OverwriteMode");
LAMEXP_MAKE_ID(hibernateComputer, "AdvancedOptions/HibernateComputerOnShutdown");
LAMEXP_MAKE_ID(metaInfoPosition, "MetaInformation/PlaylistPosition");
LAMEXP_MAKE_ID(maximumInstances, "AdvancedOptions/Threading/MaximumInstances");
@ -274,6 +275,12 @@ void SettingsModel::validate(void)
this->hibernateComputer(false);
}
}
if(this->overwriteMode() < SettingsModel::Overwrite_KeepBoth || this->overwriteMode() > SettingsModel::Overwrite_Replaces)
{
this->overwriteMode(SettingsModel::Overwrite_KeepBoth);
}
}
void SettingsModel::syncNow(void)
@ -417,6 +424,7 @@ LAMEXP_MAKE_OPTION_S(customParametersFLAC, QString());
LAMEXP_MAKE_OPTION_S(customParametersOpus, QString());
LAMEXP_MAKE_OPTION_B(renameOutputFilesEnabled, false);
LAMEXP_MAKE_OPTION_S(renameOutputFilesPattern, "[<TrackNo>] <Artist> - <Title>");
LAMEXP_MAKE_OPTION_I(overwriteMode, Overwrite_KeepBoth);
LAMEXP_MAKE_OPTION_U(metaInfoPosition, UINT_MAX);
LAMEXP_MAKE_OPTION_U(maximumInstances, 0);
LAMEXP_MAKE_OPTION_S(customTempPath, QDesktopServices::storageLocation(QDesktopServices::TempLocation));

View File

@ -72,6 +72,12 @@ public:
ABRMode = 1,
CBRMode = 2
};
enum Overwrite
{
Overwrite_KeepBoth = 0,
Overwrite_SkipFile = 1,
Overwrite_Replaces = 2
};
//Consts
static const int mp3Bitrates[15];
@ -130,6 +136,7 @@ public:
LAMEXP_MAKE_OPTION_S(customParametersOpus);
LAMEXP_MAKE_OPTION_B(renameOutputFilesEnabled);
LAMEXP_MAKE_OPTION_S(renameOutputFilesPattern);
LAMEXP_MAKE_OPTION_I(overwriteMode);
LAMEXP_MAKE_OPTION_U(metaInfoPosition);
LAMEXP_MAKE_OPTION_U(maximumInstances);
LAMEXP_MAKE_OPTION_S(customTempPath);