Skip to content

Commit f3a7733

Browse files
committed
[Settings] Add option to hide clock
1 parent 7433379 commit f3a7733

File tree

5 files changed

+106
-73
lines changed

5 files changed

+106
-73
lines changed

Installer/dt.iss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ Root: HKCU; Subkey: "Software\DISMTools\Preview\Personalization"; ValueType: str
175175
Root: HKCU; Subkey: "Software\DISMTools\Preview\Personalization"; ValueType: dword; ValueName: "LogFontBold"; ValueData: 0; Flags: uninsdeletevalue createvalueifdoesntexist
176176
Root: HKCU; Subkey: "Software\DISMTools\Preview\Personalization"; ValueType: dword; ValueName: "LogFontSi"; ValueData: 11; Flags: uninsdeletevalue createvalueifdoesntexist
177177
Root: HKCU; Subkey: "Software\DISMTools\Preview\Personalization"; ValueType: dword; ValueName: "SecondaryProgressPanelStyle"; ValueData: 1; Flags: uninsdeletevalue createvalueifdoesntexist
178+
Root: HKCU; Subkey: "Software\DISMTools\Preview\Personalization"; ValueType: dword; ValueName: "ShowDateAndTime"; ValueData: 1; Flags: uninsdeletevalue createvalueifdoesntexist
178179

179180
Root: HKCU; Subkey: "Software\DISMTools\Preview\Program"; Flags: uninsdeletekey
180181
Root: HKCU; Subkey: "Software\DISMTools\Preview\Program"; ValueType: expandsz; ValueName: "DismExe"; ValueData: "{win}\system32\dism.exe"; Flags: uninsdeletevalue createvalueifdoesntexist

MainForm.vb

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ Public Class MainForm
265265

266266
Public DarkThemeIndex As Integer = 0 ' Color theme index for dark color scheme
267267
Public LightThemeIndex As Integer = 1 ' Color theme index for light color scheme
268+
Public ShowDateAndTime As Boolean = True ' Whether to show the date and time on the project view
268269

269270
Friend NotInheritable Class NativeMethods
270271

