Esempio n. 1
0
        private void LoadGuiOptions()
        {
            m_strInitialTsRenderer = Program.Config.UI.ToolStripRenderer;

            bool?obNoMin = null;

            if (MonoWorkarounds.IsRequired(1418))
            {
                obNoMin = true;
            }

            m_lvGuiOptions.Columns.Add(KPRes.Options);             // Resize below

            ListViewGroup lvg = new ListViewGroup(KPRes.MainWindow);

            m_lvGuiOptions.Groups.Add(lvg);
            Debug.Assert(lvg.ListView == m_lvGuiOptions);

            m_cdxGuiOptions = new CheckedLVItemDXList(m_lvGuiOptions, true);

            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "CloseButtonMinimizesWindow",
                                       lvg, KPRes.CloseButtonMinimizes);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "MinimizeToTray",
                                       lvg, KPRes.MinimizeToTray);
            m_cdxGuiOptions.CreateItem(Program.Config.UI.TrayIcon, "ShowOnlyIfTrayed",
                                       lvg, KPRes.ShowTrayOnlyIfTrayed);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "ShowFullPathInTitle",
                                       lvg, KPRes.ShowFullPathInTitleBar);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "DropToBackAfterClipboardCopy",
                                       lvg, KPRes.DropToBackOnCopy);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "MinimizeAfterClipboardCopy",
                                       lvg, KPRes.MinimizeAfterCopy);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "MinimizeAfterLocking",
                                       lvg, KPRes.MinimizeAfterLocking);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "MinimizeAfterOpeningDatabase",
                                       lvg, KPRes.MinimizeAfterOpeningDatabase, obNoMin);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "DisableSaveIfNotModified",
                                       lvg, KPRes.DisableSaveIfNotModified);

            lvg = new ListViewGroup(KPRes.EntryList);
            m_lvGuiOptions.Groups.Add(lvg);
            // m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "ShowGridLines",
            //	m_lvGuiOptions, lvg, KPRes.ShowGridLines);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "EntryListAutoResizeColumns",
                                       lvg, KPRes.EntryListAutoResizeColumns);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "EntryListAlternatingBgColors",
                                       lvg, KPRes.AlternatingBgColors);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "CopyUrlsInsteadOfOpening",
                                       lvg, KPRes.CopyUrlsInsteadOfOpening);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "EntrySelGroupSel",
                                       lvg, KPRes.EntrySelGroupSel);

            if (!Program.Config.MainWindow.EntryListShowDerefData)
            {
                Debug.Assert(!Program.Config.MainWindow.EntryListShowDerefDataAsync);
                Program.Config.MainWindow.EntryListShowDerefDataAsync = false;
            }
            ListViewItem lviDeref = m_cdxGuiOptions.CreateItem(
                Program.Config.MainWindow, "EntryListShowDerefData",
                lvg, KPRes.ShowDerefData + " (" + KPRes.Slow + ")");
            ListViewItem lviDerefAsync = m_cdxGuiOptions.CreateItem(
                Program.Config.MainWindow, "EntryListShowDerefDataAsync",
                lvg, KPRes.ShowDerefDataAsync + " (" + KPRes.IncompatibleWithSorting + ")");

            m_cdxGuiOptions.AddLink(lviDeref, lviDerefAsync, CheckItemLinkType.UncheckedUnchecked);
            m_cdxGuiOptions.AddLink(lviDerefAsync, lviDeref, CheckItemLinkType.CheckedChecked);

            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "EntryListShowDerefDataAndRefs",
                                       lvg, KPRes.ShowDerefDataAndRefs);

            // lvg = new ListViewGroup(KPRes.EntryView);
            // m_lvGuiOptions.Groups.Add(lvg);
            // m_cdxGuiOptions.CreateItem(Program.Config.MainWindow.EntryView, "HideProtectedCustomStrings",
            //	lvg, KPRes.EntryViewHideProtectedCustomStrings);

            lvg = new ListViewGroup(KPRes.QuickSearchTb);
            m_lvGuiOptions.Groups.Add(lvg);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "QuickFindSearchInPasswords",
                                       lvg, KPRes.QuickSearchInPwFields);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "QuickFindExcludeExpired",
                                       lvg, KPRes.QuickSearchExclExpired);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "QuickFindDerefData",
                                       lvg, KPRes.QuickSearchDerefData + " (" + KPRes.Slow + ")");
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "FocusResultsAfterQuickFind",
                                       lvg, KPRes.FocusResultsAfterQuickSearch);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "FocusQuickFindOnRestore",
                                       lvg, KPRes.FocusQuickFindOnRestore);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "FocusQuickFindOnUntray",
                                       lvg, KPRes.FocusQuickFindOnUntray);

            lvg = new ListViewGroup(KPRes.Dialogs);
            m_lvGuiOptions.Groups.Add(lvg);
            m_cdxGuiOptions.CreateItem(Program.Config.UI, "ShowRecycleConfirmDialog",
                                       lvg, KPRes.RecycleShowConfirm);
            m_cdxGuiOptions.CreateItem(Program.Config.UI, "ShowDbMntncResultsDialog",
                                       lvg, KPRes.DbMntncResults);

            lvg = new ListViewGroup(KPRes.Advanced);
            m_lvGuiOptions.Groups.Add(lvg);
            m_cdxGuiOptions.CreateItem(Program.Config.UI, "RepeatPasswordOnlyWhenHidden",
                                       lvg, KPRes.RepeatOnlyWhenHidden);
            // m_cdxGuiOptions.CreateItem(Program.Config.UI, "UseCustomToolStripRenderer",
            //	lvg, KPRes.UseCustomToolStripRenderer);
            m_cdxGuiOptions.CreateItem(Program.Config.UI, "ForceSystemFontUnix",
                                       lvg, KPRes.ForceSystemFontUnix);

            m_cdxGuiOptions.UpdateData(false);
            UIUtil.ResizeColumns(m_lvGuiOptions, true);

            try { m_numMruCount.Value = Program.Config.Application.MostRecentlyUsed.MaxItemCount; }
            catch (Exception) { Debug.Assert(false); m_numMruCount.Value = AceMru.DefaultMaxItemCount; }
            if (AppConfigEx.IsOptionEnforced(Program.Config.Application.MostRecentlyUsed, "MaxItemCount"))
            {
                m_lblMruCount.Enabled = false;
                m_numMruCount.Enabled = false;
            }

            if (AppConfigEx.IsOptionEnforced(Program.Config.UI, "StandardFont"))
            {
                m_btnSelFont.Enabled = false;
            }
            if (AppConfigEx.IsOptionEnforced(Program.Config.UI, "PasswordFont") ||
                MonoWorkarounds.IsRequired(5795))
            {
                m_btnSelPwFont.Enabled = false;
            }
        }
