//const QFont NOKIA_FONT_SMALL = QFont("Nokia Sans", 13, QFont::Normal); ///< Small font
const int ICON_HEIGHT = 24; ///< Icon height
const int ICON_WIDTH = 24; ///< Icon width
-const int IMAGE_HEIGHT = 60; ///< Profile image height
-const int IMAGE_WIDTH = 60; ///< Profile image width
+//const int IMAGE_HEIGHT = 60; ///< Profile image height
+//const int IMAGE_WIDTH = 60; ///< Profile image width
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
m_messageDialog = new UpdateLocationDialog(this);
m_messageDialog->hide();
+ m_messageDialog->setWindowModality(Qt::NonModal);
ImageButton *updateFriendsButton = new ImageButton(this, ":/res/images/refresh.png",
":/res/images/refresh_s.png");
connect(updateStatusMessageButton,SIGNAL(clicked()),
this,SLOT(messageUpdate()));
+
connect(updateFriendsButton,SIGNAL(clicked()),
this, SIGNAL(refreshUserData()));
+
connect(m_findButton, SIGNAL(clicked()),
this, SLOT(findButtonClicked()));
+ connect(this, SIGNAL(reverseGeoReady(QString)),
+ m_messageDialog, SLOT(setAddress(QString)));
+
+ connect(m_messageDialog, SIGNAL(statusUpdate(QString,bool)),
+ this, SIGNAL(statusUpdate(QString,bool)));
+
+ connect(m_messageDialog, SIGNAL(statusUpdate(QString,bool)),
+ this, SLOT(backupUpdateLocationDialogData(QString,bool)));
+
+ connect(this, SIGNAL(messageUpdatedToSituare()),
+ this, SLOT(clearUpdateLocationDialogData()));
+
setFixedWidth(BACKGROUND_WIDTH);
this->setFont(NOKIA_FONT_SMALL);
}
+void UserInfo::backupUpdateLocationDialogData(const QString &status, const bool &publish)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ m_backupMessage = status;
+ m_backupFacebookPublishPolicity = publish;
+
+ m_messageUpdateVerified = false;
+}
+
+void UserInfo::clearUpdateLocationDialogData()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ qDebug() << "Message Before Clearing: " << m_backupMessage;
+ m_backupMessage.clear();
+ qDebug() << "Message After Clearing: " << m_backupMessage;
+ m_backupFacebookPublishPolicity = false;
+}
+
void UserInfo::restoreUnsendMessage()
{
QSettings settings(DIRECTORY_NAME, FILE_NAME);
void UserInfo::setMessageText(const QString &text)
{
- qDebug() << __PRETTY_FUNCTION__ << "VIESTI LAITETAAN TALTEEN";
+ qDebug() << __PRETTY_FUNCTION__;
m_messageText = text;
setText(false);
}
}
+void UserInfo::verifyMessageUpdateToServer(QString errorMessage)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ Q_UNUSED(errorMessage);
+
+ if (!m_messageUpdateVerified) {
+ QString message = QObject::tr("Status update failed\n\nYour message is saved to textbox "
+ "until sending will succeed");
+
+ qDebug() << "m_messageText: " << m_messageText;
+ qDebug() << "m_backupMessage: " << m_backupMessage;
+
+ if (m_messageText != m_backupMessage && !m_backupMessage.isEmpty())
+ emit notificateUpdateFailing(message);
+ }
+
+ m_messageUpdateVerified = true;
+}
+
void UserInfo::mouseReleaseEvent(QMouseEvent *event)
{
qDebug() << __PRETTY_FUNCTION__ << " " << event->pos();
emit findUser(m_coordinates);
}
-QString UserInfo::messageText() const
-{
- return m_messageText;
-}
-
void UserInfo::messageUpdate()
{
qDebug() << __PRETTY_FUNCTION__;
+ emit requestReverseGeo();
+
m_messageDialog->show();
m_messageDialog->m_textEdit->setPlainText(m_backupMessage);
m_messageDialog->m_checkBox->setCheckState(Qt::Unchecked);
if (m_backupFacebookPublishPolicity == true)
- m_messageDialog->m_checkBox->setCheckState(Qt::Checked);
-
- emit requestReverseGeo();
-
- connect(this, SIGNAL(reverseGeoReady(QString)),
- m_messageDialog, SLOT(setAddress(QString)));
-
- connect(m_messageDialog, SIGNAL(statusUpdate(QString,bool)),
- this, SIGNAL(statusUpdate(QString,bool)));
-
- connect(m_messageDialog, SIGNAL(statusUpdate(QString,bool)),
- this, SLOT(backupUpdateLocationDialogData(QString,bool)));
-
- connect(this, SIGNAL(messageUpdatedToSituare()),
- this, SLOT(clearUpdateLocationDialogData()));
+ m_messageDialog->m_checkBox->setCheckState(Qt::Checked);
m_messageDialog->exec();
}
-
-void UserInfo::backupUpdateLocationDialogData(const QString &status, const bool &publish)
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- m_backupMessage = status;
- m_backupFacebookPublishPolicity = publish;
-}
-
-void UserInfo::clearUpdateLocationDialogData()
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- qDebug() << "TEKSTIN SISALTO ENNEN: " << m_backupMessage;
- m_backupMessage.clear();
- qDebug() << "TEKSTIN SISALTO JALKEEN: " << m_backupMessage;
- m_backupFacebookPublishPolicity = false;
-}