コード例 #1
0
ファイル: TanWizardForm.cs プロジェクト: knut0815/KeePass2
        private void OnFormLoad(object sender, EventArgs e)
        {
            Debug.Assert(m_pwDatabase != null); if (m_pwDatabase == null)
            {
                throw new InvalidOperationException();
            }
            Debug.Assert(m_pgStorage != null); if (m_pgStorage == null)
            {
                throw new InvalidOperationException();
            }

            GlobalWindowManager.AddWindow(this);

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         KeePass.Properties.Resources.B48x48_Wizard, KPRes.TanWizard,
                                         KPRes.TanWizardDesc);

            this.Icon = AppIcons.Default;
            this.Text = KPRes.TanWizard;

            Debug.Assert(!m_lblToGroup.AutoSize);             // For RTL support
            if (!string.IsNullOrEmpty(m_pgStorage.Name))
            {
                m_lblToGroup.Text += ": " + m_pgStorage.Name + ".";
            }
            else
            {
                m_lblToGroup.Text += ".";
            }

            m_tbTanChars.Text = Program.Config.Defaults.TanCharacters;

            EnableControlsEx();
            UIUtil.SetFocus(m_tbTANs, this);
        }
コード例 #2
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            if (m_strTitle == null)
            {
                throw new InvalidOperationException();
            }
            if (m_strDesc == null)
            {
                throw new InvalidOperationException();
            }
            if (m_strLongDesc == null)
            {
                throw new InvalidOperationException();
            }
            if (m_imgIcon == null)
            {
                throw new InvalidOperationException();
            }
            if (m_strDefaultText == null)
            {
                throw new InvalidOperationException();
            }

            GlobalWindowManager.AddWindow(this);

            BannerFactory.CreateBannerEx(this, m_bannerImage, m_imgIcon,
                                         m_strTitle, m_strDesc);
            this.Icon = AppIcons.Default;

            this.Text = m_strTitle;

            Debug.Assert(!m_lblLongDesc.AutoSize);             // For RTL support
            m_lblLongDesc.Text = m_strLongDesc;

            if ((m_vSelectable == null) || (m_vSelectable.Length == 0))
            {
                m_cmbEdit.Enabled = false;
                m_cmbEdit.Visible = false;

                m_cEdit = m_tbEdit;
            }
            else             // With selectable values
            {
                m_tbEdit.Enabled = false;
                m_tbEdit.Visible = false;

                m_cEdit = m_cmbEdit;

                m_cmbEdit.BeginUpdate();
                foreach (string strItem in m_vSelectable)
                {
                    m_cmbEdit.Items.Add(strItem);
                }
                m_cmbEdit.EndUpdate();

                UIUtil.EnableAutoCompletion(m_cmbEdit, false);
            }

            m_cEdit.Text = m_strDefaultText;
        }
コード例 #3
0
ファイル: HelpSourceForm.cs プロジェクト: matt2005/keepass2
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this, this);

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         Properties.Resources.B48x48_Folder_Download, KPRes.HelpSourceSelection,
                                         KPRes.HelpSourceSelectionDesc);
            this.Icon = Properties.Resources.KeePass;
            this.Text = KPRes.HelpSourceSelection;

            FontUtil.AssignDefaultBold(m_radioLocal);
            FontUtil.AssignDefaultBold(m_radioOnline);

            if (AppHelp.LocalHelpAvailable == false)
            {
                m_radioLocal.Enabled = false;
                m_lblLocal.Text      = KPRes.HelpSourceNoLocalOption;

                AppHelp.PreferredHelpSource = AppHelpSource.Online;
            }

            if (AppHelp.PreferredHelpSource == AppHelpSource.Local)
            {
                m_radioLocal.Checked = true;
            }
            else
            {
                m_radioOnline.Checked = true;
            }
        }
コード例 #4
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this, this);

            string strVersion = GetMainVersion();

            string strTitle = PwDefs.ProductName;
            string strDesc  = KPRes.Version + " " + strVersion;

            Icon icoSc = AppIcons.Get(AppIconType.Main, new Size(
                                          DpiUtil.ScaleIntX(48), DpiUtil.ScaleIntY(48)), Color.Empty);

            BannerFactory.CreateBannerEx(this, m_bannerImage, icoSc.ToBitmap(),
                                         strTitle, strDesc);
            this.Icon = AppIcons.Default;

            Debug.Assert(!m_lblCopyright.AutoSize);             // For RTL support
            m_lblCopyright.Text = PwDefs.Copyright + ".";

            try { BuildComponentsList(strVersion); }
            catch (Exception) { Debug.Assert(false); }

            UIUtil.SetExplorerTheme(m_lvComponents, false);
            UIUtil.ResizeColumns(m_lvComponents, true);
            BuildComponentsContextMenu();

            UIUtil.SetFocus(m_btnOK, this);
        }
