private void OnGroupsEdit(object sender, EventArgs e) { PwGroup pg = GetSelectedGroup(); Debug.Assert(pg != null); if(pg == null) return; PwDatabase pwDb = m_docMgr.ActiveDatabase; GroupForm gf = new GroupForm(); gf.InitEx(pg, m_ilCurrentIcons, pwDb); if(UIUtil.ShowDialogAndDestroy(gf) == DialogResult.OK) UpdateUI(false, null, true, null, true, null, true); else UpdateUI(false, null, pwDb.UINeedsIconUpdate, null, pwDb.UINeedsIconUpdate, null, false); }
void openGroupEditorWindow(PwGroup pg, PwDatabase db) { GroupForm gf = new GroupForm(); gf.InitEx(pg, host.MainWindow.ClientIcons, host.Database); gf.BringToFront(); gf.ShowInTaskbar = true; host.MainWindow.Focus(); gf.TopMost = true; gf.Focus(); gf.Activate(); if (gf.ShowDialog() == DialogResult.OK) saveDB(db); }
private void OnGroupsAdd(object sender, EventArgs e) { TreeNode tn = m_tvGroups.SelectedNode; PwDatabase pd = m_docMgr.ActiveDatabase; PwGroup pgParent; if(tn != null) pgParent = (tn.Tag as PwGroup); else pgParent = pd.RootGroup; if(pgParent == null) { Debug.Assert(false); return; } PwGroup pgNew = new PwGroup(true, true, KPRes.NewGroup, PwIcon.Folder); pgParent.AddGroup(pgNew, true); // Add immediately for correct inheritance GroupForm gf = new GroupForm(); gf.InitEx(pgNew, true, m_ilCurrentIcons, pd); if(UIUtil.ShowDialogAndDestroy(gf) == DialogResult.OK) { pgParent.IsExpanded = true; UpdateUI(false, null, true, pgNew, true, null, true); } else pgParent.Groups.Remove(pgNew); }
private void OnGroupsEdit(object sender, EventArgs e) { PwGroup pg = GetSelectedGroup(); Debug.Assert(pg != null); if(pg == null) return; GroupForm gf = new GroupForm(); gf.InitEx(pg, m_ilCurrentIcons, m_docMgr.ActiveDatabase); if(gf.ShowDialog() == DialogResult.OK) UpdateUI(false, null, true, null, true, null, true); }