From b37a6e60c9ffa266fc1fc9afc13cada7704100b0 Mon Sep 17 00:00:00 2001 From: EverythingWindows Date: Mon, 14 Nov 2022 12:11:31 +0700 Subject: [PATCH] moving more from Console to Terminal Internal/External Apps --- ShiftOS-TheRevival/MainForms/Console.vb | 59 +---------------- ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb | 1 + ShiftOS-TheRevival/MainForms/Shiftoriums.vb | 22 ++++++- .../MainForms/TerminalExternalApps.vb | 6 +- .../MainForms/TerminalInternalApps.vb | 65 ++++++++++++++++++- 5 files changed, 92 insertions(+), 61 deletions(-) diff --git a/ShiftOS-TheRevival/MainForms/Console.vb b/ShiftOS-TheRevival/MainForms/Console.vb index 893b752..8837c48 100644 --- a/ShiftOS-TheRevival/MainForms/Console.vb +++ b/ShiftOS-TheRevival/MainForms/Console.vb @@ -131,42 +131,7 @@ Public Class Console AdvancedCommand = False BadCommand = False Case "date" - If Strings.AvailableFeature(24) = 1 Then - NewLine("The date is " & Date.Now.DayOfYear & " days since the first day of the year") - AdvancedCommand = False - BadCommand = False - ElseIf Strings.AvailableFeature(24) = 3 Then - If Strings.AvailableFeature(25) = 1 Then - Dim TheWeek As String = Date.Now.DayOfYear / 7 - NewLine("The date is " & TheWeek.Substring(0, 2) & " weeks since the first week of the year") - AdvancedCommand = False - BadCommand = False - ElseIf Strings.AvailableFeature(25) = 3 Then - If Strings.AvailableFeature(26) = 1 Then - NewLine("The date is " & Date.Now.Month & " months since the first month of the year") - AdvancedCommand = False - BadCommand = False - ElseIf Strings.AvailableFeature(26) = 3 Then - If Strings.AvailableFeature(27) = 1 Then - NewLine("The year is " & Date.Now.Year) - AdvancedCommand = False - BadCommand = False - ElseIf Strings.AvailableFeature(27) = 3 Then - If Strings.AvailableFeature(28) = 1 Then - NewLine("The date is " & Date.Now.Day & "/" & Date.Now.Month) - AdvancedCommand = False - BadCommand = False - ElseIf Strings.AvailableFeature(28) = 3 Then - If Strings.AvailableFeature(29) = 1 Then - NewLine("The date is " & Date.Now.Day & "/" & Date.Now.Month & "/" & Date.Now.Year) - AdvancedCommand = False - BadCommand = False - End If - End If - End If - End If - End If - End If + DateTerm() Case "dir" If Strings.AvailableFeature(16) = "1" Then TerminalDirectories(CurrentDirectory) @@ -240,27 +205,7 @@ Public Class Console BadCommand = False End If Case "time" - If Strings.AvailableFeature(5) = "1" Then - NewLine(Math.Floor(Date.Now.Subtract(Date.Today).TotalSeconds) & " seconds passed since midnight") - ElseIf Strings.AvailableFeature(5) = "3" Then - If Strings.AvailableFeature(6) = "1" Then - NewLine(Math.Floor(Date.Now.Subtract(Date.Today).TotalMinutes) & " minutes passed since midnight") - ElseIf Strings.AvailableFeature(6) = "3" Then - If Strings.AvailableFeature(7) = "1" Then - NewLine(Math.Floor(Date.Now.Subtract(Date.Today).TotalHours) & " hours passed since midnight") - ElseIf Strings.AvailableFeature(7) = "3" Then - If Strings.AvailableFeature(12) = "1" Then - If Date.Now.Hour < 12 Then - NewLine("The time is " & TimeOfDay.Hour & " AM") - Else - NewLine("The time is " & TimeOfDay.Hour - 12 & " PM") - End If - ElseIf Strings.AvailableFeature(23) = "1" Then - NewLine("The time is " & TimeOfDay.Hour & ":" & TimeOfDay.Minute) - End If - End If - End If - End If + TimeTerm() AdvancedCommand = False BadCommand = False Case "su" diff --git a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb index 1ea49e8..e1e21ac 100644 --- a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb +++ b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb @@ -10,6 +10,7 @@ Public Class ShiftOSMenu Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load CheckInstall() + lbl_BuildString.Text = My.Resources.CurrentVersion BannerChange.Start() End Sub diff --git a/ShiftOS-TheRevival/MainForms/Shiftoriums.vb b/ShiftOS-TheRevival/MainForms/Shiftoriums.vb index 3511f2e..d9317e0 100644 --- a/ShiftOS-TheRevival/MainForms/Shiftoriums.vb +++ b/ShiftOS-TheRevival/MainForms/Shiftoriums.vb @@ -51,7 +51,7 @@ NewLine("(textpad | 100 CP) TextPad") Else If Strings.AvailableFeature(30) = "0" Then - NewLine("(script | 100 CP) ShiftOS Batch Script Support") + NewLine("(batchscript | 100 CP) ShiftOS Batch Script Support") End If End If End If @@ -88,6 +88,26 @@ Else If Strings.AvailableFeature(24) = "0" Then NewLine("(date | 70 CP) Date command") + Else + If Strings.AvailableFeature(25) = "0" Then + NewLine("(woy | 75 CP) Date by week of year") + Else + If Strings.AvailableFeature(26) = "0" Then + NewLine("(moy | 80 CP) Date by month of year") + Else + If Strings.AvailableFeature(27) = "0" Then + NewLine("(year | 85 CP) Date by year") + Else + If Strings.AvailableFeature(28) = "0" Then + NewLine("(mmyyyy | 90 CP) Date by month and year") + Else + If Strings.AvailableFeature(29) = "0" Then + NewLine("(generaldate | 95 CP) Date by general format") + End If + End If + End If + End If + End If End If End If End If diff --git a/ShiftOS-TheRevival/MainForms/TerminalExternalApps.vb b/ShiftOS-TheRevival/MainForms/TerminalExternalApps.vb index a489c54..20188ed 100644 --- a/ShiftOS-TheRevival/MainForms/TerminalExternalApps.vb +++ b/ShiftOS-TheRevival/MainForms/TerminalExternalApps.vb @@ -205,7 +205,7 @@ Module TerminalExternalApps Select Case GetText Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" BC_CurrentNumber = BC_CurrentNumber & GetText - Case "+", "-", "*", "/" + Case "+", "-", "*", "/", "^" Dim BC_Numbers3 As Integer Select Case BC_ThriceMoreValue Case 1 @@ -224,7 +224,7 @@ Module TerminalExternalApps End Select BC_Operation2 = GetText Case "." - Console.TextBox1.Text = Console.TextBox1.Text & "Decimals aren't supported yet!" + NewLine("Decimals aren't supported yet!") Case Else 'BC_Counting(BC_Numbers1, BC_Numbers2, BC_Operation2) End Select @@ -251,6 +251,8 @@ Module TerminalExternalApps BC_Result = FirstNum * SecondNum Case "/" BC_Result = FirstNum / SecondNum + Case "^" + BC_Result = FirstNum ^ SecondNum End Select End Sub diff --git a/ShiftOS-TheRevival/MainForms/TerminalInternalApps.vb b/ShiftOS-TheRevival/MainForms/TerminalInternalApps.vb index 944954b..8b544a0 100644 --- a/ShiftOS-TheRevival/MainForms/TerminalInternalApps.vb +++ b/ShiftOS-TheRevival/MainForms/TerminalInternalApps.vb @@ -83,6 +83,45 @@ End Select End Sub + Public Sub DateTerm() + If Strings.AvailableFeature(24) = 1 Then + NewLine("The date is " & Date.Now.DayOfYear & " days since the first day of the year") + AdvancedCommand = False + Console.BadCommand = False + ElseIf Strings.AvailableFeature(24) = 3 Then + If Strings.AvailableFeature(25) = 1 Then + Dim TheWeek As String = Date.Now.DayOfYear / 7 + NewLine("The date is " & TheWeek.Substring(0, 2) & " weeks since the first week of the year") + AdvancedCommand = False + Console.BadCommand = False + ElseIf Strings.AvailableFeature(25) = 3 Then + If Strings.AvailableFeature(26) = 1 Then + NewLine("The date is " & Date.Now.Month & " months since the first month of the year") + AdvancedCommand = False + Console.BadCommand = False + ElseIf Strings.AvailableFeature(26) = 3 Then + If Strings.AvailableFeature(27) = 1 Then + NewLine("The year is " & Date.Now.Year) + AdvancedCommand = False + Console.BadCommand = False + ElseIf Strings.AvailableFeature(27) = 3 Then + If Strings.AvailableFeature(28) = 1 Then + NewLine("The date is " & Date.Now.Day & "/" & Date.Now.Month) + AdvancedCommand = False + Console.BadCommand = False + ElseIf Strings.AvailableFeature(28) = 3 Then + If Strings.AvailableFeature(29) = 1 Then + NewLine("The date is " & Date.Now.Day & "/" & Date.Now.Month & "/" & Date.Now.Year) + AdvancedCommand = False + Console.BadCommand = False + End If + End If + End If + End If + End If + End If + End Sub + Public Sub Help() NewLine("ShiftOS Help Manual") NewLine(Nothing) @@ -207,7 +246,7 @@ Dim mancommand As String = Command.Replace("man ", "") Dim TempUsage As String = "'" & mancommand & "' Usage: " Select Case mancommand - 'In process to convert every command from printing from code to printing from text file + 'In process to convert every command from printing from code to printing from text file Case "bc" If Strings.AvailableFeature(9) = "1" Then TempUsage = TempUsage & "bc" @@ -381,4 +420,28 @@ NewLine(" .~?55Y?!^:... ") NewLine(" .:~~^~^^::. ") End Sub + + Public Sub TimeTerm() + If Strings.AvailableFeature(5) = 1 Then + NewLine(Math.Floor(Date.Now.Subtract(Date.Today).TotalSeconds) & " seconds passed since midnight") + ElseIf Strings.AvailableFeature(5) = 3 Then + If Strings.AvailableFeature(6) = 1 Then + NewLine(Math.Floor(Date.Now.Subtract(Date.Today).TotalMinutes) & " minutes passed since midnight") + ElseIf Strings.AvailableFeature(6) = 3 Then + If Strings.AvailableFeature(7) = 1 Then + NewLine(Math.Floor(Date.Now.Subtract(Date.Today).TotalHours) & " hours passed since midnight") + ElseIf Strings.AvailableFeature(7) = 3 Then + If Strings.AvailableFeature(12) = 1 Then + If Date.Now.Hour < 12 Then + NewLine("The time is " & TimeOfDay.Hour & " AM") + Else + NewLine("The time is " & TimeOfDay.Hour - 12 & " PM") + End If + ElseIf Strings.AvailableFeature(23) = 1 Then + NewLine("The time is " & TimeOfDay.Hour & ":" & TimeOfDay.Minute) + End If + End If + End If + End If + End Sub End Module