Esempio n. 1
0
        private void ButtonBackUp_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            string text = String.Format("Backing up \"{0}\" to \"{1}\"\n\n", directory, backupDirectory);

            loggingTextBox.AppendText(text);

            if (!DamnedCopyFiles(directory, backupDirectory))
            {
                MessageBox.Show("Failed to backup Damned Folder", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Cursor.Current = Cursors.Default;
                return;
            }

            DamnedFiles damnedFiles = new DamnedFiles(backupDirectory);;

            if (damnedFiles.Check())
            {
                loggingTextBox.AppendText("Looks like you have a good backup folder!\n\n");
                damnedBackupFolderStringLabel.ForeColor = Color.FromArgb(255, 138, 38);
                validBackUpFolder     = true;
                buttonRestore.Enabled = true;
            }

            else
            {
                damnedBackupFolderStringLabel.ForeColor = Color.Red;
                MessageBox.Show("The folder you have selecetd is not a valid back up folder. Please select another.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            Cursor.Current = Cursors.Default;
        }
Esempio n. 2
0
        private void LoadSettings()
        {
            string setting = Properties.Settings.Default.damnedGamePath;

            labelDamnedDirectoryPath.Text = directory;

            if (setting != String.Empty)
            {
                labelDamnedDirectoryPath.Text = setting;
                directory = setting;

                try
                {
                    damnedFiles = new DamnedFiles(directory);
                }

                catch (IOException)
                {
                    ResetSettings();
                    string message = String.Format("The directory \"{0}\" seems to no longer exist. Your settings have been reset.", setting);
                    MessageBox.Show(message, "Directory No Longer Exists", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    labelDamnedDirectoryPath.Text = "Your Damned directory path will appear here.";
                    directory = String.Empty;
                    return;
                }

                if (damnedFiles.Check())
                {
                    labelDamnedDirectoryPath.ForeColor = Color.FromArgb(255, 168, 38);
                    damnedWelcomeTextbox.AppendText($"\n\nChecked the saved directory {directory} successfully!");
                    EnableControls();
                }
            }
        }
Esempio n. 3
0
        private void ButtonOnlyCheck_Click(object sender, EventArgs e)
        {
            DamnedFiles damnedFiles = new DamnedFiles(backupDirectory);

            if (damnedFiles.Check())
            {
                loggingTextBox.AppendText("Looks like you have a good backup folder!\n\n");
                damnedBackupFolderStringLabel.ForeColor = Color.FromArgb(255, 168, 38);
                validBackUpFolder     = true;
                buttonRestore.Enabled = true;
            }

            else
            {
                damnedBackupFolderStringLabel.ForeColor = Color.Red;
                buttonRestore.Enabled = false;
            }
        }
Esempio n. 4
0
        private void LoadSettings()
        {
            string setting = String.Empty;

            setting = Properties.Settings.Default.damnedBackupFolderPath;

            if (setting != String.Empty)
            {
                damnedBackupFolderStringLabel.Text = Properties.Settings.Default.damnedBackupFolderPath;
                buttonOnlyCheck.Enabled            = true;
                buttonBackUp.Enabled = true;
                backupDirectory      = setting;

                if (damnedFiles.Check())
                {
                    damnedBackupFolderStringLabel.ForeColor = Color.FromArgb(255, 168, 38);
                    buttonRestore.Enabled = true;
                    validBackUpFolder     = true;
                }
            }

            setting = Properties.Settings.Default.damnedPublicTestPatchStablePath;

            if (setting != String.Empty)
            {
                publicTestPatchStableSavedDirectory            = setting;
                keepPublicTestPatchStableCheckbox.Checked      = true;
                buttonSetPublicTestPatchStableLocation.Enabled = true;
                publicTestPatchStablePathLabel.Text            = setting;
            }

            setting = Properties.Settings.Default.damnedPublicTestPatchTestingPath;

            if (setting != String.Empty)
            {
                publicTestPatchStableSavedDirectory             = setting;
                keepPublicTestPatchTestingCheckbox.Checked      = true;
                buttonSetPublicTestPatchTestingLocation.Enabled = true;
                publicTestPatchTestingPathLabel.Text            = setting;
            }
        }
Esempio n. 5
0
        private void ButtonCheckPath_Click(object sender, EventArgs e)
        {
            if (directory == String.Empty)
            {
                MessageBox.Show("You did not select a directory", "No directory selected", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            try
            {
                damnedFiles = new DamnedFiles(directory);
            }

            catch (IOException)
            {
                MessageBox.Show("This directory does not exist. Either the default location for Damned does not exist on your system, or the directory that you selected was moved or deleted by something else. Please select a new directory where Damned is installed.", "Directory Not Found", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                labelDamnedDirectoryPath.Text = "Your Damned directory path will appear here.";
                directory = String.Empty;
                return;
            }

            if (damnedFiles.Check())
            {
                labelDamnedDirectoryPath.ForeColor = Color.FromArgb(255, 168, 38);
                EnableControls();
                Properties.Settings.Default.damnedGamePath = directory;
                Properties.Settings.Default.Save();
                damnedFiles.Load();
                damnedWelcomeTextbox.AppendText($"\n\nCheck successful! The directory {directory} is a valid Damned directory!");
            }

            else
            {
                labelDamnedDirectoryPath.ForeColor = Color.Red;
                damnedWelcomeTextbox.AppendText($"\n\nCheck failed! The directory {directory} is not a valid Damned directory!");
                DisableControls();
            }
        }