mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-18 11:29:31 -04:00
Show current state after the name and location in MessengerWindow.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3468 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
1c2db7eb9b
commit
1fc5347fd4
3 changed files with 32 additions and 16 deletions
|
@ -181,6 +181,7 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags)
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(updateMessengerDisplay()));
|
connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(updateMessengerDisplay()));
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(ownAvatarChanged()), this, SLOT(updateAvatar()));
|
connect(NotifyQt::getInstance(), SIGNAL(ownAvatarChanged()), this, SLOT(updateAvatar()));
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(ownStatusMessageChanged()), this, SLOT(loadmystatusmessage()));
|
connect(NotifyQt::getInstance(), SIGNAL(ownStatusMessageChanged()), this, SLOT(loadmystatusmessage()));
|
||||||
|
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(peerStatusChanged(QString,int)));
|
||||||
#endif // MINIMAL_RSGUI
|
#endif // MINIMAL_RSGUI
|
||||||
|
|
||||||
timer = new QTimer(this);
|
timer = new QTimer(this);
|
||||||
|
@ -221,11 +222,21 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags)
|
||||||
|
|
||||||
// add self nick
|
// add self nick
|
||||||
RsPeerDetails pd;
|
RsPeerDetails pd;
|
||||||
if (rsPeers->getPeerDetails(rsPeers->getOwnId(),pd)) {
|
std::string ownId = rsPeers->getOwnId();
|
||||||
ui.statusButton->setText(QString::fromStdString(pd.name) + tr(" - ") + QString::fromStdString(pd.location));
|
if (rsPeers->getPeerDetails(ownId, pd)) {
|
||||||
|
/* calculate only once */
|
||||||
|
m_nickName = QString::fromStdString(pd.name) + tr(" - ") + QString::fromStdString(pd.location);
|
||||||
|
#ifdef MINIMAL_RSGUI
|
||||||
|
ui.statusButton->setText(m_nickName);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MINIMAL_RSGUI
|
#ifndef MINIMAL_RSGUI
|
||||||
|
/* Show nick and current state */
|
||||||
|
StatusInfo statusInfo;
|
||||||
|
rsStatus->getOwnStatus(statusInfo);
|
||||||
|
peerStatusChanged(QString::fromStdString(ownId), statusInfo.status);
|
||||||
|
|
||||||
MainWindow *pMainWindow = MainWindow::getInstance();
|
MainWindow *pMainWindow = MainWindow::getInstance();
|
||||||
if (pMainWindow) {
|
if (pMainWindow) {
|
||||||
QMenu *pStatusMenu = new QMenu();
|
QMenu *pStatusMenu = new QMenu();
|
||||||
|
@ -1195,6 +1206,16 @@ void MessengerWindow::savestatusmessage()
|
||||||
{
|
{
|
||||||
rsMsgs->setCustomStateString(ui.messagelineEdit->text().toStdString());
|
rsMsgs->setCustomStateString(ui.messagelineEdit->text().toStdString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MessengerWindow::peerStatusChanged(const QString &peer_id, int status)
|
||||||
|
{
|
||||||
|
if (peer_id.toStdString() == rsPeers->getOwnId()) {
|
||||||
|
std::string statusString;
|
||||||
|
rsStatus->getStatusString(status, statusString);
|
||||||
|
ui.statusButton->setText(m_nickName + " (" + tr(statusString.c_str()) + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif // MINIMAL_RSGUI
|
#endif // MINIMAL_RSGUI
|
||||||
|
|
||||||
void MessengerWindow::on_actionSort_Peers_Descending_Order_activated()
|
void MessengerWindow::on_actionSort_Peers_Descending_Order_activated()
|
||||||
|
|
|
@ -91,6 +91,7 @@ private slots:
|
||||||
void getAvatar();
|
void getAvatar();
|
||||||
|
|
||||||
void changeAvatarClicked();
|
void changeAvatarClicked();
|
||||||
|
void peerStatusChanged(const QString &peer_id, int status);
|
||||||
|
|
||||||
void savestatusmessage();
|
void savestatusmessage();
|
||||||
#endif // MINIMAL_RSGUI
|
#endif // MINIMAL_RSGUI
|
||||||
|
@ -128,6 +129,7 @@ private:
|
||||||
LogoBar * _rsLogoBarmessenger;
|
LogoBar * _rsLogoBarmessenger;
|
||||||
|
|
||||||
QFont itemFont;
|
QFont itemFont;
|
||||||
|
QString m_nickName;
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
Ui::MessengerWindow ui;
|
Ui::MessengerWindow ui;
|
||||||
|
|
|
@ -86,8 +86,14 @@ stop:0 #05538B, stop:1 #E4F1E5);
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<layout class="QGridLayout" name="gridLayout_4">
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
<item row="0" column="0" colspan="2">
|
<item row="0" column="0" colspan="3">
|
||||||
<widget class="QPushButton" name="statusButton">
|
<widget class="QPushButton" name="statusButton">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>100</width>
|
<width>100</width>
|
||||||
|
@ -130,19 +136,6 @@ stop:0 #05538B, stop:1 #E4F1E5);
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
|
||||||
<spacer name="horizontalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>50</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" colspan="3">
|
<item row="1" column="0" colspan="3">
|
||||||
<widget class="QLineEdit" name="messagelineEdit">
|
<widget class="QLineEdit" name="messagelineEdit">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue