From 91f676e4f04230e720a89a0304e297c5e661b11b Mon Sep 17 00:00:00 2001 From: nils Date: Fri, 7 May 2010 16:14:31 +0000 Subject: added save and restore checked keys git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@315 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- keylist.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'keylist.cpp') 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(); -- cgit v1.2.3