From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- .../cryptography/cryptographyselectuserkey.cpp | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 kopete/plugins/cryptography/cryptographyselectuserkey.cpp (limited to 'kopete/plugins/cryptography/cryptographyselectuserkey.cpp') diff --git a/kopete/plugins/cryptography/cryptographyselectuserkey.cpp b/kopete/plugins/cryptography/cryptographyselectuserkey.cpp new file mode 100644 index 00000000..4f1cc35e --- /dev/null +++ b/kopete/plugins/cryptography/cryptographyselectuserkey.cpp @@ -0,0 +1,71 @@ +/*************************************************************************** + cryptographyselectuserkey.cpp - description + ------------------- + begin : dim nov 17 2002 + copyright : (C) 2002 by Olivier Goffart + email : ogoffart @ kde.org + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include +#include +#include + +#include "cryptographyuserkey_ui.h" +#include "kopetemetacontact.h" +#include "popuppublic.h" + +#include "cryptographyselectuserkey.h" + +CryptographySelectUserKey::CryptographySelectUserKey(const QString& key ,Kopete::MetaContact *mc) : KDialogBase( 0l, "CryptographySelectUserKey", /*modal = */true, i18n("Select Contact's Public Key") , KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok ) +{ + m_metaContact=mc; + view = new CryptographyUserKey_ui(this,"CryptographyUserKey_ui"); + setMainWidget(view); + + connect (view->m_selectKey , SIGNAL(clicked()) , this , SLOT(slotSelectPressed())); + connect (view->m_removeButton , SIGNAL(clicked()) , this , SLOT(slotRemovePressed())); + + view->m_titleLabel->setText(i18n("Select public key for %1").arg(mc->displayName())); + view->m_editKey->setText(key); +} +CryptographySelectUserKey::~CryptographySelectUserKey() +{ +} + +void CryptographySelectUserKey::slotSelectPressed() +{ + popupPublic *dialog=new popupPublic(this, "public_keys", 0,false); + connect(dialog,SIGNAL(selectedKey(QString &,QString,bool,bool)),this,SLOT(keySelected(QString &))); + dialog->show(); +} + + +void CryptographySelectUserKey::keySelected(QString &key) +{ + view->m_editKey->setText(key); +} + +void CryptographySelectUserKey::slotRemovePressed() +{ + view->m_editKey->setText(""); +} + +QString CryptographySelectUserKey::publicKey() const +{ + return view->m_editKey->text(); +} + + + +#include "cryptographyselectuserkey.moc" + -- cgit v1.2.1