Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 1 | /*************************************************************************** |
Edric Milaret | 4bba46d | 2015-04-29 16:33:38 -0400 | [diff] [blame] | 2 | * Copyright (C) 2015 by Savoir-Faire Linux * |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 3 | * 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 Milaret | 1235382 | 2015-05-14 14:41:09 -0400 | [diff] [blame] | 23 | #include "callmodel.h" |
Edric Milaret | 1b197eb | 2015-06-01 15:09:56 -0400 | [diff] [blame] | 24 | #include "media/audio.h" |
| 25 | #include "media/video.h" |
| 26 | #include "media/text.h" |
| 27 | #include "media/file.h" |
Edric Milaret | 1235382 | 2015-05-14 14:41:09 -0400 | [diff] [blame] | 28 | #include <iostream> |
| 29 | |
| 30 | #include <QThread> |
| 31 | |
| 32 | #include <windows.h> |
| 33 | |
Edric Milaret | 1b197eb | 2015-06-01 15:09:56 -0400 | [diff] [blame] | 34 | REGISTER_MEDIA(); |
| 35 | |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 36 | int |
| 37 | main(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 Milaret | 90bd5a8 | 2015-06-08 10:07:59 -0400 | [diff] [blame^] | 53 | |
| 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 Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 65 | |
Edric Milaret | 1235382 | 2015-05-14 14:41:09 -0400 | [diff] [blame] | 66 | QObject::connect(&a, &QApplication::aboutToQuit, [&a]() { |
| 67 | delete CallModel::instance(); |
| 68 | }); |
| 69 | |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 70 | return a.exec(); |
| 71 | } |