2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Henri Lampela - henri.lampela@ixonos.com
6 Kaj Wallin - kaj.wallin@ixonos.com
7 Jussi Laitinen jussi.laitinen@ixonos.com
9 Situare is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 version 2 as published by the Free Software Foundation.
13 Situare is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with Situare; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
25 #include "mainwindow.h"
26 #include "mapviewscreen.h"
27 #include "settingsdialog.h"
28 #include "facebookservice/facebookauthentication.h"
29 #include "situareservice/situareservice.h"
31 MainWindow::MainWindow(QWidget *parent)
34 qDebug() << __PRETTY_FUNCTION__;
36 m_mapViewScreen = new MapViewScreen(this);
37 setCentralWidget(m_mapViewScreen);
39 setWindowTitle(tr("Situare"));
42 m_locationDialog = new UpdateLocationDialog(this);
44 connect(this, SIGNAL(reverseGeoReady(QString)),
45 m_locationDialog, SLOT(setAddress(QString)));
46 connect(m_locationDialog, SIGNAL(statusUpdate(QString,bool)), this,
47 SIGNAL(statusUpdate(QString,bool)));
49 connect(this, SIGNAL(userLocationReady(User*)),
50 m_mapViewScreen, SIGNAL(userLocationReady(User*)));
51 connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
52 m_mapViewScreen, SIGNAL(friendsLocationsReady(QList<User*>&)));
55 this->toggleProgressIndicator(true);
58 void MainWindow::toggleProgressIndicator(bool value)
60 qDebug() << __PRETTY_FUNCTION__;
62 setAttribute(Qt::WA_Maemo5ShowProgressIndicator, value);
65 #endif // Q_WS_MAEMO_5
68 void MainWindow::createMenus()
70 qDebug() << __PRETTY_FUNCTION__;
71 m_toSettingsAct = new QAction(tr("Settings"), this);
72 m_toSettingsAct->setObjectName(tr("Settings"));
73 connect(m_toSettingsAct, SIGNAL(triggered()), this, SLOT(openSettingsDialog()));
74 m_viewMenu = menuBar()->addMenu(tr("Main"));
76 m_viewMenu->addAction(m_toSettingsAct);
77 m_viewMenu->setObjectName(tr("Menu"));
80 void MainWindow::openLocationUpdateDialog()
82 qDebug() << __PRETTY_FUNCTION__;
84 emit requestReverseGeo();
85 m_locationDialog->exec();
88 void MainWindow::openSettingsDialog()
90 qDebug() << __PRETTY_FUNCTION__;
91 SettingsDialog *dialog = new SettingsDialog(this);