Improved PeerItem and SecurityItem layout

Added icon for "Not Yet Friends"

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5069 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2012-03-31 23:05:30 +00:00
parent 25a266bcbf
commit 61f5ff5180
4 changed files with 117 additions and 108 deletions

View File

@ -122,7 +122,7 @@ void PeerItem::updateItemStatic()
peernameLabel->setText(nameStr.arg(peername));
QDateTime date = QDateTime::fromTime_t(details.lastConnect);
QString stime = date.toString(Qt::LocalDate);
QString stime = date.toString("dd.MMMM yyyy hh:mm");
lastLabel-> setText(stime);
/* expanded Info */

View File

@ -156,47 +156,7 @@ border-radius: 10px}</string>
<string notr="true">TextLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</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 resource="../images.qrc">
<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 resource="../images.qrc">
<normaloff>:/images/close_normal.png</normaloff>:/images/close_normal.png</iconset>
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
</property>
</widget>
</item>
@ -266,6 +226,46 @@ border-radius: 10px}</string>
</property>
</widget>
</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 resource="../images.qrc">
<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 resource="../images.qrc">
<normaloff>:/images/close_normal.png</normaloff>:/images/close_normal.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>

View File

@ -50,8 +50,8 @@ SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const std::strin
messageframe->setVisible(false);
sendmsgButton->setEnabled(false);
quickmsgButton->setEnabled(false);
chatButton->setEnabled(false);
quickmsgButton->hide();
chatButton->hide();
addFriendButton->setEnabled(false);
removeFriendButton->setEnabled(false);
removeFriendButton->hide();
@ -118,6 +118,7 @@ void SecurityItem::updateItemStatic()
break;
case SEC_TYPE_AUTH_DENIED:
title = tr("Not Yet Friends");
avatar->setDefaultAvatar(":images/avatar_request.png");
break;
case SEC_TYPE_UNKNOWN_IN:
title = tr("Unknown (Incoming) Connect Attempt");
@ -134,7 +135,7 @@ void SecurityItem::updateItemStatic()
titleLabel->setText(title);
QDateTime currentTime = QDateTime::currentDateTime();
timeLabel->setText(currentTime.toString(Qt::LocalDate));
timeLabel->setText(currentTime.toString("dd.MMMM yyyy hh:mm"));
if (mIsHome)
{
@ -184,8 +185,8 @@ void SecurityItem::updateItem()
ipLabel->setText(tr("Unknown Peer"));
connLabel->setText(tr("Unknown Peer"));
chatButton->setEnabled(false);
quickmsgButton->setEnabled(false);
chatButton->hide();
quickmsgButton->hide();
addFriendButton->setEnabled(false);
addFriendButton->show();
@ -225,8 +226,16 @@ void SecurityItem::updateItem()
connLabel->setText(StatusDefs::connectStateString(details));
/* do buttons */
chatButton->setEnabled(details.state & RS_PEER_STATE_CONNECTED);
peerDetailsButton->setEnabled(true);
if (details.state & RS_PEER_STATE_CONNECTED)
{
chatButton->show();
}
else
{
chatButton->hide();
}
if (details.accept_connection)
{
@ -245,11 +254,11 @@ void SecurityItem::updateItem()
if (details.state & RS_PEER_STATE_FRIEND)
{
quickmsgButton->setEnabled(true);
quickmsgButton->show();
}
else
{
quickmsgButton->setEnabled(false);
quickmsgButton->hide();
}
}

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>675</width>
<width>709</width>
<height>338</height>
</rect>
</property>
@ -151,47 +151,7 @@ border-radius: 10px}</string>
<string notr="true">TextLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</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 resource="../images.qrc">
<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 resource="../images.qrc">
<normaloff>:/images/close_normal.png</normaloff>:/images/close_normal.png</iconset>
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
</property>
</widget>
</item>
@ -199,22 +159,6 @@ border-radius: 10px}</string>
</item>
<item row="1" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<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>388</width>
<height>21</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="peerDetailsButton">
<property name="text">
@ -266,6 +210,22 @@ border-radius: 10px}</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>388</width>
<height>21</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="quickmsgButton">
<property name="text">
@ -312,6 +272,46 @@ border-radius: 10px}</string>
</property>
</widget>
</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 resource="../images.qrc">
<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 resource="../images.qrc">
<normaloff>:/images/close_normal.png</normaloff>:/images/close_normal.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>