Example #1
0
        public void SaveChanges()
        {
            Settings.Default.RecentFiles_MaxFiles   = (int)nudMaxRecentFiles.Value;
            Settings.Default.CheckForUpdates        = chbCheckForUpdates.Checked;
            Settings.Default.SortArchiveDirectories = chbSortBSADirectories.Checked;
            Settings.Default.RetrieveRealSize       = chbRetrieveRealSize.Checked;
            Settings.Default.EncodingCodePage       = (cbEncodings.SelectedItem as Encoding).CodePage;

            Enums.Icons icons = Enums.Icons.None;
            if (chbIconsFileList.Checked)
            {
                icons |= Enums.Icons.FileList;
            }
            if (chbIconsFolderTree.Checked)
            {
                icons |= Enums.Icons.FolderTree;
            }
            Settings.Default.Icons = icons;

            Settings.Default.MatchLastWriteTime = chbMatchLastWriteTime.Checked;
            Settings.Default.ReplaceGNFExt      = chbReplaceGNFExt.Checked;

            Settings.Default.QuickExtractPaths.Clear();
            Settings.Default.QuickExtractPaths.AddRange(lvQuickExtract.Items
                                                        .Cast <ListViewItem>().Select(x => (QuickExtractPath)x.Tag));

            Settings.Default.BuiltInPreviewing.Clear();
            Settings.Default.BuiltInPreviewing.AddRange(lvPreviewing.Items
                                                        .Cast <ListViewItem>().Where(x => x.Checked).Select(x => x.Text).ToArray());
        }
Example #2
0
        public void SaveChanges()
        {
            Settings.Default.RecentFiles_MaxFiles   = (int)nudMaxRecentFiles.Value;
            Settings.Default.CheckForUpdates        = chbCheckForUpdates.Checked;
            Settings.Default.RememberArchives       = chbRememberArchives.Checked;
            Settings.Default.SortArchiveDirectories = chbSortBSADirectories.Checked;
            Settings.Default.RetrieveRealSize       = chbRetrieveRealSize.Checked;
            Settings.Default.EncodingCodePage       = (cbEncodings.SelectedItem as Encoding).CodePage;

            Enums.Icons icons = Enums.Icons.None;
            if (chbIconsFileList.Checked)
            {
                icons |= Enums.Icons.FileList;
            }
            if (chbIconsFolderTree.Checked)
            {
                icons |= Enums.Icons.FolderTree;
            }
            Settings.Default.Icons = icons;

            Settings.Default.MatchLastWriteTime = chbMatchLastWriteTime.Checked;
            Settings.Default.ReplaceGNFExt      = chbReplaceGNFExt.Checked;

            Settings.Default.QuickExtractPaths.Clear();
            Settings.Default.QuickExtractPaths.AddRange(lvQuickExtract.Items
                                                        .Cast <ListViewItem>().Select(x => (QuickExtractPath)x.Tag));

            Settings.Default.PreviewMaxResolution = new Size(
                (int)nudMaxResolutionW.Value,
                (int)nudMaxResolutionH.Value);

            Settings.Default.BuiltInPreviewing.Clear();
            Settings.Default.BuiltInPreviewing.AddRange(lvPreviewing.Items
                                                        .Cast <ListViewItem>().Where(x => x.Checked).Select(x => x.Text).ToArray());

            if (this.CheckAssociationAndIntegrationChanged())
            {
                if (FileAssociation.HasAdminPrivileges() == false)
                {
                    MessageBox.Show(this,
                                    "File association and shell integration requires administrative rights.\n\nPrompt will be shown automatically.",
                                    "BSA Browser",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                }

                // If file association is disabled we don't care whether shell integration has changed or not
                bool?shellIntegration = null;
                if (cbAssociateFiles.Checked)
                {
                    shellIntegration = cbShellIntegration.Checked;
                }

                this.ToggleAssociateAndIntegration(cbAssociateFiles.Checked, shellIntegration);
            }
        }