Skip to content

Commit

Permalink
new features backup
Browse files Browse the repository at this point in the history
- Added bulk (de)selection in the downloader; the user can select a chapter, hold shift and select another chapter, this will invert the selection of every chapter in between - as an example, if chapters 1 through 10 were all selected and I wanted to exclude them all I can select chapter 1, hold shift and select chapter 10; this will lead to chapters 1 through 10 inclusive to be deselected; please keep in mind that this *inverts the selection*
- After the download itself has finished in the downloader, the (now) cancel button will indicate that the program is creating the archive; this is to alleviate any worries with regards to the program temporarily not responding while creating the archive
- The program will now remember if it was maximized and will restore that on launch; this is on a per-system basis
  • Loading branch information
ErisLoona committed Jun 18, 2024
1 parent 561bb6d commit c1bc540
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 9 deletions.
18 changes: 18 additions & 0 deletions App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Manga_Library_Manager.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<Manga_Library_Manager.Properties.Settings>
<setting name="Maximized" serializeAs="String">
<value>False</value>
</setting>
<setting name="Location" serializeAs="String">
<value>0, 0</value>
</setting>
</Manga_Library_Manager.Properties.Settings>
</userSettings>
</configuration>
15 changes: 14 additions & 1 deletion Manga Library Manager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationIcon>ytpfp.ico</ApplicationIcon>
<NeutralLanguage>en</NeutralLanguage>
<FileVersion>2.1.0</FileVersion>
<FileVersion>2.2.0</FileVersion>
<PackageProjectUrl>https://github.com/ErisLoona/Manga-Library-Manager</PackageProjectUrl>
<Copyright>Eris Loona, pseudonym</Copyright>
<Description>A manga downloader and offline library manager.</Description>
<Version />
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>

<ItemGroup>
Expand All @@ -40,6 +41,11 @@
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
Expand All @@ -49,4 +55,11 @@
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>

