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
This commit is contained in:
defnax 2011-05-08 17:14:51 +00:00
parent 70c3c9678d
commit 6f7dadfdc5
2 changed files with 55 additions and 79 deletions

View File

@ -58,8 +58,10 @@ ForumMsgItem::ForumMsgItem(FeedHolder *parent, uint32_t feedId, const std::strin
connect( unsubscribeButton, SIGNAL( clicked( void ) ), this, SLOT( unsubscribeForum ( void ) ) ); connect( unsubscribeButton, SIGNAL( clicked( void ) ), this, SLOT( unsubscribeForum ( void ) ) );
connect( replyButton, SIGNAL( clicked( void ) ), this, SLOT( replyToPost ( void ) ) ); connect( replyButton, SIGNAL( clicked( void ) ), this, SLOT( replyToPost ( void ) ) );
connect( sendButton, SIGNAL( clicked( ) ), this, SLOT( sendMsg() ) ); connect( sendButton, SIGNAL( clicked( ) ), this, SLOT( sendMsg() ) );
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&))); connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&)));
subjectLabel->setMinimumWidth(20);
small(); small();
updateItemStatic(); updateItemStatic();
@ -144,9 +146,7 @@ void ForumMsgItem::updateItemStatic()
if (rsPeers->getPeerName(msg.srcId) !="") if (rsPeers->getPeerName(msg.srcId) !="")
{ {
RetroShareLink linkMessage; namelabel->setText(QString::fromStdString(rsPeers->getPeerName(msg.srcId)));
linkMessage.createMessage(msg.srcId, "");
namelabel->setText(linkMessage.toHtml());
} }
else else
{ {
@ -158,8 +158,8 @@ void ForumMsgItem::updateItemStatic()
QDateTime qtime; QDateTime qtime;
qtime.setTime_t(msg.ts); 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); timestamplabel->setText(timestamp);
nextFrame->hide(); nextFrame->hide();
} }
@ -169,9 +169,7 @@ void ForumMsgItem::updateItemStatic()
if (rsPeers->getPeerName(msg.srcId) !="") if (rsPeers->getPeerName(msg.srcId) !="")
{ {
RetroShareLink linkMessage; nextnamelabel->setText(QString::fromStdString(rsPeers->getPeerName(msg.srcId)));
linkMessage.createMessage(msg.srcId, "");
nextnamelabel->setText(linkMessage.toHtml());
} }
else else
{ {
@ -183,7 +181,7 @@ void ForumMsgItem::updateItemStatic()
QDateTime qtime; QDateTime qtime;
qtime.setTime_t(msg.ts); 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); timestamplabel->setText(timestamp);
prevSHLabel->setText(tr("In Reply to") + ": "); prevSHLabel->setText(tr("In Reply to") + ": ");
@ -200,9 +198,7 @@ void ForumMsgItem::updateItemStatic()
if (rsPeers->getPeerName(msgParent.srcId) !="") if (rsPeers->getPeerName(msgParent.srcId) !="")
{ {
RetroShareLink linkMessage; namelabel->setText(QString::fromStdString(rsPeers->getPeerName(msgParent.srcId)));
linkMessage.createMessage(msgParent.srcId, "");
namelabel->setText(linkMessage.toHtml());
} }
else else
{ {
@ -218,7 +214,7 @@ void ForumMsgItem::updateItemStatic()
/* header stuff */ /* header stuff */
subjectLabel->setText(QString::fromStdWString(msg.title)); subjectLabel->setText(QString::fromStdWString(msg.title));
srcLabel->setText(QString::fromStdString(msg.srcId)); //srcLabel->setText(QString::fromStdString(msg.srcId));
} }
if (mIsHome) if (mIsHome)

View File

@ -115,7 +115,7 @@ border-radius: 10px}</string>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="0" column="1"> <item row="0" column="1" colspan="2">
<widget class="QLabel" name="timestamplabel"> <widget class="QLabel" name="timestamplabel">
<property name="font"> <property name="font">
<font> <font>
@ -128,47 +128,7 @@ border-radius: 10px}</string>
<string notr="true">Timestamp</string> <string notr="true">Timestamp</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="expandButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Expand</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>:/images/edit_add24.png</normaloff>:/images/edit_add24.png</iconset>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="clearButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Remove Item</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>:/images/close_normal.png</normaloff>:/images/close_normal.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
@ -207,6 +167,9 @@ border-radius: 10px}</string>
<property name="text"> <property name="text">
<string notr="true">Subject...</string> <string notr="true">Subject...</string>
</property> </property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="openExternalLinks"> <property name="openExternalLinks">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -228,29 +191,6 @@ border-radius: 10px}</string>
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QLabel" name="srcLabel">
<property name="text">
<string notr="true">Persons Name</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>200</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QPushButton" name="unsubscribeButton"> <widget class="QPushButton" name="unsubscribeButton">
<property name="sizePolicy"> <property name="sizePolicy">
@ -307,6 +247,46 @@ border-radius: 10px}</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="expandButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Expand</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>:/images/edit_add24.png</normaloff>:/images/edit_add24.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clearButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Remove Item</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>:/images/close_normal.png</normaloff>:/images/close_normal.png</iconset>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item row="2" column="0" colspan="2"> <item row="2" column="0" colspan="2">