14ad28724c36bf37ffe05115c3caf84df7ee58cf
[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 #include "contactmanager.h"\r
30 \r
31 int main(int argc, char *argv[])\r
32 {\r
33     QApplication app(argc, argv);\r
34 \r
35     QTranslator translator;\r
36     translator.load(":/translations/" + QLocale::system().name());\r
37     app.installTranslator(&translator);\r
38 \r
39     MainWindow window;\r
40     ResultWindow results(&window);\r
41     DetailWindow details(&results);\r
42 \r
43     window.show();\r
44 \r
45     QObject::connect(&window, SIGNAL(search(SearchDialog::SearchDetails&)),\r
46                          &results, SLOT(search(SearchDialog::SearchDetails&)));\r
47 \r
48     QObject::connect(&results, SIGNAL(itemSelected(Eniro::Result const&)),\r
49                          &details, SLOT(loadData(Eniro::Result const&)));\r
50 \r
51     return app.exec();\r
52 }\r