aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main/OS
diff options
context:
space:
mode:
authorAlex-TIMEHACK <[email protected]>2017-06-10 17:13:53 +0100
committerGitHub <[email protected]>2017-06-10 17:13:53 +0100
commit819f8021522c27988c2b84ccc217db008cc593da (patch)
treebe0ff6c1fc3c57626e97b4fd9256c29d510c8fbb /TimeHACK.Main/OS
parent801ac36d5691a8a20ef4ea63a701f6157982e53e (diff)
parente4db9cc77abc4cc79c25a6c489183f58276428e8 (diff)
downloadhistacom2-819f8021522c27988c2b84ccc217db008cc593da.tar.gz
histacom2-819f8021522c27988c2b84ccc217db008cc593da.tar.bz2
histacom2-819f8021522c27988c2b84ccc217db008cc593da.zip
Merge pull request #84 from Alex-TIMEHACK/master
Even more tweaks to the explorer and stuff
Diffstat (limited to 'TimeHACK.Main/OS')
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/WinClassicNotepad.cs32
-rw-r--r--TimeHACK.Main/OS/Win95/Win95Apps/WinClassicWindowsExplorer.cs71
2 files changed, 69 insertions, 34 deletions
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();
}
}