Skip to content

Commit

Permalink
v1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
user413 committed Aug 14, 2022
1 parent 94c989c commit 2fc9af1
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/packages
/test

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
Expand Down
4 changes: 2 additions & 2 deletions BackupHelper/BackupHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
<NoWin32Manifest>true</NoWin32Manifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="FileControlUtility, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FileControlUtility.1.1.0\lib\netstandard2.0\FileControlUtility.dll</HintPath>
<Reference Include="FileControlUtility, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FileControlUtility.1.2.0\lib\netstandard2.0\FileControlUtility.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
4 changes: 2 additions & 2 deletions BackupHelper/FileControlConsoleImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected override void HandleCurrentFileExecution(string trimmedPathWithFileNam
protected override FileTransferErrorActionNonRepeatable HandleTransferErrorNonRepeatable(string errorMessage, Exception e, FileInfo originFile,
string destinyDir, TransferSettings settings)
{
if (!showDialogs) return FileTransferErrorActionNonRepeatable.JUMP;
if (!showDialogs) return FileTransferErrorActionNonRepeatable.SKIP;

FormErrorDialog form = new FormErrorDialog(typeof(FileTransferErrorActionNonRepeatable), errorMessage);
form.ShowDialog();
Expand All @@ -31,7 +31,7 @@ protected override FileTransferErrorActionNonRepeatable HandleTransferErrorNonRe
protected override FileTransferErrorActionRepeatable HandleTransferErrorRepeatable(string errorMessage, Exception e, FileInfo originFile,
string destinyDir, TransferSettings settings)
{
if (!showDialogs) return FileTransferErrorActionRepeatable.JUMP;
if (!showDialogs) return FileTransferErrorActionRepeatable.SKIP;

FormErrorDialog form = new FormErrorDialog(typeof(FileTransferErrorActionRepeatable), errorMessage);
form.ShowDialog();
Expand Down
19 changes: 15 additions & 4 deletions BackupHelper/FormEditOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,19 @@ public partial class FormEditOptions : Form
private readonly FormOptionsMenu OptionsMenu;
public Options Option;
private readonly FormAction FormAction = FormAction.CREATE;
private static FormEditOptions Instance = null;

public FormEditOptions(FormOptionsMenu optionsMenu, Options option = null)
public static FormEditOptions GetInstance(FormOptionsMenu optionsMenu, Options option = null)
{
if (Instance != null && Instance.IsHandleCreated && option != Instance.Option) Instance.Close();

if (Instance == null || !Instance.IsHandleCreated)
Instance = new FormEditOptions(optionsMenu, option);

return Instance;
}

private FormEditOptions(FormOptionsMenu optionsMenu, Options option = null)
{
InitializeComponent();

Expand Down Expand Up @@ -65,7 +76,7 @@ private void FillCamps(Options option)
checkBoxCleanDestinyDirectory.Checked = option.CleanDestinyDirectory;
checkBoxDeleteUncommonFiles.Checked = option.DeleteUncommonFiles;
checkBoxManageFileNamesAndExtensions.Checked = option.AllowIgnoreFileExt;
radioButtonIgnore.Checked = option.SpecifiedFileNamesOrExtensionsMode == SpecifiedFileNamesAndExtensionsMode.IGNORE;
radioButtonIgnore.Checked = option.SpecifiedFileNamesOrExtensionsMode == SpecifiedEntriesMode.IGNORE;
checkBoxReenumerate.Checked = option.ReenumerateRenamedFiles;
numericUpDownMaxKeptRenamedFileCount.Value = option.MaxKeptRenamedFileCount;

Expand Down Expand Up @@ -185,8 +196,8 @@ private void SaveFieldsToObject(Options editedOption)
editedOption.SourcePath = textBoxSourcePath.Text;
editedOption.DestinyPath = textBoxDestinyPath.Text;
editedOption.FileNameConflictMethod = (FileNameConflictMethod)comboBoxMethod.SelectedIndex;
editedOption.SpecifiedFileNamesOrExtensionsMode = radioButtonIgnore.Checked ? SpecifiedFileNamesAndExtensionsMode.IGNORE :
SpecifiedFileNamesAndExtensionsMode.ALLOW_ONLY;
editedOption.SpecifiedFileNamesOrExtensionsMode = radioButtonIgnore.Checked ? SpecifiedEntriesMode.IGNORE :
SpecifiedEntriesMode.ALLOW_ONLY;
editedOption.IncludeSubFolders = checkBoxMoveSubfolders.Checked;
editedOption.KeepOriginFiles = checkBoxKeepOriginFiles.Checked;
editedOption.CleanDestinyDirectory = checkBoxCleanDestinyDirectory.Checked;
Expand Down
4 changes: 2 additions & 2 deletions BackupHelper/FormErrorDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public FormErrorDialog(Type actionType, string message)
private void ButtonErrorDialogIgnore_Click(object sender, EventArgs e)
{
if (ActionType == typeof(FileTransferErrorActionRepeatable))
Result = FileTransferErrorActionRepeatable.JUMP;
Result = FileTransferErrorActionRepeatable.SKIP;
if (ActionType == typeof(FileTransferErrorActionNonRepeatable))
Result = FileTransferErrorActionNonRepeatable.JUMP;
Result = FileTransferErrorActionNonRepeatable.SKIP;

Close();
}
Expand Down
20 changes: 14 additions & 6 deletions BackupHelper/FormOptionsMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,12 @@ private void ButtonAddOption_Click(object sender, EventArgs args)
{
try
{
FormEditOptions form = new FormEditOptions(this);
form.Show();
FormEditOptions form = FormEditOptions.GetInstance(this);

if (form.Visible)
form.WindowState = FormWindowState.Normal;
else
form.Show(this);
}
catch (Exception e)
{
Expand All @@ -227,10 +231,14 @@ private void EditSelectedOption()
{
try
{
ListViewItem item = listViewOptions.SelectedItems[0];
Options option = Options.Find(o => o.Id == (int)item.Tag);
FormEditOptions edit = new FormEditOptions(this, option);
edit.Show(this);
Options option = Options.Find(o => o.Id == (int)listViewOptions.SelectedItems[0].Tag);

FormEditOptions form = FormEditOptions.GetInstance(this, option);

if (form.Visible)
form.WindowState = FormWindowState.Normal;
else
form.Show(this);
}
catch (ArgumentOutOfRangeException)
{
Expand Down
4 changes: 2 additions & 2 deletions BackupHelper/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ static void Main(string[] args)
}

UpdateLastTimeExecuted(profile);
fileControl.ManageFiles(DBAccess.ListProfileOptions(profile).ToList<TransferSettings>());
fileControl.ManageFiles(profile.Options.ToList<TransferSettings>());
}
catch (Exception e)
{
LogManager.WriteLine($"Error: {e.Message} while executing \"{profile.Name}\".");
dialogMessage = $"Error: {e.Message} while executing \"{profile.Name}\". Proceed to the next profile?";
dialogMessage = $"Error: \"{e.Message}\" while executing \"{profile.Name}\". Proceed to the next profile?";
if (showDialogs && MessageBox.Show(dialogMessage, "", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
{
LogManager.WriteLine("Transfer canceled by user.");
Expand Down
4 changes: 2 additions & 2 deletions BackupHelper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
[assembly: AssemblyProduct("BackupHelper")]
[assembly: AssemblyCopyright("Copyright © Nain 2021")]
[assembly: AssemblyTrademark("Nain")]
[assembly: AssemblyVersion("1.4.0")]
[assembly: AssemblyFileVersion("1.4.0")]
[assembly: AssemblyVersion("1.4.1")]
[assembly: AssemblyFileVersion("1.4.1")]
[assembly: NeutralResourcesLanguage("en-US")]
2 changes: 1 addition & 1 deletion BackupHelper/SQLiteAccess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public static List<Options> ListProfileOptions(Profile prof)
DeleteUncommonFiles = reader1.GetBoolean(reader1.GetOrdinal("opt_delete_uncommon_files")),
AllowIgnoreFileExt = reader1.GetBoolean(reader1.GetOrdinal("opt_allowignore_file_ext")),
FileNameConflictMethod = (FileNameConflictMethod)reader1.GetInt32(reader1.GetOrdinal("opt_filename_conflict_method")),
SpecifiedFileNamesOrExtensionsMode = (SpecifiedFileNamesAndExtensionsMode)reader1.GetInt32(reader1.GetOrdinal("opt_spec_filenames_and_exts_mode")),
SpecifiedFileNamesOrExtensionsMode = (SpecifiedEntriesMode)reader1.GetInt32(reader1.GetOrdinal("opt_spec_filenames_and_exts_mode")),
ReenumerateRenamedFiles = reader1.GetBoolean(reader1.GetOrdinal("opt_reenumerate_renamed_files")),
MaxKeptRenamedFileCount = reader1.GetInt32(reader1.GetOrdinal("opt_max_kept_renamed_file_count"))
};
Expand Down
2 changes: 1 addition & 1 deletion BackupHelper/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FileControlUtility" version="1.1.0" targetFramework="net472" />
<package id="FileControlUtility" version="1.2.0" targetFramework="net472" />
<package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.115.5" targetFramework="net472" />
<package id="System.Data.SQLite.Core" version="1.0.115.5" targetFramework="net472" />
</packages>
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
## 1.4.1

Fixed/altered:
- Parameter execution for options with paths containing environment variables - fix
- Single open edit option window - fix

## 1.4.0

Database not compatible with previous version

New features:
- Options to re-enumerate and limit the quantity of files enumerated with the pattern <name> (<number>)<extension> (rename different files) - adapted to FileControlUtility v1.1.0 library
- Options to re-enumerate and limit the quantity of files enumerated with the pattern "&lt;name&gt; (&lt;number&gt;)&lt;extension&gt;" (rename different files) - adapted to
FileControlUtility v1.1.0 library

Fixes/changes:
- Display log text on cmd window when executing profiles through parameters - fix
Expand Down

0 comments on commit 2fc9af1

Please sign in to comment.