</Project>
8 changes: 7 additions & 1 deletion Manga Library Manager.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34728.123
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Manga Library Manager", "Manga Library Manager.csproj", "{8F5E112A-6EEC-46F1-A5F0-845D93AE1BCE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Manga Library Manager", "Manga Library Manager.csproj", "{8F5E112A-6EEC-46F1-A5F0-845D93AE1BCE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8F5E112A-6EEC-46F1-A5F0-845D93AE1BCE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F5E112A-6EEC-46F1-A5F0-845D93AE1BCE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F5E112A-6EEC-46F1-A5F0-845D93AE1BCE}.Debug|x64.ActiveCfg = Debug|x64
{8F5E112A-6EEC-46F1-A5F0-845D93AE1BCE}.Debug|x64.Build.0 = Debug|x64
{8F5E112A-6EEC-46F1-A5F0-845D93AE1BCE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F5E112A-6EEC-46F1-A5F0-845D93AE1BCE}.Release|Any CPU.Build.0 = Release|Any CPU
{8F5E112A-6EEC-46F1-A5F0-845D93AE1BCE}.Release|x64.ActiveCfg = Release|x64
{8F5E112A-6EEC-46F1-A5F0-845D93AE1BCE}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<Platform>x64</Platform>
<PublishDir>bin\Release\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
Expand Down
2 changes: 1 addition & 1 deletion Properties/PublishProfiles/FolderProfile.pubxml.user
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2024-06-17T09:12:58.4583359Z||;True|2024-06-17T10:36:25.6841440+02:00||;True|2024-06-14T11:31:32.6934516+02:00||;True|2024-06-14T11:31:23.3706499+02:00||;True|2024-06-14T11:31:18.7205494+02:00||;True|2024-06-13T09:43:43.5390795+02:00||;True|2024-06-13T08:57:35.0322797+02:00||;True|2024-06-06T15:42:28.6568298+02:00||;True|2024-06-06T15:40:12.6240419+02:00||;True|2024-06-06T13:48:19.4662781+02:00||;True|2024-06-06T12:38:52.6425012+02:00||;True|2024-06-06T12:31:36.7948282+02:00||;True|2024-06-06T10:35:12.1369025+02:00||;True|2024-06-06T10:34:54.5189019+02:00||;True|2024-06-05T23:32:06.1114024+02:00||;True|2024-05-27T18:47:08.3065316+02:00||;True|2024-05-27T18:43:26.7575713+02:00||;True|2024-05-27T16:16:44.1211325+02:00||;True|2024-05-27T16:16:29.4947310+02:00||;True|2024-05-27T11:07:49.8981157+02:00||;True|2024-05-27T11:07:01.1240671+02:00||;True|2024-05-27T11:06:53.1694382+02:00||;True|2024-05-27T09:10:47.9526993+02:00||;True|2024-05-27T09:10:02.8503554+02:00||;True|2024-05-27T09:09:35.2317189+02:00||;True|2024-05-27T08:58:09.8645241+02:00||;True|2024-05-27T08:52:52.8051920+02:00||;True|2024-05-27T08:45:19.6197985+02:00||;True|2024-05-24T11:02:27.2916636+02:00||;True|2024-05-24T08:59:01.6326756+02:00||;True|2024-05-23T09:17:13.9644300+02:00||;True|2024-05-23T09:05:46.2467509+02:00||;True|2024-05-22T22:13:45.9526537+02:00||;True|2024-05-22T22:09:03.4000755+02:00||;True|2024-05-22T22:08:00.0350517+02:00||;True|2024-05-22T21:44:48.4725626+02:00||;True|2024-05-22T21:32:35.3627900+02:00||;True|2024-05-22T19:33:34.6467061+02:00||;True|2024-05-19T19:19:28.1467287+02:00||;True|2024-05-19T19:17:09.7006733+02:00||;True|2024-05-19T19:14:06.6668981+02:00||;True|2024-05-19T14:42:07.1301968+02:00||;True|2024-05-19T14:38:02.4943907+02:00||;True|2024-05-19T09:20:51.2871097+02:00||;True|2024-05-19T09:18:16.6124371+02:00||;True|2024-05-19T09:15:08.6048404+02:00||;True|2024-05-18T22:34:28.8521894+02:00||;True|2024-05-18T22:22:14.4673452+02:00||;True|2024-05-18T21:56:58.6143811+02:00||;True|2024-05-18T07:41:43.4161277+02:00||;True|2024-05-17T11:48:43.3293227+02:00||;True|2024-05-17T09:31:58.9329403+02:00||;True|2024-05-17T09:25:57.4957904+02:00||;True|2024-05-16T19:52:10.0997229+02:00||;True|2024-05-16T18:17:01.7850021+02:00||;True|2024-05-15T09:33:00.6957135+02:00||;True|2024-05-15T08:32:31.7735956+02:00||;True|2024-05-13T17:25:21.1454345+02:00||;True|2024-05-13T17:15:09.7285346+02:00||;True|2024-05-13T16:52:20.9054581+02:00||;True|2024-05-13T16:51:27.0891569+02:00||;True|2024-05-13T16:50:34.5522468+02:00||;True|2024-05-13T16:49:22.6946988+02:00||;</History>
<History>True|2024-06-18T16:11:20.9585577Z||;True|2024-06-18T17:54:04.9775606+02:00||;True|2024-06-18T17:53:03.5685184+02:00||;True|2024-06-18T17:52:26.3088028+02:00||;True|2024-06-17T11:12:58.4583359+02:00||;True|2024-06-17T10:36:25.6841440+02:00||;True|2024-06-14T11:31:32.6934516+02:00||;True|2024-06-14T11:31:23.3706499+02:00||;True|2024-06-14T11:31:18.7205494+02:00||;True|2024-06-13T09:43:43.5390795+02:00||;True|2024-06-13T08:57:35.0322797+02:00||;True|2024-06-06T15:42:28.6568298+02:00||;True|2024-06-06T15:40:12.6240419+02:00||;True|2024-06-06T13:48:19.4662781+02:00||;True|2024-06-06T12:38:52.6425012+02:00||;True|2024-06-06T12:31:36.7948282+02:00||;True|2024-06-06T10:35:12.1369025+02:00||;True|2024-06-06T10:34:54.5189019+02:00||;True|2024-06-05T23:32:06.1114024+02:00||;True|2024-05-27T18:47:08.3065316+02:00||;True|2024-05-27T18:43:26.7575713+02:00||;True|2024-05-27T16:16:44.1211325+02:00||;True|2024-05-27T16:16:29.4947310+02:00||;True|2024-05-27T11:07:49.8981157+02:00||;True|2024-05-27T11:07:01.1240671+02:00||;True|2024-05-27T11:06:53.1694382+02:00||;True|2024-05-27T09:10:47.9526993+02:00||;True|2024-05-27T09:10:02.8503554+02:00||;True|2024-05-27T09:09:35.2317189+02:00||;True|2024-05-27T08:58:09.8645241+02:00||;True|2024-05-27T08:52:52.8051920+02:00||;True|2024-05-27T08:45:19.6197985+02:00||;True|2024-05-24T11:02:27.2916636+02:00||;True|2024-05-24T08:59:01.6326756+02:00||;True|2024-05-23T09:17:13.9644300+02:00||;True|2024-05-23T09:05:46.2467509+02:00||;True|2024-05-22T22:13:45.9526537+02:00||;True|2024-05-22T22:09:03.4000755+02:00||;True|2024-05-22T22:08:00.0350517+02:00||;True|2024-05-22T21:44:48.4725626+02:00||;True|2024-05-22T21:32:35.3627900+02:00||;True|2024-05-22T19:33:34.6467061+02:00||;True|2024-05-19T19:19:28.1467287+02:00||;True|2024-05-19T19:17:09.7006733+02:00||;True|2024-05-19T19:14:06.6668981+02:00||;True|2024-05-19T14:42:07.1301968+02:00||;True|2024-05-19T14:38:02.4943907+02:00||;True|2024-05-19T09:20:51.2871097+02:00||;True|2024-05-19T09:18:16.6124371+02:00||;True|2024-05-19T09:15:08.6048404+02:00||;True|2024-05-18T22:34:28.8521894+02:00||;True|2024-05-18T22:22:14.4673452+02:00||;True|2024-05-18T21:56:58.6143811+02:00||;True|2024-05-18T07:41:43.4161277+02:00||;True|2024-05-17T11:48:43.3293227+02:00||;True|2024-05-17T09:31:58.9329403+02:00||;True|2024-05-17T09:25:57.4957904+02:00||;True|2024-05-16T19:52:10.0997229+02:00||;True|2024-05-16T18:17:01.7850021+02:00||;True|2024-05-15T09:33:00.6957135+02:00||;True|2024-05-15T08:32:31.7735956+02:00||;True|2024-05-13T17:25:21.1454345+02:00||;True|2024-05-13T17:15:09.7285346+02:00||;True|2024-05-13T16:52:20.9054581+02:00||;True|2024-05-13T16:51:27.0891569+02:00||;True|2024-05-13T16:50:34.5522468+02:00||;True|2024-05-13T16:49:22.6946988+02:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
50 changes: 50 additions & 0 deletions Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Properties/Settings.settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Manga_Library_Manager.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="Maximized" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="Location" Type="System.Drawing.Point" Scope="User">
<Value Profile="(Default)">0, 0</Value>
</Setting>
</Settings>
</SettingsFile>
11 changes: 11 additions & 0 deletions mainMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ private void mainMenu_Load(object sender, EventArgs e)
searchTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
searchTextBox.AutoCompleteCustomSource = searchTextBoxAutomcompleteStrings;
mangaDescControls(false);
if (Properties.Settings.Default.Maximized == true)
{
this.Location = Properties.Settings.Default.Location;
this.WindowState = FormWindowState.Maximized;
}
}

