Added to display filesize on ChannelMsgItem and moved the filelabel to the right side

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3664 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-10-11 00:48:11 +00:00
parent 3681c8a2f5
commit 1ce0c822ba
2 changed files with 182 additions and 170 deletions

View File

@ -27,6 +27,7 @@
#include "FeedHolder.h" #include "FeedHolder.h"
#include "SubFileItem.h" #include "SubFileItem.h"
#include "gui/notifyqt.h" #include "gui/notifyqt.h"
#include "util/misc.h"
#include <retroshare/rschannels.h> #include <retroshare/rschannels.h>
@ -65,6 +66,7 @@ ChanMsgItem::ChanMsgItem(FeedHolder *parent, uint32_t feedId, std::string chanId
playButton->hide(); playButton->hide();
titleLabel->setMinimumWidth(100); titleLabel->setMinimumWidth(100);
subjectLabel->setMinimumWidth(100);
small(); small();
updateItemStatic(); updateItemStatic();
@ -160,7 +162,7 @@ void ChanMsgItem::updateItemStatic()
{ {
std::ostringstream out; std::ostringstream out;
out << "(" << cmi.count << " Files)"; out << "(" << cmi.count << " Files)";
filelabel->setText(QString::fromStdString(out.str())); filelabel->setText(QString::fromStdString(out.str()) + " " + misc::friendlyUnit(cmi.size));
} }

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>557</width> <width>518</width>
<height>198</height> <height>208</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -33,21 +33,21 @@ QToolButton:pressed, QPushButton:pressed{
border-image: url(:/images/btn_26_pressed.png) 4; border-image: url(:/images/btn_26_pressed.png) 4;
}</string> }</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_4">
<property name="leftMargin"> <property name="leftMargin">
<number>6</number> <number>6</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>2</number> <number>1</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>6</number> <number>6</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>2</number> <number>1</number>
</property> </property>
<property name="horizontalSpacing"> <property name="horizontalSpacing">
<number>0</number> <number>6</number>
</property> </property>
<property name="verticalSpacing"> <property name="verticalSpacing">
<number>1</number> <number>1</number>
@ -60,6 +60,12 @@ border-image: url(:/images/btn_26_pressed.png) 4;
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>140</height>
</size>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QFrame#frame{border: 3px solid #D3D3D3; <string notr="true">QFrame#frame{border: 3px solid #D3D3D3;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
@ -72,7 +78,7 @@ border-radius: 10px;}</string>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0"> <item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0"> <item row="0" column="0">
@ -117,10 +123,7 @@ border-radius: 10px;}</string>
<property name="horizontalSpacing"> <property name="horizontalSpacing">
<number>4</number> <number>4</number>
</property> </property>
<property name="verticalSpacing"> <item row="0" column="0" rowspan="2" colspan="5">
<number>6</number>
</property>
<item row="0" column="0" colspan="8">
<widget class="QLabel" name="titleLabel"> <widget class="QLabel" name="titleLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum"> <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
@ -149,7 +152,7 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="8" colspan="3"> <item row="0" column="5" rowspan="2" colspan="4">
<widget class="QLabel" name="datetimelabel"> <widget class="QLabel" name="datetimelabel">
<property name="font"> <property name="font">
<font> <font>
@ -167,7 +170,22 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0" colspan="11"> <item row="2" column="6" colspan="3">
<widget class="QLabel" name="filelabel">
<property name="font">
<font>
<stylestrategy>PreferAntialias</stylestrategy>
</font>
</property>
<property name="text">
<string notr="true">fileLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
</property>
</widget>
</item>
<item row="2" column="0" colspan="6">
<widget class="QLabel" name="subjectLabel"> <widget class="QLabel" name="subjectLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
@ -193,145 +211,7 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="7" colspan="2"> <item row="3" column="0">
<widget class="QPushButton" name="unsubscribeButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Unsubscribe From Channel</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/mail_delete.png</normaloff>:/images/mail_delete.png</iconset>
</property>
</widget>
</item>
<item row="2" column="9">
<widget class="QPushButton" name="clearButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Remove Item</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/close_normal.png</normaloff>:/images/close_normal.png</iconset>
</property>
</widget>
</item>
<item row="2" column="10">
<widget class="QPushButton" name="expandButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Expand</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/edit_add24.png</normaloff>:/images/edit_add24.png</iconset>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="filelabel">
<property name="text">
<string notr="true">fileLabel</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QPushButton" name="downloadButton">
<property name="font">
<font>
<pointsize>-1</pointsize>
<stylestrategy>PreferAntialias</stylestrategy>
</font>
</property>
<property name="text">
<string>Download</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/download16.png</normaloff>:/images/download16.png</iconset>
</property>
</widget>
</item>
<item row="2" column="5">
<widget class="QPushButton" name="playButton">
<property name="font">
<font>
<pointsize>-1</pointsize>
<stylestrategy>PreferAntialias</stylestrategy>
</font>
</property>
<property name="text">
<string>Play</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/player_play.png</normaloff>:/images/player_play.png</iconset>
</property>
</widget>
</item>
<item row="2" column="6">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>21</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="readButton"> <widget class="QPushButton" name="readButton">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
@ -361,7 +241,7 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="3"> <item row="3" column="1">
<widget class="QLabel" name="newLabel"> <widget class="QLabel" name="newLabel">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
@ -385,27 +265,140 @@ border-radius: 3px}</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item row="3" column="2">
</item> <widget class="QPushButton" name="downloadButton">
</layout> <property name="font">
<font>
<pointsize>-1</pointsize>
</font>
</property>
<property name="text">
<string>Download</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/download16.png</normaloff>:/images/download16.png</iconset>
</property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="3" column="3">
<spacer name="verticalSpacer_2"> <widget class="QPushButton" name="playButton">
<property name="font">
<font>
<pointsize>-1</pointsize>
</font>
</property>
<property name="text">
<string>Play</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/player_play.png</normaloff>:/images/player_play.png</iconset>
</property>
</widget>
</item>
<item row="3" column="4">
<spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Expanding</enum> <enum>QSizePolicy::Expanding</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>13</width>
<height>3</height> <height>21</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="3" column="5" colspan="2">
<widget class="QPushButton" name="unsubscribeButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Unsubscribe From Channel</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/mail_delete.png</normaloff>:/images/mail_delete.png</iconset>
</property>
</widget>
</item>
<item row="3" column="7">
<widget class="QPushButton" name="clearButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Remove Item</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/close_normal.png</normaloff>:/images/close_normal.png</iconset>
</property>
</widget>
</item>
<item row="3" column="8">
<widget class="QPushButton" name="expandButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Expand</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/edit_add24.png</normaloff>:/images/edit_add24.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QFrame" name="expandFrame"> <widget class="QFrame" name="expandFrame">
<property name="styleSheet"> <property name="styleSheet">
@ -447,6 +440,19 @@ border-radius: 10px;}</string>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="2" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<resources> <resources>
@ -462,6 +468,10 @@ border-radius: 10px;}</string>
<include location="../images.qrc"/> <include location="../images.qrc"/>
<include location="../images.qrc"/> <include location="../images.qrc"/>
<include location="../images.qrc"/> <include location="../images.qrc"/>
<include location="../images.qrc"/>
<include location="../images.qrc"/>
<include location="../images.qrc"/>
<include location="../images.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>