diff options
| author | Everything Windows <[email protected]> | 2024-01-18 15:06:39 +0700 |
|---|---|---|
| committer | Everything Windows <[email protected]> | 2024-01-18 15:06:39 +0700 |
| commit | 89343f67577f239042df8c1069ed74a9913fa102 (patch) | |
| tree | 73d68566a6e47a8b72ce0604531a224579effed6 /ShiftOS-TheRevival/API | |
| parent | 540a9218830989293f0e5550235742fe3a6cc05e (diff) | |
| download | shiftos-therevival-old-freeroam-master.tar.gz shiftos-therevival-old-freeroam-master.tar.bz2 shiftos-therevival-old-freeroam-master.zip | |
GUI lock, Multilanguage support, BackgroundWork early implementationfreeroam-master
Diffstat (limited to 'ShiftOS-TheRevival/API')
| -rw-r--r-- | ShiftOS-TheRevival/API/ConsoleAPI.vb | 22 | ||||
| -rw-r--r-- | ShiftOS-TheRevival/API/TerminalAPI.vb | 37 |
2 files changed, 45 insertions, 14 deletions
diff --git a/ShiftOS-TheRevival/API/ConsoleAPI.vb b/ShiftOS-TheRevival/API/ConsoleAPI.vb index 34a4cec..bf7f0ad 100644 --- a/ShiftOS-TheRevival/API/ConsoleAPI.vb +++ b/ShiftOS-TheRevival/API/ConsoleAPI.vb @@ -1,5 +1,6 @@ Module ConsoleAPI Public StayAtChapter As Boolean = False 'If this set to true, then intro for chapters are mostly going to be in + Public NewBackground As System.ComponentModel.BackgroundWorker Public Sub Console_Windowed() Console.WindowState = FormWindowState.Normal @@ -43,4 +44,25 @@ Console.TextBox1.Select(Console.TextBox1.Lines.Length - 1, 0) Console.TextBox1.ScrollToCaret() End Sub + + Public Function NewBackgroundWorker(WorkSub As System.ComponentModel.DoWorkEventHandler, ProgressSub As System.ComponentModel.ProgressChangedEventHandler, CompleteSub As System.ComponentModel.RunWorkerCompletedEventHandler) + NewLine("NewBW") + NewBackground = New ComponentModel.BackgroundWorker + NewBackground.WorkerReportsProgress = True + NewBackground.WorkerSupportsCancellation = True + AddHandler NewBackground.DoWork, WorkSub + AddHandler NewBackground.ProgressChanged, ProgressSub + AddHandler NewBackground.RunWorkerCompleted, CompleteSub + NewBackground.RunWorkerAsync() + + 'Return NewBackground + End Function + + Public Sub StopBackgroundWorker(WhichBackgroundWorker As System.ComponentModel.BackgroundWorker) + If WhichBackgroundWorker IsNot Nothing AndAlso WhichBackgroundWorker.WorkerSupportsCancellation Then + ' Request cancellation + NewLine("CloseBW") + WhichBackgroundWorker.CancelAsync() + End If + End Sub End Module diff --git a/ShiftOS-TheRevival/API/TerminalAPI.vb b/ShiftOS-TheRevival/API/TerminalAPI.vb index d40e2cc..26b1179 100644 --- a/ShiftOS-TheRevival/API/TerminalAPI.vb +++ b/ShiftOS-TheRevival/API/TerminalAPI.vb @@ -309,21 +309,25 @@ Module TerminalAPI Case "shutdown", "shut down" TerminateShiftOS() Case "startg" - If Strings.AvailableFeature(35) = 1 Then - If IsStartG = False Then - StartG() - AdvancedCommand = False - NormalCommand() - End If - End If + NormalCommand() + Undeveloped() + 'If Strings.AvailableFeature(35) = 1 Then + ' If IsStartG = False Then + ' StartG() + ' AdvancedCommand = False + ' NormalCommand() + ' End If + 'End If Case "stopg" - If Strings.AvailableFeature(35) = 1 Then - If IsStartG = True Then - StopG() - AdvancedCommand = False - NormalCommand() - End If - End If + NormalCommand() + Undeveloped() + 'If Strings.AvailableFeature(35) = 1 Then + ' If IsStartG = True Then + ' StopG() + ' AdvancedCommand = False + ' NormalCommand() + ' End If + 'End If Case "textpad" If Strings.AvailableFeature(17) = "1" Then TextPad_WarnFile() @@ -402,6 +406,11 @@ Module TerminalAPI Infobar() End If End If + If command Like "lang *" Then + Lang() + AdvancedCommand = False + NormalCommand() + End If If command Like "taskkill *" Then Taskkill() AdvancedCommand = False |