コード例 #5
0
ファイル: AboutForm.cs プロジェクト: zforks/KeeThief
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this, this);

            m_lblCopyright.Text = PwDefs.Copyright + ".";

            string strTitle = PwDefs.ProductName;
            string strDesc  = KPRes.Version + " " + PwDefs.VersionString;

            if (Program.IsDevelopmentSnapshot())
            {
                strDesc += " (Dev)";
            }

            Icon icoNew = new Icon(Properties.Resources.KeePass, 48, 48);

            BannerFactory.CreateBannerEx(this, m_bannerImage, icoNew.ToBitmap(),
                                         strTitle, strDesc);
            this.Icon = Properties.Resources.KeePass;

            m_lvComponents.Columns.Add(KPRes.Component, 100, HorizontalAlignment.Left);
            m_lvComponents.Columns.Add(KPRes.Status + " / " + KPRes.Version, 100,
                                       HorizontalAlignment.Left);

            try { GetAppComponents(); }
            catch (Exception) { Debug.Assert(false); }

            UIUtil.SetExplorerTheme(m_lvComponents, false);
            UIUtil.ResizeColumns(m_lvComponents, true);
        }
コード例 #6
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this);

            string strTitle = "Configure PKCS#11";
            string strDesc  = "Protect the database using a smartcard or token.";

            this.Text = strTitle;
            BannerFactory.CreateBannerEx(this, banner,
                                         Resource.chip, strTitle, strDesc);

            if (CryptokiKeyProvider.pkcs11_conf_lib != null)
            {
                textBox1.Text = CryptokiKeyProvider.pkcs11_conf_lib;
                try
                {
                    keyfiles = Pkcs11.read_allkeyfiles(CryptokiKeyProvider.pkcs11_conf_lib);
                    addKeyfiles2listview();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
コード例 #7
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            if (m_pd == null)
            {
                Debug.Assert(false); throw new InvalidOperationException();
            }

            GlobalWindowManager.AddWindow(this);

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         KeePass.Properties.Resources.B48x48_Binary, KPRes.XmlReplace,
                                         KPRes.XmlReplaceDesc);

            this.Icon = AppIcons.Default;
            this.Text = KPRes.XmlReplace;

            Bitmap bmpBig = SystemIcons.Warning.ToBitmap();

            m_imgWarning = GfxUtil.ScaleImage(bmpBig, DpiUtil.ScaleIntX(16),
                                              DpiUtil.ScaleIntY(16), ScaleTransformFlags.UIIcon);
            bmpBig.Dispose();
            m_picWarning.Image = m_imgWarning;

            FontUtil.AssignDefaultBold(m_rbRemove);
            FontUtil.AssignDefaultBold(m_rbReplace);

            m_rbReplace.Checked   = true;
            m_rbInnerText.Checked = true;

            EnableControlsEx();
        }
コード例 #8
0
ファイル: AboutForm.cs プロジェクト: t00/KeePassCore
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this, this);

            string strVersion = PwDefs.VersionString;

            if (Program.IsDevelopmentSnapshot())
            {
                strVersion += " - Dev.";
                try
                {
                    string   strExe = WinUtil.GetExecutable();
                    FileInfo fi     = new FileInfo(strExe);
                    strVersion += " " + fi.LastWriteTimeUtc.ToString("yyMMdd");
                }
                catch (Exception) { Debug.Assert(false); }
            }

            const string strParamPlh = @"{PARAM}";
            string       strBits     = KPRes.BitsA;

            if (strBits.IndexOf(strParamPlh) >= 0)
            {
                strVersion += (" (" + strBits.Replace(strParamPlh,
                                                      (IntPtr.Size * 8).ToString()) + ")");
            }
            else
            {
                Debug.Assert(false);
            }

            string strTitle = PwDefs.ProductName;
            string strDesc  = KPRes.Version + " " + strVersion;

            Icon icoSc = AppIcons.Get(AppIconType.Main, new Size(
                                          DpiUtil.ScaleIntX(48), DpiUtil.ScaleIntY(48)), Color.Empty);

            BannerFactory.CreateBannerEx(this, m_bannerImage, icoSc.ToBitmap(),
                                         strTitle, strDesc);
            this.Icon = AppIcons.Default;

            Debug.Assert(!m_lblCopyright.AutoSize);             // For RTL support
            m_lblCopyright.Text = PwDefs.Copyright + ".";

            string strCompValueHdr = KPRes.Version + "/" + KPRes.Status;

            if (Regex.IsMatch(strCompValueHdr, "\\s"))
            {
                strCompValueHdr = KPRes.Version + " / " + KPRes.Status;
            }

            m_lvComponents.Columns.Add(KPRes.Component, 100);
            m_lvComponents.Columns.Add(strCompValueHdr, 100);

            try { GetAppComponents(strVersion); }
            catch (Exception) { Debug.Assert(false); }

            UIUtil.SetExplorerTheme(m_lvComponents, false);
            UIUtil.ResizeColumns(m_lvComponents, true);
        }