private void mangaDescControls(bool show)
Expand Down Expand Up @@ -1040,6 +1045,12 @@ private void mainMenu_FormClosing(object sender, FormClosingEventArgs e)
form.Dispose();
}
}
if (this.WindowState == FormWindowState.Maximized)
Properties.Settings.Default.Maximized = true;
else
Properties.Settings.Default.Maximized = false;
Properties.Settings.Default.Location = this.RestoreBounds.Location;
Properties.Settings.Default.Save();
}

private void tagsTextBox_Enter(object sender, EventArgs e)
Expand Down
2 changes: 1 addition & 1 deletion mangaDownloader.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 23 additions & 1 deletion mangaDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public partial class mangaDownloader : Form
private bool downloading = false, excludedExtras = false, linkChanged = false;
private List<string> tempChapterIDs = new List<string>();
private string savingPath;
private int startOffset = 2;
private int startOffset = 2, oldChapterIndex = -1;
private List<decimal> tempChapterNumbers = new List<decimal>();
private List<int> checkedIndexes = new List<int>(), duplicateIndexes = new List<int>(), chapterNrPages = new List<int>();
private mainMenu.eBook becomingBook = new mainMenu.eBook();
Expand Down Expand Up @@ -446,6 +446,7 @@ private void downloadButton_Click(object sender, EventArgs e)
return;
}
downloading = true;
selectedChaptersList.SelectedIndex = -1;
if (titleSelectionDropDown.SelectedIndex == 0)
titleSelectionDropDown.SelectedIndex = 1;
string fileName = becomingBook.Title;
Expand All @@ -464,6 +465,7 @@ private void downloadButton_Click(object sender, EventArgs e)
pageFileNames.Clear();
SendMessage(this.Handle, 11, false, 0);
controlStatus(false);
selectedChaptersList.Enabled = true;
downloadButton.Text = "Cancel Download";
downloadButton.Font = new(downloadButton.Font, FontStyle.Bold | FontStyle.Italic);
downloadButton.Enabled = true;
Expand Down Expand Up @@ -881,6 +883,7 @@ private void downloaderThread_RunWorkerCompleted(object sender, RunWorkerComplet
else
{
downloadButton.Enabled = false;
downloadButton.Text = "Creating archive. Please wait!";
becomingBook.Path += ".cbz";
string fileName = becomingBook.Title;
foreach (char c in Path.GetInvalidFileNameChars())
Expand Down Expand Up @@ -1103,6 +1106,7 @@ private void epubMakerThread_RunWorkerCompleted(object sender, RunWorkerComplete
if (e.Cancelled == true)
return;
downloadButton.Enabled = false;
downloadButton.Text = "Creating archive. Please wait!";
becomingBook.Path += ".epub";
string fileName = becomingBook.Title;
foreach (char c in Path.GetInvalidFileNameChars())
Expand Down Expand Up @@ -1168,5 +1172,23 @@ public string padDecimal(decimal value, string padding)
return Convert.ToInt32(Math.Floor(value)).ToString(padding) + (value - Convert.ToInt32(Math.Floor(value))).ToString().Substring(1);
return Convert.ToInt32(value).ToString(padding);
}

private void selectedChaptersList_SelectedIndexChanged(object sender, EventArgs e)
{
if (selectedChaptersList.SelectedIndex == -1)
return;
if (downloading == true)
{
selectedChaptersList.SetItemChecked(selectedChaptersList.SelectedIndex, !selectedChaptersList.GetItemChecked(selectedChaptersList.SelectedIndex));
selectedChaptersList.SelectedIndexChanged -= selectedChaptersList_SelectedIndexChanged;
selectedChaptersList.SelectedIndex = -1;
selectedChaptersList.SelectedIndexChanged += selectedChaptersList_SelectedIndexChanged;
return;
}
if (oldChapterIndex != -1 && (Control.ModifierKeys & Keys.Shift) == Keys.Shift)
for (int i = Int32.Min(selectedChaptersList.SelectedIndex, oldChapterIndex) + 1; i < Int32.Max(selectedChaptersList.SelectedIndex, oldChapterIndex); i++)
selectedChaptersList.SetItemChecked(i, !selectedChaptersList.GetItemChecked(i));
oldChapterIndex = selectedChaptersList.SelectedIndex;
}
}
}
6 changes: 3 additions & 3 deletions mangaDownloader.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>172, 30</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="searchButton.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Expand Down Expand Up @@ -308,6 +305,9 @@
kiRJkiRJkiRJkiRJkiRJkiRpCdzsZv8flKSpI1rW7bUAAAAASUVORK5CYII=
</value>
</data>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>172, 30</value>
</metadata>
<metadata name="folderBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>19, 26</value>
</metadata>
Expand Down

0 comments on commit c1bc540

Please sign in to comment.