blob: 561096a7e0123e56d8601b3b4231eda741ddd4c5 [file] [log] [blame]
Yingdi Yu595aadc2013-10-21 15:01:40 -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#include "startchatdialog.h"
12#include "ui_startchatdialog.h"
13
14using namespace std;
15
16StartChatDialog::StartChatDialog(QWidget *parent) :
17 QDialog(parent),
18 ui(new Ui::StartChatDialog)
19{
20 ui->setupUi(this);
21 connect(ui->okButton, SIGNAL(clicked()),
22 this, SLOT(onOkClicked()));
23 connect(ui->cancelButton, SIGNAL(clicked()),
24 this, SLOT(onCancelClicked()));
25}
26
27StartChatDialog::~StartChatDialog()
28{
29 delete ui;
30}
31
32void
33StartChatDialog::setInvitee(const string& invitee, const string& chatroom)
34{
35 m_invitee = invitee;
36 ui->chatroomInput->setText(QString::fromUtf8(chatroom.c_str()));
37}
38
39void
40StartChatDialog::onOkClicked()
41{
42 QString chatroom = ui->chatroomInput->text();
43 QString invitee = QString::fromUtf8(m_invitee.c_str());
44 bool isIntroducer = ui->introCheckBox->isChecked();
45 emit chatroomConfirmed(chatroom, invitee, isIntroducer);
46 this->close();
47}
48
49void
50StartChatDialog::onCancelClicked()
51{ this->close(); }
52
53
54#if WAF
55#include "startchatdialog.moc"
56#include "startchatdialog.cpp.moc"
57#endif