Esempio n. 2
0
        private void LoadAdvancedOptions()
        {
            bool?obNoMin = null;

            if (MonoWorkarounds.IsRequired(1418))
            {
                obNoMin = true;
            }

            m_lvAdvanced.Columns.Add(string.Empty);             // Resize below

            m_cdxAdvanced = new CheckedLVItemDXList(m_lvAdvanced, true);

            ListViewGroup lvg = new ListViewGroup(KPRes.StartAndExit);

            m_lvAdvanced.Groups.Add(lvg);
            m_cdxAdvanced.CreateItem(Program.Config.Application.Start, "OpenLastFile",
                                     lvg, KPRes.AutoRememberOpenLastFile);
            m_cdxAdvanced.CreateItem(Program.Config.Integration, "LimitToSingleInstance",
                                     lvg, KPRes.LimitSingleInstance);
            m_cdxAdvanced.CreateItem(Program.Config.Application.Start, "CheckForUpdate",
                                     lvg, KPRes.CheckForUpdAtStart);
            m_cdxAdvanced.CreateItem(Program.Config.Application.Start, "MinimizedAndLocked",
                                     lvg, KPRes.StartMinimizedAndLocked, obNoMin);
            m_cdxAdvanced.CreateItem(Program.Config.Application.FileClosing, "AutoSave",
                                     lvg, KPRes.AutoSaveAtExit);

            lvg = new ListViewGroup(KPRes.AfterDatabaseOpen);
            m_lvAdvanced.Groups.Add(lvg);
            m_cdxAdvanced.CreateItem(Program.Config.Application.FileOpening, "ShowExpiredEntries",
                                     lvg, KPRes.AutoShowExpiredEntries);
            m_cdxAdvanced.CreateItem(Program.Config.Application.FileOpening, "ShowSoonToExpireEntries",
                                     lvg, KPRes.AutoShowSoonToExpireEntries);

            lvg = new ListViewGroup(KPRes.AutoType);
            m_lvAdvanced.Groups.Add(lvg);
            m_cdxAdvanced.CreateItem(Program.Config.Integration, "AutoTypeMatchByTitle",
                                     lvg, KPRes.AutoTypeMatchByTitle);
            m_cdxAdvanced.CreateItem(Program.Config.Integration, "AutoTypeMatchByUrlInTitle",
                                     lvg, KPRes.AutoTypeMatchByUrlInTitle);
            m_cdxAdvanced.CreateItem(Program.Config.Integration, "AutoTypeMatchByUrlHostInTitle",
                                     lvg, KPRes.AutoTypeMatchByUrlHostInTitle);
            m_cdxAdvanced.CreateItem(Program.Config.Integration, "AutoTypeMatchByTagInTitle",
                                     lvg, KPRes.AutoTypeMatchByTagInTitle);
            m_cdxAdvanced.CreateItem(Program.Config.Integration, "AutoTypeExpiredCanMatch",
                                     lvg, KPRes.ExpiredEntriesCanMatch);
            m_cdxAdvanced.CreateItem(Program.Config.Integration, "AutoTypeAlwaysShowSelDialog",
                                     lvg, KPRes.AutoTypeAlwaysShowSelDialog);

            lvg = new ListViewGroup(KPRes.AutoType + " - " + KPRes.SendingNoun);
            m_lvAdvanced.Groups.Add(lvg);
            m_cdxAdvanced.CreateItem(Program.Config.Integration, "AutoTypePrependInitSequenceForIE",
                                     lvg, KPRes.AutoTypePrependInitSeqForIE);
            m_cdxAdvanced.CreateItem(Program.Config.Integration, "AutoTypeReleaseAltWithKeyPress",
                                     lvg, KPRes.AutoTypeReleaseAltWithKeyPress);
            m_cdxAdvanced.CreateItem(Program.Config.Integration, "AutoTypeAdjustKeyboardLayout",
                                     lvg, KPRes.SameKeybLayout);
            m_cdxAdvanced.CreateItem(Program.Config.Integration, "AutoTypeAllowInterleaved",
                                     lvg, KPRes.InterleavedKeySending);
            m_cdxAdvanced.CreateItem(Program.Config.Integration, "AutoTypeCancelOnWindowChange",
                                     lvg, KPRes.AutoTypeCancelOnWindowChange);
            m_cdxAdvanced.CreateItem(Program.Config.Integration, "AutoTypeCancelOnTitleChange",
                                     lvg, KPRes.AutoTypeCancelOnTitleChange);

            lvg = new ListViewGroup(KPRes.IOConnectionLong);
            m_lvAdvanced.Groups.Add(lvg);
            m_cdxAdvanced.CreateItem(Program.Config.Application, "VerifyWrittenFileAfterSaving",
                                     lvg, KPRes.VerifyWrittenFileAfterSave);
            m_cdxAdvanced.CreateItem(Program.Config.Application, "UseTransactedFileWrites",
                                     lvg, KPRes.UseTransactedDatabaseWrites);
            m_cdxAdvanced.CreateItem(Program.Config.Application, "FileTxExtra",
                                     lvg, KPRes.FileTxExtra + " (" + KPRes.Slow + ")");
            m_cdxAdvanced.CreateItem(Program.Config.Application, "UseFileLocks",
                                     lvg, KPRes.UseFileLocks + " " + KPRes.NotRecommended);
            m_cdxAdvanced.CreateItem(Program.Config.Application, "SaveForceSync",
                                     lvg, KPRes.SaveForceSync);
            m_cdxAdvanced.CreateItem(Program.Config.Security, "SslCertsAcceptInvalid",
                                     lvg, KPRes.SslCertsAcceptInvalid);

            lvg = new ListViewGroup(KPRes.Advanced);
            m_lvAdvanced.Groups.Add(lvg);

            if (!Program.Config.Integration.SearchKeyFiles)
            {
                Program.Config.Integration.SearchKeyFilesOnRemovableMedia = false;
            }
            ListViewItem lviSearch = m_cdxAdvanced.CreateItem(
                Program.Config.Integration, "SearchKeyFiles",
                lvg, KPRes.SearchKeyFiles);
            ListViewItem lviSearchRmv = m_cdxAdvanced.CreateItem(
                Program.Config.Integration, "SearchKeyFilesOnRemovableMedia",
                lvg, KPRes.SearchKeyFilesAlsoOnRemovable);

            m_cdxAdvanced.AddLink(lviSearch, lviSearchRmv, CheckItemLinkType.UncheckedUnchecked);
            m_cdxAdvanced.AddLink(lviSearchRmv, lviSearch, CheckItemLinkType.CheckedChecked);

            m_cdxAdvanced.CreateItem(Program.Config.Defaults, "RememberKeySources",
                                     lvg, KPRes.RememberKeySources);
            m_cdxAdvanced.CreateItem(Program.Config.Application, "RememberWorkingDirectories",
                                     lvg, KPRes.RememberWorkingDirectories);
            m_cdxAdvanced.CreateItem(Program.Config.UI.Hiding, "SeparateHidingSettings",
                                     lvg, KPRes.RememberHidingSettings);
            m_cdxAdvanced.CreateItem(Program.Config.UI.Hiding, "UnhideButtonAlsoUnhidesSource",
                                     lvg, KPRes.UnhideSourceCharactersToo);
            m_cdxAdvanced.CreateItem(Program.Config.Defaults, "TanExpiresOnUse",
                                     lvg, KPRes.TanExpiresOnUse);
            m_cdxAdvanced.CreateItem(Program.Config.Defaults, "RecycleBinCollapse",
                                     lvg, KPRes.RecycleBinCollapse);
            m_cdxAdvanced.CreateItem(Program.Config.UI, "SecureDesktopPlaySound",
                                     lvg, KPRes.SecDeskPlaySound);
            m_cdxAdvanced.CreateItem(Program.Config.UI, "OptimizeForScreenReader",
                                     lvg, KPRes.OptimizeForScreenReader);

            m_cdxAdvanced.UpdateData(false);
            UIUtil.ResizeColumns(m_lvAdvanced, true);

            if (AppConfigEx.IsOptionEnforced(Program.Config.Integration, "ProxyType") ||
                AppConfigEx.IsOptionEnforced(Program.Config.Integration, "ProxyAddress"))
            {
                m_btnProxy.Enabled = false;
            }
        }
