Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
STBBRD committed Nov 4, 2023
2 parents 90f8b16 + c3c9a99 commit bb45d5c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ZongziTEK_Blackboard_Sticker/Classes/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@ public class Look
public class TimetableSettings
{
public bool useTimetable { get; set; } = true;
public bool enableTimetableNotification { get; set; } = true;
public bool useDefaultBNSPath = true;
public string BNSPath { get; set; } = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
}
}
4 changes: 4 additions & 0 deletions ZongziTEK_Blackboard_Sticker/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@
<ui:ToggleSwitch Name="ToggleSwitchUseTimetable" Header="使用带时间信息的课程表" OnContent="" OffContent="" IsOn="True" Toggled="ToggleSwitchUseTimetable_Toggled" Foreground="{DynamicResource ForegroundColor}"/>
<TextBlock Text="开启上面的开关后,将使用带时间信息的课程表,并且出现上下课提醒功能。关闭上面的开关后,课程表就是文本信息,方便编辑,但没有上下课提醒。"
TextWrapping="Wrap" Opacity="0.75"/>
<ui:ToggleSwitch Name="ToggleSwitchTimetableNotification" Header="启用上下课提醒" OnContent="" OffContent="" IsOn="True" Toggled="ToggleSwitchTimetableNotification_Toggled" Foreground="{DynamicResource ForegroundColor}"/>
<ui:ToggleSwitch Name="ToggleSwitchUseDefaultBNSPath" Header="使用默认黑板通知服务路径" OnContent="" OffContent="" IsOn="True" Toggled="ToggleSwitchUseDefaultBNSPath_Toggled" Foreground="{DynamicResource ForegroundColor}"/>
<TextBlock Text="黑板通知服务路径" FontSize="14"/>
<TextBox Name="TextBoxBNSPath" TextChanged="TextBoxBNSPath_TextChanged" Foreground="{DynamicResource ForegroundColor}"/>
</ui:SimpleStackPanel>
</GroupBox>
<GroupBox Header="关于" Foreground="{DynamicResource ForegroundColor}">
Expand Down
20 changes: 20 additions & 0 deletions ZongziTEK_Blackboard_Sticker/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,26 @@ private void ToggleSwitchUseTimetable_Toggled(object sender, RoutedEventArgs e)
SaveSettings();
}

private void ToggleSwitchTimetableNotification_Toggled(object sender, RoutedEventArgs e)
{
if (!isSettingsLoaded) return;
Settings.TimetableSettings.enableTimetableNotification = ToggleSwitchTimetableNotification.IsOn;
SaveSettings();
}

private void ToggleSwitchUseDefaultBNSPath_Toggled(object sender, RoutedEventArgs e)
{
TextBoxBNSPath.IsEnabled = !ToggleSwitchUseDefaultBNSPath.IsOn;
if (!isSettingsLoaded) return;
Settings.TimetableSettings.useDefaultBNSPath = ToggleSwitchUseDefaultBNSPath.IsOn;
SaveSettings();
}

private void TextBoxBNSPath_TextChanged(object sender, TextChangedEventArgs e)
{

}

#endregion

private void LoadSettings()
Expand Down

0 comments on commit bb45d5c

Please sign in to comment.