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