X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fui%2Fmainwindow.cpp;h=576c23886094e6f9c6926d69bfdb53c201601052;hb=bbbce1cfaf349059f0f47738f44bf91bff296298;hp=69062dd38b4daf51a258d97714e809a18a53c766;hpb=90b6daeb35aa3adaeb5fbe62a16b1c636dfced7e;p=situare diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 69062dd..576c238 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -4,9 +4,10 @@ Henri Lampela - henri.lampela@ixonos.com Kaj Wallin - kaj.wallin@ixonos.com - Jussi Laitinen jussi.laitinen@ixonos.com + Jussi Laitinen - jussi.laitinen@ixonos.com Sami Rämö - sami.ramo@ixonos.com Ville Tiensuu - ville.tiensuu@ixonos.com + Katri Kaikkonen - katri.kaikkonen@ixonos.com Situare is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -23,19 +24,27 @@ USA. */ -#include -#include +#include +#include +#include +#include #include +#include +///< @todo sort #include "facebookservice/facebookauthentication.h" #include "map/mapcommon.h" #include "map/mapview.h" #include "common.h" +#include "error.h" #include "friendlistpanel.h" #include "fullscreenbutton.h" -#include "indicatorbutton.h" +#include "indicatorbuttonpanel.h" #include "logindialog.h" #include "mapscale.h" +#include "panelcommon.h" +#include "routingpanel.h" +#include "tabbedpanel.h" #include "searchdialog.h" #include "settingsdialog.h" #include "userinfopanel.h" @@ -53,50 +62,45 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), - m_drawOwnLocationCrosshair(false), - m_errorShown(false), - m_loggedIn(false), - m_refresh(false), - m_progressIndicatorCount(0), - m_ownLocationCrosshair(0), - m_email(), - m_password(), - m_webView(0), - m_fullScreenButton(0), - m_indicatorButton(0), - m_mapScale(0), - m_cookieJar(0) + m_errorShown(false), + m_loggedIn(false), + m_refresh(false), + m_mapCenterHorizontalShifting(0), + m_progressIndicatorCount(0), + m_crosshair(0), + m_email(), ///< @todo WTF?!?!?!? + m_password(), + m_webView(0), + m_fullScreenButton(0), + m_indicatorButtonPanel(0), + m_mapScale(0), + m_cookieJar(0) { qDebug() << __PRETTY_FUNCTION__; buildMap(); - // build main layout - QHBoxLayout *layout = new QHBoxLayout; - layout->addWidget(m_mapView); - layout->setMargin(0); - layout->setSpacing(0); - - setCentralWidget(new QWidget()); - centralWidget()->setLayout(layout); + // map view is the only widget which size & location is handled automatically by the system + // default functionality + setCentralWidget(m_mapView); - buildFriendListPanel(); - buildUserInfoPanel(); + buildPanels(); createMenus(); setWindowTitle(tr("Situare")); - // set stacking order of widgets - m_zoomButtonPanel->stackUnder(m_userPanel); - if(m_fullScreenButton) { - m_fullScreenButton->stackUnder(m_zoomButtonPanel); - m_osmLicense->stackUnder(m_fullScreenButton); + // set stacking order of widgets (from top to bottom) + // m_tabbedPanel is the topmost one + if (m_fullScreenButton) { + m_fullScreenButton->stackUnder(m_tabbedPanel); + m_crosshair->stackUnder(m_fullScreenButton); } else { - m_osmLicense->stackUnder(m_zoomButtonPanel); + m_crosshair->stackUnder(m_tabbedPanel); } - m_ownLocationCrosshair->stackUnder(m_osmLicense); - m_indicatorButton->stackUnder(m_ownLocationCrosshair); - m_mapScale->stackUnder(m_indicatorButton); + m_zoomButtonPanel->stackUnder(m_crosshair); + m_indicatorButtonPanel->stackUnder(m_zoomButtonPanel); + m_osmLicense->stackUnder(m_indicatorButtonPanel); + m_mapScale->stackUnder(m_osmLicense); m_mapView->stackUnder(m_mapScale); grabZoomKeys(true); @@ -139,14 +143,22 @@ void MainWindow::automaticUpdateDialogFinished(int result) m_automaticUpdateLocationDialog->deleteLater(); } -void MainWindow::buildFullScreenButton() +void MainWindow::buildCrosshair() { qDebug() << __PRETTY_FUNCTION__; -#ifdef Q_WS_MAEMO_5 - m_fullScreenButton = new FullScreenButton(this); - connect(m_fullScreenButton, SIGNAL(clicked()), - this, SLOT(toggleFullScreen())); -#endif // Q_WS_MAEMO_5 + + m_crosshair = new QLabel(this); + QPixmap crosshairImage(":/res/images/sight.png"); + m_crosshair->setPixmap(crosshairImage); + m_crosshair->setFixedSize(crosshairImage.size()); + m_crosshair->hide(); + m_crosshair->setAttribute(Qt::WA_TransparentForMouseEvents, true); + + connect(m_mapView, SIGNAL(viewResized(QSize)), + this, SLOT(moveCrosshair())); + + connect(m_mapView, SIGNAL(horizontalShiftingChanged(int)), + this, SLOT(mapCenterHorizontalShiftingChanged(int))); } void MainWindow::buildFriendListPanel() @@ -155,43 +167,56 @@ void MainWindow::buildFriendListPanel() m_friendsListPanel = new FriendListPanel(this); - m_friendsListPanelSidebar = new PanelSideBar(this, RIGHT); - - m_friendsListPanel->stackUnder(m_friendsListPanelSidebar); - connect(this, SIGNAL(friendsLocationsReady(QList&)), m_friendsListPanel, SLOT(friendInfoReceived(QList&))); connect(this, SIGNAL(locationItemClicked(QList)), m_friendsListPanel, SLOT(showFriendsInList(QList))); - connect(m_mapView, SIGNAL(viewResized(QSize)), - m_friendsListPanel, SLOT(resizePanel(QSize))); - - connect(m_mapView, SIGNAL(viewResized(QSize)), - m_friendsListPanelSidebar, SLOT(resizeSideBar(QSize))); - connect(m_friendsListPanel, SIGNAL(findFriend(GeoCoordinate)), - this, SIGNAL(findFriend(GeoCoordinate))); + this, SIGNAL(centerToCoordinates(GeoCoordinate))); connect(this, SIGNAL(friendImageReady(User*)), m_friendsListPanel, SLOT(friendImageReady(User*))); - connect(this, SIGNAL(locationDataParsed(QList&)), - m_friendsListPanel, SLOT(locationDataReady(QList&))); + connect(m_friendsListPanel, SIGNAL(routeToFriend(const GeoCoordinate&)), + this, SIGNAL(routeTo(const GeoCoordinate&))); } -void MainWindow::buildIndicatorButton() +void MainWindow::buildFullScreenButton() { qDebug() << __PRETTY_FUNCTION__; - m_indicatorButton = new IndicatorButton(this); +#ifdef Q_WS_MAEMO_5 + m_fullScreenButton = new FullScreenButton(this); - connect(m_indicatorButton, SIGNAL(autoCenteringTriggered(bool)), + if (m_fullScreenButton) { + connect(m_fullScreenButton, SIGNAL(clicked()), + this, SLOT(toggleFullScreen())); + + connect(qApp, SIGNAL(showFullScreenButton()), + m_fullScreenButton, SLOT(invoke())); + } +#endif // Q_WS_MAEMO_5 +} + +void MainWindow::buildIndicatorButtonPanel() +{ + qDebug() << __PRETTY_FUNCTION__; + + m_indicatorButtonPanel = new IndicatorButtonPanel(this); + + connect(m_indicatorButtonPanel, SIGNAL(autoCenteringTriggered(bool)), this, SIGNAL(autoCenteringTriggered(bool))); connect(m_mapView, SIGNAL(viewResized(QSize)), - m_indicatorButton, SLOT(screenResized(QSize))); + m_indicatorButtonPanel, SLOT(screenResized(QSize))); + + connect(this, SIGNAL(directionIndicatorValuesUpdate(qreal, qreal, bool)), + m_indicatorButtonPanel, SIGNAL(directionIndicatorValuesUpdate(qreal, qreal, bool))); + + connect(m_indicatorButtonPanel, SIGNAL(draggingModeTriggered()), + this, SIGNAL(draggingModeTriggered())); } void MainWindow::buildInformationBox(const QString &message, bool modal) @@ -226,21 +251,6 @@ void MainWindow::buildInformationBox(const QString &message, bool modal) queueDialog(msgBox); } -void MainWindow::buildManualLocationCrosshair() -{ - qDebug() << __PRETTY_FUNCTION__; - - m_ownLocationCrosshair = new QLabel(this); - QPixmap crosshairImage(":/res/images/sight.png"); - m_ownLocationCrosshair->setPixmap(crosshairImage); - m_ownLocationCrosshair->setFixedSize(crosshairImage.size()); - m_ownLocationCrosshair->hide(); - m_ownLocationCrosshair->setAttribute(Qt::WA_TransparentForMouseEvents, true); - - connect(m_mapView, SIGNAL(viewResized(QSize)), - this, SLOT(drawOwnLocationCrosshair(QSize))); -} - void MainWindow::buildMap() { qDebug() << __PRETTY_FUNCTION__; @@ -249,9 +259,9 @@ void MainWindow::buildMap() buildZoomButtonPanel(); buildOsmLicense(); - buildManualLocationCrosshair(); + buildCrosshair(); buildFullScreenButton(); - buildIndicatorButton(); + buildIndicatorButtonPanel(); buildMapScale(); connect(m_mapView, SIGNAL(viewScrolled(SceneCoordinate)), @@ -270,7 +280,7 @@ void MainWindow::buildMap() this, SLOT(drawMapScale(QSize))); connect(m_mapView, SIGNAL(viewResized(QSize)), - this, SLOT(setViewPortSize(QSize))); + this, SLOT(moveCrosshair())); connect(this, SIGNAL(zoomLevelChanged(int)), m_mapView, SLOT(setZoomLevel(int))); @@ -305,45 +315,106 @@ void MainWindow::buildOsmLicense() this, SLOT(drawOsmLicense(QSize))); } -void MainWindow::buildUserInfoPanel() +void MainWindow::buildPanels() +{ + qDebug() << __PRETTY_FUNCTION__; + + buildUserInfoPanel(); + buildFriendListPanel(); + buildRoutingPanel(); + + m_tabbedPanel = new TabbedPanel(this); + m_tabbedPanel->addTab(m_userInfoPanel, QIcon(":/res/images/user_info.png")); + m_tabbedPanel->addTab(m_friendsListPanel, QIcon(":/res/images/friend_list.png")); + m_tabbedPanel->addTab(m_routingPanel, QIcon(":/res/images/routing.png")); + + connect(m_mapView, SIGNAL(viewResized(QSize)), + m_tabbedPanel, SLOT(resizePanel(QSize))); + + connect(m_friendsListPanel, SIGNAL(showPanelRequested(QWidget*)), + m_tabbedPanel, SLOT(showPanel(QWidget*))); + + connect(m_routingPanel, SIGNAL(showPanelRequested(QWidget*)), + m_tabbedPanel, SLOT(showPanel(QWidget*))); + + connect(m_tabbedPanel, SIGNAL(panelClosed()), + m_friendsListPanel, SLOT(anyPanelClosed())); + + connect(m_tabbedPanel, SIGNAL(panelOpened()), + m_friendsListPanel, SLOT(anyPanelOpened())); + + connect(m_tabbedPanel, SIGNAL(panelClosed()), + m_routingPanel, SLOT(clearListsSelections())); + + connect(m_tabbedPanel, SIGNAL(panelClosed()), + m_mapView, SLOT(disableCenterShift())); + + connect(m_tabbedPanel, SIGNAL(panelOpened()), + m_mapView, SLOT(enableCenterShift())); + + connect(m_tabbedPanel, SIGNAL(panelClosed()), + m_userInfoPanel, SIGNAL(collapse())); + + connect(m_tabbedPanel, SIGNAL(currentChanged(int)), + m_userInfoPanel, SIGNAL(collapse())); +} + +void MainWindow::buildRoutingPanel() { qDebug() << __PRETTY_FUNCTION__; - m_userPanel = new UserInfoPanel(this); + m_routingPanel = new RoutingPanel(this); + + connect(this, SIGNAL(locationDataParsed(const QList&)), + m_routingPanel, SLOT(populateLocationListView(const QList&))); - m_userPanelSidebar = new PanelSideBar(this, LEFT); + connect(m_routingPanel, SIGNAL(locationItemClicked(const GeoCoordinate&, const GeoCoordinate&)), + this, SIGNAL(locationItemClicked(const GeoCoordinate&, const GeoCoordinate&))); - m_userPanelSidebar->stackUnder(m_friendsListPanel); - m_userPanel->stackUnder(m_userPanelSidebar); + connect(m_routingPanel, SIGNAL(routeToLocation(const GeoCoordinate&)), + this, SIGNAL(routeTo(const GeoCoordinate&))); + + connect(this, SIGNAL(routeParsed(Route&)), + m_routingPanel, SLOT(setRoute(Route&))); + + connect(m_routingPanel, SIGNAL(routeWaypointItemClicked(GeoCoordinate)), + this, SIGNAL(centerToCoordinates(GeoCoordinate))); + + connect(m_routingPanel, SIGNAL(requestSearchLocation()), + this, SLOT(startLocationSearch())); + + connect(m_routingPanel, SIGNAL(clearRoute()), + this, SIGNAL(clearRoute())); +} + +void MainWindow::buildUserInfoPanel() +{ + qDebug() << __PRETTY_FUNCTION__; + + m_userInfoPanel = new UserInfoPanel(this); connect(this, SIGNAL(userLocationReady(User*)), - m_userPanel, SLOT(userDataReceived(User*))); + m_userInfoPanel, SLOT(userDataReceived(User*))); connect(this, SIGNAL(reverseGeoReady(QString)), - m_userPanel, SIGNAL(reverseGeoReady(QString))); + m_userInfoPanel, SIGNAL(reverseGeoReady(QString))); connect(this, SIGNAL(clearUpdateLocationDialogData()), - m_userPanel, SIGNAL(clearUpdateLocationDialogData())); + m_userInfoPanel, SIGNAL(clearUpdateLocationDialogData())); - connect(m_mapView, SIGNAL(viewResized(QSize)), - m_userPanel, SLOT(resizePanel(QSize))); - - connect(m_mapView, SIGNAL(viewResized(QSize)), - m_userPanelSidebar, SLOT(resizeSideBar(QSize))); + connect(m_userInfoPanel, SIGNAL(findUser(GeoCoordinate)), + this, SIGNAL(centerToCoordinates(GeoCoordinate))); - connect(m_userPanel, SIGNAL(findUser(GeoCoordinate)), - this, SIGNAL(findUser(GeoCoordinate))); - - connect(m_userPanel, SIGNAL(requestReverseGeo()), + connect(m_userInfoPanel, SIGNAL(requestReverseGeo()), this, SIGNAL(requestReverseGeo())); - connect(m_userPanel, SIGNAL(statusUpdate(QString,bool)), + connect(m_userInfoPanel, SIGNAL(statusUpdate(QString,bool)), this, SIGNAL(statusUpdate(QString,bool))); - connect(m_userPanel, SIGNAL(refreshUserData()), + connect(m_userInfoPanel, SIGNAL(refreshUserData()), this, SIGNAL(refreshUserData())); - connect(m_userPanel, SIGNAL(notificateUpdateFailing(QString, bool)), + connect(m_userInfoPanel, SIGNAL(notificateUpdateFailing(QString, bool)), this, SLOT(buildInformationBox(QString, bool))); } @@ -394,6 +465,8 @@ void MainWindow::buildZoomButtonPanel() connect(m_mapView, SIGNAL(viewResized(QSize)), m_zoomButtonPanel, SLOT(screenResized(QSize))); + connect(m_zoomButtonPanel, SIGNAL(draggingModeTriggered()), + this, SIGNAL(draggingModeTriggered())); } void MainWindow::clearCookieJar() @@ -435,17 +508,11 @@ void MainWindow::createMenus() connect(m_gpsToggleAct, SIGNAL(triggered(bool)), this, SIGNAL(gpsTriggered(bool))); - /// @todo remove when not needed! - m_searchLocationAct = new QAction(tr("Location search"), this); - connect(m_searchLocationAct, SIGNAL(triggered()), - this, SLOT(startLocationSearch())); - // build the actual menu m_viewMenu = menuBar()->addMenu(tr("Main")); m_viewMenu->addAction(m_loginAct); m_viewMenu->addAction(m_toSettingsAct); m_viewMenu->addAction(m_gpsToggleAct); - m_viewMenu->addAction(m_searchLocationAct); /// @todo remove when not needed! m_viewMenu->setObjectName(tr("Menu")); } @@ -498,15 +565,9 @@ void MainWindow::drawFullScreenButton(const QSize &size) { qDebug() << __PRETTY_FUNCTION__ << size.width() << "x" << size.height(); - if(m_fullScreenButton) { - if(m_loggedIn) { - m_fullScreenButton->move(size.width() - m_fullScreenButton->size().width() - - PANEL_PEEK_AMOUNT, - size.height() - m_fullScreenButton->size().height()); - } else { - m_fullScreenButton->move(size.width() - m_fullScreenButton->size().width(), - size.height() - m_fullScreenButton->size().height()); - } + if (m_fullScreenButton) { + m_fullScreenButton->move(size.width() - m_fullScreenButton->size().width(), + size.height() - m_fullScreenButton->size().height()); } } @@ -516,9 +577,8 @@ void MainWindow::drawMapScale(const QSize &size) const int LEFT_SCALE_MARGIN = 10; const int BOTTOM_SCALE_MARGIN = 2; - qDebug() << __PRETTY_FUNCTION__ << size.width() << "x" << size.height(); - m_mapScale->move(PANEL_PEEK_AMOUNT + LEFT_SCALE_MARGIN, + m_mapScale->move(LEFT_SCALE_MARGIN, size.height() - m_mapScale->size().height() - BOTTOM_SCALE_MARGIN); } @@ -527,20 +587,10 @@ 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, + - PANEL_BAR_WIDTH, size.height() - m_osmLicense->fontMetrics().height()); } -void MainWindow::drawOwnLocationCrosshair(const QSize &size) -{ - qDebug() << __PRETTY_FUNCTION__; - - if (m_drawOwnLocationCrosshair && m_ownLocationCrosshair != 0) { - m_ownLocationCrosshair->move(size.width()/2 - m_ownLocationCrosshair->pixmap()->width()/2, - size.height()/2 - m_ownLocationCrosshair->pixmap()->height()/2); - } -} - void MainWindow::errorDialogFinished(int status) { qDebug() << __PRETTY_FUNCTION__; @@ -730,32 +780,34 @@ void MainWindow::loginUsingCookies() } -void MainWindow::openSettingsDialog() +void MainWindow::mapCenterHorizontalShiftingChanged(int shifting) { - qDebug() << __PRETTY_FUNCTION__; + m_mapCenterHorizontalShifting = shifting; + moveCrosshair(); +} - SettingsDialog *settingsDialog = new SettingsDialog(this); - settingsDialog->enableSituareSettings((m_loggedIn && m_gpsToggleAct->isChecked())); - connect(settingsDialog, SIGNAL(accepted()), this, SLOT(settingsDialogAccepted())); +void MainWindow::moveCrosshair() +{ + qDebug() << __PRETTY_FUNCTION__; - settingsDialog->show(); + if (m_crosshair) { + int mapHeight = m_mapView->size().height(); + int mapWidth = m_mapView->size().width(); + m_crosshair->move(mapWidth / 2 - m_crosshair->pixmap()->width() / 2 + - m_mapCenterHorizontalShifting, + mapHeight / 2 - m_crosshair->pixmap()->height() / 2); + } } -void MainWindow::readAutomaticLocationUpdateSettings() +void MainWindow::openSettingsDialog() { qDebug() << __PRETTY_FUNCTION__; - QSettings settings(DIRECTORY_NAME, FILE_NAME); - bool automaticUpdateEnabled = settings.value(SETTINGS_AUTOMATIC_UPDATE_ENABLED, false).toBool(); - QTime automaticUpdateInterval = settings.value(SETTINGS_AUTOMATIC_UPDATE_INTERVAL, QTime()) - .toTime(); + SettingsDialog *settingsDialog = new SettingsDialog(this); + settingsDialog->enableSituareSettings((m_loggedIn && m_gpsToggleAct->isChecked())); + connect(settingsDialog, SIGNAL(accepted()), this, SLOT(settingsDialogAccepted())); - if (automaticUpdateEnabled && automaticUpdateInterval.isValid()) { - QTime time; - emit enableAutomaticLocationUpdate(true, time.msecsTo(automaticUpdateInterval)); - } else { - emit enableAutomaticLocationUpdate(false); - } + settingsDialog->show(); } void MainWindow::queueDialog(QDialog *dialog) @@ -776,6 +828,23 @@ void MainWindow::queueDialog(QDialog *dialog) showInformationBox(); } +void MainWindow::readAutomaticLocationUpdateSettings() +{ + qDebug() << __PRETTY_FUNCTION__; + + QSettings settings(DIRECTORY_NAME, FILE_NAME); + bool automaticUpdateEnabled = settings.value(SETTINGS_AUTOMATIC_UPDATE_ENABLED, false).toBool(); + QTime automaticUpdateInterval = settings.value(SETTINGS_AUTOMATIC_UPDATE_INTERVAL, QTime()) + .toTime(); + + if (automaticUpdateEnabled && automaticUpdateInterval.isValid()) { + QTime time; + emit enableAutomaticLocationUpdate(true, time.msecsTo(automaticUpdateInterval)); + } else { + emit enableAutomaticLocationUpdate(false); + } +} + void MainWindow::saveCookies() { qDebug() << __PRETTY_FUNCTION__; @@ -797,42 +866,37 @@ void MainWindow::saveCookies() settings.setValue(COOKIES, list); } -void MainWindow::setGPSButtonEnabled(bool enabled) +void MainWindow::setCrosshairVisibility(bool visibility) { qDebug() << __PRETTY_FUNCTION__; - m_gpsToggleAct->setChecked(enabled); - - setOwnLocationCrosshairVisibility(!enabled); + if (visibility) { + m_crosshair->show(); + moveCrosshair(); + } else { + m_crosshair->hide(); + } } -void MainWindow::setIndicatorButtonEnabled(bool enabled) +void MainWindow::setGPSButtonEnabled(bool enabled) { qDebug() << __PRETTY_FUNCTION__; - m_indicatorButton->setChecked(enabled); - + m_gpsToggleAct->setChecked(enabled); } -void MainWindow::setMapViewScene(QGraphicsScene *scene) +void MainWindow::setIndicatorButtonEnabled(bool enabled) { qDebug() << __PRETTY_FUNCTION__; - m_mapView->setScene(scene); + m_indicatorButtonPanel->setIndicatorButtonEnabled(enabled); } -void MainWindow::setOwnLocationCrosshairVisibility(bool visibility) +void MainWindow::setMapViewScene(QGraphicsScene *scene) { qDebug() << __PRETTY_FUNCTION__; - if (visibility && m_loggedIn) { - m_ownLocationCrosshair->show(); - m_drawOwnLocationCrosshair = true; - drawOwnLocationCrosshair(m_viewPortSize); - } else { - m_ownLocationCrosshair->hide(); - m_drawOwnLocationCrosshair = false; - } + m_mapView->setScene(scene); } void MainWindow::settingsDialogAccepted() @@ -849,13 +913,6 @@ void MainWindow::setUsername(const QString &username) m_email = username; } -void MainWindow::setViewPortSize(const QSize &size) -{ - qDebug() << __PRETTY_FUNCTION__; - - m_viewPortSize = size; -} - void MainWindow::showEnableAutomaticUpdateLocationDialog(const QString &text) { qDebug() << __PRETTY_FUNCTION__; @@ -870,16 +927,6 @@ void MainWindow::showEnableAutomaticUpdateLocationDialog(const QString &text) m_automaticUpdateLocationDialog->show(); } -void MainWindow::toggleFullScreen() -{ - qDebug() << __PRETTY_FUNCTION__; - - if(windowState() == Qt::WindowNoState) - showFullScreen(); - else - showNormal(); -} - void MainWindow::showErrorInformationBox() { qDebug() << __PRETTY_FUNCTION__; @@ -909,19 +956,19 @@ void MainWindow::showPanels() { qDebug() << __PRETTY_FUNCTION__; - drawFullScreenButton(m_viewPortSize); +///< @todo check how this is called and can this method be removed - if(m_loggedIn) { - if(!m_friendsListPanel->isVisible()) { - m_friendsListPanel->show(); - m_friendsListPanelSidebar->show(); - } +// if(m_loggedIn) { +// if(!m_friendsListPanel->isVisible()) { +// m_friendsListPanel->show(); +// m_friendsListPanelSidebar->show(); +// } - if(!m_userPanel->isVisible()) { - m_userPanel->show(); - m_userPanelSidebar->show(); - } - } +// if(!m_userPanel->isVisible()) { +// m_userPanel->show(); +// m_userPanelSidebar->show(); +// } +// } } void MainWindow::startLocationSearch() @@ -948,6 +995,16 @@ void MainWindow::startLoginProcess() queueDialog(loginDialog); } +void MainWindow::toggleFullScreen() +{ + qDebug() << __PRETTY_FUNCTION__; + + if(windowState() == Qt::WindowNoState) + showFullScreen(); + else + showNormal(); +} + void MainWindow::toggleProgressIndicator(bool value) { qDebug() << __PRETTY_FUNCTION__; @@ -972,19 +1029,17 @@ void MainWindow::updateItemVisibility() { qDebug() << __PRETTY_FUNCTION__; - if(m_loggedIn) { +///< @todo can this be removed? - if(!m_gpsToggleAct->isChecked()) - setOwnLocationCrosshairVisibility(true); - } else { - m_friendsListPanel->closePanel(); - m_friendsListPanel->hide(); - m_friendsListPanelSidebar->hide(); - m_userPanel->closePanel(); - m_userPanel->hide(); - m_userPanelSidebar->hide(); - setOwnLocationCrosshairVisibility(false); - } +// if(!m_loggedIn) { +// m_friendsListPanel->closePanel(); +// m_friendsListPanel->hide(); +// m_friendsListPanelSidebar->hide(); + +// m_userPanel->closePanel(); +// m_userPanel->hide(); +// m_userPanelSidebar->hide(); +// } } const QString MainWindow::username()