Commit dc545856 authored by Rolf Eike Beer's avatar Rolf Eike Beer
Browse files

pressing Enter in keysmanager now has the same effect as double clicking

svn path=/trunk/KDE/kdeutils/kgpg/; revision=767809
parent d1ad9a63
......@@ -118,6 +118,10 @@ KeysManager::KeysManager(QWidget *parent)
QAction *action = 0;
action = actionCollection()->addAction( "default" );
connect(action, SIGNAL(triggered(bool)), SLOT(slotDefaultAction()));
action->setShortcut(QKeySequence(Qt::Key_Return));
action = actionCollection()->addAction( "key_server" );
action->setText( i18n("&Key Server Dialog") );
action->setIcon( KIcon("network-server") );
......@@ -165,7 +169,6 @@ KeysManager::KeysManager(QWidget *parent)
infoKey->setIcon(KIcon("document-properties-key"));
infoKey->setText(i18n("K&ey properties"));
connect(infoKey, SIGNAL(triggered(bool)), SLOT(keyproperties()));
infoKey->setShortcut(QKeySequence(Qt::Key_Return));
editKey = actionCollection()->addAction("key_edit");
editKey->setIcon(KIcon("utilities-terminal"));
......@@ -382,8 +385,6 @@ KeysManager::KeysManager(QWidget *parent)
KConfigGroup cg = KConfigGroup(KGlobal::config().data(), "KeyView");
iview->restoreLayout(cg);
#warning port me
// connect(keysList2, SIGNAL(returnPressed(Q3ListViewItem *)), this, SLOT(defaultAction()));
connect(photoProps, SIGNAL(activated(int)), this, SLOT(slotSetPhotoSize(int)));
// get all keys data
......@@ -1481,6 +1482,16 @@ void KeysManager::defaultAction(const QModelIndex &index)
{
KGpgNode *nd = iproxy->nodeForIndex(index);
defaultAction(nd);
}
void KeysManager::slotDefaultAction()
{
defaultAction(iview->selectedNode());
}
void KeysManager::defaultAction(KGpgNode *nd)
{
switch (nd->getType()) {
case ITYPE_GROUP:
editGroup();
......@@ -1499,16 +1510,14 @@ void KeysManager::defaultAction(const QModelIndex &index)
break;
case ITYPE_PAIR:
case ITYPE_PUBLIC:
showProperties(index);
showProperties(nd);
return;
}
}
void
KeysManager::showProperties(const QModelIndex &index)
KeysManager::showProperties(KGpgNode *n)
{
KGpgNode *n = imodel->nodeForIndex(iproxy->mapToSource(index));
switch (n->getType()) {
case ITYPE_UAT:
return;
......
......@@ -160,7 +160,9 @@ private slots:
void signatureResult(int success, const QString &keyId, KgpgInterface*);
void delsignatureResult(bool);
void defaultAction(const QModelIndex &);
void showProperties(const QModelIndex &);
void defaultAction(KGpgNode *);
void slotDefaultAction();
void showProperties(KGpgNode *);
void keyproperties();
void slotexport();
void slotexportsec();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment