Skip to content

Commit

Permalink
Add autofilling songnames; add cell highlighting; add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
asdfCYBER committed Feb 12, 2022
1 parent 32b6472 commit 05ee89e
Show file tree
Hide file tree
Showing 12 changed files with 843 additions and 45 deletions.
22 changes: 10 additions & 12 deletions Dialogs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace PPTXcreator
{
static class Dialogs
public static class Dialogs
{
public static void GenericWarning(string message)
{
Expand Down Expand Up @@ -40,6 +40,10 @@ public static void GenericInformation(string title, string message)
);
}

/// <summary>
/// Show a folder selection window and check if the selected folder exists
/// </summary>
/// <returns>The path to the selected folder, or null if the path is invalid</returns>
public static string SelectFolder(string description)
{
FolderBrowserDialog folderDialog = new FolderBrowserDialog
Expand All @@ -62,6 +66,10 @@ public static string SelectFolder(string description)
return null;
}

/// <summary>
/// Show a file selection window and check if the selected file exists
/// </summary>
/// <returns>The path to the selected file, or null if the path is invalid</returns>
public static string SelectFile(string filter, string title)
{
OpenFileDialog fileDialog = new OpenFileDialog
Expand All @@ -87,16 +95,6 @@ public static string SelectFile(string filter, string title)
return null;
}

public static DialogResult CreateNewSettingsfile(string path)
{
return MessageBox.Show(
$"Het configuratiebestand is niet gevonden op locatie '{path}'. Wil je een nieuw bestand maken?",
"Er is een fout opgetreden",
MessageBoxButtons.YesNoCancel,
MessageBoxIcon.Warning
);
}

public static void UpdateAvailable(string newversion)
{
DialogResult result = MessageBox.Show(
Expand All @@ -108,7 +106,7 @@ public static void UpdateAvailable(string newversion)

if (result == DialogResult.Yes)
{
System.Diagnostics.Process.Start("https://github.com/Sionkerk-Houten/PPTXcreator/releases/latest");
System.Diagnostics.Process.Start("https://github.com/Sionkerk-Techniek/PPTXcreator/releases/latest");
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions PPTXcreator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
<Compile Include="Service.cs" />
<Compile Include="ServiceElement.cs" />
<Compile Include="PastorInfo.cs" />
<Compile Include="Songnames.cs" />
<Compile Include="UpdateChecker.cs" />
<Compile Include="Settings.cs" />
<Compile Include="Window.cs">
Expand Down Expand Up @@ -217,6 +218,7 @@
</Target>
<ItemGroup>
<Content Include="Resources\Icon.ico" />
<EmbeddedResource Include="Resources\liednamen" />
<None Include="Resources\outline_update_black_24dp_mirrored.png" />
<None Include="Resources\outline_update_black_24dp.png" />
</ItemGroup>
Expand Down
6 changes: 5 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace PPTXcreator
{
static class Program
public static class Program
{
public static Window MainWindow { get; private set; }

Expand All @@ -20,9 +20,12 @@ public static void Main()
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(CrashHandlerUI);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CrashHandlerDomain);

// Load settings, service information, songnames from disk
Settings.Load();
Service.UpdateJsonCache();
Songnames.LoadNames();

// Check for updates
if (Settings.Instance.EnableUpdateChecker) Task.Run(() => UpdateChecker.CheckReleases());

// start UI
Expand All @@ -31,6 +34,7 @@ public static void Main()
MainWindow = new Window();
Application.Run(MainWindow);

// Save settings when closing
Settings.Save();
}

Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: NeutralResourcesLanguage("nl")]
10 changes: 10 additions & 0 deletions Properties/Resources.Designer.cs

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

3 changes: 3 additions & 0 deletions Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,7 @@
<data name="outline_update_black_24dp_mirrored" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\outline_update_black_24dp_mirrored.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="liednamen" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\liednamen;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
Loading

0 comments on commit 05ee89e

Please sign in to comment.