Initial commit to the repository
[deb_shairplay.git] / AirTV-Qt / main.cpp
1 #include <QtGui>
2 #include <QtSingleApplication>
3
4 #include "mainapplication.h"
5 #include "videowidget.h"
6 #include "raopservice.h"
7
8 int main(int argc, char *argv[])
9 {
10 QtSingleApplication a(argc, argv);
11 if (a.isRunning()) {
12 return 0;
13 }
14 a.setApplicationName("AirTV");
15
16 if (!QSystemTrayIcon::isSystemTrayAvailable()) {
17 QMessageBox::critical(0, QObject::tr("Systray"),
18 QObject::tr("I couldn't detect any system tray "
19 "on this system."));
20 return 1;
21 }
22 QApplication::setQuitOnLastWindowClosed(false);
23
24 MainApplication m;
25 QObject::connect(&m, SIGNAL(quitRequested()), &a, SLOT(quit()));
26 QObject::connect(&a, SIGNAL(aboutToQuit()), &m, SLOT(aboutToQuit()));
27 m.start();
28
29 return a.exec();
30 }