blob: bea269344e8689c9a810b3393c52469700e434bd [file] [log] [blame]
Yingdi Yudaceb8a2013-10-22 23:42:16 -07001/* -*- 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 "invitationdialog.h"
13#include "ui_invitationdialog.h"
14
15using namespace std;
16
17InvitationDialog::InvitationDialog(QWidget *parent) :
18 QDialog(parent),
19 ui(new Ui::InvitationDialog)
20{
21 ui->setupUi(this);
22}
23
24InvitationDialog::~InvitationDialog()
25{
26 delete ui;
27}
28
29void
30InvitationDialog::setMsg(const string& inviter, const string& chatroom)
31{
32 string msg = inviter;
33 msg.append(" invites you to join the chat room: ");
34
35 ui->msgLabel->setText(QString::fromUtf8(msg.c_str()));
36 ui->chatroomLine->setText(QString::fromUtf8(msg.c_str()));
37}
38
39void
40InvitationDialog::onOkClicked()
41{ emit invitationAccepted(m_interestName); }
42
43void
44InvitationDialog::onCancelClicked()
45{
46 ui->msgLabel->clear();
47 ui->chatroomLine->clear();
48 m_interestName = Name();
49 emit invitationRejected(m_interestName);
50}
51
52#if WAF
53#include "invitationdialog.moc"
54#include "invitationdialog.cpp.moc"
55#endif