コード例 #9
0
ファイル: EcasTriggersForm.cs プロジェクト: knut0815/KeePass2
        private void OnFormLoad(object sender, EventArgs e)
        {
            if (m_triggers == null)
            {
                Debug.Assert(false); return;
            }

            GlobalWindowManager.AddWindow(this);
            GlobalWindowManager.CustomizeControl(m_ctxTools);

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         Properties.Resources.B48x48_Make_KDevelop, KPRes.Triggers,
                                         KPRes.TriggersDesc);
            this.Text = KPRes.Triggers;
            this.Icon = AppIcons.Default;

            int nWidth = (m_lvTriggers.ClientSize.Width - UIUtil.GetVScrollBarWidth() - 1);

            m_lvTriggers.Columns.Add(KPRes.Triggers, nWidth);

            m_lvTriggers.SmallImageList = m_ilIcons;

            m_cbEnableTriggers.Checked = m_triggers.Enabled;
            UpdateTriggerListEx(false);

            EcasTriggerSystem ts    = Program.TriggerSystem;
            EcasTriggerSystem tsCfg = Program.Config.Application.TriggerSystem;

            if (object.ReferenceEquals(m_triggersInOut, ts) &&
                AppConfigEx.IsOptionEnforced(tsCfg, "Enabled"))
            {
                m_cbEnableTriggers.Enabled = false;
            }
        }
コード例 #10
0
ファイル: IOConnectionForm.cs プロジェクト: knut0815/KeePass2
        private void OnFormLoad(object sender, EventArgs e)
        {
            // Must work without a parent window
            Debug.Assert(this.StartPosition == FormStartPosition.CenterScreen);

            // The password text box should not be focused by default
            // in order to avoid a Caps Lock warning tooltip bug;
            // https://sourceforge.net/p/keepass/bugs/1807/
            Debug.Assert((m_tbPassword.TabIndex >= 2) && !m_tbPassword.Focused);

            InitAdvancedTab();             // After translation, before resize

            GlobalWindowManager.AddWindow(this);

            string strTitle = (m_bSave ? KPRes.UrlSaveTitle : KPRes.UrlOpenTitle);
            string strDesc  = (m_bSave ? KPRes.UrlSaveDesc : KPRes.UrlOpenDesc);

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         KeePass.Properties.Resources.B48x48_WWW, strTitle, strDesc);
            this.Icon = AppIcons.Default;
            this.Text = strTitle;

            FontUtil.AssignDefaultBold(m_lblUrl);
            FontUtil.AssignDefaultBold(m_lblUserName);
            FontUtil.AssignDefaultBold(m_lblPassword);
            FontUtil.AssignDefaultBold(m_lblRemember);

            m_tbUrl.Text      = (m_ioc.IsLocalFile() ? string.Empty : m_ioc.Path);
            m_tbUserName.Text = m_ioc.UserName;
            m_tbPassword.Text = m_ioc.Password;

            m_cmbCredSaveMode.Items.Add(KPRes.CredSaveNone);
            m_cmbCredSaveMode.Items.Add(KPRes.CredSaveUserOnly);
            m_cmbCredSaveMode.Items.Add(KPRes.CredSaveAll);

            if (m_ioc.CredSaveMode == IOCredSaveMode.UserNameOnly)
            {
                m_cmbCredSaveMode.SelectedIndex = 1;
            }
            else if (m_ioc.CredSaveMode == IOCredSaveMode.SaveCred)
            {
                m_cmbCredSaveMode.SelectedIndex = 2;
            }
            else
            {
                m_cmbCredSaveMode.SelectedIndex = 0;
            }

            if (!m_bCanRememberCred)
            {
                m_cmbCredSaveMode.SelectedIndex = 0;
                m_cmbCredSaveMode.Enabled       = false;
            }

            ThreadPool.QueueUserWorkItem(delegate(object state)
            {
                try { InitAutoCompletions(); }
                catch (Exception) { Debug.Assert(false); }
            });
        }
