Yingdi Yu | 0484223 | 2013-10-23 14:03:09 -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 | * |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 8 | * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu> |
| 9 | * Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
| 10 | * Yingdi Yu <yingdi@cs.ucla.edu> |
Yingdi Yu | 0484223 | 2013-10-23 14:03:09 -0700 | [diff] [blame] | 11 | */ |
| 12 | |
| 13 | #ifndef CHATDIALOG_H |
| 14 | #define CHATDIALOG_H |
| 15 | |
| 16 | #include <QDialog> |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 17 | #include <QTextTable> |
| 18 | #include <QStringListModel> |
| 19 | #include <QTimer> |
Yingdi Yu | a059409 | 2013-11-06 22:07:38 -0800 | [diff] [blame] | 20 | #include <QSystemTrayIcon> |
Yingdi Yu | 07b5b09 | 2013-11-07 17:00:54 -0800 | [diff] [blame] | 21 | #include <QMenu> |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 22 | |
| 23 | #include "invitelistdialog.h" |
Yingdi Yu | 0484223 | 2013-10-23 14:03:09 -0700 | [diff] [blame] | 24 | |
| 25 | #ifndef Q_MOC_RUN |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 26 | #include <ndn-cpp/data.hpp> |
| 27 | #include <ndn-cpp/face.hpp> |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame^] | 28 | #include <ndn-cpp/security/key-chain.hpp> |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 29 | #include "invitation-policy-manager.h" |
Yingdi Yu | c4d08d2 | 2013-10-23 23:07:29 -0700 | [diff] [blame] | 30 | #include "contact-item.h" |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 31 | |
Alexander Afanasyev | 4f04c55 | 2013-11-07 15:30:05 -0800 | [diff] [blame] | 32 | #include <sync-socket.h> |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 33 | #include <sync-seq-no.h> |
| 34 | #include "chatbuf.pb.h" |
| 35 | #include "digesttreescene.h" |
Yingdi Yu | accbda9 | 2013-12-27 08:44:12 +0800 | [diff] [blame] | 36 | |
| 37 | #include <boost/thread/locks.hpp> |
| 38 | #include <boost/thread/recursive_mutex.hpp> |
| 39 | #include <boost/thread/thread.hpp> |
Yingdi Yu | 0484223 | 2013-10-23 14:03:09 -0700 | [diff] [blame] | 40 | #endif |
| 41 | |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 42 | typedef ndn::func_lib::function<void()> OnEventualTimeout; |
| 43 | |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 44 | #define MAX_HISTORY_ENTRY 20 |
| 45 | |
Yingdi Yu | 0484223 | 2013-10-23 14:03:09 -0700 | [diff] [blame] | 46 | namespace Ui { |
| 47 | class ChatDialog; |
| 48 | } |
| 49 | |
| 50 | class ChatDialog : public QDialog |
| 51 | { |
| 52 | Q_OBJECT |
| 53 | |
| 54 | public: |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 55 | explicit ChatDialog(ndn::ptr_lib::shared_ptr<ContactManager> contactManager, |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 56 | const ndn::Name& chatroomPrefix, |
Yingdi Yu | 0484223 | 2013-10-23 14:03:09 -0700 | [diff] [blame] | 57 | const ndn::Name& localPrefix, |
Yingdi Yu | c4d08d2 | 2013-10-23 23:07:29 -0700 | [diff] [blame] | 58 | const ndn::Name& defaultIdentity, |
Yingdi Yu | 4237244 | 2013-11-06 18:43:31 -0800 | [diff] [blame] | 59 | const std::string& nick, |
| 60 | bool trial = false, |
Yingdi Yu | 0484223 | 2013-10-23 14:03:09 -0700 | [diff] [blame] | 61 | QWidget *parent = 0); |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 62 | |
| 63 | // explicit ChatDialog(const ndn::Name& chatroomPrefix, |
| 64 | // const ndn::Name& localPrefix, |
| 65 | // const ndn::Name& defaultIdentity, |
| 66 | // const ndn::security::IdentityCertificate& identityCertificate, |
| 67 | // QWidget *parent = 0); |
| 68 | |
Yingdi Yu | 0484223 | 2013-10-23 14:03:09 -0700 | [diff] [blame] | 69 | ~ChatDialog(); |
| 70 | |
| 71 | const ndn::Name& |
| 72 | getChatroomPrefix() const |
| 73 | { return m_chatroomPrefix; } |
| 74 | |
| 75 | const ndn::Name& |
| 76 | getLocalPrefix() const |
| 77 | { return m_localPrefix; } |
| 78 | |
| 79 | void |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 80 | sendInvitation(ndn::ptr_lib::shared_ptr<ContactItem> contact, bool isIntroducer); |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 81 | |
| 82 | void |
| 83 | addTrustAnchor(const EndorseCertificate& selfEndorseCertificate); |
| 84 | |
| 85 | void |
| 86 | addChatDataRule(const ndn::Name& prefix, |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 87 | const ndn::IdentityCertificate& identityCertificate, |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 88 | bool isIntroducer); |
| 89 | |
| 90 | void |
| 91 | appendMessage(const SyncDemo::ChatMessage msg, bool isHistory = false); |
| 92 | |
| 93 | void |
| 94 | processTreeUpdateWrapper(const std::vector<Sync::MissingDataInfo>, Sync::SyncSocket *); |
| 95 | |
| 96 | void |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 97 | processDataWrapper(const ndn::ptr_lib::shared_ptr<ndn::Data>& data); |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 98 | |
| 99 | void |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 100 | processDataNoShowWrapper(const ndn::ptr_lib::shared_ptr<ndn::Data>& data); |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 101 | |
| 102 | void |
| 103 | processRemoveWrapper(std::string); |
Yingdi Yu | 0484223 | 2013-10-23 14:03:09 -0700 | [diff] [blame] | 104 | |
Yingdi Yu | a059409 | 2013-11-06 22:07:38 -0800 | [diff] [blame] | 105 | void |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 106 | publishIntroCert(const ndn::IdentityCertificate& dskCertificate, bool isIntroducer); |
Yingdi Yu | a059409 | 2013-11-06 22:07:38 -0800 | [diff] [blame] | 107 | |
Yingdi Yu | 4237244 | 2013-11-06 18:43:31 -0800 | [diff] [blame] | 108 | protected: |
Yingdi Yu | a059409 | 2013-11-06 22:07:38 -0800 | [diff] [blame] | 109 | void |
| 110 | closeEvent(QCloseEvent *e); |
| 111 | |
| 112 | void |
| 113 | changeEvent(QEvent *e); |
Yingdi Yu | 4237244 | 2013-11-06 18:43:31 -0800 | [diff] [blame] | 114 | |
Yingdi Yu | 0484223 | 2013-10-23 14:03:09 -0700 | [diff] [blame] | 115 | private: |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 116 | |
Yingdi Yu | accbda9 | 2013-12-27 08:44:12 +0800 | [diff] [blame] | 117 | void |
| 118 | startFace(); |
| 119 | |
| 120 | void |
| 121 | shutdownFace(); |
| 122 | |
| 123 | void |
| 124 | eventLoop(); |
| 125 | |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 126 | void |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 127 | connectToDaemon(); |
| 128 | |
| 129 | void |
| 130 | onConnectionData(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, |
| 131 | const ndn::ptr_lib::shared_ptr<ndn::Data>& data); |
| 132 | |
| 133 | void |
| 134 | onConnectionDataTimeout(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest); |
| 135 | |
| 136 | void |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 137 | initializeSetting(); |
| 138 | |
Yingdi Yu | 2ab22e7 | 2013-11-10 01:38:21 -0800 | [diff] [blame] | 139 | QString |
| 140 | getRandomString(); |
| 141 | |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 142 | void |
| 143 | updateLabels(); |
| 144 | |
Yingdi Yu | c4d08d2 | 2013-10-23 23:07:29 -0700 | [diff] [blame] | 145 | void |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 146 | initializeSync(); |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 147 | |
| 148 | void |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 149 | onTargetData(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, |
| 150 | const ndn::ptr_lib::shared_ptr<ndn::Data>& data, |
| 151 | int stepCount, |
| 152 | const ndn::OnVerified& onVerified, |
| 153 | const ndn::OnVerifyFailed& onVerifyFailed, |
| 154 | const OnEventualTimeout& timeoutNotify, |
| 155 | const ndn::ptr_lib::shared_ptr<ndn::PolicyManager>& policyManager); |
| 156 | |
| 157 | void |
| 158 | onTargetTimeout(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, |
| 159 | int retry, |
| 160 | int stepCount, |
| 161 | const ndn::OnVerified& onVerified, |
| 162 | const ndn::OnVerifyFailed& onVerifyFailed, |
| 163 | const OnEventualTimeout& timeoutNotify, |
| 164 | const ndn::ptr_lib::shared_ptr<ndn::PolicyManager>& policyManager); |
| 165 | |
| 166 | void |
| 167 | onCertData(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, |
| 168 | const ndn::ptr_lib::shared_ptr<ndn::Data>& cert, |
| 169 | ndn::ptr_lib::shared_ptr<ndn::ValidationRequest> previousStep, |
| 170 | const ndn::ptr_lib::shared_ptr<ndn::PolicyManager>& policyManager); |
| 171 | |
| 172 | void |
| 173 | onCertTimeout(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, |
| 174 | const ndn::OnVerifyFailed& onVerifyFailed, |
| 175 | const ndn::ptr_lib::shared_ptr<ndn::Data>& data, |
| 176 | ndn::ptr_lib::shared_ptr<ndn::ValidationRequest> nextStep, |
| 177 | const ndn::ptr_lib::shared_ptr<ndn::PolicyManager>& policyManager); |
| 178 | |
| 179 | void |
| 180 | sendInterest(const ndn::Interest& interest, |
| 181 | const ndn::OnVerified& onVerified, |
| 182 | const ndn::OnVerifyFailed& onVerifyFailed, |
| 183 | const OnEventualTimeout& timeoutNotify, |
| 184 | const ndn::ptr_lib::shared_ptr<ndn::PolicyManager>& policyManager, |
| 185 | int retry = 1, |
| 186 | int stepCount = 0); |
Yingdi Yu | c4d08d2 | 2013-10-23 23:07:29 -0700 | [diff] [blame] | 187 | |
| 188 | void |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 189 | onInviteReplyVerified(const ndn::ptr_lib::shared_ptr<ndn::Data>& data, |
| 190 | const ndn::Name& identity, |
| 191 | bool isIntroduce); |
| 192 | |
| 193 | void |
| 194 | onInviteReplyVerifyFailed(const ndn::ptr_lib::shared_ptr<ndn::Data>& data, |
| 195 | const ndn::Name& identity); |
Yingdi Yu | c4d08d2 | 2013-10-23 23:07:29 -0700 | [diff] [blame] | 196 | |
| 197 | void |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 198 | onInviteReplyTimeout(const ndn::Name& identity); |
| 199 | |
Yingdi Yu | c4d08d2 | 2013-10-23 23:07:29 -0700 | [diff] [blame] | 200 | |
| 201 | void |
| 202 | invitationRejected(const ndn::Name& identity); |
| 203 | |
| 204 | void |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 205 | invitationAccepted(const ndn::Name& identity, |
| 206 | ndn::ptr_lib::shared_ptr<ndn::Data> data, |
| 207 | const std::string& inviteePrefix, |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 208 | bool isIntroducer); |
Yingdi Yu | c4d08d2 | 2013-10-23 23:07:29 -0700 | [diff] [blame] | 209 | |
| 210 | void |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 211 | onLocalPrefix(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest, |
| 212 | const ndn::ptr_lib::shared_ptr<ndn::Data>& data); |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 213 | |
Yingdi Yu | 4237244 | 2013-11-06 18:43:31 -0800 | [diff] [blame] | 214 | void |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 215 | onLocalPrefixTimeout(const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest); |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 216 | |
| 217 | // void |
| 218 | // fetchHistory(std::string name); |
| 219 | |
| 220 | void |
| 221 | formChatMessage(const QString &text, SyncDemo::ChatMessage &msg); |
| 222 | |
| 223 | void |
| 224 | formControlMessage(SyncDemo::ChatMessage &msg, SyncDemo::ChatMessage::ChatMessageType type); |
| 225 | |
| 226 | void |
| 227 | sendMsg(SyncDemo::ChatMessage &msg); |
| 228 | |
| 229 | void |
| 230 | resizeEvent(QResizeEvent *); |
| 231 | |
| 232 | void |
| 233 | showEvent(QShowEvent *); |
| 234 | |
| 235 | void |
| 236 | fitView(); |
| 237 | |
Yingdi Yu | a059409 | 2013-11-06 22:07:38 -0800 | [diff] [blame] | 238 | void |
| 239 | createActions(); |
| 240 | |
| 241 | void |
| 242 | createTrayIcon(); |
| 243 | |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 244 | QString |
| 245 | formatTime(time_t); |
| 246 | |
| 247 | void |
| 248 | printTimeInCell(QTextTable *, time_t); |
| 249 | |
| 250 | void |
| 251 | disableTreeDisplay(); |
| 252 | |
| 253 | signals: |
| 254 | void |
| 255 | dataReceived(QString name, const char *buf, size_t len, bool show, bool isHistory); |
| 256 | |
| 257 | void |
| 258 | treeUpdated(const std::vector<Sync::MissingDataInfo>); |
| 259 | |
| 260 | void |
| 261 | removeReceived(QString prefix); |
| 262 | |
Yingdi Yu | 4237244 | 2013-11-06 18:43:31 -0800 | [diff] [blame] | 263 | void |
| 264 | closeChatDialog(const ndn::Name& chatroomPrefix); |
| 265 | |
Yingdi Yu | b29f78c | 2013-11-09 20:12:31 -0800 | [diff] [blame] | 266 | void |
| 267 | noNdnConnection(const QString& msg); |
Yingdi Yu | 3e87bd8 | 2013-11-10 10:47:44 -0800 | [diff] [blame] | 268 | |
| 269 | void |
| 270 | inivationRejection(const QString& msg); |
Yingdi Yu | b29f78c | 2013-11-09 20:12:31 -0800 | [diff] [blame] | 271 | |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 272 | public slots: |
| 273 | void |
| 274 | processTreeUpdate(const std::vector<Sync::MissingDataInfo>); |
| 275 | |
| 276 | void |
| 277 | processData(QString name, const char *buf, size_t len, bool show, bool isHistory); |
| 278 | |
| 279 | void |
| 280 | processRemove(QString prefix); |
| 281 | |
| 282 | private slots: |
| 283 | void |
| 284 | returnPressed(); |
| 285 | |
| 286 | void |
| 287 | treeButtonPressed(); |
| 288 | |
Yingdi Yu | 2ab22e7 | 2013-11-10 01:38:21 -0800 | [diff] [blame] | 289 | void |
| 290 | settingUpdated(QString, QString, QString); |
| 291 | |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 292 | void |
| 293 | sendJoin(); |
| 294 | |
| 295 | void |
| 296 | sendHello(); |
| 297 | |
| 298 | void |
| 299 | sendLeave(); |
| 300 | |
| 301 | void |
| 302 | replot(); |
| 303 | |
| 304 | void |
| 305 | updateRosterList(QStringList); |
| 306 | |
| 307 | void |
| 308 | enableTreeDisplay(); |
| 309 | |
Yingdi Yu | 2ab22e7 | 2013-11-10 01:38:21 -0800 | [diff] [blame] | 310 | void |
| 311 | updateLocalPrefix(); |
| 312 | |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 313 | void |
| 314 | summonReaper(); |
| 315 | |
| 316 | void |
| 317 | reap(); |
| 318 | |
| 319 | void |
Yingdi Yu | a059409 | 2013-11-06 22:07:38 -0800 | [diff] [blame] | 320 | iconActivated(QSystemTrayIcon::ActivationReason reason); |
| 321 | |
| 322 | void |
| 323 | messageClicked(); |
| 324 | |
| 325 | void |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 326 | showMessage(QString, QString); |
| 327 | |
| 328 | void |
| 329 | openInviteListDialog(); |
| 330 | |
| 331 | void |
| 332 | sendInvitationWrapper(QString, bool); |
Yingdi Yu | 07b5b09 | 2013-11-07 17:00:54 -0800 | [diff] [blame] | 333 | |
| 334 | void |
| 335 | quit(); |
Yingdi Yu | c4d08d2 | 2013-10-23 23:07:29 -0700 | [diff] [blame] | 336 | |
| 337 | private: |
Yingdi Yu | 0484223 | 2013-10-23 14:03:09 -0700 | [diff] [blame] | 338 | Ui::ChatDialog *ui; |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 339 | ndn::ptr_lib::shared_ptr<ContactManager> m_contactManager; |
Yingdi Yu | 0484223 | 2013-10-23 14:03:09 -0700 | [diff] [blame] | 340 | ndn::Name m_chatroomPrefix; |
| 341 | ndn::Name m_localPrefix; |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 342 | ndn::Name m_localChatPrefix; |
Yingdi Yu | c4d08d2 | 2013-10-23 23:07:29 -0700 | [diff] [blame] | 343 | ndn::Name m_defaultIdentity; |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 344 | ndn::ptr_lib::shared_ptr<InvitationPolicyManager> m_invitationPolicyManager; |
| 345 | ndn::ptr_lib::shared_ptr<SyncPolicyManager> m_syncPolicyManager; |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame^] | 346 | ndn::ptr_lib::shared_ptr<ndn::KeyChain> m_keyChain; |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 347 | ndn::ptr_lib::shared_ptr<ndn::Face> m_face; |
Yingdi Yu | 0a953c3 | 2013-11-10 10:32:18 -0800 | [diff] [blame] | 348 | |
Yingdi Yu | accbda9 | 2013-12-27 08:44:12 +0800 | [diff] [blame] | 349 | boost::recursive_mutex m_mutex; |
| 350 | boost::thread m_thread; |
| 351 | bool m_running; |
| 352 | |
Yingdi Yu | 0a953c3 | 2013-11-10 10:32:18 -0800 | [diff] [blame] | 353 | ndn::Name m_newLocalPrefix; |
| 354 | bool m_newLocalPrefixReady; |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 355 | |
| 356 | User m_user; |
Yingdi Yu | 4237244 | 2013-11-06 18:43:31 -0800 | [diff] [blame] | 357 | std::string m_nick; |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 358 | Sync::SyncSocket *m_sock; |
| 359 | uint32_t m_session; |
| 360 | DigestTreeScene *m_scene; |
| 361 | boost::recursive_mutex m_msgMutex; |
| 362 | boost::recursive_mutex m_sceneMutex; |
| 363 | time_t m_lastMsgTime; |
| 364 | int m_randomizedInterval; |
| 365 | QTimer *m_timer; |
| 366 | QStringListModel *m_rosterModel; |
Yingdi Yu | a059409 | 2013-11-06 22:07:38 -0800 | [diff] [blame] | 367 | QSystemTrayIcon *trayIcon; |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 368 | |
Yingdi Yu | 07b5b09 | 2013-11-07 17:00:54 -0800 | [diff] [blame] | 369 | QAction *minimizeAction; |
| 370 | QAction *maximizeAction; |
| 371 | QAction *restoreAction; |
Yingdi Yu | 2ab22e7 | 2013-11-10 01:38:21 -0800 | [diff] [blame] | 372 | QAction *updateLocalPrefixAction; |
Yingdi Yu | 07b5b09 | 2013-11-07 17:00:54 -0800 | [diff] [blame] | 373 | QAction *quitAction; |
| 374 | QMenu *trayIconMenu; |
| 375 | |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 376 | // QQueue<SyncDemo::ChatMessage> m_history; |
| 377 | // bool m_historyInitialized; |
| 378 | bool m_joined; |
| 379 | |
| 380 | QList<QString> m_zombieList; |
| 381 | int m_zombieIndex; |
| 382 | |
| 383 | InviteListDialog* m_inviteListDialog; |
Yingdi Yu | 0484223 | 2013-10-23 14:03:09 -0700 | [diff] [blame] | 384 | }; |
| 385 | |
| 386 | #endif // ChatDIALOG_H |