From e4db9cc77abc4cc79c25a6c489183f58276428e8 Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sat, 10 Jun 2017 17:12:28 +0100 Subject: Even more tweaks to the explorer and stuff --- .../OS/Win95/Win95Apps/WinClassicNotepad.cs | 32 ++++++++-- .../Win95/Win95Apps/WinClassicWindowsExplorer.cs | 71 ++++++++++++--------- TimeHACK.Main/Program.cs | 8 +-- TimeHACK.Main/SaveDialogs/LoadGameProfileItem.cs | 2 +- TimeHACK.Main/SaveDialogs/NewGameDialog.cs | 2 +- TimeHACK.Main/bin/Release/TimeHACK.application | 2 +- TimeHACK.Main/bin/Release/TimeHACK.exe | Bin 6356480 -> 6356480 bytes TimeHACK.Main/bin/Release/TimeHACK.exe.manifest | 2 +- TimeHACK.Main/bin/Release/TimeHACK.pdb | Bin 273920 -> 275968 bytes TimeHACK.Main/bin/Release/app.publish/TimeHACK.exe | Bin 6356480 -> 6356480 bytes TimeHACK.Main/obj/Release/TimeHACK.application | 2 +- TimeHACK.Main/obj/Release/TimeHACK.exe | Bin 6356480 -> 6356480 bytes TimeHACK.Main/obj/Release/TimeHACK.exe.manifest | 2 +- TimeHACK.Main/obj/Release/TimeHACK.pdb | Bin 273920 -> 275968 bytes 14 files changed, 76 insertions(+), 47 deletions(-) (limited to 'TimeHACK.Main') diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicNotepad.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicNotepad.cs index e08e6ec..6dd6ee8 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicNotepad.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicNotepad.cs @@ -88,14 +88,38 @@ namespace TimeHACK.OS.Win95.Win95Apps private void openToolStripMenuItem_Click(object sender, EventArgs e) { - ActivateOpenFileDialog(".txt"); - mainText.Text = ReadTextFile(Program.OpenFileExplorerAsDialogAndReturnGivenPath()); + try + { + ActivateSaveFileDialog(".txt"); + String selectedPath; + selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); + + MessageBox.Show(selectedPath); + if (selectedPath != "") + { + mainText.Text = ReadTextFile(selectedPath); + } + } + catch + { + } } private void saveToolStripMenuItem_Click(object sender, EventArgs e) { - ActivateSaveFileDialog(".txt"); - File.WriteAllText(Program.OpenFileExplorerAsDialogAndReturnGivenPath(), mainText.Text); + try + { + ActivateSaveFileDialog(".txt"); + String selectedPath; + selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); + + MessageBox.Show(selectedPath); + if (selectedPath != "") + { + File.WriteAllText(selectedPath, mainText.Text); + } + } catch { + } } } } diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs index 44002fd..2c84133 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs @@ -116,12 +116,12 @@ namespace TimeHACK.OS.Win95.Win95Apps { if (new FileInfo(str).Extension == onlyViewExtension) { - this.mainView.Items.Add(Path.GetFileName(str), 0); + this.mainView.Items.Add(Path.GetFileName(str), 2); } } } else { if (!(Path.GetFileName(str) == "_data.info")) { - this.mainView.Items.Add(Path.GetFileName(str)); + this.mainView.Items.Add(Path.GetFileName(str), 2); } } } @@ -467,23 +467,18 @@ namespace TimeHACK.OS.Win95.Win95Apps if ((String)mainView.FocusedItem.Tag != "") { // If it isn't a file GoToDir(currentDirectory + "\\" + mainView.FocusedItem.Tag); } else { // If it is a file - if (IsFileOpenDialog == true || IsFileSaveDialog == true) { // If it is a open/save file dialog box - Program.WindowsExplorerReturnPath = currentDirectory + "\\" + mainView.FocusedItem.Text; - ((Form)this.TopLevelControl).Close(); + if (new FileInfo(Path.Combine(currentDirectory, txtSave.Text)).Extension == onlyViewExtension) + { + Program.WindowsExplorerReturnPath = currentDirectory + "\\" + txtSave.Text; + } - } else { - ReturnType(new FileInfo(currentDirectory + "\\" + mainView.FocusedItem.Text).Extension); + FileDialogBoxManager.IsInOpenDialog = false; + FileDialogBoxManager.IsInSaveDialog = false; - switch (fileType) { - case 1: - //ManageTextFile.OpenNewTextFile(currentDirectory + "\\" + mainView.FocusedItem.Text); - break; - } - } + ((Form)this.TopLevelControl).Close(); } - - } catch (Exception ex) { + } catch { } } @@ -495,11 +490,9 @@ namespace TimeHACK.OS.Win95.Win95Apps if (diskView.FocusedItem.Text == "My Computer") { GoToDir(ProfileFileSystemDirectory); - } - - } catch (Exception ex) { + } catch { } } @@ -543,24 +536,42 @@ namespace TimeHACK.OS.Win95.Win95Apps private void Button1_Click(object sender, EventArgs e) { - if (txtSave.Text == "") - { - wm.startInfobox95("Windows Explorer", "Please enter a filename", Properties.Resources.Win95Info); - } - else + try { - if (new FileInfo(currentDirectory + "\\" + txtSave.Text).Extension == onlyViewExtension) + Boolean OpenFile = false; + if (mainView.FocusedItem != null) { + if ((String)mainView.FocusedItem.Tag != "") + { // If it isn't a file + GoToDir(currentDirectory + "\\" + mainView.FocusedItem.Tag); + } + else OpenFile = true; // If it is a file + } + else OpenFile = true; + if (OpenFile == true) + { + if (txtSave.Text == "") + { + wm.startInfobox95("Windows Explorer", "Please enter a filename", Properties.Resources.Win95Info); + } + else + { + if (new FileInfo(currentDirectory + "\\" + txtSave.Text).Extension == onlyViewExtension) + { - Program.WindowsExplorerReturnPath = currentDirectory + "\\" + txtSave.Text; + Program.WindowsExplorerReturnPath = currentDirectory + "\\" + txtSave.Text; - } - + } + + + FileDialogBoxManager.IsInOpenDialog = false; + FileDialogBoxManager.IsInSaveDialog = false; - FileDialogBoxManager.IsInOpenDialog = false; - FileDialogBoxManager.IsInSaveDialog = false; + ((Form)this.TopLevelControl).Close(); + } + } + } catch { - ((Form)this.TopLevelControl).Close(); } } diff --git a/TimeHACK.Main/Program.cs b/TimeHACK.Main/Program.cs index 97a9ca2..839a0c8 100644 --- a/TimeHACK.Main/Program.cs +++ b/TimeHACK.Main/Program.cs @@ -78,14 +78,8 @@ namespace TimeHACK public static String OpenFileExplorerAsDialogAndReturnGivenPath() { WinClassicWindowsExplorer we = new WinClassicWindowsExplorer(); - WinClassic app = wm.startWin95(we, "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true, true); - TitleScreen.frm95.AddTaskBarItem(app, app.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer); - - TitleScreen.frm95.nonimportantapps.Add(app); - TitleScreen.frm95.nonimportantapps[TitleScreen.frm95.nonimportantapps.Count - 1].BringToFront(); - TitleScreen.frm95.nonimportantapps[TitleScreen.frm95.nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(TitleScreen.frm95.NonImportantApp_Closing); - app.BringToFront(); + WinClassic app = wm.startWin95(we, "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true, true); try { return WindowsExplorerReturnPath; diff --git a/TimeHACK.Main/SaveDialogs/LoadGameProfileItem.cs b/TimeHACK.Main/SaveDialogs/LoadGameProfileItem.cs index 0087fb0..5e1ccf4 100644 --- a/TimeHACK.Main/SaveDialogs/LoadGameProfileItem.cs +++ b/TimeHACK.Main/SaveDialogs/LoadGameProfileItem.cs @@ -123,7 +123,7 @@ namespace TimeHACK } } pnlConfirm.Hide(); - } catch (Exception ex) + } catch { } diff --git a/TimeHACK.Main/SaveDialogs/NewGameDialog.cs b/TimeHACK.Main/SaveDialogs/NewGameDialog.cs index d492a79..0e6f346 100644 --- a/TimeHACK.Main/SaveDialogs/NewGameDialog.cs +++ b/TimeHACK.Main/SaveDialogs/NewGameDialog.cs @@ -76,7 +76,7 @@ namespace TimeHACK { MessageBox.Show("You must enter a profile name!"); } - } catch (Exception ex) + } catch { } diff --git a/TimeHACK.Main/bin/Release/TimeHACK.application b/TimeHACK.Main/bin/Release/TimeHACK.application index e3c83f9..0beb307 100644 --- a/TimeHACK.Main/bin/Release/TimeHACK.application +++ b/TimeHACK.Main/bin/Release/TimeHACK.application @@ -14,7 +14,7 @@ - HQXMPfmrHd5GpwrSTljeapHcCrGpgq+tIA1XDC7Pu6w= + JDwiYb71FkbK9zwH+UQdUb+H04Uw0ZB3rfbjGZC5v94= diff --git a/TimeHACK.Main/bin/Release/TimeHACK.exe b/TimeHACK.Main/bin/Release/TimeHACK.exe index fc9bd62..4635586 100644 Binary files a/TimeHACK.Main/bin/Release/TimeHACK.exe and b/TimeHACK.Main/bin/Release/TimeHACK.exe differ diff --git a/TimeHACK.Main/bin/Release/TimeHACK.exe.manifest b/TimeHACK.Main/bin/Release/TimeHACK.exe.manifest index 6255fac..f085b35 100644 --- a/TimeHACK.Main/bin/Release/TimeHACK.exe.manifest +++ b/TimeHACK.Main/bin/Release/TimeHACK.exe.manifest @@ -63,7 +63,7 @@ - v0BE/qFWSZ0zeYD5hTCBto9Xqr5DEGUeahvBP1QyKl4= + 0Ls6I3WA5aPR/KrX4zGwrbzZvIh/wgf+cl6bLQj/nrY= diff --git a/TimeHACK.Main/bin/Release/TimeHACK.pdb b/TimeHACK.Main/bin/Release/TimeHACK.pdb index 5afc08d..67e3c50 100644 Binary files a/TimeHACK.Main/bin/Release/TimeHACK.pdb and b/TimeHACK.Main/bin/Release/TimeHACK.pdb differ diff --git a/TimeHACK.Main/bin/Release/app.publish/TimeHACK.exe b/TimeHACK.Main/bin/Release/app.publish/TimeHACK.exe index fc9bd62..4635586 100644 Binary files a/TimeHACK.Main/bin/Release/app.publish/TimeHACK.exe and b/TimeHACK.Main/bin/Release/app.publish/TimeHACK.exe differ diff --git a/TimeHACK.Main/obj/Release/TimeHACK.application b/TimeHACK.Main/obj/Release/TimeHACK.application index e3c83f9..0beb307 100644 --- a/TimeHACK.Main/obj/Release/TimeHACK.application +++ b/TimeHACK.Main/obj/Release/TimeHACK.application @@ -14,7 +14,7 @@ - HQXMPfmrHd5GpwrSTljeapHcCrGpgq+tIA1XDC7Pu6w= + JDwiYb71FkbK9zwH+UQdUb+H04Uw0ZB3rfbjGZC5v94= diff --git a/TimeHACK.Main/obj/Release/TimeHACK.exe b/TimeHACK.Main/obj/Release/TimeHACK.exe index fc9bd62..4635586 100644 Binary files a/TimeHACK.Main/obj/Release/TimeHACK.exe and b/TimeHACK.Main/obj/Release/TimeHACK.exe differ diff --git a/TimeHACK.Main/obj/Release/TimeHACK.exe.manifest b/TimeHACK.Main/obj/Release/TimeHACK.exe.manifest index 6255fac..f085b35 100644 --- a/TimeHACK.Main/obj/Release/TimeHACK.exe.manifest +++ b/TimeHACK.Main/obj/Release/TimeHACK.exe.manifest @@ -63,7 +63,7 @@ - v0BE/qFWSZ0zeYD5hTCBto9Xqr5DEGUeahvBP1QyKl4= + 0Ls6I3WA5aPR/KrX4zGwrbzZvIh/wgf+cl6bLQj/nrY= diff --git a/TimeHACK.Main/obj/Release/TimeHACK.pdb b/TimeHACK.Main/obj/Release/TimeHACK.pdb index 5afc08d..67e3c50 100644 Binary files a/TimeHACK.Main/obj/Release/TimeHACK.pdb and b/TimeHACK.Main/obj/Release/TimeHACK.pdb differ -- cgit v1.2.3