コード例 #11
0
        public AuthWaitOrCancel(IPluginHost host, EntryConfiguration entry)
        {
            m_entryConfig = entry;
            m_host        = host;

            InitializeComponent();

            lblMessage.Text      = Resources.GetString(lblMessage.Text);
            lnkHelp.Text         = Resources.GetString(lnkHelp.Text);
            btnCancel.Text       = Resources.GetString(btnCancel.Text);
            lblSubTitle.Text     = Resources.GetString(lblSubTitle.Text);
            btnCopyUser.Text     = Resources.GetString(btnCopyUser.Text);
            btnCopyPassword.Text = Resources.GetString(btnCopyPassword.Text);
            Text = GdsDefs.ProductName;

            btnCopyUser.Enabled     = false;
            btnCopyPassword.Enabled = false;
            if (m_entryConfig != null)
            {
                btnCopyUser.Enabled     = !string.IsNullOrEmpty(m_entryConfig.User);
                btnCopyPassword.Enabled = m_entryConfig.Password != null &&
                                          !m_entryConfig.Password.IsEmpty;
            }

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         Resources.GetBitmap("btn_google_signin_dark_pressed_web"),
                                         Resources.GetFormat("Title_AuthDialogMain",
                                                             GdsDefs.ProductName),
                                         string.Format("{0} {1}", GdsDefs.ProductName, GdsDefs.Version));
        }
コード例 #12
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this, this);

            m_lblCopyright.Text = PwDefs.Copyright + ".";

            string strTitle = PwDefs.ProductName;
            string strDesc  = KPRes.Version + " " + PwDefs.VersionString;

            Icon icoNew = new Icon(Properties.Resources.KeePass, 48, 48);

            BannerFactory.CreateBannerEx(this, m_bannerImage, icoNew.ToBitmap(),
                                         strTitle, strDesc);
            this.Icon = Properties.Resources.KeePass;

            m_lvComponents.Columns.Add(KPRes.Component, 100, HorizontalAlignment.Left);
            m_lvComponents.Columns.Add(KPRes.Status + " / " + KPRes.Version, 100,
                                       HorizontalAlignment.Left);

            try { GetAppComponents(); }
            catch (Exception) { Debug.Assert(false); }

            int nWidth = m_lvComponents.ClientRectangle.Width / 2;
            int nMod   = m_lvComponents.ClientRectangle.Width % 2;

            m_lvComponents.Columns[0].Width = nWidth;
            m_lvComponents.Columns[1].Width = nWidth + nMod;

            UIUtil.SetExplorerTheme(m_lvComponents, false);
        }
コード例 #13
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            Debug.Assert(m_pwDatabase != null); if (m_pwDatabase == null)
            {
                throw new InvalidOperationException();
            }
            Debug.Assert(m_pgStorage != null); if (m_pgStorage == null)
            {
                throw new InvalidOperationException();
            }

            GlobalWindowManager.AddWindow(this);

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         KeePass.Properties.Resources.B48x48_Wizard, KPRes.TanWizard,
                                         KPRes.TanWizardDesc);

            this.Icon = Properties.Resources.KeePass;
            this.Text = KPRes.TanWizard;

            if ((m_pgStorage.Name != null) && (m_pgStorage.Name.Length > 0))
            {
                m_lblToGroup.Text += ": " + m_pgStorage.Name + ".";
            }
            else
            {
                m_lblToGroup.Text += ".";
            }

            m_tbTanChars.Text = Program.Config.Defaults.TanCharacters;

            EnableControlsEx();
        }
コード例 #14
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this);

            string strTitle = (m_bEditing ? KPRes.TriggerEdit : KPRes.TriggerAdd);
            string strDesc  = (m_bEditing ? KPRes.TriggerEditDesc : KPRes.TriggerAddDesc);

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         Properties.Resources.B48x48_Run, strTitle, strDesc);
            this.Text = strTitle;
            this.Icon = Properties.Resources.KeePass;

            m_lvEvents.SmallImageList     = m_ilIcons;
            m_lvConditions.SmallImageList = m_ilIcons;
            m_lvActions.SmallImageList    = m_ilIcons;

            int nColWidth = ((m_lvEvents.ClientSize.Width - UIUtil.GetVScrollBarWidth()) / 2);

            m_lvEvents.Columns.Add(KPRes.Event, nColWidth);
            m_lvEvents.Columns.Add(string.Empty, nColWidth);
            m_lvConditions.Columns.Add(KPRes.Condition, nColWidth);
            m_lvConditions.Columns.Add(string.Empty, nColWidth);
            m_lvActions.Columns.Add(KPRes.Action, nColWidth);
            m_lvActions.Columns.Add(string.Empty, nColWidth);

            m_tbName.Text = m_trigger.Name;
            UIUtil.SetMultilineText(m_tbComments, m_trigger.Comments);
            m_cbEnabled.Checked            = m_trigger.Enabled;
            m_cbInitiallyOn.Checked        = m_trigger.InitiallyOn;
            m_cbTurnOffAfterAction.Checked = m_trigger.TurnOffAfterAction;

            UpdateListsEx(false);
            EnableControlsEx();
            UIUtil.SetFocus(m_tbName, this);
        }
