blob: 7327c1b308c02f4de8d999e575e5c9d2478b0bc1 [file] [log] [blame]
Yingdi Yu348f5ea2014-03-01 14:47:25 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2013, Regents of the University of California
4 * Yingdi Yu
5 *
6 * BSD license, See the LICENSE file for more information
7 *
8 * Author: Yingdi Yu <yingdi@cs.ucla.edu>
9 */
10
11#include "set-alias-dialog.h"
12#include "ui_set-alias-dialog.h"
13
14
15using namespace ndn;
16using namespace std;
17
18SetAliasDialog::SetAliasDialog(QWidget *parent)
19 : QDialog(parent)
20 , ui(new Ui::SetAliasDialog)
21{
22 ui->setupUi(this);
23
24 connect(ui->okButton, SIGNAL(clicked()),
25 this, SLOT(onOkClicked()));
26 connect(ui->cancelButton, SIGNAL(clicked()),
27 this, SLOT(onCancelClicked()));
28}
29
30SetAliasDialog::~SetAliasDialog()
31{
32 delete ui;
33}
34
35void
36SetAliasDialog::onOkClicked()
37{
38 emit aliasChanged(m_targetIdentity, ui->aliasInput->text());
39 this->close();
40}
41
42void
43SetAliasDialog::onCancelClicked()
44{
45 this->close();
46}
47
48void
49SetAliasDialog::setTargetIdentity(const QString& targetIdentity, const QString& alias)
50{
51 m_targetIdentity = targetIdentity;
52 QString msg = QString("Set alias for %1:").arg(targetIdentity);
53 ui->introLabel->setText(msg);
54 ui->aliasInput->setText(alias);
55}
56
57
58#if WAF
59#include "set-alias-dialog.moc"
60#include "set-alias-dialog.cpp.moc"
61#endif