@@ -713,6 +714,7 @@ Public Class MainForm
713714
LoadDTSettings(1)
714715
End If
715716
imgStatus = 0
717+
TimeLabel.Visible = ShowDateAndTime
716718
ChangeImgStatus()
717719
If DismExe <> "" Then
718720
DynaLog.LogMessage("Checking version of DISM executable...")
@@ -1280,6 +1282,7 @@ Public Class MainForm
12801282
ProgressPanelStyle = CInt(PersKey.GetValue("SecondaryProgressPanelStyle"))
12811283
AllCaps = (CInt(PersKey.GetValue("AllCaps")) = 1)
12821284
ExpandedProgressPanel = (CInt(PersKey.GetValue("ExpandedProgressPanel")) = 1)
1285+
ShowDateAndTime = (CInt(PersKey.GetValue("ShowDateAndTime")) = 1)
12831286
ProjectView.Visible = True
12841287
PersKey.Close()
12851288
Dim LogKey As RegistryKey = Key.OpenSubKey("Logs")
@@ -1463,6 +1466,11 @@ Public Class MainForm
14631466
ElseIf DTSettingForm.RichTextBox1.Text.Contains("ExpandedProgressPanel=1") Then
14641467
ExpandedProgressPanel = 1
14651468
End If
1469+
If DTSettingForm.RichTextBox1.Text.Contains("ShowDateAndTime=0") Then
1470+
ShowDateAndTime = False
1471+
ElseIf DTSettingForm.RichTextBox1.Text.Contains("ShowDateAndTime=1") Then
1472+
ShowDateAndTime = True
1473+
End If
14661474
ProjectView.Visible = True
14671475
' Detect log file level: 1 - Errors only
14681476
' 2 - Errors and warnings
@@ -1694,6 +1702,7 @@ Public Class MainForm
16941702
"SecondaryProgressPanelStyle= " & ProgressPanelStyle & CrLf &
16951703
"AllCaps = " & AllCaps & CrLf &
16961704
"ExpandedProgressPanel = " & ExpandedProgressPanel & CrLf &
1705+
"ShowDateAndTime = " & ShowDateAndTime & CrLf &
16971706
"LogFile = " & Quote & LogFile & Quote & CrLf &
16981707
"LogLevel = " & LogLevel & CrLf &
16991708
"AutoLogs = " & AutoLogs & CrLf &
@@ -4578,9 +4587,9 @@ Public Class MainForm
45784587
DTSettingForm.RichTextBox2.AppendText(CrLf & "LogFontBold=0")
45794588
DTSettingForm.RichTextBox2.AppendText(CrLf & "SecondaryProgressPanelStyle=1")
45804589
DTSettingForm.RichTextBox2.AppendText(CrLf & "AllCaps=0")
4581-
DTSettingForm.RichTextBox2.AppendText(CrLf & "NewDesign=1")
45824590
DTSettingForm.RichTextBox2.AppendText(CrLf & "ColorSchemes=0")
45834591
DTSettingForm.RichTextBox2.AppendText(CrLf & "ExpandedProgressPanel=1")
4592+
DTSettingForm.RichTextBox2.AppendText(CrLf & "ShowDateAndTime=1")
45844593
DTSettingForm.RichTextBox2.AppendText(CrLf & CrLf & "[Logs]" & CrLf)
45854594
DTSettingForm.RichTextBox2.AppendText("LogFile=" & Quote & "{common:WinDir}\Logs\DISM\DISM.log" & Quote)
45864595
DTSettingForm.RichTextBox2.AppendText(CrLf & "LogLevel=3")
@@ -4652,9 +4661,9 @@ Public Class MainForm
46524661
PersKey.SetValue("LogFontBold", 0, RegistryValueKind.DWord)
46534662
PersKey.SetValue("SecondaryProgressPanelStyle", 1, RegistryValueKind.DWord)
46544663
PersKey.SetValue("AllCaps", 0, RegistryValueKind.DWord)
4655-
PersKey.SetValue("NewDesign", 1, RegistryValueKind.DWord)
46564664
PersKey.SetValue("ColorSchemes", 0, RegistryValueKind.DWord)
46574665
PersKey.SetValue("ExpandedProgressPanel", 1, RegistryValueKind.DWord)
4666+
PersKey.SetValue("ShowDateAndTime", 1, RegistryValueKind.DWord)
46584667
PersKey.Close()
46594668
Dim LogKey As RegistryKey = Key.CreateSubKey("Logs")
46604669
LogKey.SetValue("LogFile", Quote & Environment.GetFolderPath(Environment.SpecialFolder.Windows) & "\logs\DISM\DISM.log" & Quote, RegistryValueKind.ExpandString)
@@ -4776,6 +4785,11 @@ Public Class MainForm
47764785
Else
47774786
DTSettingForm.RichTextBox2.AppendText(CrLf & "ExpandedProgressPanel=0")
47784787
End If
4788+
If ShowDateAndTime Then
4789+
DTSettingForm.RichTextBox2.AppendText(CrLf & "ShowDateAndTime=1")
4790+
Else
4791+
DTSettingForm.RichTextBox2.AppendText(CrLf & "ShowDateAndTime=0")
4792+
End If
47794793
DTSettingForm.RichTextBox2.AppendText(CrLf & CrLf & "[Logs]" & CrLf)
47804794
DTSettingForm.RichTextBox2.AppendText("LogFile=" & Quote & LogFile & Quote)
47814795
Select Case LogLevel
@@ -4946,6 +4960,7 @@ Public Class MainForm
49464960
PersKey.SetValue("SecondaryProgressPanelStyle", ProgressPanelStyle, RegistryValueKind.DWord)
49474961
PersKey.SetValue("AllCaps", If(AllCaps, 1, 0), RegistryValueKind.DWord)
49484962
PersKey.SetValue("ExpandedProgressPanel", If(ExpandedProgressPanel, 1, 0), RegistryValueKind.DWord)
4963+
PersKey.SetValue("ShowDateAndTime", If(ShowDateAndTime, 1, 0), RegistryValueKind.DWord)
49494964
PersKey.Close()
49504965
DynaLog.LogMessage("Configuring log settings...")
49514966
Dim LogKey As RegistryKey = Key.CreateSubKey("Logs")

Panels/Exe_Ops/Options.Designer.vb

Lines changed: 84 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Panels/Exe_Ops/Options.vb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ Public Class Options
213213
MainForm.AutoCompleteInfo(4) = CheckBox19.Checked
214214
MainForm.StatusStrip.BackColor = CurrentTheme.AccentColors(1)
215215
MainForm.ExpandedProgressPanel = CheckBox7.Checked
216+
MainForm.ShowDateAndTime = CheckBox21.Checked
217+
MainForm.TimeLabel.Visible = CheckBox21.Checked
216218
End Sub
217219

218220
Sub GiveErrorExplanation(ErrorCode As Integer)
@@ -1810,6 +1812,7 @@ Public Class Options
18101812
CheckBox19.Checked = MainForm.AutoCompleteInfo(4)
18111813
CheckBox22.Checked = MainForm.AutoCleanMounts
18121814
CheckBox7.Checked = MainForm.ExpandedProgressPanel
1815+
CheckBox21.Checked = MainForm.ShowDateAndTime
18131816
End Sub
18141817

18151818
Private Sub ComboBox5_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox5.SelectedIndexChanged

settings.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ SecondaryProgressPanelStyle=1
1717
AllCaps=0
1818
ColorSchemes=0
1919
ExpandedProgressPanel=1
20+
ShowDateAndTime=1
2021

2122
[Logs]
2223
LogFile="{common:WinDir}\Logs\DISM\DISM.log"

0 commit comments

Comments
 (0)