コード例 #15
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this);
            try { if (this.Owner == null)
                  {
                      this.Owner = Program.MainForm;
                  }
            }
            catch (Exception) { Debug.Assert(false); }

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         Properties.Resources.B48x48_Folder_Download, KPRes.ImportBehavior,
                                         KPRes.ImportBehaviorDesc);
            this.Icon = AppIcons.Default;

            this.Text = KPRes.ImportBehavior;

            m_radioCreateNew.Text        = KPRes.CreateNewIDs;
            m_radioKeepExisting.Text     = KPRes.KeepExisting;
            m_radioOverwrite.Text        = KPRes.OverwriteExisting;
            m_radioOverwriteIfNewer.Text = KPRes.OverwriteIfNewer;
            m_radioSynchronize.Text      = KPRes.OverwriteIfNewerAndApplyDel;

            FontUtil.AssignDefaultBold(m_radioCreateNew);
            FontUtil.AssignDefaultBold(m_radioKeepExisting);
            FontUtil.AssignDefaultBold(m_radioOverwrite);
            FontUtil.AssignDefaultBold(m_radioOverwriteIfNewer);
            FontUtil.AssignDefaultBold(m_radioSynchronize);

            m_radioCreateNew.Checked = true;
        }
コード例 #16
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this);

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         Properties.Resources.B48x48_KGPG_Sign, KPRes.CreateMasterKey,
                                         m_ioInfo.GetDisplayName());
            this.Icon = Properties.Resources.KeePass;
            this.Text = KPRes.CreateMasterKey;

            FontUtil.SetDefaultFont(m_cbPassword);
            FontUtil.AssignDefaultBold(m_cbPassword);
            FontUtil.AssignDefaultBold(m_cbKeyFile);
            FontUtil.AssignDefaultBold(m_cbUserAccount);

            Bitmap bmpBig = SystemIcons.Warning.ToBitmap();

            m_imgAccWarning = GfxUtil.ScaleImage(bmpBig, DpiUtil.ScaleIntX(16),
                                                 DpiUtil.ScaleIntY(16), ScaleTransformFlags.UIIcon);
            bmpBig.Dispose();
            m_picAccWarning.Image = m_imgAccWarning;

            // m_ttRect.SetToolTip(m_cbHidePassword, KPRes.TogglePasswordAsterisks);
            m_ttRect.SetToolTip(m_btnSaveKeyFile, KPRes.KeyFileCreate);
            m_ttRect.SetToolTip(m_btnOpenKeyFile, KPRes.KeyFileUseExisting);
            m_ttRect.SetToolTip(m_tbRepeatPassword, KPRes.PasswordRepeatHint);

            if (!m_bCreatingNew)
            {
                m_lblIntro.Text = KPRes.ChangeMasterKeyIntroShort;
            }

            m_icgPassword.Attach(m_tbPassword, m_cbHidePassword, m_lblRepeatPassword,
                                 m_tbRepeatPassword, m_lblEstimatedQuality, m_pbPasswordQuality,
                                 m_lblQualityInfo, m_ttRect, this, true, false);

            m_cmbKeyFile.Items.Add(KPRes.NoKeyFileSpecifiedMeta);
            foreach (KeyProvider prov in Program.KeyProviderPool)
            {
                m_cmbKeyFile.Items.Add(prov.Name);
            }

            m_cmbKeyFile.SelectedIndex = 0;

            m_cbPassword.Checked = true;
            UIUtil.ApplyKeyUIFlags(Program.Config.UI.KeyCreationFlags,
                                   m_cbPassword, m_cbKeyFile, m_cbUserAccount, m_cbHidePassword);

            if (WinUtil.IsWindows9x || NativeLib.IsUnix())
            {
                UIUtil.SetChecked(m_cbUserAccount, false);
                UIUtil.SetEnabled(m_cbUserAccount, false);
                UIUtil.SetEnabled(m_lblWindowsAccDesc, false);
                UIUtil.SetEnabled(m_lblWindowsAccDesc2, false);
            }

            CustomizeForScreenReader();
            EnableUserControls();
            // UIUtil.SetFocus(m_tbPassword, this); // See OnFormShown
        }
