blob: a475c168b4d3a1cab070f1415fff3bfe2a3acde7 [file] [log] [blame]
Yingdi Yu348f5ea2014-03-01 14:47:25 -08001/* -*- 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: Zhenkai Zhu <zhenkai@cs.ucla.edu>
9 * Alexander Afanasyev <alexander.afanasyev@ucla.edu>
10 * Yingdi Yu <yingdi@cs.ucla.edu>
11 */
12
Yingdi Yu0b0a7362014-08-05 16:31:30 -070013#include "chat-dialog.hpp"
Yingdi Yu348f5ea2014-03-01 14:47:25 -080014#include "ui_chat-dialog.h"
15
16#include <QScrollBar>
17#include <QMessageBox>
18#include <QCloseEvent>
19
Yingdi Yud45777b2014-10-16 23:54:11 -070020Q_DECLARE_METATYPE(ndn::Name)
21Q_DECLARE_METATYPE(time_t)
22Q_DECLARE_METATYPE(std::vector<chronos::NodeInfo>)
Yingdi Yu0b0a7362014-08-05 16:31:30 -070023
24namespace chronos {
25
Yingdi Yud45777b2014-10-16 23:54:11 -070026static const Name PRIVATE_PREFIX("/private/local");
27static const uint8_t ROUTING_HINT_SEPARATOR[2] = {0xF0, 0x2E}; // %F0.
Yingdi Yu0b0a7362014-08-05 16:31:30 -070028
Yingdi Yud45777b2014-10-16 23:54:11 -070029ChatDialog::ChatDialog(const Name& chatroomPrefix,
30 const Name& userChatPrefix,
31 const Name& routingPrefix,
32 const std::string& chatroomName,
Yingdi Yu17032f82014-03-25 15:48:23 -070033 const std::string& nick,
Yingdi Yud45777b2014-10-16 23:54:11 -070034 bool isSecured,
Yingdi Yufa0b6a02014-04-30 14:26:42 -070035 QWidget* parent)
Yingdi Yu348f5ea2014-03-01 14:47:25 -080036 : QDialog(parent)
37 , ui(new Ui::ChatDialog)
Yingdi Yud45777b2014-10-16 23:54:11 -070038 , m_backend(chatroomPrefix, userChatPrefix, routingPrefix, chatroomName, nick)
39 , m_chatroomName(chatroomName)
40 , m_nick(nick.c_str())
41 , m_isSecured(isSecured)
Yingdi Yu348f5ea2014-03-01 14:47:25 -080042{
Yingdi Yud45777b2014-10-16 23:54:11 -070043 qRegisterMetaType<ndn::Name>("ndn::Name");
44 qRegisterMetaType<time_t>("time_t");
45 qRegisterMetaType<std::vector<chronos::NodeInfo> >("std::vector<chronos::NodeInfo>");
Yingdi Yu348f5ea2014-03-01 14:47:25 -080046
47 m_scene = new DigestTreeScene(this);
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -070048 m_trustScene = new TrustTreeScene(this);
Yingdi Yu348f5ea2014-03-01 14:47:25 -080049 m_rosterModel = new QStringListModel(this);
Yingdi Yu348f5ea2014-03-01 14:47:25 -080050
51 ui->setupUi(this);
Yingdi Yud45777b2014-10-16 23:54:11 -070052
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -070053 ui->syncTreeViewer->setScene(m_scene);
Yingdi Yu348f5ea2014-03-01 14:47:25 -080054 m_scene->setSceneRect(m_scene->itemsBoundingRect());
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -070055 ui->syncTreeViewer->hide();
Yingdi Yud45777b2014-10-16 23:54:11 -070056
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -070057 ui->trustTreeViewer->setScene(m_trustScene);
58 m_trustScene->setSceneRect(m_trustScene->itemsBoundingRect());
59 ui->trustTreeViewer->hide();
Yingdi Yud45777b2014-10-16 23:54:11 -070060
Yingdi Yu348f5ea2014-03-01 14:47:25 -080061 ui->listView->setModel(m_rosterModel);
62
Yingdi Yud45777b2014-10-16 23:54:11 -070063 Name routablePrefix;
Yingdi Yud85e29f2014-09-09 17:20:04 -070064
Yingdi Yud45777b2014-10-16 23:54:11 -070065 if (routingPrefix.isPrefixOf(userChatPrefix))
66 routablePrefix = userChatPrefix;
67 else
68 routablePrefix.append(routingPrefix)
69 .append(ROUTING_HINT_SEPARATOR, 2)
70 .append(userChatPrefix);
Yingdi Yud85e29f2014-09-09 17:20:04 -070071
Yingdi Yud45777b2014-10-16 23:54:11 -070072 updateLabels(routablePrefix);
Yingdi Yu348f5ea2014-03-01 14:47:25 -080073
Yingdi Yud45777b2014-10-16 23:54:11 -070074 QStringList roster;
75 roster << "- " + m_nick;
76 m_rosterModel->setStringList(roster);
77
78 // When backend receives a sync update, notify frontend to update sync tree
79 connect(&m_backend, SIGNAL(syncTreeUpdated(std::vector<chronos::NodeInfo>, QString)),
80 this, SLOT(updateSyncTree(std::vector<chronos::NodeInfo>, QString)));
81
82 // When backend receives a new chat message, notify frontent to print it out.
83 connect(&m_backend, SIGNAL(chatMessageReceived(QString, QString, time_t)),
84 this, SLOT(receiveChatMessage(QString, QString, time_t)));
85
86 // When backend detects a new session, notify frontend to print the message.
87 connect(&m_backend, SIGNAL(sessionAdded(QString, QString, time_t)),
88 this, SLOT(addSession(QString, QString, time_t)));
89
90 // When backend detects a deleted session, notify frontend to print the message.
91 connect(&m_backend, SIGNAL(sessionRemoved(QString, QString, time_t)),
92 this, SLOT(removeSession(QString, QString, time_t)));
93
94 // When backend detects nick changed, notify frontend to print the new nick
95 connect(&m_backend, SIGNAL(nickUpdated(QString, QString)),
96 this, SLOT(updateNick(QString, QString)));
97
98 // When backend receives a new message, notify frontend to print notification
99 connect(&m_backend, SIGNAL(messageReceived(QString)),
100 this, SLOT(receiveMessage(QString)));
101
102 // When backend updates prefix, notify frontend to update labels.
103 connect(&m_backend, SIGNAL(chatPrefixChanged(ndn::Name)),
104 this, SLOT(updateLabels(ndn::Name)));
105
106 // When frontend gets a message to send, notify backend.
107 connect(this, SIGNAL(msgToSent(QString, time_t)),
108 &m_backend, SLOT(sendChatMessage(QString, time_t)));
109
110 // When frontend gets a shutdown command, notify backend.
111 connect(this, SIGNAL(shutdownBackend()),
112 &m_backend, SLOT(shutdown()));
113
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800114 m_scene->plot("Empty");
115
Yingdi Yufa0b6a02014-04-30 14:26:42 -0700116 connect(ui->lineEdit, SIGNAL(returnPressed()),
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800117 this, SLOT(onReturnPressed()));
Yingdi Yufa0b6a02014-04-30 14:26:42 -0700118 connect(ui->syncTreeButton, SIGNAL(pressed()),
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -0700119 this, SLOT(onSyncTreeButtonPressed()));
Yingdi Yufa0b6a02014-04-30 14:26:42 -0700120 connect(ui->trustTreeButton, SIGNAL(pressed()),
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -0700121 this, SLOT(onTrustTreeButtonPressed()));
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800122
Yingdi Yud45777b2014-10-16 23:54:11 -0700123 disableSyncTreeDisplay();
124 QTimer::singleShot(2200, this, SLOT(enableSyncTreeDisplay()));
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800125
Yingdi Yud45777b2014-10-16 23:54:11 -0700126 m_backend.start();
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800127}
128
129
130ChatDialog::~ChatDialog()
131{
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800132}
133
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800134void
135ChatDialog::closeEvent(QCloseEvent *e)
136{
Yingdi Yud45777b2014-10-16 23:54:11 -0700137 // When close button is clicked, do not close the dialog immediately.
138
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800139 QMessageBox::information(this, tr("ChronoChat"),
140 tr("The chatroom will keep running in the "
141 "system tray. To close the chatroom, "
142 "choose <b>Close chatroom</b> in the "
143 "context memu of the system tray entry."));
Yingdi Yue8323b62014-09-02 17:24:15 -0700144 hide();
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800145 e->ignore();
146}
147
148void
Yingdi Yu233a9722014-03-07 15:47:09 -0800149ChatDialog::changeEvent(QEvent *e)
150{
Yingdi Yu0b0a7362014-08-05 16:31:30 -0700151 switch(e->type()) {
Yingdi Yu233a9722014-03-07 15:47:09 -0800152 case QEvent::ActivationChange:
Yingdi Yu0b0a7362014-08-05 16:31:30 -0700153 if (isActiveWindow()) {
Yingdi Yu233a9722014-03-07 15:47:09 -0800154 emit resetIcon();
155 }
156 break;
157 default:
158 break;
159 }
160}
161
162void
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800163ChatDialog::resizeEvent(QResizeEvent *e)
164{
165 fitView();
166}
167
168void
169ChatDialog::showEvent(QShowEvent *e)
170{
171 fitView();
172}
173
Yingdi Yud45777b2014-10-16 23:54:11 -0700174shared_ptr<ChatroomInfo>
175ChatDialog::getChatroomInfo()
176{
177 shared_ptr<ChatroomInfo> chatroomInfo = make_shared<ChatroomInfo>();
178
179 chatroomInfo->setName(Name::Component(m_chatroomName));
180
181 QStringList prefixList = m_scene->getRosterPrefixList();
182 for(QStringList::iterator it = prefixList.begin();
183 it != prefixList.end(); ++it ) {
184 Name participant = Name(it->toStdString()).getPrefix(-3);
185 chatroomInfo->addParticipant(participant);
186 }
187
188 if (m_isSecured)
189 chatroomInfo->setTrustModel(ChatroomInfo::TRUST_MODEL_WEBOFTRUST);
190 else
191 chatroomInfo->setTrustModel(ChatroomInfo::TRUST_MODEL_NONE);
192 return chatroomInfo;
193}
194
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800195// private methods:
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -0700196void ChatDialog::disableSyncTreeDisplay()
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800197{
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -0700198 ui->syncTreeButton->setEnabled(false);
199 ui->syncTreeViewer->hide();
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800200 fitView();
201}
202
203void
Yingdi Yud45777b2014-10-16 23:54:11 -0700204ChatDialog::appendChatMessage(const QString& nick, const QString& text, time_t timestamp)
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800205{
Yingdi Yud45777b2014-10-16 23:54:11 -0700206 QTextCharFormat nickFormat;
207 nickFormat.setForeground(Qt::darkGreen);
208 nickFormat.setFontWeight(QFont::Bold);
209 nickFormat.setFontUnderline(true);
210 nickFormat.setUnderlineColor(Qt::gray);
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800211
Yingdi Yud45777b2014-10-16 23:54:11 -0700212 // Print who & when
213 QTextCursor cursor(ui->textEdit->textCursor());
214 cursor.movePosition(QTextCursor::End);
215 QTextTableFormat tableFormat;
216 tableFormat.setBorder(0);
217 QTextTable *table = cursor.insertTable(1, 2, tableFormat);
218 QString from = QString("%1 ").arg(nick);
219 QTextTableCell fromCell = table->cellAt(0, 0);
220 fromCell.setFormat(nickFormat);
221 fromCell.firstCursorPosition().insertText(from);
222 printTimeInCell(table, timestamp);
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800223
Yingdi Yud45777b2014-10-16 23:54:11 -0700224 // Print what
225 QTextCursor nextCursor(ui->textEdit->textCursor());
226 nextCursor.movePosition(QTextCursor::End);
227 table = nextCursor.insertTable(1, 1, tableFormat);
228 table->cellAt(0, 0).firstCursorPosition().insertText(text);
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800229
Yingdi Yud45777b2014-10-16 23:54:11 -0700230 // Popup notification
231 showMessage(from, text);
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800232
233 QScrollBar *bar = ui->textEdit->verticalScrollBar();
234 bar->setValue(bar->maximum());
235}
236
237void
Yingdi Yud45777b2014-10-16 23:54:11 -0700238ChatDialog::appendControlMessage(const QString& nick,
239 const QString& action,
240 time_t timestamp)
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800241{
Yingdi Yud45777b2014-10-16 23:54:11 -0700242 QTextCharFormat nickFormat;
243 nickFormat.setForeground(Qt::gray);
244 nickFormat.setFontWeight(QFont::Bold);
245 nickFormat.setFontUnderline(true);
246 nickFormat.setUnderlineColor(Qt::gray);
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800247
Yingdi Yud45777b2014-10-16 23:54:11 -0700248 QTextCursor cursor(ui->textEdit->textCursor());
249 cursor.movePosition(QTextCursor::End);
250 QTextTableFormat tableFormat;
251 tableFormat.setBorder(0);
252 QTextTable *table = cursor.insertTable(1, 2, tableFormat);
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800253
Yingdi Yud45777b2014-10-16 23:54:11 -0700254 QString controlMsg = QString("%1 %2 ").arg(nick).arg(action);
255 QTextTableCell fromCell = table->cellAt(0, 0);
256 fromCell.setFormat(nickFormat);
257 fromCell.firstCursorPosition().insertText(controlMsg);
258 printTimeInCell(table, timestamp);
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800259}
260
261QString
262ChatDialog::formatTime(time_t timestamp)
263{
264 struct tm *tm_time = localtime(&timestamp);
265 int hour = tm_time->tm_hour;
266 QString amOrPM;
Yingdi Yu0b0a7362014-08-05 16:31:30 -0700267 if (hour > 12) {
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800268 hour -= 12;
269 amOrPM = "PM";
270 }
Yingdi Yu0b0a7362014-08-05 16:31:30 -0700271 else {
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800272 amOrPM = "AM";
Yingdi Yu0b0a7362014-08-05 16:31:30 -0700273 if (hour == 0) {
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800274 hour = 12;
275 }
276 }
277
278 char textTime[12];
Yingdi Yu0b0a7362014-08-05 16:31:30 -0700279 sprintf(textTime, "%d:%02d:%02d %s",
280 hour, tm_time->tm_min, tm_time->tm_sec, amOrPM.toStdString().c_str());
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800281 return QString(textTime);
282}
283
284void
285ChatDialog::printTimeInCell(QTextTable *table, time_t timestamp)
286{
287 QTextCharFormat timeFormat;
288 timeFormat.setForeground(Qt::gray);
289 timeFormat.setFontUnderline(true);
290 timeFormat.setUnderlineColor(Qt::gray);
291 QTextTableCell timeCell = table->cellAt(0, 1);
292 timeCell.setFormat(timeFormat);
293 timeCell.firstCursorPosition().insertText(formatTime(timestamp));
294}
295
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800296void
297ChatDialog::showMessage(const QString& from, const QString& data)
298{
299 if (!isActiveWindow())
300 emit showChatMessage(QString::fromStdString(m_chatroomName),
301 from, data);
302}
303
304void
305ChatDialog::fitView()
306{
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800307 QRectF rect = m_scene->itemsBoundingRect();
308 m_scene->setSceneRect(rect);
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -0700309 ui->syncTreeViewer->fitInView(m_scene->itemsBoundingRect(), Qt::KeepAspectRatio);
310
311 QRectF trustRect = m_trustScene->itemsBoundingRect();
312 m_trustScene->setSceneRect(trustRect);
313 ui->trustTreeViewer->fitInView(m_trustScene->itemsBoundingRect(), Qt::KeepAspectRatio);
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800314}
315
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800316// public slots:
317void
Yingdi Yue8323b62014-09-02 17:24:15 -0700318ChatDialog::onShow()
319{
320 this->show();
321 this->raise();
322 this->activateWindow();
323}
324
325void
Yingdi Yud45777b2014-10-16 23:54:11 -0700326ChatDialog::shutdown()
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800327{
Yingdi Yud45777b2014-10-16 23:54:11 -0700328 if (m_backend.isRunning()) {
329 emit shutdownBackend();
330 m_backend.wait();
331 }
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800332 hide();
333 emit closeChatDialog(QString::fromStdString(m_chatroomName));
334}
335
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800336// private slots:
337void
Yingdi Yud45777b2014-10-16 23:54:11 -0700338ChatDialog::updateSyncTree(std::vector<chronos::NodeInfo> updates, QString rootDigest)
339{
340 m_scene->processSyncUpdate(updates, rootDigest);
341}
342
343void
344ChatDialog::receiveChatMessage(QString nick, QString text, time_t timestamp)
345{
346 appendChatMessage(nick, text, timestamp);
347}
348
349void
350ChatDialog::addSession(QString sessionPrefix, QString nick, time_t timestamp)
351{
352 appendControlMessage(nick, "enters room", timestamp);
353 m_scene->updateNick(sessionPrefix, nick);
354 m_rosterModel->setStringList(m_scene->getRosterList());
355}
356
357void
358ChatDialog::removeSession(QString sessionPrefix, QString nick, time_t timestamp)
359{
360 appendControlMessage(nick, "leaves room", timestamp);
361 m_scene->removeNode(sessionPrefix);
362 m_rosterModel->setStringList(m_scene->getRosterList());
363}
364
365void
366ChatDialog::updateNick(QString sessionPrefix, QString nick)
367{
368 m_scene->updateNick(sessionPrefix, nick);
369 m_rosterModel->setStringList(m_scene->getRosterList());
370}
371
372void
373ChatDialog::receiveMessage(QString sessionPrefix)
374{
375 m_scene->messageReceived(sessionPrefix);
376}
377
378void
379ChatDialog::updateLabels(Name newChatPrefix)
380{
381 // Reset DigestTree
382 m_scene->clearAll();
383 m_scene->plot("Empty");
384
385 // Display chatroom name
386 QString chatroomName = QString("Chatroom: %1").arg(QString::fromStdString(m_chatroomName));
387 ui->infoLabel->setStyleSheet("QLabel {color: #630; font-size: 16px; font: bold \"Verdana\";}");
388 ui->infoLabel->setText(chatroomName);
389
390 // Display chat message prefix
391 QString chatPrefix;
392 if (PRIVATE_PREFIX.isPrefixOf(newChatPrefix)) {
393 chatPrefix =
394 QString("<Warning: no connection to hub or hub does not support prefix autoconfig.>\n"
395 "<Prefix = %1>")
396 .arg(QString::fromStdString(newChatPrefix.toUri()));
397 ui->prefixLabel->setStyleSheet(
398 "QLabel {color: red; font-size: 12px; font: bold \"Verdana\";}");
399 }
400 else {
401 chatPrefix = QString("<Prefix = %1>")
402 .arg(QString::fromStdString(newChatPrefix.toUri()));
403 ui->prefixLabel->setStyleSheet(
404 "QLabel {color: Green; font-size: 12px; font: bold \"Verdana\";}");
405 }
406 ui->prefixLabel->setText(chatPrefix);
407}
408
409void
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800410ChatDialog::onReturnPressed()
411{
412 QString text = ui->lineEdit->text();
Yingdi Yud45777b2014-10-16 23:54:11 -0700413
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800414 if (text.isEmpty())
415 return;
416
417 ui->lineEdit->clear();
418
Yingdi Yud45777b2014-10-16 23:54:11 -0700419 time_t timestamp =
420 static_cast<time_t>(time::toUnixTimestamp(time::system_clock::now()).count() / 1000);
421 // appendChatMessage(m_nick, text, timestamp);
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800422
Yingdi Yud45777b2014-10-16 23:54:11 -0700423 emit msgToSent(text, timestamp);
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800424
425 fitView();
426}
427
Yingdi Yufa0b6a02014-04-30 14:26:42 -0700428void
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -0700429ChatDialog::onSyncTreeButtonPressed()
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800430{
Yingdi Yu0b0a7362014-08-05 16:31:30 -0700431 if (ui->syncTreeViewer->isVisible()) {
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -0700432 ui->syncTreeViewer->hide();
433 ui->syncTreeButton->setText("Show ChronoSync Tree");
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800434 }
Yingdi Yu0b0a7362014-08-05 16:31:30 -0700435 else {
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -0700436 ui->syncTreeViewer->show();
437 ui->syncTreeButton->setText("Hide ChronoSync Tree");
438 }
439
440 fitView();
441}
442
443void
444ChatDialog::onTrustTreeButtonPressed()
445{
Yingdi Yu0b0a7362014-08-05 16:31:30 -0700446 if (ui->trustTreeViewer->isVisible()) {
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -0700447 ui->trustTreeViewer->hide();
448 ui->trustTreeButton->setText("Show Trust Tree");
449 }
Yingdi Yu0b0a7362014-08-05 16:31:30 -0700450 else {
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -0700451 ui->trustTreeViewer->show();
452 ui->trustTreeButton->setText("Hide Trust Tree");
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800453 }
454
455 fitView();
456}
457
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -0700458void ChatDialog::enableSyncTreeDisplay()
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800459{
Yingdi Yuf4aaa8b2014-03-10 11:24:31 -0700460 ui->syncTreeButton->setEnabled(true);
Yingdi Yud45777b2014-10-16 23:54:11 -0700461 ui->syncTreeViewer->show();
462 fitView();
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800463}
464
Yingdi Yu0b0a7362014-08-05 16:31:30 -0700465} // namespace chronos
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800466
Mengjin Yanaec70742014-08-25 10:37:45 -0700467
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800468#if WAF
469#include "chat-dialog.moc"
Yingdi Yu42125862014-08-07 17:04:28 -0700470// #include "chat-dialog.cpp.moc"
Yingdi Yu348f5ea2014-03-01 14:47:25 -0800471#endif