Skip to content

Commit

Permalink
Merge pull request #17 from banksio/beta0.6
Browse files Browse the repository at this point in the history
Beta 0.6
  • Loading branch information
banksio committed Jan 15, 2019
2 parents 5048980 + 0906312 commit b8c15ea
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 9 deletions.
12 changes: 12 additions & 0 deletions KeyboardDisplay/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +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="KeyboardDisplay.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
<userSettings>
<KeyboardDisplay.Properties.Settings>
<setting name="alwaysOn" serializeAs="String">
<value>False</value>
</setting>
</KeyboardDisplay.Properties.Settings>
</userSettings>
</configuration>
9 changes: 6 additions & 3 deletions KeyboardDisplay/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,12 @@ private async void ShowChange(CancellationToken token)
{
//tokenSource.Dispose();
}
Storyboard sb2 = FindResource("FadeOut") as Storyboard;
Storyboard.SetTarget(sb2, this);
sb2.Begin();
if (Properties.Settings.Default.alwaysOn == false)
{
Storyboard sb2 = FindResource("FadeOut") as Storyboard;
Storyboard.SetTarget(sb2, this);
sb2.Begin();
}
}

protected override void OnSourceInitialized(EventArgs e)
Expand Down
12 changes: 12 additions & 0 deletions KeyboardDisplay/Properties/Settings.Designer.cs

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

12 changes: 7 additions & 5 deletions KeyboardDisplay/Properties/Settings.settings
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="KeyboardDisplay.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="alwaysOn" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>
3 changes: 2 additions & 1 deletion KeyboardDisplay/Window1.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:KeyboardDisplay"
mc:Ignorable="d"
Title="Keyboard Display Settings" Icon="Resources/KBDDisp.ico" SizeToContent="Height" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Width="300">
Title="Keyboard Display Settings" Icon="Resources/KBDDisp.ico" SizeToContent="Height" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Width="424.413" Loaded="Window_Loaded">

<StackPanel Margin="10,0,10,10" VerticalAlignment="Top">
<Label Padding="0,0,0,20" Content="Settings" FontFamily="Segoe UI Light" FontSize="48" HorizontalAlignment="Left" VerticalAlignment="Top"/>
<CheckBox x:Name="startupCheckbox" Content="Start at sign in (current user)" HorizontalAlignment="Left" VerticalAlignment="Top" Click="StartupCheckbox_Click"/>
<CheckBox x:Name="startupCheckbox_AllUsers" Content="Start at sign in (all users)" HorizontalAlignment="Left" VerticalAlignment="Top" Click="StartupCheckbox_AllUsers_Click" IsEnabled="False"/>
<CheckBox x:Name="alwaysOnCheckbox" Content="Always show lock status (active on next lock change)" HorizontalAlignment="Left" VerticalAlignment="Top" Click="alwaysOnCheckbox_Click" Margin="0,15,0,0"/>
<Button Margin="10" Content="OK" Width="73" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="21" Click="Button_Click"/>
</StackPanel>
</Window>
14 changes: 14 additions & 0 deletions KeyboardDisplay/Window1.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ namespace KeyboardDisplay
/// </summary>
public partial class Window1 : Window
{

public Window1()
{
InitializeComponent();

//set checkbox
startupCheckbox.IsChecked = Functions.GetStartupRegistryKeyStatus("currentUser");
startupCheckbox_AllUsers.IsChecked = Functions.GetStartupRegistryKeyStatus("localMachine");
alwaysOnCheckbox.IsChecked = Properties.Settings.Default.alwaysOn;
}

private void StartupCheckbox_Click(object sender, RoutedEventArgs e)
Expand Down Expand Up @@ -59,5 +61,17 @@ private void Button_Click(object sender, RoutedEventArgs e)
{
this.Close();
}

private void alwaysOnCheckbox_Click(object sender, RoutedEventArgs e)
{
Properties.Settings.Default.alwaysOn = alwaysOnCheckbox.IsChecked.Value;
Properties.Settings.Default.Save();

}

private void Window_Loaded(object sender, RoutedEventArgs e)
{

}
}
}
Binary file added Output/setup.exe
Binary file not shown.
56 changes: 56 additions & 0 deletions setupScript.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Keyboard Display"
#define MyAppVersion "b0.5"
#define MyAppPublisher "Nathan Banks"
#define MyAppURL "https://www.github.com/banksio/KeyboardDisplay"
#define MyAppExeName "KeyboardDisplay.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{28C8AB21-2F98-4D95-8591-052EC938186E}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

[Tasks]
Name: startAtLogon; Description: "Start at sign in"; GroupDescription: "Startup parameters:"
Name: startAtLogon\common; Description: "For all users"; GroupDescription: "Startup parameters"; Flags: exclusive
Name: startAtLogon\user; Description: "For the current user only"; GroupDescription:"Startup parameters"; Flags: exclusive unchecked

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "F:\Development\GitHub\originals\KeyboardDisplay\KeyboardDisplay\bin\Release\KeyboardDisplay.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\Development\GitHub\originals\KeyboardDisplay\KeyboardDisplay\bin\Release\Hardcodet.Wpf.TaskbarNotification.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\Development\GitHub\originals\KeyboardDisplay\KeyboardDisplay\bin\Release\Hardcodet.Wpf.TaskbarNotification.pdb"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\Development\GitHub\originals\KeyboardDisplay\KeyboardDisplay\bin\Release\Hardcodet.Wpf.TaskbarNotification.xml"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\Development\GitHub\originals\KeyboardDisplay\KeyboardDisplay\bin\Release\KeyboardDisplay.exe.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\Development\GitHub\originals\KeyboardDisplay\KeyboardDisplay\bin\Release\KeyboardDisplay.pdb"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"

[Registry]
Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "KbdDispStart"; ValueData: """{app}\KeyboardDisplay.exe"""; Flags: uninsdeletevalue; Tasks: startAtLogon\user
Root: HKLM; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "KbdDispStart"; ValueData: """{app}\KeyboardDisplay.exe"""; Flags: uninsdeletevalue; Tasks: startAtLogon\common

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

0 comments on commit b8c15ea

Please sign in to comment.