aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Main/ShiftOS/Desktop.cs
blob: 7d1a0522d9fab32f3e45ba96bda89f42c5ad44cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System;
using System.Windows.Forms;
using ShiftOS.Engine.WindowManager;
using ShiftOS.Main.Properties;
using ShiftOS.Main.ShiftOS.Apps;
using System.IO;
using ShiftOS.Engine;

namespace ShiftOS.Main.ShiftOS
{
    // testing github because git hates me
    public partial class Desktop : Form
	{
		public Desktop()
		{
			InitializeComponent();
            timer1.Start();
            Setup();
			Closed += (sender, args) => { Application.Exit(); };
		}

        private void shifterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Apps.ShifterStuff.Shifter app = new Apps.ShifterStuff.Shifter();
            ShiftWM.Init(app, "Shifter", null);
        }

        private void Desktop_Load(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Maximized;
        }

        private void terminalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var t = new Apps.Terminal();
            ShiftWM.Init(t, "Terminal", Resources.iconTerminal, false);

        }

        private void textPadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var t = new TextPad();
            ShiftWM.Init(t, "TextPad", Resources.iconTextPad);
        }

        private void fileSkimmerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var fs = new FileSkimmer();
            ShiftWM.Init(fs, "File Skimmer", Resources.iconFileSkimmer);
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            lblClock.Text = DateTime.Now.ToString("hh:mm:ss");
        }
        public void Setup()
        {
            if (!Directory.Exists(SaveSystem.gameDir)) Directory.CreateDirectory(SaveSystem.gameDir);
            if (!Directory.Exists(SaveSystem.fontDir)) Directory.CreateDirectory(SaveSystem.fontDir);
            if (!File.Exists(SaveSystem.fontDir + "\\termFont.ttf")) File.WriteAllBytes(SaveSystem.fontDir + "\\termFont.ttf", Resources.UbuntuMono_R);
        }
    }
}