#include "settingsdialog.h"
#include "userinfopanel.h"
#include "zoombuttonpanel.h"
+#include "indicatorbuttonpanel.h"
#include "mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent),
- m_drawOwnLocationCrosshair(false),
m_errorShown(false),
m_loggedIn(false),
m_refresh(false),
m_password(),
m_webView(0),
m_fullScreenButton(0),
- m_indicatorButton(0),
+// m_indicatorButton(0),
+ m_indicatorButtonPanel(0),
m_mapScale(0),
m_cookieJar(0)
{
m_osmLicense->stackUnder(m_zoomButtonPanel);
}
m_ownLocationCrosshair->stackUnder(m_osmLicense);
- m_indicatorButton->stackUnder(m_ownLocationCrosshair);
- m_mapScale->stackUnder(m_indicatorButton);
+ m_indicatorButtonPanel->stackUnder(m_ownLocationCrosshair);
+ m_mapScale->stackUnder(m_indicatorButtonPanel);
m_mapView->stackUnder(m_mapScale);
grabZoomKeys(true);
m_friendsListPanel, SLOT(friendImageReady(User*)));
}
-void MainWindow::buildIndicatorButton()
+void MainWindow::buildIndicatorButtonPanel()
{
qDebug() << __PRETTY_FUNCTION__;
- m_indicatorButton = new IndicatorButton(this);
+ m_indicatorButtonPanel = new IndicatorButtonPanel(this);
- connect(m_indicatorButton, SIGNAL(autoCenteringTriggered(bool)),
+ 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_indicatorButton, SLOT(updateValues(qreal, qreal, bool)));
+ m_indicatorButtonPanel, SIGNAL(updateValues(qreal, qreal, bool)));
+
+ connect(m_indicatorButtonPanel, SIGNAL(draggingModeTriggered()),
+ this, SIGNAL(draggingModeTriggered()));
}
void MainWindow::buildInformationBox(const QString &message, bool modal)
buildOsmLicense();
buildManualLocationCrosshair();
buildFullScreenButton();
- buildIndicatorButton();
+ buildIndicatorButtonPanel();
buildMapScale();
connect(m_mapView, SIGNAL(viewScrolled(SceneCoordinate)),
connect(m_mapView, SIGNAL(viewResized(QSize)),
m_zoomButtonPanel, SLOT(screenResized(QSize)));
+ connect(m_zoomButtonPanel, SIGNAL(draggingModeTriggered()),
+ this, SIGNAL(draggingModeTriggered()));
}
void MainWindow::clearCookieJar()
{
qDebug() << __PRETTY_FUNCTION__;
- if (m_drawOwnLocationCrosshair && m_ownLocationCrosshair != 0) {
+ if (m_ownLocationCrosshair != 0) {
m_ownLocationCrosshair->move(size.width()/2 - m_ownLocationCrosshair->pixmap()->width()/2,
size.height()/2 - m_ownLocationCrosshair->pixmap()->height()/2);
}
qDebug() << __PRETTY_FUNCTION__;
m_gpsToggleAct->setChecked(enabled);
-
- setOwnLocationCrosshairVisibility(!enabled);
}
void MainWindow::setIndicatorButtonEnabled(bool enabled)
{
qDebug() << __PRETTY_FUNCTION__;
- m_indicatorButton->setChecked(enabled);
+// m_indicatorButton->setChecked(enabled);
}
{
qDebug() << __PRETTY_FUNCTION__;
- if (visibility && m_loggedIn) {
+ if (visibility) {
m_ownLocationCrosshair->show();
- m_drawOwnLocationCrosshair = true;
drawOwnLocationCrosshair(m_viewPortSize);
} else {
m_ownLocationCrosshair->hide();
- m_drawOwnLocationCrosshair = false;
}
}
{
qDebug() << __PRETTY_FUNCTION__;
- if(m_loggedIn) {
-
- if(!m_gpsToggleAct->isChecked())
- setOwnLocationCrosshairVisibility(true);
- } else {
+ if(!m_loggedIn) {
m_friendsListPanel->closePanel();
m_friendsListPanel->hide();
m_friendsListPanelSidebar->hide();
m_userPanel->closePanel();
m_userPanel->hide();
m_userPanelSidebar->hide();
- setOwnLocationCrosshairVisibility(false);
}
}