mirror of
https://github.com/chris2511/xca.git
synced 2026-09-14 11:06:19 +05:00
show if it is private or public key in icon
This commit is contained in:
parent
e7f8c55612
commit
1fcdca4d6f
@ -5,7 +5,6 @@ db_key::db_key(DbEnv *dbe, string DBfile, QListView *l)
|
||||
:db_base(dbe, DBfile, "keydb")
|
||||
{
|
||||
listView = l;
|
||||
icon = loadImg("key.png");
|
||||
loadContainer();
|
||||
updateView();
|
||||
}
|
||||
@ -15,6 +14,30 @@ pki_base *db_key::newPKI(){
|
||||
}
|
||||
|
||||
|
||||
bool db_key::updateView()
|
||||
{
|
||||
listView->clear();
|
||||
QPixmap *pm[2];
|
||||
pm[0] = loadImg("key.png");
|
||||
pm[1] = loadImg("halfkey.png");
|
||||
pki_key *pki;
|
||||
QListViewItem *current;
|
||||
cerr <<"myupdate keys"<<endl;
|
||||
if ( container.isEmpty() ) return false;
|
||||
QListIterator<pki_base> it(container);
|
||||
for ( ; it.current(); ++it ) {
|
||||
pki = (pki_key *)it.current();
|
||||
// create the listview item
|
||||
current = new QListViewItem(listView, pki->getDescription().c_str());
|
||||
CERR<< "Adding as parent: "<<pki->getDescription().c_str()<<endl;
|
||||
int pixnum = 0;
|
||||
if (pki->isPubKey()) pixnum += 1;
|
||||
current->setPixmap(0, *pm[pixnum]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
QStringList db_key::getPrivateDesc()
|
||||
{
|
||||
pki_key *pki;
|
||||
|
||||
@ -12,6 +12,7 @@ class db_key: public db_base
|
||||
db_key(DbEnv *dbe, string DBfile, QListView *l);
|
||||
pki_base *newPKI();
|
||||
QStringList getPrivateDesc();
|
||||
bool updateView();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user