Ejemplo n.º 1
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;
            m_tbComments.Text              = StrUtil.NormalizeNewLines(m_trigger.Comments, true);
            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);
        }
        /// <summary>
        /// The frm config_ load.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void frmConfig_Load(object sender, EventArgs e)
        {
            // banner
            this.picBannerImage.Image = BannerFactory.CreateBanner(
                this.picBannerImage.Width,
                this.picBannerImage.Height,
                BannerStyle.Default,
                Resources.hd2_backup48x48,
                "Configuration",
                "Configure option for DBBackup");
            this.Icon = Resources.hd2_backup;

            this.txtQtyBackup.Value = this._appConfig.HistoQty;
            if (this._appConfig.HistoFolder != null)
            {
                foreach (string it in this._appConfig.HistoFolder)
                {
                    if (it != null)
                    {
                        this.lbFolder.Items.Add(it);
                    }
                }
            }

            this.txtDateFormat.Text = this._appConfig.DateFormat;
        }
Ejemplo n.º 3
0
        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;
            }
        }
        private void HIBPOfflineCheckOptions_Load(object sender, EventArgs e)
        {
            Icon = AppIcons.Default;

            pb_BannerImage.Image = BannerFactory.CreateBanner(pb_BannerImage.Width, pb_BannerImage.Height, 
                BannerStyle.Default, Properties.Resources.B48x48_KOrganizer, 
                "HIBP Offline Check Options", "Manage plugin settings.");

            options = ext.LoadOptions();

            radioButtonOffline.Checked = (options.CheckMode == Options.CheckModeType.Offline);
            radioButtonOnline.Checked = (options.CheckMode == Options.CheckModeType.Online);
            radioButtonBloom.Checked = (options.CheckMode == Options.CheckModeType.BloomFilter);
            textBoxFileName.Text = options.HIBPFileName;
            textBoxColumnName.Text = options.ColumnName;
            textBoxSecureText.Text = options.SecureText;
            textBoxInsecureText.Text = options.InsecureText;
            textBoxExcludedText.Text = options.ExcludedText;
            checkBoxBreachCountDetails.Checked = options.BreachCountDetails;
            checkBoxExcludeRecycleBin.Checked = options.ExcludeRecycleBin;
            checkBoxExcludeExpired.Checked = options.ExcludeExpired;
            checkBoxWarningDialog.Checked = options.WarningDialog;
            checkBoxAutoCheck.Checked = options.AutoCheck;
            textBoxWarningDialog.Text = options.WarningDialogText;
            textBoxWarningDialog.Enabled = checkBoxWarningDialog.Checked;
            textBoxBloomFilter.Text = options.BloomFilter;
            textBoxBloomFilter.Enabled = radioButtonBloom.Checked;
            buttonCreateBloom.Enabled = radioButtonBloom.Checked;
            buttonBrowseBloom.Enabled = radioButtonBloom.Checked;

            textBoxFileName.Select();
            textBoxFileName.Select(0, 0);
        }
Ejemplo n.º 5
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
        }
Ejemplo n.º 6
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 = 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);
        }
Ejemplo n.º 7
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;
        }
Ejemplo n.º 8
0
        internal AuthWaitOrCancel(IPluginHost host, DatabaseContext dbCtx,
                                  EntryConfiguration entry)
        {
            m_entryConfig = entry;
            m_host        = host;
            m_dbCtx       = dbCtx;

            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 && dbCtx.Database.IsOpen)
            {
                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));
        }
Ejemplo n.º 9
0
        private void HIBPOfflineCheckOptions_Load(object sender, EventArgs e)
        {
            this.Icon = AppIcons.Default;

            pb_BannerImage.Image = BannerFactory.CreateBanner(pb_BannerImage.Width, pb_BannerImage.Height,
                                                              BannerStyle.Default, Properties.Resources.B48x48_KOrganizer,
                                                              "HIBP Offline Check Options", "Manage plugin settings.");

            options = ext.LoadOptions();

            textBoxFileName.Text               = options.HIBPFileName;
            textBoxColumnName.Text             = options.ColumnName;
            textBoxSecureText.Text             = options.SecureText;
            textBoxInsecureText.Text           = options.InsecureText;
            checkBoxBreachCountDetails.Checked = options.BreachCountDetails;
            checkBoxWarningDialog.Checked      = options.WarningDialog;
            textBoxWarningDialog.Text          = options.WarningDialogText;

            textBoxFileName.Select();
            textBoxFileName.Select(0, 0);

            if (checkBoxWarningDialog.Checked == false)
            {
                textBoxWarningDialog.Enabled = false;
            }
            else
            {
                textBoxWarningDialog.Enabled = true;
            }
        }
Ejemplo n.º 10
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);
        }
Ejemplo n.º 11
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();
            UIUtil.SetFocus(m_tbSelNodes, this);
        }
Ejemplo n.º 12
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this, this);

            m_bannerImage.Image = BannerFactory.CreateBanner(m_bannerImage.Width,
                                                             m_bannerImage.Height, BannerStyle.Default,
                                                             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);

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

            GetAvailableTranslations(strPath);
        }
Ejemplo n.º 13
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;

            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);
        }
Ejemplo n.º 14
0
        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 = AppIcons.Default;
            this.Text = KPRes.HelpSourceSelection;

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

            Debug.Assert(!m_lblLocal.AutoSize);             // For RTL support
            if (!AppHelp.LocalHelpAvailable)
            {
                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;
            }
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 16
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();
        }
Ejemplo n.º 17
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);
        }
Ejemplo n.º 18
0
 private void doHeader()
 {
     this.Text           = w_Title;
     m_bannerImage.Image = BannerFactory.CreateBanner(m_bannerImage.Width,
                                                      m_bannerImage.Height, BannerStyle.Default,
                                                      w_Icon.ToBitmap(), w_Title, w_Desc);
 }
Ejemplo n.º 19
0
        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);
        }
Ejemplo n.º 20
0
        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); }
            });
        }
Ejemplo n.º 21
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            Debug.Assert(m_mgr != null); if (m_mgr == null)
            {
                throw new ArgumentException();
            }

            GlobalWindowManager.AddWindow(this, this);

            m_bannerImage.Image = BannerFactory.CreateBanner(m_bannerImage.Width,
                                                             m_bannerImage.Height, BannerStyle.Default,
                                                             Properties.Resources.B48x48_BlockDevice, KPRes.Plugins,
                                                             KPRes.PluginsDesc);
            this.Icon = Properties.Resources.KeePass;

            m_lvPlugins.Columns.Add(KPRes.Plugin, 197);
            m_lvPlugins.Columns.Add(KPRes.Version, 106);
            m_lvPlugins.Columns.Add(KPRes.Author, 136);
            m_lvPlugins.Columns.Add(KPRes.Description, 0);
            m_lvPlugins.Columns.Add(KPRes.File, 119);

            m_ilIcons.ImageSize  = new Size(16, 16);
            m_ilIcons.ColorDepth = ColorDepth.Depth32Bit;

            m_lvPlugins.SmallImageList = m_ilIcons;
            UpdatePluginsList();

            if (m_lvPlugins.Items.Count > 0)
            {
                m_lvPlugins.Items[0].Selected = true;
                m_lvPlugins.Focus();
            }

            UpdatePluginDescription();
        }
Ejemplo n.º 22
0
        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);
            }
        }
Ejemplo n.º 23
0
        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);
        }
Ejemplo n.º 24
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;
        }
Ejemplo n.º 25
0
        private void GeneratingForm_Load(object sender, EventArgs e)
        {
            string strTitle = "StrengthReport: Generating";
            string strDesc  = "Generating the report you requested";
            Icon   icoNew   = new Icon(Resources.StrengthReportPrinting, 48, 48);

            m_bannerImage.Image = BannerFactory.CreateBanner(m_bannerImage.Width,
                                                             m_bannerImage.Height, BannerStyle.Default,
                                                             icoNew.ToBitmap(), strTitle, strDesc);
        }
Ejemplo n.º 26
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, AzureResources.Keepass_Banner_Title,
                                         AzureResources.Keepass_Banner_Line);
        }
Ejemplo n.º 27
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.");
        }
Ejemplo n.º 28
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.");
        }
Ejemplo n.º 29
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
        }
Ejemplo n.º 30
0
        private void RecreateResizableWindowControls()
        {
            string strTitle = KPRes.PickCharacters;

            if (m_uCharCount > 0)
            {
                strTitle += " (" + m_uCharCount.ToString() + ")";
            }

            BannerFactory.UpdateBanner(this, m_bannerImage,
                                       Properties.Resources.B48x48_KGPG_Key2, strTitle,
                                       KPRes.PickCharactersDesc, ref m_nBannerWidth);

            RemoveAllCharButtons();

            bool bRtl = (this.RightToLeft == RightToLeft.Yes);

            string strWord = ((m_psWord != null) ? m_psWord.ReadString() : string.Empty);

            if (strWord.Length >= 1)
            {
                int x = 0;
                int nPnlWidth = m_pnlSelect.Width, nPnlHeight = m_pnlSelect.Height;
                for (int i = 0; i < strWord.Length; ++i)
                {
                    int w = ((nPnlWidth * (i + 1)) / strWord.Length) - x;

                    int rx = (bRtl ? (nPnlWidth - x - w) : x);

                    Button btn = new Button();
                    btn.Location = new Point(rx, 0);
                    btn.Size     = new Size(w, nPnlHeight / 2 - 1);
                    btn.Font     = m_fontChars;
                    btn.Tag      = strWord[i];
                    btn.Click   += this.OnSelectCharacter;

                    m_lButtons.Add(btn);
                    m_pnlSelect.Controls.Add(btn);

                    Label lbl = new Label();
                    lbl.Text      = (i + 1).ToString();
                    lbl.TextAlign = ContentAlignment.MiddleCenter;
                    lbl.Location  = new Point(rx - 1, nPnlHeight / 2);
                    lbl.Size      = new Size(w + 2, nPnlHeight / 2 - 3);

                    m_lLabels.Add(lbl);
                    m_pnlSelect.Controls.Add(lbl);

                    x += w;
                }
            }

            OnHideCharsCheckedChanged(null, EventArgs.Empty);
        }