aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS-TheRevival/MainForms/Terminal.vb
diff options
context:
space:
mode:
authorEverythingWindows <[email protected]>2022-11-04 13:12:41 +0700
committerEverythingWindows <[email protected]>2022-11-04 13:12:41 +0700
commit552304f614c30c8be8d2e5f042b39cadf3477bcf (patch)
treefe7f3f857a31a413e67b5269aefc3bd0203fffdc /ShiftOS-TheRevival/MainForms/Terminal.vb
parentcd741c3850b861c48fbb2a8e51f1189fb006b935 (diff)
downloadshiftos-therevival-old-0.2.2.tar.gz
shiftos-therevival-old-0.2.2.tar.bz2
shiftos-therevival-old-0.2.2.zip
v0.2.2 stuffy (infobar, time, more efficient code)0.2.2
Diffstat (limited to 'ShiftOS-TheRevival/MainForms/Terminal.vb')
-rw-r--r--ShiftOS-TheRevival/MainForms/Terminal.vb74
1 files changed, 73 insertions, 1 deletions
diff --git a/ShiftOS-TheRevival/MainForms/Terminal.vb b/ShiftOS-TheRevival/MainForms/Terminal.vb
index 1f11e9e..abf395a 100644
--- a/ShiftOS-TheRevival/MainForms/Terminal.vb
+++ b/ShiftOS-TheRevival/MainForms/Terminal.vb
@@ -9,15 +9,20 @@ Public Class Terminal
Public DisplayStory As Integer
Public StoryToTell As String
Public ChangeInterpreter As Boolean = False
- Public CurrentInterpreter As String = "Terminal"
+ Public CurrentInterpreter As String = "terminal"
Private Sub Terminal_Load(sender As Object, e As EventArgs) Handles MyBase.Load
FormBorderStyle = FormBorderStyle.None
WindowState = FormWindowState.Maximized
+ InitializeTerminal()
+ End Sub
+
+ Public Sub InitializeTerminal()
If Strings.IsFree = True Then
Strings.ComputerInfo(0) = "shiftos"
Strings.ComputerInfo(1) = "user"
'Strings.ComputerInfo(2) = 0
+ CheckFeature()
PrintPrompt()
AssignPrompt()
Else
@@ -28,6 +33,7 @@ Public Class Terminal
Strings.ComputerInfo(0) = "shiftos"
Strings.ComputerInfo(1) = "user"
Strings.ComputerInfo(2) = 0
+ CheckFeature()
PrintPrompt()
AssignPrompt()
End If
@@ -36,6 +42,20 @@ Public Class Terminal
TextBox1.ScrollToCaret()
End Sub
+ Public Sub CheckFeature()
+ If Strings.AvailableFeature(4) = "1" Then
+ InfoBarTimer.Start()
+ TextBox1.Dock = DockStyle.None
+ InfoBar.Visible = True
+ InfoBar.SendToBack()
+ TextBox1.Dock = DockStyle.Fill
+ Else
+ TextBox1.Dock = DockStyle.None
+ InfoBar.Visible = False
+ TextBox1.Dock = DockStyle.Fill
+ End If
+ End Sub
+
Public Sub PrintPrompt()
If TextBox1.Text = Nothing Then
If ChangeInterpreter = True Then
@@ -130,10 +150,26 @@ Public Class Terminal
TextBox1.Text = TextBox1.Text & Environment.NewLine & "SHIFTORIUM A software center for upgrading features on ShiftOS"
TextBox1.Text = TextBox1.Text & Environment.NewLine & "SHUTDOWN Terminate ShiftOS session"
TextBox1.Text = TextBox1.Text & Environment.NewLine & "SU Runs terminal as super user"
+ If Strings.AvailableFeature(5) = 1 Then
+ TextBox1.Text = TextBox1.Text & Environment.NewLine & "TIME Display the current time in the form of seconds since midnight"
+ ElseIf Strings.AvailableFeature(5) = 3 Then
+ If Strings.AvailableFeature(6) = 1 Then
+ TextBox1.Text = TextBox1.Text & Environment.NewLine & "TIME Display the current time in the form of minutes since midnight"
+ ElseIf Strings.AvailableFeature(6) = 3 Then
+ If Strings.AvailableFeature(7) = 1 Then
+ TextBox1.Text = TextBox1.Text & Environment.NewLine & "TIME Display the current time in the form of hours since midnight"
+ End If
+ End If
+ End If
TextBox1.Text = TextBox1.Text & Environment.NewLine & "VER Printing current version of ShiftOS TheRevival"
TextBox1.Text = TextBox1.Text & Environment.NewLine
AdvancedCommand = False
BadCommand = False
+ Case "reboot"
+ TextBox1.Text = Nothing
+ AdvancedCommand = False
+ BadCommand = False
+ InitializeTerminal()
Case "su"
If Strings.OnceInfo(0) = "Yes" Then
TextBox1.Text = TextBox1.Text & Environment.NewLine & "You already in root mode!"
@@ -146,6 +182,20 @@ Public Class Terminal
Case "shutdown", "shut down"
ShiftOSMenu.Show()
Close()
+ Case "time"
+ If Strings.AvailableFeature(5) = "1" Then
+ TextBox1.Text = TextBox1.Text & Environment.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
+ TextBox1.Text = TextBox1.Text & Environment.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
+ TextBox1.Text = TextBox1.Text & Environment.NewLine & Math.Floor(Date.Now.Subtract(Date.Today).TotalHours) & " hours passed since midnight"
+ End If
+ End If
+ End If
+ AdvancedCommand = False
+ BadCommand = False
Case "ver"
TextBox1.Text = TextBox1.Text & Environment.NewLine & "ShiftOS TheRevival version " & My.Resources.CurrentVersion
AdvancedCommand = False
@@ -382,4 +432,26 @@ Public Class Terminal
End Select
DisplayStory = DisplayStory + 1
End Sub
+
+ Private Sub InfoBarTimer_Tick(sender As Object, e As EventArgs) Handles InfoBarTimer.Tick
+ InfoBar.Text = "|"
+ If Strings.AvailableFeature(5) = "1" Then
+ InfoBar.Text = InfoBar.Text & " " & Math.Floor(Date.Now.Subtract(Date.Today).TotalSeconds) & " |"
+ ElseIf Strings.AvailableFeature(5) = "3" Then
+ If Strings.AvailableFeature(6) = "1" Then
+ InfoBar.Text = InfoBar.Text & " " & Math.Floor(Date.Now.Subtract(Date.Today).TotalMinutes) & " |"
+ ElseIf Strings.AvailableFeature(6) = "3" Then
+ If Strings.AvailableFeature(7) = "1" Then
+ InfoBar.Text = InfoBar.Text & " " & Math.Floor(Date.Now.Subtract(Date.Today).TotalHours) & " |"
+ End If
+ End If
+ End If
+ If Strings.OnceInfo(0) = "Yes" Then
+ InfoBar.Text = InfoBar.Text & " root |"
+ Else
+ InfoBar.Text = InfoBar.Text & " user |"
+ End If
+ InfoBar.Text = InfoBar.Text & " " & CurrentInterpreter & " |"
+ InfoBar.Text = InfoBar.Text & " " & Strings.ComputerInfo(2) & " CP |"
+ End Sub
End Class \ No newline at end of file