Yingdi Yu | daceb8a | 2013-10-22 23:42:16 -0700 | [diff] [blame^] | 1 | /* -*- 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 | |
| 15 | using namespace std; |
| 16 | |
| 17 | InvitationDialog::InvitationDialog(QWidget *parent) : |
| 18 | QDialog(parent), |
| 19 | ui(new Ui::InvitationDialog) |
| 20 | { |
| 21 | ui->setupUi(this); |
| 22 | } |
| 23 | |
| 24 | InvitationDialog::~InvitationDialog() |
| 25 | { |
| 26 | delete ui; |
| 27 | } |
| 28 | |
| 29 | void |
| 30 | InvitationDialog::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 | |
| 39 | void |
| 40 | InvitationDialog::onOkClicked() |
| 41 | { emit invitationAccepted(m_interestName); } |
| 42 | |
| 43 | void |
| 44 | InvitationDialog::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 |