blob: 02d88f0e43711fd99a53128ac2358eaecdce5e4c [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());
Yingdi Yu7989eb22013-10-31 17:38:22 -070044 // bool isIntroducer = ui->introCheckBox->isChecked();
45 bool isIntroducer = true;
Yingdi Yu595aadc2013-10-21 15:01:40 -070046 emit chatroomConfirmed(chatroom, invitee, isIntroducer);
47 this->close();
48}
49
50void
51StartChatDialog::onCancelClicked()
52{ this->close(); }
53
54
55#if WAF
56#include "startchatdialog.moc"
57#include "startchatdialog.cpp.moc"
58#endif