Esempio n. 3
0
        public OptionsPanel(KeeAgentExt ext)
        {
            InitializeComponent();
            if (Type.GetType("Mono.Runtime") != null)
            {
                const int xOffset = -30;
                const int yOffset = -30;
                helpButton.Left        += xOffset;
                customListViewEx.Width += xOffset;
                groupBox1.Width        += xOffset;
                groupBox1.Height       += yOffset;
            }

            this.ext = ext;
            isUnix   = Environment.OSVersion.Platform == PlatformID.Unix ||
                       Environment.OSVersion.Platform == PlatformID.MacOSX;

            // make transparent so tab styling shows
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            BackColor = Color.Transparent;

            modeComboBox.Items.Add(Translatable.OptionAgentModeAuto);
            modeComboBox.Items.Add(Translatable.OptionAgentModeAgent);
            modeComboBox.Items.Add(Translatable.OptionAgentModeClient);
            switch (ext.Options.AgentMode)
            {
            case AgentMode.Client:
                modeComboBox.SelectedItem = Translatable.OptionAgentModeClient;
                break;

            case AgentMode.Server:
                modeComboBox.SelectedItem = Translatable.OptionAgentModeAgent;
                break;

            default:
                modeComboBox.SelectedItem = Translatable.OptionAgentModeAuto;
                break;
            }

            // additional configuration of list view
            customListViewEx.UseCompatibleStateImageBehavior = false;
            UIUtil.SetExplorerTheme(customListViewEx, false);

            optionsList = new CheckedLVItemDXList(customListViewEx, true);
            var optionsGroup = new ListViewGroup("common", "Options");

            customListViewEx.Groups.Add(optionsGroup);
            optionsList.CreateItem(ext.Options, "IgnoreMissingExternalKeyFiles",
                                   optionsGroup, Translatable.OptionIgnoreMissingExternalKeyFiles);

            var agentModeOptionsGroup = new ListViewGroup("agentMode",
                                                          "Agent Mode Options (no effect in Client Mode)");

            customListViewEx.Groups.Add(agentModeOptionsGroup);
            optionsList.CreateItem(ext.Options, "AlwaysConfirm", agentModeOptionsGroup,
                                   Translatable.OptionAlwaysConfirm);
            optionsList.CreateItem(ext.Options, "ShowBalloon", agentModeOptionsGroup,
                                   Translatable.OptionShowBalloon);
            //mOptionsList.CreateItem(aExt.Options, "LoggingEnabled", optionsGroup,
            //  Translatable.optionLoggingEnabled);
            optionsList.CreateItem(ext.Options, "UnlockOnActivity", agentModeOptionsGroup,
                                   Translatable.OptionUnlockOnActivity);
            optionsList.CreateItem(ext.Options, "UserPicksKeyOnRequestIdentities",
                                   agentModeOptionsGroup, Translatable.OptionUserPicksKeyOnRequestIdentities);
            if (!isUnix)
            {
                optionsList.CreateItem(ext.Options, "UseWindowsOpenSshPipe",
                                       agentModeOptionsGroup, Translatable.OptionUseWindowsOpenSshPipe);
            }

            columnHeader.Width = customListViewEx.ClientRectangle.Width -
                                 UIUtil.GetVScrollBarWidth() - 1;
            if (isUnix)
            {
                groupBox1.Text = "Agent mode socket file";
                useCygwinSocketCheckBox.Visible = false;
                cygwinSocketPathTextBox.Text    = ext.Options.UnixSocketPath;
                cygwinSocketPathTextBox.Enabled = true;
                cygwinPathBrowseButton.Enabled  = true;
                useMsysSocketCheckBox.Visible   = false;
                label4.Visible = false;
                msysSocketPathTextBox.Visible = false;
                msysPathBrowseButton.Visible  = false;
            }
            else
            {
                useCygwinSocketCheckBox.Checked = ext.Options.UseCygwinSocket;
                cygwinSocketPathTextBox.Text    = ext.Options.CygwinSocketPath;
                useMsysSocketCheckBox.Checked   = ext.Options.UseMsysSocket;
                msysSocketPathTextBox.Text      = ext.Options.MsysSocketPath;
            }
            optionsList.UpdateData(false);
        }
Esempio n. 4
0
        private void LoadSecurityOptions()
        {
            AceWorkspaceLocking aceWL = Program.Config.Security.WorkspaceLocking;

            uint uLockTime = aceWL.LockAfterTime;
            bool bLockTime = (uLockTime > 0);

            m_numLockAfterTime.Value  = (bLockTime ? uLockTime : 300);
            m_cbLockAfterTime.Checked = bLockTime;
            if (AppConfigEx.IsOptionEnforced(aceWL, "LockAfterTime"))
            {
                m_cbLockAfterTime.Enabled = false;
            }

            uLockTime = aceWL.LockAfterGlobalTime;
            bLockTime = (uLockTime > 0);
            m_numLockAfterGlobalTime.Value  = (bLockTime ? uLockTime : 240);
            m_cbLockAfterGlobalTime.Checked = bLockTime;
            if (AppConfigEx.IsOptionEnforced(aceWL, "LockAfterGlobalTime"))
            {
                m_cbLockAfterGlobalTime.Enabled = false;
            }

            int nDefaultExpireDays = Program.Config.Defaults.NewEntryExpiresInDays;

            if (nDefaultExpireDays < 0)
            {
                m_cbDefaultExpireDays.Checked = false;
            }
            else
            {
                m_cbDefaultExpireDays.Checked = true;
                try { m_numDefaultExpireDays.Value = nDefaultExpireDays; }
                catch (Exception) { Debug.Assert(false); }
            }
            if (AppConfigEx.IsOptionEnforced(Program.Config.Defaults, "NewEntryExpiresInDays"))
            {
                m_cbDefaultExpireDays.Enabled = false;
            }

            int nClipClear = Program.Config.Security.ClipboardClearAfterSeconds;

            if (nClipClear >= 0)
            {
                m_cbClipClearTime.Checked = true;
                m_numClipClearTime.Value  = nClipClear;
            }
            else
            {
                m_cbClipClearTime.Checked = false;
            }
            if (AppConfigEx.IsOptionEnforced(Program.Config.Security, "ClipboardClearAfterSeconds"))
            {
                m_cbClipClearTime.Enabled = false;
            }

            m_lvSecurityOptions.Columns.Add(string.Empty);             // Resize below

            ListViewGroup lvg = new ListViewGroup(KPRes.Options);

            m_lvSecurityOptions.Groups.Add(lvg);
            Debug.Assert(lvg.ListView == m_lvSecurityOptions);

            m_cdxSecurityOptions = new CheckedLVItemDXList(m_lvSecurityOptions, true);

            bool?  obNoSEv      = null;       // Allow read-only by enforced config
            string strSEvSuffix = string.Empty;

            if (MonoWorkarounds.IsRequired(1378))
            {
                obNoSEv      = true;
                strSEvSuffix = " (" + KPRes.UnsupportedByMono + ")";
            }

            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnWindowMinimize",
                                            lvg, KPRes.LockOnMinimize);
            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnSessionSwitch",
                                            lvg, KPRes.LockOnSessionSwitch + strSEvSuffix, obNoSEv);
            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnSuspend",
                                            lvg, KPRes.LockOnSuspend + strSEvSuffix, obNoSEv);
            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnRemoteControlChange",
                                            lvg, KPRes.LockOnRemoteControlChange + strSEvSuffix, obNoSEv);
            m_cdxSecurityOptions.CreateItem(aceWL, "ExitInsteadOfLockingAfterTime",
                                            lvg, KPRes.ExitInsteadOfLockingAfterTime);
            m_cdxSecurityOptions.CreateItem(aceWL, "AlwaysExitInsteadOfLocking",
                                            lvg, KPRes.ExitInsteadOfLockingAlways);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security, "ClipboardClearOnExit",
                                            lvg, KPRes.ClipboardClearOnExit);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security,
                                            "UseClipboardViewerIgnoreFormat", lvg,
                                            KPRes.ClipboardViewerIgnoreFormat + " " + KPRes.NotRecommended);

            if (NativeLib.IsLibraryInstalled())
            {
                m_cdxSecurityOptions.CreateItem(Program.Config.Native, "NativeKeyTransformations",
                                                lvg, KPRes.NativeLibUse);
            }

            bool?obNoWin = null;              // Allow read-only by enforced config

            if (NativeLib.IsUnix())
            {
                obNoWin = true;
            }

            m_cdxSecurityOptions.CreateItem(Program.Config.Security, "MasterKeyOnSecureDesktop",
                                            lvg, KPRes.MasterKeyOnSecureDesktop, obNoWin);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security, "ClearKeyCommandLineParams",
                                            lvg, KPRes.ClearKeyCmdLineParams);

            m_cdxSecurityOptions.UpdateData(false);
            UIUtil.ResizeColumns(m_lvSecurityOptions, true);
        }
