Subversion Repositories Code-Repo

Rev

Rev 57 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 57 Rev 63
Line 7... Line 7...
7
using System.Text;
7
using System.Text;
8
using System.Windows.Forms;
8
using System.Windows.Forms;
9
 
9
 
10
namespace SWAT_Office_App
10
namespace SWAT_Office_App
11
{
11
{
12
    public partial class Menu_Main : Form
12
    public partial class Menu_Main_Form : Form
13
    {
13
    {
14
        public Menu_Main()
14
        public Menu_Main_Form()
15
        {
15
        {
16
            DebugText.startNewSession();
16
            Debug.startNewSession();
17
            Settings_Form.ImportSettings();
17
            Settings_Form.ImportSettings();
18
            StatLogging.ImportSettings();
18
            Stat_Logging.ImportSettings();
19
            InitializeComponent();
19
            InitializeComponent();
20
            this.KeyPress += new KeyPressEventHandler(Menu_Main_KeyPress);
20
            this.KeyPress += new KeyPressEventHandler(Menu_Main_KeyPress);
21
            this.FormClosing += new FormClosingEventHandler(Menu_Main_FormClosing);
21
            this.FormClosing += new FormClosingEventHandler(Menu_Main_FormClosing);
22
        }
22
        }
23
 
23
 
24
        void Menu_Main_FormClosing(object sender, FormClosingEventArgs e)
24
        void Menu_Main_FormClosing(object sender, FormClosingEventArgs e)
25
        {
25
        {
26
            StatLogging.ExportSettings();
26
            Stat_Logging.ExportSettings();
27
        }
27
        }
28
        void Menu_Main_KeyPress(object sender, KeyPressEventArgs e)
28
        void Menu_Main_KeyPress(object sender, KeyPressEventArgs e)
29
        {
29
        {
30
            // Monitors for keypresses
30
            // Monitors for keypresses
31
            switch (e.KeyChar)
31
            switch (e.KeyChar)
32
            {
32
            {
33
                case '1':   // Manage User Accounts and Shares
33
                case '1':   // Manage User Accounts and Shares
34
                    ManageUserAccounts_Form user_Mgmt = new ManageUserAccounts_Form();
34
                    Manage_User_Accounts_Form user_Mgmt = new Manage_User_Accounts_Form();
35
                    user_Mgmt.ShowDialog();
35
                    user_Mgmt.ShowDialog();
36
                    break;
36
                    break;
37
                case '2':   // DriveLogger
37
                case '2':   // DriveLogger
38
                    // Check to make sure that an instance of DriveLogger isnt already running
38
                    // Check to make sure that an instance of DriveLogger isnt already running
39
                    if (!DriveLogger_Form.instanceAlreadyRunning)
39
                    if (!DriveLogger_Form.instanceAlreadyRunning)
40
                    {
40
                    {
41
                        DebugText.appendText("Starting instance of DriveLogger");
41
                        Debug.appendText("Starting instance of DriveLogger");
42
                        DriveLogger_Form driveForm = new DriveLogger_Form();
42
                        DriveLogger_Form driveForm = new DriveLogger_Form();
43
                        driveForm.Show();
43
                        driveForm.Show();
44
                    }
44
                    }
45
                    else
45
                    else
46
                    {
46
                    {
Line 49... Line 49...
49
                    break;
49
                    break;
50
                case '3':   // Reimage USB Drives
50
                case '3':   // Reimage USB Drives
51
                    // Check to make sure that another imaging thread isnt running
51
                    // Check to make sure that another imaging thread isnt running
52
                    if (!Reimage_USB_Drives.threadsRunning)
52
                    if (!Reimage_USB_Drives.threadsRunning)
53
                    {
53
                    {
54
                        DebugText.appendText("Starting reimaging of USB drives");
54
                        Debug.appendText("Starting reimaging of USB drives");
55
                        Reimage_USB_Drives.reimageUSBDrives();
55
                        Reimage_USB_Drives.reimageUSBDrives();
56
                    }
56
                    }
57
                    else
57
                    else
58
                        MessageBox.Show("Another file copy operation is currently in progress.\n" +
58
                        MessageBox.Show("Another file copy operation is currently in progress.\n" +
59
                                        "Please wait for transfer to finish before starting another");
59
                                        "Please wait for transfer to finish before starting another");
60
                    break;
60
                    break;
61
                case '4':   // Program Settings
61
                case '4':   // Program Settings
62
                    SettingsVerify_Form settingsForm = new SettingsVerify_Form();
62
                    Settings_Verify_Form settingsForm = new Settings_Verify_Form();
63
                    settingsForm.ShowDialog();
63
                    settingsForm.ShowDialog();
64
                    break;
64
                    break;
65
                case '?':   // About
65
                case '?':   // About
66
                    AboutBox aboutForm = new AboutBox();
66
                    About_Box_Form aboutForm = new About_Box_Form();
67
                    aboutForm.ShowDialog();
67
                    aboutForm.ShowDialog();
68
                    break;
68
                    break;
69
            }
69
            }
70
        }
70
        }
71
        private void btn_Main_UserMgmt_Click(object sender, EventArgs e)
71
        private void btn_Main_UserMgmt_Click(object sender, EventArgs e)
72
        {
72
        {
73
            // Manage User Accounts and Shares
73
            // Manage User Accounts and Shares
74
            ManageUserAccounts_Form userMgmtForm = new ManageUserAccounts_Form();
74
            Manage_User_Accounts_Form userMgmtForm = new Manage_User_Accounts_Form();
75
            userMgmtForm.ShowDialog();
75
            userMgmtForm.ShowDialog();
76
        }
76
        }
77
        private void btn_DriveLogger_Click(object sender, EventArgs e)
77
        private void btn_DriveLogger_Click(object sender, EventArgs e)
78
        {
78
        {
79
            // DriveLogger
79
            // DriveLogger
80
            if (!DriveLogger_Form.instanceAlreadyRunning)
80
            if (!DriveLogger_Form.instanceAlreadyRunning)
81
            {
81
            {
82
                DebugText.appendText("Starting instance of DriveLogger");
82
                Debug.appendText("Starting instance of DriveLogger");
83
                DriveLogger_Form driveForm = new DriveLogger_Form();
83
                DriveLogger_Form driveForm = new DriveLogger_Form();
84
                driveForm.Show();
84
                driveForm.Show();
85
            }
85
            }
86
            else
86
            else
87
                MessageBox.Show("An instance of DriveLogger is already running");
87
                MessageBox.Show("An instance of DriveLogger is already running");
Line 89... Line 89...
89
        private void btn_Reimage_USB_Drives_Click(object sender, EventArgs e)
89
        private void btn_Reimage_USB_Drives_Click(object sender, EventArgs e)
90
        {
90
        {
91
            // Reimage USB Drives
91
            // Reimage USB Drives
92
            if (!Reimage_USB_Drives.threadsRunning)
92
            if (!Reimage_USB_Drives.threadsRunning)
93
            {
93
            {
94
                DebugText.appendText("Starting reimaging of USB drives");
94
                Debug.appendText("Starting reimaging of USB drives");
95
                Reimage_USB_Drives.reimageUSBDrives();
95
                Reimage_USB_Drives.reimageUSBDrives();
96
            }
96
            }
97
            else
97
            else
98
                MessageBox.Show("Another file copy operation is currently in progress.\n" +
98
                MessageBox.Show("Another file copy operation is currently in progress.\n" +
99
                                "Please wait for transfer to finish before starting another");
99
                                "Please wait for transfer to finish before starting another");
100
        }
100
        }
101
        private void btn_Main_Settings_Click(object sender, EventArgs e)
101
        private void btn_Main_Settings_Click(object sender, EventArgs e)
102
        {
102
        {
103
            // Program Settings
103
            // Program Settings
104
            SettingsVerify_Form settingsForm = new SettingsVerify_Form();
104
            Settings_Verify_Form settingsForm = new Settings_Verify_Form();
105
            settingsForm.ShowDialog();
105
            settingsForm.ShowDialog();
106
        }
106
        }
107
    }
107
    }
108
}
108
}