From 6f7dadfdc55705f50a9d0745c729ffa953917c9b Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 8 May 2011 17:14:51 +0000 Subject: [PATCH] fixed ForumsMsgItem to not stretch the widget, when forum subject is too long, and optimized little bit. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4191 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/feeds/ForumMsgItem.cpp | 24 ++-- retroshare-gui/src/gui/feeds/ForumMsgItem.ui | 110 +++++++----------- 2 files changed, 55 insertions(+), 79 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/ForumMsgItem.cpp b/retroshare-gui/src/gui/feeds/ForumMsgItem.cpp index 9f2d570fa..0bd1c8e2e 100644 --- a/retroshare-gui/src/gui/feeds/ForumMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/ForumMsgItem.cpp @@ -58,8 +58,10 @@ ForumMsgItem::ForumMsgItem(FeedHolder *parent, uint32_t feedId, const std::strin connect( unsubscribeButton, SIGNAL( clicked( void ) ), this, SLOT( unsubscribeForum ( void ) ) ); connect( replyButton, SIGNAL( clicked( void ) ), this, SLOT( replyToPost ( void ) ) ); connect( sendButton, SIGNAL( clicked( ) ), this, SLOT( sendMsg() ) ); - + connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&))); + + subjectLabel->setMinimumWidth(20); small(); updateItemStatic(); @@ -144,9 +146,7 @@ void ForumMsgItem::updateItemStatic() if (rsPeers->getPeerName(msg.srcId) !="") { - RetroShareLink linkMessage; - linkMessage.createMessage(msg.srcId, ""); - namelabel->setText(linkMessage.toHtml()); + namelabel->setText(QString::fromStdString(rsPeers->getPeerName(msg.srcId))); } else { @@ -158,8 +158,8 @@ void ForumMsgItem::updateItemStatic() QDateTime qtime; qtime.setTime_t(msg.ts); - QString timestamp = qtime.toString("dd.MM.yyyy hh:mm:ss"); - timestamplabel->setText(timestamp); + QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm"); + timestamplabel->setText(timestamp); nextFrame->hide(); } @@ -169,9 +169,7 @@ void ForumMsgItem::updateItemStatic() if (rsPeers->getPeerName(msg.srcId) !="") { - RetroShareLink linkMessage; - linkMessage.createMessage(msg.srcId, ""); - nextnamelabel->setText(linkMessage.toHtml()); + nextnamelabel->setText(QString::fromStdString(rsPeers->getPeerName(msg.srcId))); } else { @@ -183,7 +181,7 @@ void ForumMsgItem::updateItemStatic() QDateTime qtime; qtime.setTime_t(msg.ts); - QString timestamp = qtime.toString("dd.MM.yyyy hh:mm:ss"); + QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm"); timestamplabel->setText(timestamp); prevSHLabel->setText(tr("In Reply to") + ": "); @@ -200,9 +198,7 @@ void ForumMsgItem::updateItemStatic() if (rsPeers->getPeerName(msgParent.srcId) !="") { - RetroShareLink linkMessage; - linkMessage.createMessage(msgParent.srcId, ""); - namelabel->setText(linkMessage.toHtml()); + namelabel->setText(QString::fromStdString(rsPeers->getPeerName(msgParent.srcId))); } else { @@ -218,7 +214,7 @@ void ForumMsgItem::updateItemStatic() /* header stuff */ subjectLabel->setText(QString::fromStdWString(msg.title)); - srcLabel->setText(QString::fromStdString(msg.srcId)); + //srcLabel->setText(QString::fromStdString(msg.srcId)); } if (mIsHome) diff --git a/retroshare-gui/src/gui/feeds/ForumMsgItem.ui b/retroshare-gui/src/gui/feeds/ForumMsgItem.ui index 16fe745ac..762e387d0 100644 --- a/retroshare-gui/src/gui/feeds/ForumMsgItem.ui +++ b/retroshare-gui/src/gui/feeds/ForumMsgItem.ui @@ -115,7 +115,7 @@ border-radius: 10px} - + @@ -128,47 +128,7 @@ border-radius: 10px} Timestamp - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - Expand - - - - - - - :/images/edit_add24.png:/images/edit_add24.png - - - - - - - - 0 - 0 - - - - Remove Item - - - - - - - :/images/close_normal.png:/images/close_normal.png + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop @@ -207,6 +167,9 @@ border-radius: 10px} Subject... + + false + true @@ -228,29 +191,6 @@ border-radius: 10px} - - - - Persons Name - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 200 - 20 - - - - @@ -307,6 +247,46 @@ border-radius: 10px} + + + + + 0 + 0 + + + + Expand + + + + + + + :/images/edit_add24.png:/images/edit_add24.png + + + + + + + + 0 + 0 + + + + Remove Item + + + + + + + :/images/close_normal.png:/images/close_normal.png + + +