Skip to content

Commit

Permalink
Add telemetry checkbox in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Belphemur committed Aug 23, 2021
1 parent 38cb95c commit 0161ec0
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
10 changes: 10 additions & 0 deletions SoundSwitch/Model/AppModel.cs
Expand Up @@ -120,6 +120,16 @@ public bool IncludeBetaVersions
}
}

public bool Telemetry
{
get => AppConfigs.Configuration.Telemetry;
set
{
AppConfigs.Configuration.Telemetry = value;
AppConfigs.Configuration.Save();
}
}


public IEnumerable<DeviceInfo> SelectedDevices => AppConfigs.Configuration.SelectedDevices.OrderBy(info => info.DiscoveredAt);

Expand Down
2 changes: 2 additions & 0 deletions SoundSwitch/Model/IAppModel.cs
Expand Up @@ -114,6 +114,8 @@ public interface IAppModel : IDisposable
/// </summary>
IAudioDeviceLister ActiveUnpluggedAudioLister { get; set; }

bool Telemetry { get; set; }

#endregion

#region Events
Expand Down
23 changes: 15 additions & 8 deletions SoundSwitch/UI/Forms/Settings.Designer.cs

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

2 changes: 2 additions & 0 deletions SoundSwitch/UI/Forms/Settings.cs
Expand Up @@ -178,6 +178,8 @@ public SettingsForm(IAudioDeviceLister audioDeviceLister)
muteHotKey.Visible = false;
muteHotKeyCheckbox.Visible = false;
toggleMuteLabel.Visible = false;

telemetryCheckbox.DataBindings.Add(nameof(CheckBox.Checked), AppModel.Instance, nameof(AppModel.Telemetry), false, DataSourceUpdateMode.OnPropertyChanged);

PopulateSettings();

Expand Down
3 changes: 3 additions & 0 deletions SoundSwitch/UI/Forms/Settings.resx
Expand Up @@ -57,4 +57,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="selectSoundFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

0 comments on commit 0161ec0

Please sign in to comment.