Subversion Repositories Code-Repo

Rev

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

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