aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-04-22 08:54:38 -0400
committerMichael <[email protected]>2017-04-22 08:54:38 -0400
commit114141b56e02857fa749cc130f16a2d6cc4c35f5 (patch)
tree711c08594ef4baaac47e334cba4522bf35badb8e /ShiftOS.WinForms
parent45b290efd9a907456b7d3bfa44e9f730dc8cd703 (diff)
downloadshiftos_thereturn-114141b56e02857fa749cc130f16a2d6cc4c35f5.tar.gz
shiftos_thereturn-114141b56e02857fa749cc130f16a2d6cc4c35f5.tar.bz2
shiftos_thereturn-114141b56e02857fa749cc130f16a2d6cc4c35f5.zip
Add FS delete functions
Diffstat (limited to 'ShiftOS.WinForms')
-rw-r--r--ShiftOS.WinForms/Applications/FileSkimmer.Designer.cs1
-rw-r--r--ShiftOS.WinForms/Applications/FileSkimmer.cs21
-rw-r--r--ShiftOS.WinForms/Resources/Shiftorium.txt14
-rw-r--r--ShiftOS.WinForms/WinformsDesktop.cs10
4 files changed, 43 insertions, 3 deletions
diff --git a/ShiftOS.WinForms/Applications/FileSkimmer.Designer.cs b/ShiftOS.WinForms/Applications/FileSkimmer.Designer.cs
index c917840..dd19108 100644
--- a/ShiftOS.WinForms/Applications/FileSkimmer.Designer.cs
+++ b/ShiftOS.WinForms/Applications/FileSkimmer.Designer.cs
@@ -122,6 +122,7 @@ namespace ShiftOS.WinForms.Applications
this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
this.deleteToolStripMenuItem.Size = new System.Drawing.Size(52, 20);
this.deleteToolStripMenuItem.Text = "Delete";
+ this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click);
//
// connectToRemoteServerToolStripMenuItem
//
diff --git a/ShiftOS.WinForms/Applications/FileSkimmer.cs b/ShiftOS.WinForms/Applications/FileSkimmer.cs
index 4b11d24..3b4b2e7 100644
--- a/ShiftOS.WinForms/Applications/FileSkimmer.cs
+++ b/ShiftOS.WinForms/Applications/FileSkimmer.cs
@@ -261,7 +261,7 @@ namespace ShiftOS.WinForms.Applications
{
moveToolStripMenuItem.Visible = false;
copyToolStripMenuItem.Visible = false;
-
+ deleteToolStripMenuItem.Visible = false;
}
private void newFolderToolStripMenuItem_Click(object sender, EventArgs e)
@@ -298,11 +298,13 @@ namespace ShiftOS.WinForms.Applications
{
if (DirectoryExists(currentdir + "/" + itm.Tag.ToString()))
{
+ deleteToolStripMenuItem.Visible = Shiftorium.UpgradeInstalled("fs_recursive_delete");
moveToolStripMenuItem.Visible = Shiftorium.UpgradeInstalled("fs_move_folder");
copyToolStripMenuItem.Visible = Shiftorium.UpgradeInstalled("fs_copy_folder");
}
else if (FileExists(currentdir + "/" + itm.Tag.ToString()))
{
+ deleteToolStripMenuItem.Visible = Shiftorium.UpgradeInstalled("fs_delete");
moveToolStripMenuItem.Visible = Shiftorium.UpgradeInstalled("fs_move");
copyToolStripMenuItem.Visible = Shiftorium.UpgradeInstalled("fs_copy");
}
@@ -322,6 +324,7 @@ namespace ShiftOS.WinForms.Applications
{
moveToolStripMenuItem.Visible = false;
copyToolStripMenuItem.Visible = false;
+ deleteToolStripMenuItem.Visible = false;
}
}
@@ -387,6 +390,22 @@ namespace ShiftOS.WinForms.Applications
}
}
+
+ private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ Infobox.PromptYesNo("Delete file", "Are you sure you want to delete " + lvitems.SelectedItems[0].Text + "?", (result) =>
+ {
+ if (result == true)
+ {
+ Delete(currentdir + "/" + lvitems.SelectedItems[0].Tag.ToString());
+ ResetList();
+ }
+ });
+ }
+ catch { }
+ }
}
diff --git a/ShiftOS.WinForms/Resources/Shiftorium.txt b/ShiftOS.WinForms/Resources/Shiftorium.txt
index 2cd9680..dadb022 100644
--- a/ShiftOS.WinForms/Resources/Shiftorium.txt
+++ b/ShiftOS.WinForms/Resources/Shiftorium.txt
@@ -271,6 +271,20 @@
Dependencies: "color_depth_8_bits"
},
{
+ Name: "FS Delete",
+ Cost: 75,
+ Description: "Got some files that you want to get rid of? This upgrade adds a button to the File Skimmer for doing just that.",
+ Dependencies: "file_skimmer",
+ Category: "Enhancements",
+ },
+ {
+ Name: "FS Recursive Delete",
+ Cost: 100,
+ Description: "Deleting files is great, but what if you have an entire folder you need to get rid of? This upgrade allows the deletion of folders and all files and folders inside them. Just, don't delete your system folder!",
+ Dependencies: "fs_delete",
+ Category: "Enhancements"
+ },
+ {
Name: "Color Depth 24 Bits",
Cost: 24000,
Description: "Having actual color is nice for our images as we can truly see detail in our images - but if we had a third byte, each channel could have up to 256 values - adding up to almost 17 million different colors! Our eyes can't even distinguish that many.",
diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs
index 09703db..c458a4a 100644
--- a/ShiftOS.WinForms/WinformsDesktop.cs
+++ b/ShiftOS.WinForms/WinformsDesktop.cs
@@ -61,6 +61,7 @@ namespace ShiftOS.WinForms
public WinformsDesktop()
{
InitializeComponent();
+ ControlManager.MakeDoubleBuffered(pnlwidgetlayer);
this.Click += (o, a) =>
{
HideAppLauncher();
@@ -455,7 +456,7 @@ namespace ShiftOS.WinForms
UserControl w = (UserControl)Activator.CreateInstance(widget.Value, null);
w.Location = WidgetManager.LoadLocation(w.GetType());
-
+ w.Top -= desktoppanel.Height;
pnlwidgetlayer.Controls.Add(w);
MakeWidgetMovable(w);
Widgets.Add(w as IDesktopWidget);
@@ -466,6 +467,8 @@ namespace ShiftOS.WinForms
{
if (Shiftorium.UpgradeInstalled("desktop_widgets"))
{
+ widget.OnSkinLoad();
+ widget.OnUpgrade();
widget.Setup();
widget.Show();
}
@@ -474,6 +477,9 @@ namespace ShiftOS.WinForms
widget.Hide();
}
}
+ pnlwidgetlayer.Show();
+ pnlwidgetlayer.BringToFront();
+
}
else
@@ -520,7 +526,7 @@ namespace ShiftOS.WinForms
w.MouseUp += (o, a) =>
{
moving = false;
- WidgetManager.SaveLocation(startCtrl.GetType(), w.Location);
+ WidgetManager.SaveLocation(startCtrl.GetType(), startCtrl.Location);
};
foreach (Control c in w.Controls)