blob: 35f390c39d5294cd6b38bbe693aa6ae497590fd4 [file] [log] [blame]
Edric Milaret627500d2015-03-27 16:41:40 -04001/***************************************************************************
Edric Milaret4bba46d2015-04-29 16:33:38 -04002 * Copyright (C) 2015 by Savoir-Faire Linux *
Edric Milaret627500d2015-03-27 16:41:40 -04003 * Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>*
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17 **************************************************************************/
18
19#include "mainwindow.h"
20#include <QApplication>
21#include <QFile>
22
Edric Milaret12353822015-05-14 14:41:09 -040023#include "callmodel.h"
Edric Milaret1b197eb2015-06-01 15:09:56 -040024#include "media/audio.h"
25#include "media/video.h"
26#include "media/text.h"
27#include "media/file.h"
Edric Milaret12353822015-05-14 14:41:09 -040028#include <iostream>
29
30#include <QThread>
31
32#include <windows.h>
33
Edric Milaret1b197eb2015-06-01 15:09:56 -040034REGISTER_MEDIA();
35
Edric Milaret627500d2015-03-27 16:41:40 -040036int
37main(int argc, char *argv[])
38{
39 QApplication a(argc, argv);
40
41 QFont font;
42 font.setFamily("Segoe UI");
43 a.setFont(font);
44
45 QFile file(":/stylesheet.css");
46 if(file.open(QIODevice::ReadOnly | QIODevice::Text))
47 {
48 a.setStyleSheet(file.readAll());
49 file.close();
50 }
51
52 MainWindow w;
Edric Milaret90bd5a82015-06-08 10:07:59 -040053
54 auto startMinimized = false;
55
56 for (auto string : QCoreApplication::arguments()) {
57 if (string == "-m" || string == "--minimized")
58 startMinimized = true;
59 }
60
61 if (not startMinimized)
62 w.show();
63 else
64 w.showMinimized();
Edric Milaret627500d2015-03-27 16:41:40 -040065
Edric Milaret12353822015-05-14 14:41:09 -040066 QObject::connect(&a, &QApplication::aboutToQuit, [&a]() {
67 delete CallModel::instance();
68 });
69
Edric Milaret627500d2015-03-27 16:41:40 -040070 return a.exec();
71}