Esempio n. 5
0
        private void LoadGuiOptions()
        {
            m_bInitialTsRenderer = Program.Config.UI.UseCustomToolStripRenderer;

            m_lvGuiOptions.Columns.Add(KPRes.Options, 200);             // Resize below

            ListViewGroup lvg = new ListViewGroup(KPRes.MainWindow);

            m_lvGuiOptions.Groups.Add(lvg);
            Debug.Assert(lvg.ListView == m_lvGuiOptions);

            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "CloseButtonMinimizesWindow",
                                       m_lvGuiOptions, lvg, KPRes.CloseButtonMinimizes);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "MinimizeToTray",
                                       m_lvGuiOptions, lvg, KPRes.MinimizeToTray);
            m_cdxGuiOptions.CreateItem(Program.Config.UI.TrayIcon, "ShowOnlyIfTrayed",
                                       m_lvGuiOptions, lvg, KPRes.ShowTrayOnlyIfTrayed);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "ShowFullPathInTitle",
                                       m_lvGuiOptions, lvg, KPRes.ShowFullPathInTitleBar);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "DropToBackAfterClipboardCopy",
                                       m_lvGuiOptions, lvg, KPRes.DropToBackOnCopy);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "MinimizeAfterClipboardCopy",
                                       m_lvGuiOptions, lvg, KPRes.MinimizeAfterCopy);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "MinimizeAfterLocking",
                                       m_lvGuiOptions, lvg, KPRes.MinimizeAfterLocking);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "MinimizeAfterOpeningDatabase",
                                       m_lvGuiOptions, lvg, KPRes.MinimizeAfterOpeningDatabase);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "QuickFindSearchInPasswords",
                                       m_lvGuiOptions, lvg, KPRes.QuickSearchInPasswords);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "QuickFindExcludeExpired",
                                       m_lvGuiOptions, lvg, KPRes.QuickSearchExcludeExpired);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "FocusResultsAfterQuickFind",
                                       m_lvGuiOptions, lvg, KPRes.FocusResultsAfterQuickFind);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "FocusQuickFindOnUntray",
                                       m_lvGuiOptions, lvg, KPRes.FocusQuickFindOnUntray);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "DisableSaveIfNotModified",
                                       m_lvGuiOptions, lvg, KPRes.DisableSaveIfNotModified);

            lvg = new ListViewGroup(KPRes.EntryList);
            m_lvGuiOptions.Groups.Add(lvg);
            // m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "ShowGridLines",
            //	m_lvGuiOptions, lvg, KPRes.ShowGridLines);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "EntryListAutoResizeColumns",
                                       m_lvGuiOptions, lvg, KPRes.EntryListAutoResizeColumns);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "EntryListAlternatingBgColors",
                                       m_lvGuiOptions, lvg, KPRes.AlternatingBgColors);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow, "CopyUrlsInsteadOfOpening",
                                       m_lvGuiOptions, lvg, KPRes.CopyUrlsInsteadOfOpening);

            lvg = new ListViewGroup(KPRes.EntryView);
            m_lvGuiOptions.Groups.Add(lvg);
            m_cdxGuiOptions.CreateItem(Program.Config.MainWindow.EntryView, "HideProtectedCustomStrings",
                                       m_lvGuiOptions, lvg, KPRes.EntryViewHideProtectedCustomStrings);

            lvg = new ListViewGroup(KPRes.Advanced);
            m_lvGuiOptions.Groups.Add(lvg);
            m_cdxGuiOptions.CreateItem(Program.Config.UI, "UseCustomToolStripRenderer",
                                       m_lvGuiOptions, lvg, KPRes.UseCustomToolStripRenderer);
            m_cdxGuiOptions.CreateItem(Program.Config.UI, "ForceSystemFontUnix",
                                       m_lvGuiOptions, lvg, KPRes.ForceSystemFontUnix);

            m_cdxGuiOptions.UpdateData(false);
            m_lvGuiOptions.Columns[0].Width = m_lvGuiOptions.ClientRectangle.Width -
                                              UIUtil.GetVScrollBarWidth() - 1;

            try { m_numMruCount.Value = Program.Config.Application.MostRecentlyUsed.MaxItemCount; }
            catch (Exception) { Debug.Assert(false); m_numMruCount.Value = AceMru.DefaultMaxItemCount; }
        }
