m_drawOwnLocationCrosshair(false),
m_loggedIn(false),
m_refresh(false),
+ m_ownLocationCrosshair(0),
m_email(),
m_password(),
+ m_fullScreenButton(0),
m_webView(0),
m_cookieJar(0)
{
// set stacking order of widgets
m_zoomButtonPanel->stackUnder(m_userPanel);
- m_osmLicense->stackUnder(m_zoomButtonPanel);
+ if(m_fullScreenButton) {
+ m_fullScreenButton->stackUnder(m_zoomButtonPanel);
+ m_osmLicense->stackUnder(m_fullScreenButton);
+ } else
+ m_osmLicense->stackUnder(m_zoomButtonPanel);
m_ownLocationCrosshair->stackUnder(m_osmLicense);
m_mapView->stackUnder(m_ownLocationCrosshair);
delete m_webView;
}
+void MainWindow::buildFullScreenButton()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+#ifdef Q_WS_MAEMO_5
+ m_fullScreenButton = new QToolButton(this);
+ m_fullScreenButton->setIcon(QIcon::fromTheme(QLatin1String("general_fullsize")));
+ m_fullScreenButton->setFixedSize(m_fullScreenButton->sizeHint());
+ connect(m_fullScreenButton, SIGNAL(clicked()),
+ this, SLOT(toggleFullScreen()));
+#endif // Q_WS_MAEMO_5
+
+}
+
void MainWindow::buildFriendListPanel()
{
qDebug() << __PRETTY_FUNCTION__;
m_mapView = new MapView(this);
buildZoomButtonPanel();
-
- m_ownLocationCrosshair = 0;
buildOsmLicense();
buildManualLocationCrosshair();
+ buildFullScreenButton();
connect(m_mapView, SIGNAL(viewScrolled(QPoint)),
this, SIGNAL(mapViewScrolled(QPoint)));
connect(m_mapView, SIGNAL(viewResized(QSize)),
this, SIGNAL(mapViewResized(QSize)));
+ connect(m_mapView, SIGNAL(viewResized(QSize)),
+ this, SLOT(drawFullScreenButton(QSize)));
+
connect(m_mapView, SIGNAL(viewResizedNewSize(int, int)),
this, SLOT(setViewPortSize(int, int)));
connect(m_mapView, SIGNAL(viewResized(QSize)),
m_userPanel, SLOT(screenResized(QSize)));
+
+ connect(this, SIGNAL(updateWasSuccessful()),
+ m_userPanel, SIGNAL(updateWasSuccessful()));
+
+ connect(this, SIGNAL(messageSendingFailed(QString)),
+ m_userPanel, SIGNAL(messageSendingFailed(QString)));
+
+ connect(m_userPanel, SIGNAL(notificateUpdateFailing(QString)),
+ this, SIGNAL(notificateUpdateFailing(QString)));
}
void MainWindow::buildWebView()
m_viewMenu->setObjectName(tr("Menu"));
}
+void MainWindow::drawFullScreenButton(const QSize &size)
+{
+ qDebug() << __PRETTY_FUNCTION__ << size.width() << "x" << size.height();
+
+ if(m_fullScreenButton) {
+ m_fullScreenButton->move(size.width() - m_fullScreenButton->size().width()
+ - PANEL_PEEK_AMOUNT,
+ size.height() - m_fullScreenButton->size().height());
+ }
+}
+
void MainWindow::drawOsmLicense(const QSize &size)
{
qDebug() << __PRETTY_FUNCTION__ << size.width() << "x" << size.height();
m_osmLicense->move(size.width() - m_osmLicense->fontMetrics().width(OSM_LICENSE)
- PANEL_PEEK_AMOUNT,
size.height() - m_osmLicense->fontMetrics().height());
-
}
void MainWindow::drawOwnLocationCrosshair(int width, int height)
}
}
-void MainWindow::gpsError(const QString &message)
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- showMaemoInformationBox(message);
-}
-
void MainWindow::gpsTimeout()
{
qDebug() << __PRETTY_FUNCTION__;
toggleProgressIndicator(false);
- showMaemoInformationBox(tr("Invalid E-mail address or password"), true);
-
QStringList urlParts;
urlParts.append(FACEBOOK_LOGINBASE);
urlParts.append(SITUARE_PUBLIC_FACEBOOKAPI_KEY);
#endif
}
+void MainWindow::toggleFullScreen()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ if(windowState() == Qt::WindowNoState)
+ showFullScreen();
+ else
+ showNormal();
+}
+
void MainWindow::startLoginProcess(const QUrl &url)
{
qDebug() << __PRETTY_FUNCTION__;
}
else {
loginDialog.userInput(m_email, m_password);
+ emit saveUsername(m_email);
m_webView->load(url);
toggleProgressIndicator(true);
m_refresh = true;