コード例 #17
0
ファイル: LanguageForm.cs プロジェクト: sinelaw/keepass
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this, this);

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         Properties.Resources.B48x48_Keyboard_Layout,
                                         KPRes.SelectLanguage, KPRes.SelectLanguageDesc);
            this.Icon = Properties.Resources.KeePass;
            this.Text = KPRes.SelectLanguage;

            int nWidth = m_lvLanguages.ClientRectangle.Width / 4;

            m_lvLanguages.Columns.Add(KPRes.AvailableLanguages, nWidth);
            m_lvLanguages.Columns.Add(KPRes.Version, nWidth);
            m_lvLanguages.Columns.Add(KPRes.Author, nWidth);
            m_lvLanguages.Columns.Add(KPRes.Contact, nWidth);

            ListViewItem lvi = m_lvLanguages.Items.Add("English", 0);

            lvi.SubItems.Add(PwDefs.VersionString);
            lvi.SubItems.Add(AppDefs.DefaultTrlAuthor);
            lvi.SubItems.Add(AppDefs.DefaultTrlContact);

            List <string> vList = new List <string>();

            GetAvailableTranslations(AppConfigSerializer.AppDataDirectory, vList);
            GetAvailableTranslations(AppConfigSerializer.LocalAppDataDirectory, vList);

            string strExe  = WinUtil.GetExecutable();
            string strPath = UrlUtil.GetFileDirectory(strExe, false, true);

            GetAvailableTranslations(strPath, vList);
        }
コード例 #18
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            Debug.Assert(m_triggers != null); if (m_triggers == null)
            {
                return;
            }

            GlobalWindowManager.AddWindow(this);
            GlobalWindowManager.CustomizeControl(m_ctxTools);

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         Properties.Resources.B48x48_Make_KDevelop, KPRes.Triggers,
                                         KPRes.TriggersDesc);
            this.Text = KPRes.Triggers;
            this.Icon = AppIcons.Default;

            int nWidth = (m_lvTriggers.ClientSize.Width - UIUtil.GetVScrollBarWidth() - 1);

            m_lvTriggers.Columns.Add(KPRes.Triggers, nWidth);

            m_lvTriggers.SmallImageList = m_ilIcons;

            m_cbEnableTriggers.Checked = m_triggers.Enabled;
            UpdateTriggerListEx(false);
        }
コード例 #19
0
ファイル: IOConnectionForm.cs プロジェクト: sinelaw/keepass
        private void OnFormLoad(object sender, EventArgs e)
        {
            // Must work without a parent window
            Debug.Assert(this.StartPosition == FormStartPosition.CenterScreen);

            GlobalWindowManager.AddWindow(this);

            string strTitle = (m_bSave ? KPRes.UrlSaveTitle : KPRes.UrlOpenTitle);
            string strDesc  = (m_bSave ? KPRes.UrlSaveDesc : KPRes.UrlOpenDesc);

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         KeePass.Properties.Resources.B48x48_WWW, strTitle, strDesc);
            this.Icon = Properties.Resources.KeePass;
            this.Text = strTitle;

            FontUtil.AssignDefaultBold(m_lblUrl);
            FontUtil.AssignDefaultBold(m_lblUserName);
            FontUtil.AssignDefaultBold(m_lblPassword);
            FontUtil.AssignDefaultBold(m_lblRemember);

            m_tbUrl.Text      = (m_ioc.IsLocalFile() ? string.Empty : m_ioc.Path);
            m_tbUserName.Text = m_ioc.UserName;
            m_tbPassword.Text = m_ioc.Password;

            m_cmbCredSaveMode.Items.Add(KPRes.CredSaveNone);
            m_cmbCredSaveMode.Items.Add(KPRes.CredSaveUserOnly);
            m_cmbCredSaveMode.Items.Add(KPRes.CredSaveAll);

            if (m_ioc.CredSaveMode == IOCredSaveMode.UserNameOnly)
            {
                m_cmbCredSaveMode.SelectedIndex = 1;
            }
            else if (m_ioc.CredSaveMode == IOCredSaveMode.SaveCred)
            {
                m_cmbCredSaveMode.SelectedIndex = 2;
            }
            else
            {
                m_cmbCredSaveMode.SelectedIndex = 0;
            }

            if (m_bCanRememberCred == false)
            {
                m_cmbCredSaveMode.SelectedIndex = 0;
                m_cmbCredSaveMode.Enabled       = false;
            }

            UIUtil.SetFocus(m_tbUrl, this);

            if ((m_tbUrl.TextLength > 0) && (m_tbUserName.TextLength > 0))
            {
                UIUtil.SetFocus(m_tbPassword, this);
            }
            else if (m_tbUrl.TextLength > 0)
            {
                UIUtil.SetFocus(m_tbUserName, this);
            }
        }
