mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-24 14:20:44 -04:00
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
This commit is contained in:
parent
f1ae5766dd
commit
1bcaeebdaa
2 changed files with 19 additions and 41 deletions
|
@ -106,8 +106,8 @@ PopupChatDialog::PopupChatDialog(std::string id, std::string name,
|
||||||
last_status_send_time = 0 ;
|
last_status_send_time = 0 ;
|
||||||
styleHtm = ":/qss/chat/default.htm";
|
styleHtm = ":/qss/chat/default.htm";
|
||||||
|
|
||||||
/* Hide Avatar and Info frame */
|
/* Hide or show the frames */
|
||||||
showAvatarFrame(false);
|
showAvatarFrame(true);
|
||||||
ui.infoframe->setVisible(false);
|
ui.infoframe->setVisible(false);
|
||||||
ui.statusmessagelabel->hide();
|
ui.statusmessagelabel->hide();
|
||||||
|
|
||||||
|
@ -1260,6 +1260,9 @@ void PopupChatDialog::setCurrentFileName(const QString &fileName)
|
||||||
void PopupChatDialog::updateStatus(const QString &peer_id, int status)
|
void PopupChatDialog::updateStatus(const QString &peer_id, int status)
|
||||||
{
|
{
|
||||||
std::string stdPeerId = peer_id.toStdString();
|
std::string stdPeerId = peer_id.toStdString();
|
||||||
|
|
||||||
|
/* set font size for status */
|
||||||
|
QString statusString("<span style=\"font-size:11pt; font-weight:500;""\">%1</span>");
|
||||||
|
|
||||||
if (stdPeerId == dialogId) {
|
if (stdPeerId == dialogId) {
|
||||||
// the peers status has changed
|
// the peers status has changed
|
||||||
|
@ -1269,8 +1272,7 @@ void PopupChatDialog::updateStatus(const QString &peer_id, int status)
|
||||||
ui.avatarlabel->setEnabled(false);
|
ui.avatarlabel->setEnabled(false);
|
||||||
ui.infoframe->setVisible(true);
|
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.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.friendnamelabel->setText( QString::fromStdString(dialogName) + " " + statusString.arg("(Offline)")) ;
|
||||||
ui.statuslabel->setText( tr("(Offline)")) ;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RS_STATUS_INACTIVE:
|
case RS_STATUS_INACTIVE:
|
||||||
|
@ -1278,16 +1280,14 @@ void PopupChatDialog::updateStatus(const QString &peer_id, int status)
|
||||||
ui.avatarlabel->setEnabled(true);
|
ui.avatarlabel->setEnabled(true);
|
||||||
ui.infoframe->setVisible(true);
|
ui.infoframe->setVisible(true);
|
||||||
ui.infolabel->setText( QString::fromStdString(dialogName) + " " + tr("is Idle and may not reply"));
|
ui.infolabel->setText( QString::fromStdString(dialogName) + " " + tr("is Idle and may not reply"));
|
||||||
ui.friendnamelabel->setText( QString::fromStdString(dialogName)) ;
|
ui.friendnamelabel->setText( QString::fromStdString(dialogName) + " " + statusString.arg("(Idle)")) ;
|
||||||
ui.statuslabel->setText( tr("(Idle)")) ;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RS_STATUS_ONLINE:
|
case RS_STATUS_ONLINE:
|
||||||
ui.avatarlabel->setStyleSheet("QLabel#avatarlabel{ border-image:url(:/images/avatarstatus_bg_online.png); }");
|
ui.avatarlabel->setStyleSheet("QLabel#avatarlabel{ border-image:url(:/images/avatarstatus_bg_online.png); }");
|
||||||
ui.avatarlabel->setEnabled(true);
|
ui.avatarlabel->setEnabled(true);
|
||||||
ui.infoframe->setVisible(false);
|
ui.infoframe->setVisible(false);
|
||||||
ui.friendnamelabel->setText( QString::fromStdString(dialogName)) ;
|
ui.friendnamelabel->setText( QString::fromStdString(dialogName) + " " + statusString.arg("(Online)")) ;
|
||||||
ui.statuslabel->setText( tr("(Online)")) ;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RS_STATUS_AWAY:
|
case RS_STATUS_AWAY:
|
||||||
|
@ -1295,8 +1295,7 @@ void PopupChatDialog::updateStatus(const QString &peer_id, int status)
|
||||||
ui.avatarlabel->setEnabled(true);
|
ui.avatarlabel->setEnabled(true);
|
||||||
ui.infolabel->setText( QString::fromStdString(dialogName) + " " + tr("is Away and may not reply"));
|
ui.infolabel->setText( QString::fromStdString(dialogName) + " " + tr("is Away and may not reply"));
|
||||||
ui.infoframe->setVisible(true);
|
ui.infoframe->setVisible(true);
|
||||||
ui.friendnamelabel->setText( QString::fromStdString(dialogName)) ;
|
ui.friendnamelabel->setText( QString::fromStdString(dialogName) + " " + statusString.arg("(Away)")) ;
|
||||||
ui.statuslabel->setText( tr("(Away)")) ;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RS_STATUS_BUSY:
|
case RS_STATUS_BUSY:
|
||||||
|
@ -1304,8 +1303,7 @@ void PopupChatDialog::updateStatus(const QString &peer_id, int status)
|
||||||
ui.avatarlabel->setEnabled(true);
|
ui.avatarlabel->setEnabled(true);
|
||||||
ui.infolabel->setText( QString::fromStdString(dialogName) + " " + tr("is Busy and may not reply"));
|
ui.infolabel->setText( QString::fromStdString(dialogName) + " " + tr("is Busy and may not reply"));
|
||||||
ui.infoframe->setVisible(true);
|
ui.infoframe->setVisible(true);
|
||||||
ui.friendnamelabel->setText( QString::fromStdString(dialogName));
|
ui.friendnamelabel->setText( QString::fromStdString(dialogName) + " " + statusString.arg("(Busy)")) ;
|
||||||
ui.statuslabel->setText( tr("(Busy)")) ;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>528</width>
|
<width>531</width>
|
||||||
<height>451</height>
|
<height>451</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -235,7 +235,7 @@ border-image: url(:/images/avatarstatus_bg.png);
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="friendnamelabel">
|
<widget class="QLabel" name="friendnamelabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
@ -257,20 +257,7 @@ border-image: url(:/images/avatarstatus_bg.png);
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="1" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="statuslabel">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Arial</family>
|
|
||||||
<pointsize>9</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>TextLabel</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" colspan="3">
|
|
||||||
<widget class="QLabel" name="statusmessagelabel">
|
<widget class="QLabel" name="statusmessagelabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
|
@ -283,19 +270,6 @@ border-image: url(:/images/avatarstatus_bg.png);
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -975,6 +949,12 @@ p, li { white-space: pre-wrap; }
|
||||||
<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"/>
|
||||||
|
<include location="../images.qrc"/>
|
||||||
|
<include location="../images.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue