blob: a9b4c38ffde672134dfaff6de1061c6dbc29fcbb [file] [log] [blame]
Yingdi Yu847aa862013-10-09 16:35:53 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
Varun Patila24bd3e2020-11-24 10:08:33 +05303 * Copyright (c) 2020, Regents of the University of California
Yingdi Yu847aa862013-10-09 16:35:53 -07004 * Yingdi Yu
5 *
6 * BSD license, See the LICENSE file for more information
7 *
8 * Author: Yingdi Yu <yingdi@cs.ucla.edu>
9 */
10
Varun Patila24bd3e2020-11-24 10:08:33 +053011#include "controller.hpp"
12
Yingdi Yu847aa862013-10-09 16:35:53 -070013#include <QApplication>
Yingdi Yu847aa862013-10-09 16:35:53 -070014
Davide Pesavento7676b562020-12-14 00:41:26 -050015#include <boost/exception/diagnostic_information.hpp>
Varun Patil3d850902020-11-23 12:19:14 +053016#include <iostream>
Yingdi Yu3b318c12013-10-15 17:54:00 -070017
Davide Pesavento7676b562020-12-14 00:41:26 -050018class ChronoChatApp : public QApplication
Yingdi Yu7989eb22013-10-31 17:38:22 -070019{
20public:
Davide Pesavento7676b562020-12-14 00:41:26 -050021 using QApplication::QApplication;
Yingdi Yu7989eb22013-10-31 17:38:22 -070022
Yingdi Yu0b0a7362014-08-05 16:31:30 -070023 bool
Davide Pesavento7676b562020-12-14 00:41:26 -050024 notify(QObject* receiver, QEvent* event) final
Yingdi Yu7989eb22013-10-31 17:38:22 -070025 {
Yingdi Yu8e135832013-11-09 20:12:31 -080026 try {
Varun Patila24bd3e2020-11-24 10:08:33 +053027 return QApplication::notify(receiver, event);
Yingdi Yufa0b6a02014-04-30 14:26:42 -070028 }
Varun Patila24bd3e2020-11-24 10:08:33 +053029 catch (const std::exception& e) {
Davide Pesavento7676b562020-12-14 00:41:26 -050030 std::cerr << boost::diagnostic_information(e) << std::endl;
Yingdi Yu8e135832013-11-09 20:12:31 -080031 return false;
32 }
Yingdi Yu7989eb22013-10-31 17:38:22 -070033 }
34};
35
Davide Pesavento7676b562020-12-14 00:41:26 -050036int
37main(int argc, char *argv[])
Zhenkai Zhu6d589aa2012-05-29 17:34:35 -070038{
Davide Pesavento7676b562020-12-14 00:41:26 -050039 ChronoChatApp app(argc, argv);
Yingdi Yueb692ac2015-02-10 18:46:18 -080040 chronochat::Controller controller;
Yingdi Yu348f5ea2014-03-01 14:47:25 -080041 app.setQuitOnLastWindowClosed(false);
Yingdi Yufa4ce792014-02-06 18:09:22 -080042
Zhenkai Zhu6d589aa2012-05-29 17:34:35 -070043 return app.exec();
44}