blob: 64795c06ba3561fca1403aebdde77361b3f3b055 [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;
Yingdi Yue35bdb82013-11-07 11:32:40 -080036 ui->chatroomInput->setText(QString::fromStdString(chatroom));
Yingdi Yu595aadc2013-10-21 15:01:40 -070037}
38
39void
40StartChatDialog::onOkClicked()
41{
42 QString chatroom = ui->chatroomInput->text();
Yingdi Yue35bdb82013-11-07 11:32:40 -080043 QString invitee = QString::fromStdString(m_invitee);
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