blob: 444f9c7b019e866e8b77aad397c3739efd295932 [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()
Yingdi Yufa4ce792014-02-06 18:09:22 -080028{ delete ui; }
Yingdi Yu595aadc2013-10-21 15:01:40 -070029
30void
Yingdi Yufa4ce792014-02-06 18:09:22 -080031StartChatDialog::setChatroom(const string& chatroom)
32{ ui->chatroomInput->setText(QString::fromStdString(chatroom)); }
Yingdi Yu595aadc2013-10-21 15:01:40 -070033
Yingdi Yufa4ce792014-02-06 18:09:22 -080034void
Yingdi Yu595aadc2013-10-21 15:01:40 -070035StartChatDialog::onOkClicked()
36{
37 QString chatroom = ui->chatroomInput->text();
Yingdi Yufa4ce792014-02-06 18:09:22 -080038 emit chatroomConfirmed(chatroom);
Yingdi Yu595aadc2013-10-21 15:01:40 -070039 this->close();
40}
41
42void
43StartChatDialog::onCancelClicked()
44{ this->close(); }
45
Yingdi Yu595aadc2013-10-21 15:01:40 -070046#if WAF
47#include "startchatdialog.moc"
48#include "startchatdialog.cpp.moc"
49#endif