}
void SituareEngine::loginOk()
-
{
qDebug() << __PRETTY_FUNCTION__;
m_loggedIn = true;
m_buttonWidth(MAP_ZOOM_PANEL_BUTTON_SIZE),
m_buttonHeight(MAP_ZOOM_PANEL_BUTTON_SIZE)
{
- QPixmap pixmap(fileName);
-
- // Temporary (lazy fix) solution to get the buttons larger
- addPixmap(pixmap.scaled(m_buttonWidth, m_buttonHeight, Qt::KeepAspectRatio, Qt::FastTransformation));
+ // Add an image to the icon
+ addFile(fileName);
}
void MapButton::draw(QPainter *painter, int x, int y)
: QMainWindow(parent)
{
qDebug() << __PRETTY_FUNCTION__;
- m_loggedIn = false;
+
createViews();
setCentralWidget(m_situareViews);
createMenus();
setWindowTitle(tr("List view"));
this->hide();
- m_facebookAuthenticator = new FacebookAuthentication(this);
- connect(m_facebookAuthenticator, SIGNAL(credentialsReady()), this, SLOT(loginOK()));
- connect(m_facebookAuthenticator, SIGNAL(userExit()), this, SLOT(loginScreenClosed()));
- m_facebookAuthenticator->start();
-
m_locationDialog = new UpdateLocationDialog(this);
connect(m_listViewScreen->m_personalInfo,SIGNAL(launchMessageUpdate()),
this,SLOT(openLocationUpdateDialog()));
connect(this, SIGNAL(reverseGeoReady(QString)), m_locationDialog, SLOT(setAddress(QString)));
connect(m_locationDialog, SIGNAL(statusUpdate(QString,bool)), this,
SIGNAL(statusUpdate(QString,bool)));
-
- m_networkManager = new QNetworkAccessManager;
- m_situareService = new SituareService(this,m_networkManager);
}
MainWindow::~MainWindow()
SettingsDialog *dialog = new SettingsDialog(this);
dialog->show();
}
-
-void MainWindow::loginScreenClosed()
-{
- qDebug() << __PRETTY_FUNCTION__ << m_loggedIn;
- if (m_loggedIn) {
- this->show();
- return;
- }
- else {
- this->close();
- }
-}
-
-void MainWindow::loginOK()
-{
- qDebug() << __PRETTY_FUNCTION__ << m_loggedIn;
- m_loggedIn = true;
- m_facebookAuthenticator->close();
-}
/**
* @brief Public slot, which open settings dialog
*/
- void openSettingsDialog();
+ void openSettingsDialog();
/**
* @brief Public slot, which initiates toListViewAct action to switch view
private slots:
/**
- * @brief Slot to change value of m_loggedIn to true
- */
- void loginOK();
-
- /**
- * @brief Slot to check login status and exits if necessary
- */
- void loginScreenClosed();
-
- /**
* @brief Private slot, which starts UpdateLocationDialog
*
*/
/*******************************************************************************
* SIGNALS
******************************************************************************/
-
signals:
-
/**
* @brief Signal for requesting reverseGeo from SituareEngine
*
/*******************************************************************************
* DATA MEMBERS
******************************************************************************/
-
private:
ListViewScreen *m_listViewScreen;
UpdateLocationDialog *m_locationDialog; ///< Message dialog
MapViewScreen *m_mapViewScreen;
- FacebookAuthentication *m_facebookAuthenticator; ///< Instance for facebook authenticator
- QNetworkAccessManager *m_networkManager; ///< NetworkManager that is passed on to SituareService
- SituareService *m_situareService; ///< Instance of the situare server communication service
- bool m_loggedIn; ///< Boolean value to indicate whether login has been successfull or not
QStackedWidget *m_situareViews; ///< Stacked widget that hold both view widgets
QAction *m_toListViewAct; ///< Action to trigger switch to list view
QAction *m_toMapViewAct; ///< Action to trigger switch to map view
* @fn textEditChanged
*/
void textEditChanged();
+
/*******************************************************************************
* DATA MEMBERS
******************************************************************************/