blob: b0593c9fd98daff87073723e8b6bd71f1ceaecd3 [file] [log] [blame]
Mengjin Yan391d7242014-08-28 20:51:55 -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: 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 Yueb692ac2015-02-10 18:46:18 -080014namespace chronochat {
Mengjin Yan391d7242014-08-28 20:51:55 -070015
Mengjin Yan391d7242014-08-28 20:51:55 -070016using ndn::Name;
17
18ChatroomDiscoveryViewDialog::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
30ChatroomDiscoveryViewDialog::~ChatroomDiscoveryViewDialog()
31{
32 delete ui;
33}
34
35void
36ChatroomDiscoveryViewDialog::onCloseButtonClicked()
37{
38 this->close();
39}
40
41void
42ChatroomDiscoveryViewDialog::setChatroomName(QString chatroomName)
43{
44 ui->chatroomNameLabel->setText("Chatroom Name: "+chatroomName);
45}
46
47void
48ChatroomDiscoveryViewDialog::setChatroomTrustModel(QString chatroomTrustModel)
49{
50 ui->chatroomTrustModelLabel->setText("Chatroom Trust Model: "+chatroomTrustModel);
51}
52
53void
Qiuhan Ding5d98cc52014-10-30 15:17:53 -070054ChatroomDiscoveryViewDialog::setChatroomParticipants(const std::list<Name>& participants)
Mengjin Yan391d7242014-08-28 20:51:55 -070055{
56 QString content;
Qiuhan Ding5d98cc52014-10-30 15:17:53 -070057 for (std::list<Name>::const_iterator it = participants.begin();
Mengjin Yan391d7242014-08-28 20:51:55 -070058 it != participants.end(); it++) {
59 content.append(QString::fromStdString(it->toUri())).append("\n");
60 }
61
62 ui->participantsBrowser->setPlainText(content);
63}
64
Yingdi Yueb692ac2015-02-10 18:46:18 -080065} // namespace chronochat
Mengjin Yan391d7242014-08-28 20:51:55 -070066
67#if WAF
68#include "chatroom-discovery-view-dialog.moc"
69#endif