649f4a7d9c2bc92dd173cae1d0c80eb8154cf7c9
[jenirok] / src / gui / main.cpp
1 /*\r
2  * This file is part of Jenirok.\r
3  *\r
4  * Jenirok is free software: you can redistribute it and/or modify\r
5  * it under the terms of the GNU General Public License as published by\r
6  * the Free Software Foundation, either version 3 of the License, or\r
7  * (at your option) any later version.\r
8  *\r
9  * Jenirok is distributed in the hope that it will be useful,\r
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
12  * GNU General Public License for more details.\r
13  *\r
14  * You should have received a copy of the GNU General Public License\r
15  * along with Jenirok.  If not, see <http://www.gnu.org/licenses/>.\r
16  *\r
17  */\r
18 \r
19 #include <QtCore/QTranslator>\r
20 #include <QtCore/QLocale>\r
21 #include <QtGui/QApplication>\r
22 #include <QtCore/QObject>\r
23 #include "mainwindow.h"\r
24 #include "searchdialog.h"\r
25 #include "resultwindow.h"\r
26 #include "detailwindow.h"\r
27 #include "eniro.h"\r
28 \r
29 int main(int argc, char *argv[])\r
30 {\r
31     QApplication app(argc, argv);\r
32 \r
33     QTranslator translator;\r
34     translator.load(":/translations/" + QLocale::system().name());\r
35     app.installTranslator(&translator);\r
36 \r
37     MainWindow window;\r
38     ResultWindow results(&window);\r
39     DetailWindow details(&results);\r
40 \r
41     window.show();\r
42 \r
43     QObject::connect(&window, SIGNAL(search(SearchDialog::SearchDetails&)),\r
44                      &results, SLOT(search(SearchDialog::SearchDetails&)));\r
45 \r
46     QObject::connect(&results, SIGNAL(itemSelected(Eniro::Result const&)),\r
47                      &details, SLOT(loadData(Eniro::Result const&)));\r
48 \r
49     return app.exec();\r
50 }\r