Esempio n. 6
0
        private void LoadSecurityOptions()
        {
            uint uLockTime = Program.Config.Security.WorkspaceLocking.LockAfterTime;
            bool bLockTime = (uLockTime > 0);

            m_numLockAfterTime.Value  = (bLockTime ? uLockTime : 300);
            m_cbLockAfterTime.Checked = bLockTime;

            int nDefaultExpireDays = Program.Config.Defaults.NewEntryExpiresInDays;

            if (nDefaultExpireDays < 0)
            {
                m_cbDefaultExpireDays.Checked = false;
            }
            else
            {
                m_cbDefaultExpireDays.Checked = true;
                try { m_numDefaultExpireDays.Value = nDefaultExpireDays; }
                catch (Exception) { Debug.Assert(false); }
            }

            int nClipClear = Program.Config.Security.ClipboardClearAfterSeconds;

            if (nClipClear >= 0)
            {
                m_cbClipClearTime.Checked = true;
                m_numClipClearTime.Value  = nClipClear;
            }
            else
            {
                m_cbClipClearTime.Checked = false;
            }

            m_lvSecurityOptions.Columns.Add(string.Empty, 200);             // Resize below

            ListViewGroup lvg = new ListViewGroup(KPRes.Options);

            m_lvSecurityOptions.Groups.Add(lvg);
            Debug.Assert(lvg.ListView == m_lvSecurityOptions);

            m_cdxSecurityOptions.CreateItem(Program.Config.Security.WorkspaceLocking,
                                            "LockOnWindowMinimize", m_lvSecurityOptions, lvg, KPRes.LockOnMinimize);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security.WorkspaceLocking,
                                            "LockOnSessionLock", m_lvSecurityOptions, lvg, KPRes.LockOnSessionLock);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security, "ClipboardClearOnExit",
                                            m_lvSecurityOptions, lvg, KPRes.ClipboardClearOnExit);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security.WorkspaceLocking,
                                            "ExitInsteadOfLockingAfterTime", m_lvSecurityOptions, lvg, KPRes.ExitInsteadOfLockingAfterTime);

            if (NativeLib.IsLibraryInstalled())
            {
                m_cdxSecurityOptions.CreateItem(Program.Config.Native, "NativeKeyTransformations",
                                                m_lvSecurityOptions, lvg, KPRes.NativeLibUse);
            }

            m_cdxSecurityOptions.CreateItem(Program.Config.Security,
                                            "UseClipboardViewerIgnoreFormat", m_lvSecurityOptions, lvg,
                                            KPRes.ClipboardViewerIgnoreFormat + " " + KPRes.NotRecommended);

            m_cdxSecurityOptions.UpdateData(false);
            m_lvSecurityOptions.Columns[0].Width = m_lvSecurityOptions.ClientRectangle.Width -
                                                   UIUtil.GetVScrollBarWidth() - 1;
        }
