Fetching SelfEndorseCertificate works
diff --git a/src/addcontactpanel.cpp b/src/addcontactpanel.cpp
index a3dabf7..9d332a7 100644
--- a/src/addcontactpanel.cpp
+++ b/src/addcontactpanel.cpp
@@ -11,28 +11,41 @@
#include "addcontactpanel.h"
#include "ui_addcontactpanel.h"
+#ifndef Q_MOC_RUN
+#include "logging.h"
+#endif
+
using namespace ndn;
using namespace std;
+INIT_LOGGER("AddContactPanel");
+
AddContactPanel::AddContactPanel(Ptr<ContactManager> contactManager,
QWidget *parent)
: QDialog(parent)
, ui(new Ui::AddContactPanel)
, m_contactManager(contactManager)
+ , m_warningDialog(new WarningDialog())
{
ui->setupUi(this);
+
+ qRegisterMetaType<ndn::Name>("NdnName");
+ qRegisterMetaType<EndorseCertificate>("EndorseCertificate");
connect(ui->cancelButton, SIGNAL(clicked()),
this, SLOT(onCancelClicked()));
connect(ui->searchButton, SIGNAL(clicked()),
this, SLOT(onSearchClicked()));
- connect(&*m_contactManager, SIGNAL(contactFetched(ndn::Ptr<EndorseCertificate>)),
- this, SLOT(selfEndorseCertificateFetched(ndn::Ptr<EndorseCertificate>)));
+ connect(&*m_contactManager, SIGNAL(contactFetched(const EndorseCertificate&>)),
+ this, SLOT(selfEndorseCertificateFetched(const EndorseCertificate&>)));
+ connect(&*m_contactManager, SIGNAL(contactFetchFailed(const ndn::Name&)),
+ this, SLOT(selfEndorseCertificateFetchFailed(const ndn::Name&)));
}
AddContactPanel::~AddContactPanel()
{
delete ui;
+ delete m_warningDialog;
}
void
@@ -44,6 +57,8 @@
{
QString inputIdentity = ui->contactInput->text();
m_searchIdentity = Name(inputIdentity.toUtf8().constData());
+
+ m_contactManager->fetchSelfEndorseCertificate(m_searchIdentity);
}
void
@@ -52,8 +67,16 @@
}
void
-AddContactPanel::selfEndorseCertificateFetched(Ptr<EndorseCertificate> endorseCertificate)
+AddContactPanel::selfEndorseCertificateFetched(const EndorseCertificate& endorseCertificate)
{
+ _LOG_DEBUG("CALLED");
+}
+
+void
+AddContactPanel::selfEndorseCertificateFetchFailed(const Name& identity)
+{
+ m_warningDialog->setMsg("Cannot fetch contact profile");
+ m_warningDialog->show();
}
#if WAF