~ubuntu-branches/ubuntu/trusty/keepass2/trusty-proposed

« back to all changes in this revision

Viewing changes to .pc/use-installed-ico-files.patch/KeePass/Forms/ColumnsForm.cs

  • Committer: Package Import Robot
  • Author(s): Julian Taylor
  • Date: 2011-12-30 15:45:59 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20111230154559-3en1b9v90hswvs1w
Tags: 2.18+dfsg-1
* New upstream release
  - refresh patches
  - drop upstream applied patches:
    explicitly-PUT-for-webdav-writes.patch
    prefer-4.0-framework-if-available.patch
* add patch to improve autotype when dealing with multiple keyboard layouts
  - Thanks to amiryal for the patch
* disable initial autoupdate popup via patch
* update years in debian/copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
  KeePass Password Safe - The Open-Source Password Manager
3
 
  Copyright (C) 2003-2011 Dominik Reichl <dominik.reichl@t-online.de>
 
3
  Copyright (C) 2003-2012 Dominik Reichl <dominik.reichl@t-online.de>
4
4
 
5
5
  This program is free software; you can redistribute it and/or modify
6
6
  it under the terms of the GNU General Public License as published by
42
42
 
43
43
        public partial class ColumnsForm : Form
44
44
        {
 
45
                private bool m_bIgnoreHideCheckEvent = false;
 
46
 
45
47
                public ColumnsForm()
46
48
                {
47
49
                        InitializeComponent();
68
70
 
69
71
                        ThreadPool.QueueUserWorkItem(new WaitCallback(FillColumnsList));
70
72
 
71
 
                        EnableControlsEx();
 
73
                        UpdateColumnPropInfo();
72
74
                }
73
75
 
74
76
                private void AddAceColumnTh(AceColumn c)
91
93
                        }
92
94
 
93
95
                        ListViewItem lvi = new ListViewItem(c.GetDisplayName());
 
96
                        lvi.Tag = c;
94
97
 
95
 
                        lvi.SubItems.Add(c.HideWithAsterisks ? KPRes.Yes : string.Empty);
 
98
                        lvi.SubItems.Add(c.HideWithAsterisks ? KPRes.Yes : KPRes.No);
96
99
 
97
100
                        if(c.Type == AceColumnType.Password)
98
101
                                lvi.SubItems.Add(KPRes.KeyboardKeyCtrl + "+H");
128
131
                        }
129
132
                        lvi.Checked = bChecked;
130
133
 
131
 
                        lvi.Tag = c;
132
134
                        lvi.Group = lvgContainer;
133
135
                        m_lvColumns.Items.Add(lvi);
134
136
                }
250
252
                                        AceColumn c = (lvi.Tag as AceColumn);
251
253
                                        if(c == null) { Debug.Assert(false); continue; }
252
254
 
253
 
                                        string str = (c.HideWithAsterisks ? KPRes.Yes : string.Empty);
 
255
                                        string str = (c.HideWithAsterisks ? KPRes.Yes : KPRes.No);
254
256
                                        lvi.SubItems[1].Text = str;
255
257
                                }
256
258
                        }
257
259
                }
258
260
 
259
 
                private void EnableControlsEx()
 
261
                private void UpdateColumnPropInfo()
260
262
                {
261
 
                        m_btnAsterisks.Enabled = (m_lvColumns.SelectedIndices.Count > 0);
 
263
                        ListView.SelectedListViewItemCollection lvsic = m_lvColumns.SelectedItems;
 
264
                        if((lvsic == null) || (lvsic.Count != 1) || (lvsic[0] == null))
 
265
                        {
 
266
                                m_grpColumn.Text = KPRes.SelectedColumn + ": (" + KPRes.None + ")";
 
267
                                m_cbHide.Checked = false;
 
268
                                m_cbHide.Enabled = false;
 
269
                        }
 
270
                        else
 
271
                        {
 
272
                                ListViewItem lvi = lvsic[0];
 
273
                                AceColumn c = (lvi.Tag as AceColumn);
 
274
                                if(c == null) { Debug.Assert(false); return; }
 
275
 
 
276
                                m_grpColumn.Text = KPRes.SelectedColumn + ": " + c.GetDisplayName();
 
277
                                m_cbHide.Enabled = true;
 
278
 
 
279
                                m_bIgnoreHideCheckEvent = true;
 
280
                                UIUtil.SetChecked(m_cbHide, c.HideWithAsterisks);
 
281
                                m_bIgnoreHideCheckEvent = false;
 
282
                        }
262
283
                }
263
284
 
264
285
                private void OnFormClosed(object sender, FormClosedEventArgs e)
286
307
                {
287
308
                }
288
309
 
289
 
                private void OnBtnAsterisks(object sender, EventArgs e)
290
 
                {
 
310
                private void OnColumnsSelectedIndexChanged(object sender, EventArgs e)
 
311
                {
 
312
                        UpdateColumnPropInfo();
 
313
                }
 
314
 
 
315
                private void OnHideCheckedChanged(object sender, EventArgs e)
 
316
                {
 
317
                        if(m_bIgnoreHideCheckEvent) return;
 
318
 
 
319
                        bool bChecked = m_cbHide.Checked;
291
320
                        foreach(ListViewItem lvi in m_lvColumns.SelectedItems)
292
321
                        {
293
322
                                AceColumn c = (lvi.Tag as AceColumn);
297
326
                                        !AppPolicy.Try(AppPolicyId.UnhidePasswords))
298
327
                                {
299
328
                                }
300
 
                                else c.HideWithAsterisks = !c.HideWithAsterisks;
 
329
                                else c.HideWithAsterisks = bChecked;
301
330
                        }
302
331
 
303
332
                        UpdateListEx(false);
304
333
                }
305
 
 
306
 
                private void OnColumnsSelectedIndexChanged(object sender, EventArgs e)
307
 
                {
308
 
                        EnableControlsEx();
309
 
                }
310
334
        }
311
335
}