blob: 160275f7a9e78980441a9376bee87781e7ae3112 [file] [log] [blame]
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2020, 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 "start-chat-dialog.hpp"
#include "ui_start-chat-dialog.h"
namespace chronochat {
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::setChatroom(const std::string& chatroom)
{
ui->chatroomInput->setText(QString::fromStdString(chatroom));
}
void
StartChatDialog::onOkClicked()
{
QString chatroom = ui->chatroomInput->text();
bool secured = false;
// bool secured = ui->withSecurity->isChecked();
emit startChatroom(chatroom, secured);
this->close();
}
void
StartChatDialog::onCancelClicked()
{
this->close();
}
} // namespace chronochat
#if WAF
#include "start-chat-dialog.moc"
#endif