blob: 8be49fcfbd75fa384901dd785aa0aa880985bbfd [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
12#include "invitation-dialog.h"
13#include "ui_invitation-dialog.h"
14
15using namespace std;
16using namespace ndn;
17
18InvitationDialog::InvitationDialog(QWidget *parent)
19 : QDialog(parent)
20 , ui(new Ui::InvitationDialog)
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
30InvitationDialog::~InvitationDialog()
31{
32 delete ui;
33}
34
35void
36InvitationDialog::setInvitation(const string& alias,
37 const string& chatroom,
38 const Name& interestName)
39{
40 string msg = alias;
41 msg.append(" invites you to: ").append(chatroom);
42 ui->msgLabel->setText(QString::fromStdString(msg));
43}
44
45void
46InvitationDialog::onOkClicked()
47{
48 emit invitationResponded(m_invitationInterest, true);
49 this->close();
50
51 ui->msgLabel->clear();
52 m_invitationInterest.clear();
53}
54
55void
56InvitationDialog::onCancelClicked()
57{
58 emit invitationResponded(m_invitationInterest, false);
59 this->close();
60
61 ui->msgLabel->clear();
62 m_invitationInterest.clear();
63}
64
65#if WAF
66#include "invitation-dialog.moc"
67#include "invitation-dialog.cpp.moc"
68#endif