From 1bcaeebdaa267d6ec31860d095bd77841958069e Mon Sep 17 00:00:00 2001 From: defnax Date: Fri, 3 Sep 2010 16:46:47 +0000 Subject: [PATCH] enabled to display the Avatar Frame by default, and optimized the labels git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3436 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- .../src/gui/chat/PopupChatDialog.cpp | 22 +++++------ .../src/gui/chat/PopupChatDialog.ui | 38 +++++-------------- 2 files changed, 19 insertions(+), 41 deletions(-) diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index 7d807ebf9..e9b0d02bc 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -106,8 +106,8 @@ PopupChatDialog::PopupChatDialog(std::string id, std::string name, last_status_send_time = 0 ; styleHtm = ":/qss/chat/default.htm"; - /* Hide Avatar and Info frame */ - showAvatarFrame(false); + /* Hide or show the frames */ + showAvatarFrame(true); ui.infoframe->setVisible(false); ui.statusmessagelabel->hide(); @@ -1260,6 +1260,9 @@ void PopupChatDialog::setCurrentFileName(const QString &fileName) void PopupChatDialog::updateStatus(const QString &peer_id, int status) { std::string stdPeerId = peer_id.toStdString(); + + /* set font size for status */ + QString statusString("%1"); if (stdPeerId == dialogId) { // the peers status has changed @@ -1269,8 +1272,7 @@ void PopupChatDialog::updateStatus(const QString &peer_id, int status) ui.avatarlabel->setEnabled(false); ui.infoframe->setVisible(true); ui.infolabel->setText( QString::fromStdString(dialogName) + " " + tr("apears to be Offline.") +"\n" + tr("Messages you send will be lost and not delivered, rs-Mail this contact instead.")); - ui.friendnamelabel->setText( QString::fromStdString(dialogName)) ; - ui.statuslabel->setText( tr("(Offline)")) ; + ui.friendnamelabel->setText( QString::fromStdString(dialogName) + " " + statusString.arg("(Offline)")) ; break; case RS_STATUS_INACTIVE: @@ -1278,16 +1280,14 @@ void PopupChatDialog::updateStatus(const QString &peer_id, int status) ui.avatarlabel->setEnabled(true); ui.infoframe->setVisible(true); ui.infolabel->setText( QString::fromStdString(dialogName) + " " + tr("is Idle and may not reply")); - ui.friendnamelabel->setText( QString::fromStdString(dialogName)) ; - ui.statuslabel->setText( tr("(Idle)")) ; + ui.friendnamelabel->setText( QString::fromStdString(dialogName) + " " + statusString.arg("(Idle)")) ; break; case RS_STATUS_ONLINE: ui.avatarlabel->setStyleSheet("QLabel#avatarlabel{ border-image:url(:/images/avatarstatus_bg_online.png); }"); ui.avatarlabel->setEnabled(true); ui.infoframe->setVisible(false); - ui.friendnamelabel->setText( QString::fromStdString(dialogName)) ; - ui.statuslabel->setText( tr("(Online)")) ; + ui.friendnamelabel->setText( QString::fromStdString(dialogName) + " " + statusString.arg("(Online)")) ; break; case RS_STATUS_AWAY: @@ -1295,8 +1295,7 @@ void PopupChatDialog::updateStatus(const QString &peer_id, int status) ui.avatarlabel->setEnabled(true); ui.infolabel->setText( QString::fromStdString(dialogName) + " " + tr("is Away and may not reply")); ui.infoframe->setVisible(true); - ui.friendnamelabel->setText( QString::fromStdString(dialogName)) ; - ui.statuslabel->setText( tr("(Away)")) ; + ui.friendnamelabel->setText( QString::fromStdString(dialogName) + " " + statusString.arg("(Away)")) ; break; case RS_STATUS_BUSY: @@ -1304,8 +1303,7 @@ void PopupChatDialog::updateStatus(const QString &peer_id, int status) ui.avatarlabel->setEnabled(true); ui.infolabel->setText( QString::fromStdString(dialogName) + " " + tr("is Busy and may not reply")); ui.infoframe->setVisible(true); - ui.friendnamelabel->setText( QString::fromStdString(dialogName)); - ui.statuslabel->setText( tr("(Busy)")) ; + ui.friendnamelabel->setText( QString::fromStdString(dialogName) + " " + statusString.arg("(Busy)")) ; break; } return; diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.ui b/retroshare-gui/src/gui/chat/PopupChatDialog.ui index d57261b52..3a7d527aa 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.ui +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.ui @@ -9,7 +9,7 @@ 0 0 - 528 + 531 451 @@ -235,7 +235,7 @@ border-image: url(:/images/avatarstatus_bg.png); 6 - + @@ -257,20 +257,7 @@ border-image: url(:/images/avatarstatus_bg.png); - - - - - Arial - 9 - - - - TextLabel - - - - + @@ -283,19 +270,6 @@ border-image: url(:/images/avatarstatus_bg.png); - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -975,6 +949,12 @@ p, li { white-space: pre-wrap; } + + + + + +