Esempio n. 7
0
        private void SaveOptions()
        {
            if (!m_cbLockAfterTime.Checked)
            {
                Program.Config.Security.WorkspaceLocking.LockAfterTime = 0;
            }
            else
            {
                Program.Config.Security.WorkspaceLocking.LockAfterTime =
                    (uint)m_numLockAfterTime.Value;
            }

            if (!m_cbLockAfterGlobalTime.Checked)
            {
                Program.Config.Security.WorkspaceLocking.LockAfterGlobalTime = 0;
            }
            else
            {
                Program.Config.Security.WorkspaceLocking.LockAfterGlobalTime =
                    (uint)m_numLockAfterGlobalTime.Value;
            }

            if (m_cbDefaultExpireDays.Checked)
            {
                Program.Config.Defaults.NewEntryExpiresInDays =
                    (int)m_numDefaultExpireDays.Value;
            }
            else
            {
                Program.Config.Defaults.NewEntryExpiresInDays = -1;
            }

            if (m_cbClipClearTime.Checked)
            {
                Program.Config.Security.ClipboardClearAfterSeconds =
                    (int)m_numClipClearTime.Value;
            }
            else
            {
                Program.Config.Security.ClipboardClearAfterSeconds = -1;
            }

            m_cdxSecurityOptions.UpdateData(true);

            NativeLib.AllowNative = Program.Config.Native.NativeKeyTransformations;

            m_cdxPolicy.UpdateData(true);
            m_cdxGuiOptions.UpdateData(true);

            string strUuid;

            m_dTsrUuids.TryGetValue(m_cmbMenuStyle.SelectedIndex, out strUuid);
            Program.Config.UI.ToolStripRenderer = (strUuid ?? string.Empty);

            if (m_cmbBannerStyle.SelectedIndex != (int)BannerStyle.Default)
            {
                Program.Config.UI.BannerStyle = (BannerStyle)
                                                m_cmbBannerStyle.SelectedIndex;
            }

            Program.Config.Application.MostRecentlyUsed.MaxItemCount =
                (uint)m_numMruCount.Value;

            Program.Config.MainWindow.EntryListAlternatingBgColor =
                (m_cbCustomAltColor.Checked ? m_argbAltItemBg : 0);

            ChangeHotKey(ref m_kPrevATHKKey, m_hkGlobalAutoType,
                         AppDefs.GlobalHotKeyId.AutoType);
            ChangeHotKey(ref m_kPrevATSHKKey, m_hkSelectedAutoType,
                         AppDefs.GlobalHotKeyId.AutoTypeSelected);
            ChangeHotKey(ref m_kPrevSWHKKey, m_hkShowWindow,
                         AppDefs.GlobalHotKeyId.ShowWindow);

            // Program.Config.UI.TrayIcon.SingleClickDefault = m_cbSingleClickTrayAction.Checked;

            Program.Config.Integration.UrlSchemeOverrides = m_aceUrlSchemeOverrides;
            Program.Config.Integration.UrlOverride        = m_strUrlOverrideAll;

            m_cdxAdvanced.UpdateData(true);

            Program.Config.Apply(AceApplyFlags.All);
        }
Esempio n. 8
0
        private void SaveOptions()
        {
            if (!m_cbLockAfterTime.Checked)
            {
                Program.Config.Security.WorkspaceLocking.LockAfterTime = 0;
            }
            else
            {
                Program.Config.Security.WorkspaceLocking.LockAfterTime =
                    (uint)m_numLockAfterTime.Value;
            }

            if (!m_cbLockAfterGlobalTime.Checked)
            {
                Program.Config.Security.WorkspaceLocking.LockAfterGlobalTime = 0;
            }
            else
            {
                Program.Config.Security.WorkspaceLocking.LockAfterGlobalTime =
                    (uint)m_numLockAfterGlobalTime.Value;
            }

            if (m_cbDefaultExpireDays.Checked)
            {
                Program.Config.Defaults.NewEntryExpiresInDays =
                    (int)m_numDefaultExpireDays.Value;
            }
            else
            {
                Program.Config.Defaults.NewEntryExpiresInDays = -1;
            }

            if (m_cbClipClearTime.Checked)
            {
                Program.Config.Security.ClipboardClearAfterSeconds =
                    (int)m_numClipClearTime.Value;
            }
            else
            {
                Program.Config.Security.ClipboardClearAfterSeconds = -1;
            }

            m_cdxSecurityOptions.UpdateData(true);

            NativeLib.AllowNative = Program.Config.Native.NativeKeyTransformations;

            m_cdxPolicy.UpdateData(true);
            m_cdxGuiOptions.UpdateData(true);

            if (m_cmbBannerStyle.SelectedIndex != (int)BannerStyle.Default)
            {
                Program.Config.UI.BannerStyle = (BannerStyle)
                                                m_cmbBannerStyle.SelectedIndex;
            }

            Program.Config.Application.MostRecentlyUsed.MaxItemCount =
                (uint)m_numMruCount.Value;

            ChangeHotKey(ref m_kPrevATHKKey, m_hkGlobalAutoType,
                         AppDefs.GlobalHotKeyId.AutoType);
            ChangeHotKey(ref m_kPrevATSHKKey, m_hkSelectedAutoType,
                         AppDefs.GlobalHotKeyId.AutoTypeSelected);
            ChangeHotKey(ref m_kPrevSWHKKey, m_hkShowWindow,
                         AppDefs.GlobalHotKeyId.ShowWindow);

            Program.Config.UI.TrayIcon.SingleClickDefault = m_cbSingleClickTrayAction.Checked;

            if (m_cbUrlOverride.Checked)
            {
                Program.Config.Integration.UrlOverride = m_tbUrlOverride.Text;
            }
            else
            {
                Program.Config.Integration.UrlOverride = string.Empty;
            }

            m_cdxAdvanced.UpdateData(true);

            Program.Config.Integration.UrlSchemeOverrides = m_aceUrlSchemeOverrides;

            Program.Config.Apply(AceApplyFlags.All);
        }
