Mengjin Yan | 391d724 | 2014-08-28 20:51:55 -0700 | [diff] [blame] | 1 | /* -*- 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: Mengjin Yan <jane.yan0129@gmail.com> |
| 9 | * Author: Yingdi Yu <yingdi@cs.ucla.edu> |
| 10 | */ |
| 11 | #include "chatroom-discovery-view-dialog.hpp" |
| 12 | #include "ui_chatroom-discovery-view-dialog.h" |
| 13 | |
Yingdi Yu | eb692ac | 2015-02-10 18:46:18 -0800 | [diff] [blame] | 14 | namespace chronochat { |
Mengjin Yan | 391d724 | 2014-08-28 20:51:55 -0700 | [diff] [blame] | 15 | |
Mengjin Yan | 391d724 | 2014-08-28 20:51:55 -0700 | [diff] [blame] | 16 | using ndn::Name; |
| 17 | |
| 18 | ChatroomDiscoveryViewDialog::ChatroomDiscoveryViewDialog(QWidget* parent) |
| 19 | : QDialog(parent) |
| 20 | , ui(new Ui::ChatroomDiscoveryViewDialog) |
| 21 | { |
| 22 | ui->setupUi(this); |
| 23 | |
| 24 | ui->participantsBrowser->setReadOnly(true); |
| 25 | |
| 26 | connect(ui->closeButton, SIGNAL(clicked()), |
| 27 | this, SLOT(onCloseButtonClicked())); |
| 28 | } |
| 29 | |
| 30 | ChatroomDiscoveryViewDialog::~ChatroomDiscoveryViewDialog() |
| 31 | { |
| 32 | delete ui; |
| 33 | } |
| 34 | |
| 35 | void |
| 36 | ChatroomDiscoveryViewDialog::onCloseButtonClicked() |
| 37 | { |
| 38 | this->close(); |
| 39 | } |
| 40 | |
| 41 | void |
| 42 | ChatroomDiscoveryViewDialog::setChatroomName(QString chatroomName) |
| 43 | { |
| 44 | ui->chatroomNameLabel->setText("Chatroom Name: "+chatroomName); |
| 45 | } |
| 46 | |
| 47 | void |
| 48 | ChatroomDiscoveryViewDialog::setChatroomTrustModel(QString chatroomTrustModel) |
| 49 | { |
| 50 | ui->chatroomTrustModelLabel->setText("Chatroom Trust Model: "+chatroomTrustModel); |
| 51 | } |
| 52 | |
| 53 | void |
Qiuhan Ding | 5d98cc5 | 2014-10-30 15:17:53 -0700 | [diff] [blame] | 54 | ChatroomDiscoveryViewDialog::setChatroomParticipants(const std::list<Name>& participants) |
Mengjin Yan | 391d724 | 2014-08-28 20:51:55 -0700 | [diff] [blame] | 55 | { |
| 56 | QString content; |
Qiuhan Ding | 5d98cc5 | 2014-10-30 15:17:53 -0700 | [diff] [blame] | 57 | for (std::list<Name>::const_iterator it = participants.begin(); |
Mengjin Yan | 391d724 | 2014-08-28 20:51:55 -0700 | [diff] [blame] | 58 | it != participants.end(); it++) { |
| 59 | content.append(QString::fromStdString(it->toUri())).append("\n"); |
| 60 | } |
| 61 | |
| 62 | ui->participantsBrowser->setPlainText(content); |
| 63 | } |
| 64 | |
Yingdi Yu | eb692ac | 2015-02-10 18:46:18 -0800 | [diff] [blame] | 65 | } // namespace chronochat |
Mengjin Yan | 391d724 | 2014-08-28 20:51:55 -0700 | [diff] [blame] | 66 | |
| 67 | #if WAF |
| 68 | #include "chatroom-discovery-view-dialog.moc" |
| 69 | #endif |