Skip to content

Commit 5892c19

Browse files
committed
- Change the to have "no default" option for Scrub
- Update nuget packages - Switch to "canary" Krypton dlls to use the "No Close" button - Fix fallout for Krypton Usage - Ensure Dll Search paths" are locked down - Add icon to the log view - Correct some compiler warnings - Update (c) year in altered files #85
1 parent da13321 commit 5892c19

21 files changed

Lines changed: 345 additions & 55 deletions

Elucidate/Elucidate/CmdLine/ScrubVerb.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// ---------------------------------------------------------------------------------------------------------------
33
// <copyright file="ScrubVerb.cs" company="Smurf-IV">
44
//
5-
// Copyright (C) 2018 Simon Coghlan (Aka Smurf-IV)
5+
// Copyright (C) 2018-2022 Simon Coghlan (Aka Smurf-IV)
66
//
77
// This program is free software: you can redistribute it and/or modify
88
// it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
3030

3131
namespace Elucidate.CmdLine
3232
{
33-
[Verb("scrub", HelpText = "Defaults to 100% (-p100) of all of blocks (older than 0 days = -o0).\r\nBlocks alre" +
33+
[Verb("scrub", HelpText = "Defaults to 8% of all of blocks (oldest unchecked first).\r\nBlocks alre" +
3434
"ady marked as bad are always checked.\r\nUse \"Additional Command\" to override the " +
3535
"default of 100% of 0 days")]
3636
internal class ScrubVerb : StdOptions

Elucidate/Elucidate/Controls/DataGridViewTripleValueBarColumn.cs

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
1-
using System.ComponentModel;
1+
#region Copyright (C)
2+
// ---------------------------------------------------------------------------------------------------------------
3+
// <copyright file="LogsViewerControl.cs" company="Smurf-IV">
4+
//
5+
// Copyright (C) 2019-2022 Simon Coghlan (Aka Smurf-IV)
6+
//
7+
// This program is free software: you can redistribute it and/or modify
8+
// it under the terms of the GNU General Public License as published by
9+
// the Free Software Foundation, either version 2 of the License, or
10+
// any later version.
11+
//
12+
// This program is distributed in the hope that it will be useful,
13+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
// GNU General Public License for more details.
16+
//
17+
// You should have received a copy of the GNU General Public License
18+
// along with this program. If not, see http://www.gnu.org/licenses/.
19+
// </copyright>
20+
// <summary>
21+
// Url: https://github.com/Smurf-IV/Elucidate
22+
// Email: https://github.com/Smurf-IV
23+
// </summary>
24+
// --------------------------------------------------------------------------------------------------------------------
25+
#endregion
26+
27+
using System.ComponentModel;
228
using System.Drawing;
329
using System.Windows.Forms;
430

@@ -52,6 +78,11 @@ protected override void Paint(Graphics g, Rectangle clipBounds, Rectangle cellBo
5278
float.TryParse(values[1], out var mid);
5379
float.TryParse(values[2], out var max);
5480

81+
if (max <= 0)
82+
{
83+
return;
84+
}
85+
5586
var lowPercent = low / max;
5687
var midPercent = mid / max;
5788
// Draws the cell grid

Elucidate/Elucidate/Controls/LogsViewerControl.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// ---------------------------------------------------------------------------------------------------------------
33
// <copyright file="LogsViewerControl.cs" company="Smurf-IV">
44
//
5-
// Copyright (C) 2018-2021 Simon Coghlan (Aka Smurf-IV) & BlueBlock 2018
5+
// Copyright (C) 2018-2022 Simon Coghlan (Aka Smurf-IV) & BlueBlock 2018
66
//
77
// This program is free software: you can redistribute it and/or modify
88
// it under the terms of the GNU General Public License as published by
@@ -41,13 +41,9 @@ public partial class LogsViewerControl : UserControl
4141
private static readonly Logger Log = LogManager.GetCurrentClassLogger();
4242

4343
public enum LexerNameEnum { ScanRaid, NLog }
44-
4544
public LexerNameEnum LexerToUse { get; set; } = LexerNameEnum.NLog;
4645

4746
private readonly FileSystemWatcher logFileWatcher = new();
48-
49-
private string selectedDirectoryTitle;
50-
5147
private readonly string snapraidErrorSearchTerm = @"error: ";
5248
private readonly string snapraidWarningSearchTerm = @"WARNING";
5349
private readonly string elucidateErrorSearchTerm = @"] ERROR ";
@@ -104,7 +100,8 @@ private void UpdateLogFileList(string selectedDirectoryTitle = null)
104100
}
105101
else
106102
{
107-
this.selectedDirectoryTitle = selectedDirectoryTitle;
103+
// TODO:
104+
//this.selectedDirectoryTitle = selectedDirectoryTitle;
108105
}
109106

110107
string errorSearchTerm;

Elucidate/Elucidate/Controls/RunControl.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#region Copyright (C)
22
// <copyright file="RunControl.cs" company="Smurf-IV">
33
//
4-
// Copyright (C) 2018-2021 Smurf-IV & BlueBlock 2018
4+
// Copyright (C) 2018-2022 Smurf-IV & BlueBlock 2018
55
//
66
// This program is free software: you can redistribute it and/or modify
77
// it under the terms of the GNU General Public License as published by
@@ -168,7 +168,6 @@ internal void StartSnapRaidProcess(CommandType commandToRun, Stack<string> paths
168168
break;
169169
case CommandType.Scrub:
170170
command.Append(@"scrub");
171-
defaultOption = @" -p100 -o0";
172171
break;
173172
case CommandType.Fix:
174173
command.Append(@"fix");
@@ -650,12 +649,15 @@ private enum ThreadAccess
650649
}
651650

652651
[DllImport(@"kernel32.dll")]
652+
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
653653
private static extern IntPtr OpenThread(ThreadAccess dwDesiredAccess, bool bInheritHandle, uint dwThreadId);
654654

655655
[DllImport(@"kernel32.dll")]
656+
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
656657
private static extern uint SuspendThread(IntPtr hThread);
657658

658659
[DllImport("kernel32.dll")]
660+
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
659661
private static extern int ResumeThread(IntPtr hThread);
660662

661663
public static void Suspend(this Process process)

Elucidate/Elucidate/Elucidate.csproj

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<!--<TargetFrameworks>net48;net5.0-windows;net6.0-windows</TargetFrameworks>-->
3+
<!--<TargetFrameworks>net48;net6.0-windows</TargetFrameworks>-->
44
<TargetFramework>net48</TargetFramework>
55
<OutputType>WinExe</OutputType>
66
<RootNamespace>Elucidate</RootNamespace>
@@ -39,22 +39,18 @@
3939
<Version>2.1.1</Version>
4040
</PackageReference>
4141
<PackageReference Include="CommandLineParser">
42-
<Version>2.8.0</Version>
42+
<Version>2.9.1</Version>
4343
</PackageReference>
4444
<PackageReference Include="Exceptionless.NLog">
45-
<Version>4.6.2</Version>
45+
<Version>4.8.0</Version>
4646
</PackageReference>
4747
<PackageReference Include="Exceptionless.Windows">
48-
<Version>4.6.2</Version>
49-
</PackageReference>
50-
<PackageReference Include="Krypton.Navigator">
51-
<Version>6.2111.312</Version>
52-
</PackageReference>
53-
<PackageReference Include="Krypton.Toolkit">
54-
<Version>6.2111.312</Version>
48+
<Version>4.8.0</Version>
5549
</PackageReference>
50+
<PackageReference Include="Krypton.Navigator.Canary" Version="80.22.11.325-beta" />
51+
<PackageReference Include="Krypton.Toolkit.Canary" Version="80.22.11.325-beta" />
5652
<PackageReference Include="NLog">
57-
<Version>4.7.13</Version>
53+
<Version>4.7.15</Version>
5854
</PackageReference>
5955
</ItemGroup>
6056
<ItemGroup>

Elucidate/Elucidate/Forms/CalculateBlockSize.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// ---------------------------------------------------------------------------------------------------------------
33
// <copyright file="CalculateBlockSize.cs" company="Smurf-IV">
44
//
5-
// Copyright (C) 2010-2021 Simon Coghlan (Aka Smurf-IV)
5+
// Copyright (C) 2010-2022 Simon Coghlan (Aka Smurf-IV)
66
//
77
// This program is free software: you can redistribute it and/or modify
88
// it under the terms of the GNU General Public License as published by
@@ -109,7 +109,7 @@ private static string FindNextPow2(ulong val)
109109
private static void FindAndAddDisplaySizes(string path, ref ulong min, ref ulong max)
110110
{
111111
// ReSharper disable once UnusedVariable
112-
Util.SourcePathFreeBytesAvailable(path, out var freeBytesAvailable, out var pathUsedBytes, out var rootBytesNotCoveredByPath);
112+
Util.SourcePathFreeBytesAvailable(path, out var freeBytesAvailable, out var pathUsedBytes, out var _);
113113

114114
min += pathUsedBytes;
115115
max += pathUsedBytes;

Elucidate/Elucidate/Forms/ElucidateForm.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// ---------------------------------------------------------------------------------------------------------------
33
// <copyright file="ElucidateForm.cs" company="Smurf-IV">
44
//
5-
// Copyright (C) 2010-2021 Simon Coghlan (Aka Smurf-IV)
5+
// Copyright (C) 2010-2022 Simon Coghlan (Aka Smurf-IV)
66
//
77
// This program is free software: you can redistribute it and/or modify
88
// it under the terms of the GNU General Public License as published by
@@ -117,7 +117,7 @@ private void ElucidateForm_Shown(object sender, EventArgs e)
117117
$"There are warnings for the configuration file:{Environment.NewLine} - {string.Join(" - ", srConfig.ConfigWarnings)}",
118118
"Configuration File Warnings",
119119
MessageBoxButtons.OK,
120-
MessageBoxIcon.Warning);
120+
KryptonMessageBoxIcon.Warning);
121121
}
122122
else
123123
{
@@ -208,7 +208,7 @@ private void deleteAllSnapRAIDRaidFilesToolStripMenuItem_Click(object sender, Ev
208208
sb.ToString(),
209209
@"Delete All SnapRAID Files",
210210
MessageBoxButtons.YesNoCancel,
211-
MessageBoxIcon.Warning);
211+
KryptonMessageBoxIcon.Warning);
212212

213213
if (result == DialogResult.Yes)
214214
{

Elucidate/Elucidate/Forms/LiveLog.Designer.cs

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)