blob: 219151e90cc8b745f414a37db940b3f1ef1e9a6f [file] [log] [blame]
Yingdi Yu847aa862013-10-09 16:35:53 -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: Yingdi Yu <yingdi@cs.ucla.edu>
9 */
10
11#include <QApplication>
12#include <QSystemTrayIcon>
13
Yingdi Yu847aa862013-10-09 16:35:53 -070014#include "contactpanel.h"
Yingdi Yu3b318c12013-10-15 17:54:00 -070015#include "contact-storage.h"
Yingdi Yu4685b1b2013-10-18 17:05:02 -070016#include "dns-storage.h"
Yingdi Yu9236c432013-10-18 11:29:25 -070017#include "contact-manager.h"
Yingdi Yu46948282013-11-06 18:43:31 -080018#include "logging.h"
Yingdi Yu3b318c12013-10-15 17:54:00 -070019
Yingdi Yu46948282013-11-06 18:43:31 -080020INIT_LOGGER("MAIN");
21
Yingdi Yu3b318c12013-10-15 17:54:00 -070022using namespace ndn;
Zhenkai Zhu6d589aa2012-05-29 17:34:35 -070023
Yingdi Yu7989eb22013-10-31 17:38:22 -070024class NewApp : public QApplication
25{
26public:
27 NewApp(int & argc, char ** argv)
28 : QApplication(argc, argv)
Yingdi Yu46948282013-11-06 18:43:31 -080029 { }
Yingdi Yu7989eb22013-10-31 17:38:22 -070030
31 bool notify(QObject * receiver, QEvent * event)
32 {
Yingdi Yu8e135832013-11-09 20:12:31 -080033 try {
Yingdi Yu7989eb22013-10-31 17:38:22 -070034 return QApplication::notify(receiver, event);
Yingdi Yu8e135832013-11-09 20:12:31 -080035 }
Yingdi Yu8e135832013-11-09 20:12:31 -080036 catch(std::exception& e){
Yingdi Yu76dd8002013-12-24 11:16:32 +080037 std::cerr << "Exception thrown:" << e.what() << std::endl;
Yingdi Yu8e135832013-11-09 20:12:31 -080038 return false;
39 }
Yingdi Yu7989eb22013-10-31 17:38:22 -070040
41 }
42};
43
Alexander Afanasyevb4b92292013-07-09 13:54:59 -070044int main(int argc, char *argv[])
Zhenkai Zhu6d589aa2012-05-29 17:34:35 -070045{
Yingdi Yu7989eb22013-10-31 17:38:22 -070046 NewApp app(argc, argv);
Zhenkai Zhu3a008fc2012-06-08 17:36:39 -070047
Yingdi Yu8e135832013-11-09 20:12:31 -080048 ContactPanel contactPanel;
Alexander Afanasyevb4b92292013-07-09 13:54:59 -070049
Yingdi Yu847aa862013-10-09 16:35:53 -070050 contactPanel.show ();
51 contactPanel.activateWindow ();
52 contactPanel.raise ();
53
Zhenkai Zhu6d589aa2012-05-29 17:34:35 -070054 return app.exec();
55}