comunicwatcher/main.cpp

35 lines
985 B
C++
Raw Normal View History

2020-06-12 12:22:37 +00:00
#include <QApplication>
2020-06-13 12:19:30 +00:00
#include <QMessageBox>
#include <QSystemTrayIcon>
2020-06-12 12:22:37 +00:00
2020-06-13 08:19:49 +00:00
#include "loginwindow.h"
#include "refreshservice.h"
2020-06-12 12:22:37 +00:00
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
2020-06-12 13:15:06 +00:00
2020-06-12 16:20:53 +00:00
// Initialize configuration
2020-06-13 08:19:49 +00:00
QCoreApplication::setOrganizationName("Communiquons");
2020-06-12 16:20:53 +00:00
QCoreApplication::setOrganizationDomain("communiquons.org");
QCoreApplication::setApplicationName("ComunicWatcher");
2020-06-13 12:19:30 +00:00
// Check if the system is compatible
if(!QSystemTrayIcon::isSystemTrayAvailable()) {
QMessageBox::warning(nullptr, QObject::tr("Unsupported system"), QObject::tr("Unfortunately, your system is not supported by this application..."));
return -1;
}
2020-06-15 16:39:46 +00:00
// Useful information in case of upgrade
qDebug() << "Required version of OpenSSL: " << QSslSocket::sslLibraryBuildVersionString();
2020-06-13 12:19:30 +00:00
2020-06-13 08:19:49 +00:00
if(!AccountHelper::SignedIn()) {
(new LoginWindow())->show();
}
2020-06-12 13:15:06 +00:00
2020-06-13 08:19:49 +00:00
else
RefreshService::startService();
2020-06-12 13:15:06 +00:00
2020-06-12 12:22:37 +00:00
return a.exec();
}