major change: Add security support & Adjust GUI
Change-Id: I7abef37169dec1ef4b68e760dee5214c147c1915
diff --git a/src/invitation-dialog.cpp b/src/invitation-dialog.cpp
new file mode 100644
index 0000000..8be49fc
--- /dev/null
+++ b/src/invitation-dialog.cpp
@@ -0,0 +1,68 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013, Regents of the University of California
+ * Yingdi Yu
+ *
+ * BSD license, See the LICENSE file for more information
+ *
+ * Author: Yingdi Yu <yingdi@cs.ucla.edu>
+ */
+
+
+#include "invitation-dialog.h"
+#include "ui_invitation-dialog.h"
+
+using namespace std;
+using namespace ndn;
+
+InvitationDialog::InvitationDialog(QWidget *parent)
+ : QDialog(parent)
+ , ui(new Ui::InvitationDialog)
+{
+ ui->setupUi(this);
+
+ connect(ui->okButton, SIGNAL(clicked()),
+ this, SLOT(onOkClicked()));
+ connect(ui->cancelButton, SIGNAL(clicked()),
+ this, SLOT(onCancelClicked()));
+}
+
+InvitationDialog::~InvitationDialog()
+{
+ delete ui;
+}
+
+void
+InvitationDialog::setInvitation(const string& alias,
+ const string& chatroom,
+ const Name& interestName)
+{
+ string msg = alias;
+ msg.append(" invites you to: ").append(chatroom);
+ ui->msgLabel->setText(QString::fromStdString(msg));
+}
+
+void
+InvitationDialog::onOkClicked()
+{
+ emit invitationResponded(m_invitationInterest, true);
+ this->close();
+
+ ui->msgLabel->clear();
+ m_invitationInterest.clear();
+}
+
+void
+InvitationDialog::onCancelClicked()
+{
+ emit invitationResponded(m_invitationInterest, false);
+ this->close();
+
+ ui->msgLabel->clear();
+ m_invitationInterest.clear();
+}
+
+#if WAF
+#include "invitation-dialog.moc"
+#include "invitation-dialog.cpp.moc"
+#endif