diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2010-05-07 16:14:31 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2010-05-07 16:14:31 +0000 |
commit | 91f676e4f04230e720a89a0304e297c5e661b11b (patch) | |
tree | ce8a885af9f8822d0165311638fb01ad5b0b96ee /keylist.cpp | |
parent | finished spanish translation (diff) | |
download | gpg4usb-91f676e4f04230e720a89a0304e297c5e661b11b.tar.gz gpg4usb-91f676e4f04230e720a89a0304e297c5e661b11b.zip |
added save and restore checked keys
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@315 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'keylist.cpp')
-rw-r--r-- | keylist.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/keylist.cpp b/keylist.cpp index 76e9291..7a0b12e 100644 --- a/keylist.cpp +++ b/keylist.cpp @@ -35,6 +35,7 @@ KeyList::KeyList(GpgME::Context *ctx, QString iconpath, QWidget *parent) mKeyList->setColumnWidth(1, 20); mKeyList->sortByColumn(2, Qt::AscendingOrder); mKeyList->setSelectionBehavior(QAbstractItemView::SelectRows); + // id of key mKeyList->setColumnHidden(4, true); // tableitems not editable mKeyList->setEditTriggers(QAbstractItemView::NoEditTriggers); @@ -108,6 +109,30 @@ QStringList *KeyList::getChecked() return ret; } +void KeyList::setChecked(QStringList *keyIds) +{ + if (!keyIds->isEmpty()){ + if (keyIds->at(0) != "" ){ + for (int i = 0; i < mKeyList->rowCount(); i++) { + if (keyIds->contains(mKeyList->item(i, 4)->text())) { + mKeyList->item(i, 0)->setCheckState(Qt::Checked); + } + } + } + } +} + +/*QStringList *KeyList::getPrivateChecked() +{ + QStringList *ret = new QStringList(); + for (int i = 0; i < mKeyList->rowCount(); i++) { + if ((mKeyList->item(i, 0)->checkState() == Qt::Checked) && (mKeyList->item(i, 4))) { + *ret << mKeyList->item(i, 4)->text(); + } + } + return ret; +} +*/ QStringList *KeyList::getSelected() { QStringList *ret = new QStringList(); |