Esempio n. 9
0
        private void LoadSecurityOptions()
        {
            AceWorkspaceLocking aceWL = Program.Config.Security.WorkspaceLocking;

            uint uLockTime = aceWL.LockAfterTime;
            bool bLockTime = (uLockTime > 0);

            m_numLockAfterTime.Value  = (bLockTime ? uLockTime : 300);
            m_cbLockAfterTime.Checked = bLockTime;
            if (AppConfigEx.IsOptionEnforced(aceWL, "LockAfterTime"))
            {
                m_cbLockAfterTime.Enabled = false;
            }

            uLockTime = aceWL.LockAfterGlobalTime;
            bLockTime = (uLockTime > 0);
            m_numLockAfterGlobalTime.Value  = (bLockTime ? uLockTime : 240);
            m_cbLockAfterGlobalTime.Checked = bLockTime;
            if (AppConfigEx.IsOptionEnforced(aceWL, "LockAfterGlobalTime"))
            {
                m_cbLockAfterGlobalTime.Enabled = false;
            }

            int nDefaultExpireDays = Program.Config.Defaults.NewEntryExpiresInDays;

            if (nDefaultExpireDays < 0)
            {
                m_cbDefaultExpireDays.Checked = false;
            }
            else
            {
                m_cbDefaultExpireDays.Checked = true;
                try { m_numDefaultExpireDays.Value = nDefaultExpireDays; }
                catch (Exception) { Debug.Assert(false); }
            }
            if (AppConfigEx.IsOptionEnforced(Program.Config.Defaults, "NewEntryExpiresInDays"))
            {
                m_cbDefaultExpireDays.Enabled = false;
            }

            int nClipClear = Program.Config.Security.ClipboardClearAfterSeconds;

            if (nClipClear >= 0)
            {
                m_cbClipClearTime.Checked = true;
                m_numClipClearTime.Value  = nClipClear;
            }
            else
            {
                m_cbClipClearTime.Checked = false;
            }
            if (AppConfigEx.IsOptionEnforced(Program.Config.Security, "ClipboardClearAfterSeconds"))
            {
                m_cbClipClearTime.Enabled = false;
            }

            m_lvSecurityOptions.Columns.Add(string.Empty, 200);             // Resize below

            ListViewGroup lvg = new ListViewGroup(KPRes.Options);

            m_lvSecurityOptions.Groups.Add(lvg);
            Debug.Assert(lvg.ListView == m_lvSecurityOptions);

            m_cdxSecurityOptions = new CheckedLVItemDXList(m_lvSecurityOptions, true);

            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnWindowMinimize",
                                            lvg, KPRes.LockOnMinimize);
            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnSessionSwitch",
                                            lvg, KPRes.LockOnSessionSwitch);
            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnSuspend",
                                            lvg, KPRes.LockOnSuspend);
            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnRemoteControlChange",
                                            lvg, KPRes.LockOnRemoteControlChange);
            m_cdxSecurityOptions.CreateItem(aceWL, "ExitInsteadOfLockingAfterTime",
                                            lvg, KPRes.ExitInsteadOfLockingAfterTime);
            m_cdxSecurityOptions.CreateItem(aceWL, "AlwaysExitInsteadOfLocking",
                                            lvg, KPRes.ExitInsteadOfLockingAlways);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security, "ClipboardClearOnExit",
                                            lvg, KPRes.ClipboardClearOnExit);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security,
                                            "UseClipboardViewerIgnoreFormat", lvg,
                                            KPRes.ClipboardViewerIgnoreFormat + " " + KPRes.NotRecommended);

            if (NativeLib.IsLibraryInstalled())
            {
                m_cdxSecurityOptions.CreateItem(Program.Config.Native, "NativeKeyTransformations",
                                                lvg, KPRes.NativeLibUse);
            }

            m_cdxSecurityOptions.CreateItem(Program.Config.Security, "MasterKeyOnSecureDesktop",
                                            lvg, KPRes.MasterKeyOnSecureDesktop);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security, "ClearKeyCommandLineParams",
                                            lvg, KPRes.ClearKeyCmdLineParams);

            m_cdxSecurityOptions.UpdateData(false);
            m_lvSecurityOptions.Columns[0].Width = m_lvSecurityOptions.ClientRectangle.Width -
                                                   UIUtil.GetVScrollBarWidth() - 1;
        }