source: ntrip/trunk/BNC/src/app.cpp@ 10417

Last change on this file since 10417 was 8898, checked in by stuerze, 5 years ago

minor changes

File size: 1.3 KB
RevLine 
[5067]1/* -------------------------------------------------------------------------
2 * GnssCenter
3 * -------------------------------------------------------------------------
4 *
5 * Class: t_app
6 *
7 * Purpose: This class implements the main application
8 *
9 * Author: L. Mervart
10 *
11 * Created: 05-Jan-2013
12 *
[8897]13 * Changes:
[5067]14 *
15 * -----------------------------------------------------------------------*/
16
[8897]17#include "app.h"
[5070]18#include "bnccore.h"
[5067]19
20using namespace std;
21
[8897]22QCoreApplication* createApplication(int& argc, char* argv[], bool GUIenabled) {
23
24 if (GUIenabled) {
25 return new t_app(argc, argv);
26 }
27
28 return new QCoreApplication(argc, argv);
29}
30
31
[5067]32// Constructor
33////////////////////////////////////////////////////////////////////////////
[8897]34t_app::t_app(int& argc, char* argv[]) : QApplication(argc, argv) {
35 setWindowIcon(QPixmap(":ntrip-logo.png"));
[5067]36}
37
38// Destructor
39////////////////////////////////////////////////////////////////////////////
40t_app::~t_app() {
41}
42
43// Handling Events (virtual)
44////////////////////////////////////////////////////////////////////////////
45bool t_app::event(QEvent* ev) {
46
47 if (ev->type() == QEvent::FileOpen) { // currently happens on Mac only
48 QString fileName = static_cast<QFileOpenEvent*>(ev)->file();
[5068]49 BNC_CORE->setConfFileName(fileName);
[5067]50 return true;
51 }
[8897]52
[5067]53 return QApplication::event(ev);
54}
55
[8897]56
Note: See TracBrowser for help on using the repository browser.