| /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| /* |
| * Copyright (c) 2013, Regents of the University of California |
| * Yingdi Yu |
| * |
| * BSD license, See the LICENSE file for more information |
| * |
| * Author: Yingdi Yu <yingdi@cs.ucla.edu> |
| */ |
| |
| #include "startchatdialog.h" |
| #include "ui_startchatdialog.h" |
| |
| using namespace std; |
| |
| StartChatDialog::StartChatDialog(QWidget *parent) : |
| QDialog(parent), |
| ui(new Ui::StartChatDialog) |
| { |
| ui->setupUi(this); |
| connect(ui->okButton, SIGNAL(clicked()), |
| this, SLOT(onOkClicked())); |
| connect(ui->cancelButton, SIGNAL(clicked()), |
| this, SLOT(onCancelClicked())); |
| } |
| |
| StartChatDialog::~StartChatDialog() |
| { |
| delete ui; |
| } |
| |
| void |
| StartChatDialog::setInvitee(const string& invitee, const string& chatroom) |
| { |
| m_invitee = invitee; |
| ui->chatroomInput->setText(QString::fromStdString(chatroom)); |
| } |
| |
| void |
| StartChatDialog::onOkClicked() |
| { |
| QString chatroom = ui->chatroomInput->text(); |
| QString invitee = QString::fromStdString(m_invitee); |
| // bool isIntroducer = ui->introCheckBox->isChecked(); |
| bool isIntroducer = true; |
| emit chatroomConfirmed(chatroom, invitee, isIntroducer); |
| this->close(); |
| } |
| |
| void |
| StartChatDialog::onCancelClicked() |
| { this->close(); } |
| |
| |
| #if WAF |
| #include "startchatdialog.moc" |
| #include "startchatdialog.cpp.moc" |
| #endif |