@@ -12,6 +12,7 @@ namespace PSpaceStatusChanger
1212 public partial class Options : Form
1313 {
1414 bool autorun_enabled = false ;
15+ int silent = 0 ;
1516
1617 public Options ( )
1718 {
@@ -22,34 +23,35 @@ public Options()
2223 void Options_Load ( object sender , EventArgs e )
2324 {
2425 autorun_enabled = Program . IsStartupItem ( ) ;
26+ silent = Properties . Settings . Default . silent_mode ;
2527
2628 if ( autorun_enabled )
2729 {
2830 IsEnabledLbl . Text = "ENABLED" ;
2931 IsEnabledLbl . ForeColor = Color . DarkGreen ;
30- ToggleActionBtn . Text = "Disable Autorun" ;
32+ AutoRunChkBox . Checked = true ;
3133 }
3234 else
3335 {
3436 IsEnabledLbl . Text = "DISABLED" ;
3537 IsEnabledLbl . ForeColor = Color . DarkRed ;
36- ToggleActionBtn . Text = "Enable Autorun" ;
38+ AutoRunChkBox . Checked = false ;
3739 }
3840
39- TimeIntTxt . Text = Properties . Settings . Default . refresh_interval . ToString ( ) ;
40- }
41-
42- private void ToggleActionBtn_Click ( object sender , EventArgs e )
43- {
44- if ( autorun_enabled )
41+ if ( silent == 1 )
4542 {
46- Program . DisableAutoStartup ( ) ;
43+ SilentIsEnabledLbl . Text = "ENABLED" ;
44+ SilentIsEnabledLbl . ForeColor = Color . DarkGreen ;
45+ SilentChkBox . Checked = true ;
4746 }
4847 else
4948 {
50- Program . EnableAutoStartup ( ) ;
49+ SilentIsEnabledLbl . Text = "DISABLED" ;
50+ SilentIsEnabledLbl . ForeColor = Color . DarkRed ;
51+ SilentChkBox . Checked = false ;
5152 }
52- Options_Load ( null , null ) ;
53+
54+ TimeIntTxt . Text = Properties . Settings . Default . refresh_interval . ToString ( ) ;
5355 }
5456
5557 private void SetTimeBtn_Click ( object sender , EventArgs e )
@@ -64,9 +66,37 @@ private void SetTimeBtn_Click(object sender, EventArgs e)
6466 SetTimeBtn . Text = "Done!" ;
6567 SetTimeBtn . Enabled = false ;
6668
67- Program . UpdateTime ( ) ;
69+ Properties . Settings . Default . Save ( ) ;
70+
71+ Program . UpdateTime ( ) ;
72+ }
73+
74+ private void AutoRunChkBox_CheckedChanged ( object sender , EventArgs e )
75+ {
76+ if ( autorun_enabled )
77+ {
78+ Program . DisableAutoStartup ( ) ;
79+ }
80+ else
81+ {
82+ Program . EnableAutoStartup ( ) ;
83+ }
84+ Options_Load ( null , null ) ;
85+ }
6886
87+ private void SilentChkBox_CheckedChanged ( object sender , EventArgs e )
88+ {
89+ if ( silent == 1 )
90+ {
91+ Properties . Settings . Default . silent_mode = 0 ;
92+ }
93+ else
94+ {
95+ Properties . Settings . Default . silent_mode = 1 ;
96+ }
97+ Options_Load ( null , null ) ;
6998 Properties . Settings . Default . Save ( ) ;
99+ Program . UpdateSilent ( ) ;
70100 }
71101
72102 }
0 commit comments