const QString EMPTY = "";
const QString SETTINGS_AUTOMATIC_UPDATE_ENABLED = "SETTINGS_AUTOMATIC_UPDATE_ENABLED";
const QString SETTINGS_AUTOMATIC_UPDATE_INTERVAL = "SETTINGS_AUTOMATIC_UPDATE_INTERVAL";
+const QString USER_UNSEND_MESSAGE = "UNSEND_MESSAGE_CONTENT";
+const QString USER_UNSEND_MESSAGE_PUBLISH = "UNSEND_MESSAGE_PUBLISH_POLICITY";
const QColor COLOR_GRAY = QColor(152, 152, 152); ///< Gray color
const QFont NOKIA_FONT_NORMAL = QFont("Nokia Sans", 18, QFont::Normal); ///< Normal font
case SituareError::SESSION_EXPIRED:
m_ui->buildInformationBox(tr("Session expired. Please login again"), true);
m_facebookAuthenticator->clearAccountInformation(true); // keep username = true
+ m_loggedIn = false;
+ m_situareService->clearUserData();
m_ui->loggedIn(false);
m_ui->loginFailed();
break;
m_loggedIn = false;
m_ui->loggedIn(m_loggedIn);
+
+ // we use existing updateWasSuccessful signal to clear locationUpdateDialog's data
+ connect(this, SIGNAL(clearUpdateLocationDialogData()),
+ m_ui, SIGNAL(clearUpdateLocationDialogData()));
+ emit clearUpdateLocationDialogData();
+ // disconnect immediately
+ disconnect(this, SIGNAL(clearUpdateLocationDialogData()),
+ m_ui, SIGNAL(clearUpdateLocationDialogData()));
+
m_facebookAuthenticator->clearAccountInformation(); // clear all
m_automaticUpdateEnabled = false;
m_automaticUpdateFirstStart = true;
this, SLOT(updateWasSuccessful()));
connect(m_situareService, SIGNAL(updateWasSuccessful()),
- m_ui, SIGNAL(updateWasSuccessful()));
+ m_ui, SIGNAL(clearUpdateLocationDialogData()));
}
void SituareEngine::updateWasSuccessful()
* MEMBER FUNCTIONS AND SLOTS
******************************************************************************/
public slots:
-// /**
-// * @brief Slot to intercept error signal from ImageFetcher and SituareService
-// *
-// * @param error Error message
-// */
-// void error(const QString &error);
/**
* @brief Slot to intercept error signal from ImageFetcher and SituareService
*
void automaticLocationUpdateEnabled(bool enabled);
/**
+ * @brief Signal to clear locationUpdateDialog's data
+ *
+ */
+ void clearUpdateLocationDialogData();
+
+ /**
* @brief Signals when new friends data is ready
*
* @param friendList List of User instances (friends)
#include "facebookauthentication.h"
#include "facebookcommon.h"
-#include "../common.h"
+#include "common.h"
#include "parser.h"
FacebookAuthentication::FacebookAuthentication(QObject *parent)
}
settings.remove(COOKIES);
+ settings.remove(USER_UNSEND_MESSAGE);
+ settings.remove(USER_UNSEND_MESSAGE_PUBLISH);
}
const QString FacebookAuthentication::loadUsername()
const int AUTO_CENTERING_DISABLE_DISTANCE = 200; ///< Distance in pixels
//String constants for storing map settings:
-const QString MAP_LAST_ZOOMLEVEL = "Last_map_zoom_level"; ///< Maps last zoom level before logout
-const QString MAP_LAST_POSITION = "Last_map_location"; ///< Maps last postion before logout
+const QString MAP_LAST_ZOOMLEVEL = "LAST_MAP_ZOOM_LEVEL"; ///< Maps last zoom level before logout
+const QString MAP_LAST_POSITION = "LAST_MAP_LOCATION"; ///< Maps last postion before logout
/**
* @var ERROR_VALUE_NOT_FOUND_ON_SETTINGS
* @brief Error string that program will get if value is not found on settings
QT += network \
webkit
-#DEFINES += QT_NO_DEBUG_OUTPUT
+DEFINES += QT_NO_DEBUG_OUTPUT
simulator {
SOURCES += network/networkhandlerprivatestub.cpp \
connect(m_mapView, SIGNAL(viewResized(QSize)),
m_userPanel, SLOT(screenResized(QSize)));
- connect(this, SIGNAL(updateWasSuccessful()),
- m_userPanel, SIGNAL(updateWasSuccessful()));
+ connect(this, SIGNAL(clearUpdateLocationDialogData()),
+ m_userPanel, SIGNAL(clearUpdateLocationDialogData()));
connect(this, SIGNAL(messageSendingFailed(int)),
m_userPanel, SIGNAL(messageSendingFailed(int)));
*/
void queueDialog(QDialog *dialog);
-// /**
-// * @brief Set own location crosshair visibility
-// *
-// * @param visible
-// */
-// void setOwnLocationCrosshairVisibility(bool visible);
-
/**
* @brief Shows queued error information box
*
void updateCredentials(const QUrl &url);
/**
- * @brief Signals when updateLocation request finished successfully
+ * @brief Signals when updateLocationDialog's data must be cleared
*
*/
- void updateWasSuccessful();
+ void clearUpdateLocationDialogData();
/**
* @brief MapView has finished zooming
const int MARGIN = 5; ///< Icon margin
const int MOUSE_PRESS_AREA_WIDTH = 20; ///< Area width for item height toggling
const int MOUSE_PRESS_AREA_HEIGHT = 20; ///< Area height for item height toggling
-const QString USER_UNSEND_MESSAGE = "User_unsend_message_content";
-const QString USER_UNSEND_MESSAGE_PUBLISH_POLICITY = "User_unsend_message_publish";
/**
* @var LABEL_MAX_WIDTH
if (!m_backupMessage.isEmpty()) {
settings.setValue(USER_UNSEND_MESSAGE, m_backupMessage.toAscii());
- settings.setValue(USER_UNSEND_MESSAGE_PUBLISH_POLICITY, m_backupFacebookPublishPolicity);
+ settings.setValue(USER_UNSEND_MESSAGE_PUBLISH, m_backupFacebookPublishPolicity);
} else {
settings.remove(USER_UNSEND_MESSAGE);
- settings.remove(USER_UNSEND_MESSAGE_PUBLISH_POLICITY);
+ settings.remove(USER_UNSEND_MESSAGE_PUBLISH);
}
}
qDebug() << __PRETTY_FUNCTION__;
QSettings settings(DIRECTORY_NAME, FILE_NAME);
- m_backupMessage = settings.value(USER_UNSEND_MESSAGE, "").toString();
+ m_backupMessage = settings.value(USER_UNSEND_MESSAGE, EMPTY).toString();
m_backupFacebookPublishPolicity =
- settings.value(USER_UNSEND_MESSAGE_PUBLISH_POLICITY, false).toBool();
+ settings.value(USER_UNSEND_MESSAGE_PUBLISH, false).toBool();
}
QString UserInfo::shortenText(const QLabel *label, const QString &text, int textMaxWidth)
if (!m_messageUpdateVerified) {
if (m_messageText != m_backupMessage && !m_backupMessage.isEmpty())
-// emit notificateUpdateFailing(tr("Location update failed\n\nYour message is saved to "
-// "textbox until sending will succeed"), true);
emit notificateUpdateFailing(tr("Location update failed, please try again"), false);
}
connect(m_userInfo, SIGNAL(refreshUserData()),
this, SIGNAL(refreshUserData()));
- connect(this, SIGNAL(updateWasSuccessful()),
+ connect(this, SIGNAL(clearUpdateLocationDialogData()),
m_userInfo, SLOT(clearUpdateLocationDialogData()));
connect (this, SIGNAL(messageSendingFailed(int)),
void statusUpdate(const QString &status, const bool &publish);
/**
- * @brief Signals when updateLocation request finished successfully
+ * @brief Signals when updateLocationDialog's data must be cleared
*
*/
- void updateWasSuccessful();
+ void clearUpdateLocationDialogData();
/*******************************************************************************
* DATA MEMBERS
******************************************************************************/