コード例 #20
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this);

            lb_Label2.Text = "";
            this.Text      = _desc;
            BannerFactory.CreateBannerEx(this, pb_Image1, Resources.SafeVault.B48x48_SafeVault, _desc, _title);
            this.ActiveControl = tb_oneTimePassword;
        }
コード例 #21
0
ファイル: SearchForm.cs プロジェクト: knut0815/KeePass2
        private void OnFormLoad(object sender, EventArgs e)
        {
            Debug.Assert(m_pgRoot != null); if (m_pgRoot == null)
            {
                throw new InvalidOperationException();
            }

            GlobalWindowManager.AddWindow(this, this);

            string strTitle = KPRes.SearchTitle;

            if ((m_pgRoot != null) && (m_pgRoot.ParentGroup != null))
            {
                strTitle += " - " + m_pgRoot.Name;
            }

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         Properties.Resources.B48x48_XMag, strTitle, KPRes.SearchDesc2);
            this.Icon = AppIcons.Default;

            m_bUpdating = true;

            UIUtil.SetText(m_cbDerefData, m_cbDerefData.Text + " (" + KPRes.Slow + ")");

            SearchParameters sp = Program.Config.Defaults.SearchParameters;

            m_cbTitle.Checked       = sp.SearchInTitles;
            m_cbUserName.Checked    = sp.SearchInUserNames;
            m_cbURL.Checked         = sp.SearchInUrls;
            m_cbPassword.Checked    = sp.SearchInPasswords;
            m_cbNotes.Checked       = sp.SearchInNotes;
            m_cbOtherFields.Checked = sp.SearchInOther;
            m_cbStringName.Checked  = sp.SearchInStringNames;
            m_cbTags.Checked        = sp.SearchInTags;
            m_cbUuid.Checked        = sp.SearchInUuids;
            m_cbGroupPath.Checked   = sp.SearchInGroupPaths;
            m_cbGroupName.Checked   = sp.SearchInGroupNames;

            StringComparison sc = sp.ComparisonMode;

            m_cbCaseSensitive.Checked = ((sc != StringComparison.CurrentCultureIgnoreCase) &&
                                         (sc != StringComparison.InvariantCultureIgnoreCase) &&
                                         (sc != StringComparison.OrdinalIgnoreCase));

            m_cbRegEx.Checked               = sp.RegularExpression;
            m_cbExcludeExpired.Checked      = sp.ExcludeExpired;
            m_cbIgnoreGroupSettings.Checked = !sp.RespectEntrySearchingDisabled;

            string strTrf = SearchUtil.GetTransformation(sp);

            m_cbDerefData.Checked = (strTrf == SearchUtil.StrTrfDeref);

            m_bUpdating = false;

            EnableControlsEx();
            UIUtil.SetFocus(m_tbSearch, this);
        }
コード例 #22
0
ファイル: AzureAccountForm.cs プロジェクト: ydov/KeeAnywhere
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this);

            this.Icon = PluginResources.Icon_OneDrive_16x16;

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         PluginResources.KeeAnywhere_48x48, AzureResources.Keepass_Banner_Title,
                                         AzureResources.Keepass_Banner_Line);
        }
コード例 #23
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this);

            this.Icon = PluginResources.Icon_OneDrive_16x16;

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         PluginResources.KeeAnywhere_48x48, "Donate for KeeAnywhere",
                                         "Your contribution to support KeeAnywhere.");
        }
コード例 #24
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this);

            this.Icon = PluginResources.Icon_OneDrive_16x16;

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         PluginResources.KeeAnywhere_48x48, "Authorize to Amazon S3",
                                         "Please enter your Amazon S3 credentials here.");
        }
