Skip to content

Commit

Permalink
Merge pull request #108 from Owen2k6/1.5
Browse files Browse the repository at this point in the history
1.5.1 Patches
  • Loading branch information
Owen2k6 authored Mar 15, 2024
2 parents f9956cf + 2c01216 commit b7365ca
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 31 deletions.
34 changes: 26 additions & 8 deletions GoOS/GUI/Apps/Gosplorer/MainFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ public override void ShowContextMenu()

if (!IsMouseOverFolderArea) return;
else if (ContextButton != null && ContextButton.Image == folderIcon) contextMenuEntries = new[] { " Open", " Delete" };
else if (ContextButton != null && ContextButton.Image == fileIcon) contextMenuEntries = new[] { " Open", " Delete", string.Empty, " Pin to start menu", " Open with..." };
else if (ContextButton != null && ContextButton.Image == fileIcon) contextMenuEntries = new[] { " Open", " Delete", " Pin to start menu", " Unpin from start menu", /*" Open with..."*/ };
//else if (ContextButton != null && ContextButton.Image == fileIcon && ContextButton.Name.EndsWith(".goexe") || ContextButton.Name.EndsWith(".gexe") || ContextButton.Name.EndsWith(".9xc")) contextMenuEntries = new[] { " Open", " Delete", string.Empty, " Pin to start menu", " Open with..." };
else if (!Path.StartsWith(@"1:\")) contextMenuEntries = new[] { " New Folder", " New File" };

ContextMenu.Show(contextMenuEntries.ToArray(), (ContextButton.Image == fileIcon || ContextButton.Image == folderIcon) ? (ushort)64 : (ushort)96, ContextMenu_Handle);
ContextMenu.Show(contextMenuEntries.ToArray(), (ContextButton.Image == fileIcon || ContextButton.Image == folderIcon) ? (ushort)168 : (ushort)64, ContextMenu_Handle);
}

private void ContextMenu_Handle(string item)
Expand All @@ -172,11 +172,29 @@ private void ContextMenu_Handle(string item)
break;

case " Pin to start menu":
List<string> lines = new List<string>(File.ReadAllLines(@"0:\content\sys\pinnedapps.gms")) { Path + @"\" + ContextButton.Name };
List<string> lines = new List<string>(File.ReadAllLines(@"0:\content\sys\pinnedapps.gms"))
{
(Path + (Path.EndsWith(@"\") ? "" : @"\") + ContextButton.Name).Trim()
};
File.WriteAllLines(@"0:\content\sys\pinnedapps.gms", lines.ToArray());
Dialogue.Show("Gosplorer", "App pinned to start menu");
break;

case " Open with...":
case " Unpin to start menu":
List<string> lines2 = new List<string>(File.ReadAllLines(@"0:\content\sys\pinnedapps.gms"));
for (int i = 0; i < lines2.Count; i++)
{
if (lines2[i] == (Path + (Path.EndsWith(@"\") ? "" : @"\") + ContextButton.Name).Trim())
{
lines2.RemoveAt(i);
}
}

File.WriteAllLines(@"0:\content\sys\pinnedapps.gms", lines2.ToArray());
Dialogue.Show("Gosplorer", "App unpinned to start menu");
break;

/*case " Open with...":
Dialogue openWithDialogue = new Dialogue(
"Open with...",
"Select the app to open with:",
Expand All @@ -197,7 +215,7 @@ private void ContextMenu_Handle(string item)
Dialog_List = new List(openWithDialogue, 80, 52, 195, 20, "Applications", new string[] { "Notepad", "GoCode Interpreter", "9xCode Interpreter", "GoIDE", "Gimviewer" });
WindowManager.AddWindow(openWithDialogue);
break;
break;*/

case " New Folder":
Dialogue folderDialogue = new Dialogue(
Expand Down Expand Up @@ -247,10 +265,10 @@ private void ContextMenu_Handle(string item)
}
}

private void OpenWith_Handler()
/*private void OpenWith_Handler()
{
Dialogue.Show("Debug", "This function is not implemented yet");
}
Dialogue.Show("Warning", "This function is not implemented yet", default, Resources.WarningIcon);
}*/

private void NewFolder_Handler()
{
Expand Down
Binary file modified GoOS/GoGL.dll
Binary file not shown.
39 changes: 20 additions & 19 deletions GoOS/Kernel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class Kernel : Sys.Kernel
public static string[] pathPaths = { };

//Vars for OS
public const string version = "1.5";
public const string version = "1.5.1";
public const string edition = "1.5"; // This is the current edition of GoOS. Used for UPDATER.
public const string editionnext = "1.6"; // This is the next edition of GoOS. Used for UPDATER.
public const string BuildType = "R";
Expand Down Expand Up @@ -79,18 +79,6 @@ protected override void BeforeRun()
Resources.Generate(ResourceType.Fonts);
Resources.Generate(ResourceType.Priority);

WindowManager.Canvas = Display.GetDisplay(1920, 1080);

WindowManager.Canvas.DrawImage(0, 0, Resources.background, false);
Console.Init(800, 600);

WindowManager.AddWindow(new LoadingDialogue("GoOS is starting\nPlease wait..."));
WindowManager.Update();

Resources.Generate(ResourceType.Normal);

ThemeManager.SetTheme(Theme.Fallback);
log(ThemeManager.WindowText, "GoOS - Starting GoOS...");
try
{
FS = new Sys.FileSystem.CosmosVFS();
Expand All @@ -100,14 +88,27 @@ protected override void BeforeRun()
}
catch
{
WindowManager.AddWindow(new Dialogue("Fatal Error", "Failed to initialize filesystem!\n" +
"GoOS needs a HDD installed to save user settings, application data and more\n" +
"Please verify that your hard disk is plugged in correctly",
default, WindowManager.errorIcon));
WindowManager.Update();
while (true) ;
log(ConsoleColorEx.Red, "Failed to initialize filesystem!");
log(ConsoleColorEx.Red, "GoOS needs a HDD installed to save user settings, application data and more");
log(ConsoleColorEx.Red, "Please verify that your hard disk is plugged in correctly");
while (true);
}

byte[] screenRes = File.Exists(@"0:\content\sys\resolution.gms") ? File.ReadAllBytes(@"0:\content\sys\resolution.gms") : new byte[] { 6 };
byte[] termRes = File.Exists(@"0:\content\sys\tresolution.gms") ? File.ReadAllBytes(@"0:\content\sys\tresolution.gms") : new byte[] { 2 };
WindowManager.Canvas = Display.GetDisplay(ControlPanel.videoModes[screenRes[0]].Item2.Width, ControlPanel.videoModes[screenRes[0]].Item2.Height);

WindowManager.Canvas.DrawImage(0, 0, Resources.background, false);
Console.Init(ControlPanel.terminalModes[termRes[0]].Item2.Width, ControlPanel.terminalModes[termRes[0]].Item2.Height);

WindowManager.AddWindow(new LoadingDialogue("GoOS is starting\nPlease wait..."));
WindowManager.Update();

Resources.Generate(ResourceType.Normal);

ThemeManager.SetTheme(Theme.Fallback);
log(ThemeManager.WindowText, "GoOS - Starting GoOS...");

if (!File.Exists(@"0:\content\sys\setup.gms"))
{
Resources.Generate(ResourceType.OOBE);
Expand Down
Binary file modified GoOS/Resources/GUI/1920-1080.bmp
Binary file not shown.
7 changes: 3 additions & 4 deletions GoOS/Settings/ControlPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ public static class ControlPanel

public static readonly List<(string, (ushort Width, ushort Height))> terminalModes = new()
{
("480 x 360", (480, 360)),
("640 x 480", (640, 480)),
("720 x 480", (720, 480)),
("800 x 600", (800, 600)),
("640 x 480 (4:3)", (640, 480)),
("720 x 480 (3:2)", (720, 480)),
("800 x 600 (4:3)", (800, 600)),
("1024 x 768 (4:3)", (1024, 768)),
("1152 x 864 (4:3)", (1152, 864)),
("1280 x 720 (16:9)", (1280, 720)),
Expand Down

0 comments on commit b7365ca

Please sign in to comment.