major change: Add security support & Adjust GUI
Change-Id: I7abef37169dec1ef4b68e760dee5214c147c1915
diff --git a/src/set-alias-dialog.cpp b/src/set-alias-dialog.cpp
new file mode 100644
index 0000000..7327c1b
--- /dev/null
+++ b/src/set-alias-dialog.cpp
@@ -0,0 +1,61 @@
+/* -*- 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 "set-alias-dialog.h"
+#include "ui_set-alias-dialog.h"
+
+
+using namespace ndn;
+using namespace std;
+
+SetAliasDialog::SetAliasDialog(QWidget *parent)
+ : QDialog(parent)
+ , ui(new Ui::SetAliasDialog)
+{
+ ui->setupUi(this);
+
+ connect(ui->okButton, SIGNAL(clicked()),
+ this, SLOT(onOkClicked()));
+ connect(ui->cancelButton, SIGNAL(clicked()),
+ this, SLOT(onCancelClicked()));
+}
+
+SetAliasDialog::~SetAliasDialog()
+{
+ delete ui;
+}
+
+void
+SetAliasDialog::onOkClicked()
+{
+ emit aliasChanged(m_targetIdentity, ui->aliasInput->text());
+ this->close();
+}
+
+void
+SetAliasDialog::onCancelClicked()
+{
+ this->close();
+}
+
+void
+SetAliasDialog::setTargetIdentity(const QString& targetIdentity, const QString& alias)
+{
+ m_targetIdentity = targetIdentity;
+ QString msg = QString("Set alias for %1:").arg(targetIdentity);
+ ui->introLabel->setText(msg);
+ ui->aliasInput->setText(alias);
+}
+
+
+#if WAF
+#include "set-alias-dialog.moc"
+#include "set-alias-dialog.cpp.moc"
+#endif