コード例 #25
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            Debug.Assert(m_vStringDict != null); if (m_vStringDict == null)
            {
                throw new InvalidOperationException();
            }

            GlobalWindowManager.AddWindow(this);

            m_ctxValue.Attach(m_richStringValue, this);

            string strTitle, strDesc;

            if (m_strStringName == null)
            {
                strTitle = KPRes.AddStringField;
                strDesc  = KPRes.AddStringFieldDesc;
            }
            else
            {
                strTitle = KPRes.EditStringField;
                strDesc  = KPRes.EditStringFieldDesc;
            }

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         Properties.Resources.B48x48_Font, strTitle, strDesc);
            this.Icon = AppIcons.Default;

            UIUtil.EnableAutoCompletion(m_cmbStringName, true);
            UIUtil.PrepareStandardMultilineControl(m_richStringValue, true, true);

            if (m_strStringName != null)
            {
                m_cmbStringName.Text = m_strStringName;
            }
            if (m_psStringInitialValue != null)
            {
                m_richStringValue.Text = StrUtil.NormalizeNewLines(
                    m_psStringInitialValue.ReadString(), true);
                m_cbProtect.Checked = m_psStringInitialValue.IsProtected;
            }

            ValidateStringNameUI();
            PopulateNamesComboBox();

            if (m_bReadOnly)
            {
                m_cmbStringName.Enabled    = false;
                m_richStringValue.ReadOnly = true;
                m_cbProtect.Enabled        = false;
                // m_btnOK.Enabled = false; // See ValidateStringNameUI
            }

            // UIUtil.SetFocus(..., this); // See PopulateNamesComboBox
        }
コード例 #26
0
ファイル: EntropyForm.cs プロジェクト: matt2005/keepass2
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this);

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         Properties.Resources.B48x48_Binary, KPRes.EntropyTitle,
                                         KPRes.EntropyDesc);
            this.Icon = Properties.Resources.KeePass;
            this.Text = KPRes.EntropyTitle;

            UpdateUIState();
        }
コード例 #27
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this);

            string strTitle = "PKCS#11";
            string strDesc  = "Enter your pin.";

            this.Text = strTitle;
            BannerFactory.CreateBannerEx(this, banner,
                                         Resource.chip, strTitle, strDesc);
            this.textBox1.PasswordChar = '*';
            this.textBox1.Select();
        }
コード例 #28
0
ファイル: OAuth2Form.cs プロジェクト: ydov/KeeAnywhere
        private void UpdateBanner()
        {
            if (m_provider == null)
            {
                return;
            }
            var text = string.Format("Authorize to {0}", m_provider.FriendlyProviderName);

            this.Text = text;
            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         PluginResources.KeeAnywhere_48x48, text,
                                         string.Format("Please follow the instructions to authorize KeeAnywhere to access your {0} account.", m_provider.FriendlyProviderName));
        }
コード例 #29
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            ++m_cBlockUIUpdate;

            GlobalWindowManager.AddWindow(this);

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         KeePass.Properties.Resources.B48x48_KGPG_Gen,
                                         KPRes.KeyFileCreateTitle, KPRes.KeyFileCreate + ".");
            this.Icon = AppIcons.Default;
            this.Text = KPRes.KeyFileCreateTitle;

            FontUtil.AssignDefaultBold(m_rbCreate);
            FontUtil.AssignDefaultBold(m_rbRecreate);
            FontUtil.AssignDefaultMono(m_tbRecKeyHash, false);
            FontUtil.AssignDefaultMono(m_tbRecKey, false);

            if (m_bRecreateOnly)
            {
                m_rbRecreate.Checked = true;
                m_rbCreate.Enabled   = false;
            }
            else
            {
                m_rbCreate.Checked = true;
            }

            m_cbNewEntropy.Checked = true;

            Debug.Assert(!m_cmbNewFormat.Sorted);
            foreach (KfcfInfo kfi in m_vNewFormat)
            {
                m_cmbNewFormat.Items.Add(kfi.Name);
            }
            m_cmbNewFormat.SelectedIndex = 0;

            Debug.Assert(!m_cmbRecFormat.Sorted);
            foreach (KfcfInfo kfi in m_vRecFormat)
            {
                m_cmbRecFormat.Items.Add(kfi.Name);
            }
            m_cmbRecFormat.SelectedIndex = 0;

            m_rbCreate.CheckedChanged           += this.OnShouldUpdateUIState;
            m_rbRecreate.CheckedChanged         += this.OnShouldUpdateUIState;
            m_cmbRecFormat.SelectedIndexChanged += this.OnShouldUpdateUIState;
            m_tbRecKey.TextChanged += this.OnShouldUpdateUIState;

            --m_cBlockUIUpdate;
            UpdateUIState();
        }
コード例 #30
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this);

            this.Icon = PluginResources.Icon_OneDrive_16x16;

            BannerFactory.CreateBannerEx(this, m_bannerImage,
                                         PluginResources.KeeAnywhere_48x48, "KeeAnywhere Settings",
                                         "Here you can manage KeeAnywhere's settings.");

            InitGeneralTab();
            InitAccountsTab();
            InitAboutTab();
        }