added functionality to edit your own Personal message on Label click

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1724 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2009-10-08 19:08:44 +00:00
parent b47fc8ce4b
commit d9d77c0cef
3 changed files with 75 additions and 54 deletions

View File

@ -36,6 +36,8 @@
#include "connect/ConfCertDialog.h"
#include "profile/ProfileView.h"
#include "profile/ProfileWidget.h"
#include "profile/StatusMessage.h"
#include "GenCertDialog.h"
#include "gui/connect/ConnectFriendWizard.h"
@ -87,6 +89,9 @@ PeersDialog::PeersDialog(QWidget *parent)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
/* Create RshareSettings object */
_settings = new RshareSettings();
last_status_send_time = 0 ;
@ -94,6 +99,7 @@ PeersDialog::PeersDialog(QWidget *parent)
connect( ui.peertreeWidget, SIGNAL( itemDoubleClicked ( QTreeWidgetItem *, int)), this, SLOT(chatfriend()));
connect( ui.avatartoolButton, SIGNAL(clicked()), SLOT(getAvatar()));
connect( ui.mypersonalstatuslabel, SIGNAL(clicked()), SLOT(statusmessage()));
/* hide the Tree +/- */
ui.peertreeWidget -> setRootIsDecorated( false );
@ -175,10 +181,11 @@ PeersDialog::PeersDialog(QWidget *parent)
menu->addSeparator();
menu->addAction(ui.actionCreate_new_Profile);
ui.menupushButton->setMenu(menu);
updateAvatar();
loadmypersonalstatus();
/* Hide platform specific features */
#ifdef Q_WS_WIN
@ -329,7 +336,7 @@ void PeersDialog::insertPeers()
item -> setTextAlignment(1, Qt::AlignCenter | Qt::AlignVCenter );
/* (1) Person */
item -> setText( 2, QString::fromStdString(detail.name) + tr(" ") + tr(" - ") +
item -> setText( 2, QString::fromStdString(detail.name) + tr(" - ") +
QString::fromStdString(rsMsgs->getCustomStateString(detail.id)));
/* (2) Auto Connect */
@ -1364,3 +1371,9 @@ void PeersDialog::loadmypersonalstatus()
ui.mypersonalstatuslabel->setText(QString::fromStdString(rsMsgs->getCustomStateString()));
}
void PeersDialog::statusmessage()
{
static StatusMessage *statusmsgdialog = new StatusMessage();
statusmsgdialog->show();
}

View File

@ -108,6 +108,8 @@ class PeersDialog : public MainPage
void insertSendList();
void checkChat();
void sendMsg();
void statusmessage();
//void privchat();

View File

@ -700,10 +700,13 @@ background: white;}</string>
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<property name="leftMargin">
<number>1</number>
</property>
<item row="0" column="0">
<property name="topMargin">
<number>1</number>
</property>
<item row="0" column="0" rowspan="2">
<widget class="QToolButton" name="avatartoolButton">
<property name="minimumSize">
<size>
@ -737,61 +740,33 @@ background: white;}</string>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="nicklabel">
<property name="minimumSize">
<size>
<width>0</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>42</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
<item row="0" column="1" colspan="2">
<widget class="QLabel" name="nicklabel">
<property name="minimumSize">
<size>
<width>0</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>42</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:14pt; color:#00aa00;&quot;&gt;nickname (me)&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="mypersonalstatuslabel">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;mypersonalstatus&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>98</width>
<height>18</height>
</size>
</property>
</spacer>
</item>
</layout>
</property>
</widget>
</item>
<item row="0" column="2">
<item row="0" column="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -804,6 +779,37 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="mypersonalstatuslabel">
<property name="toolTip">
<string>Edit Personal message</string>
</property>
<property name="styleSheet">
<string notr="true"> QPushButton:hover {
border: 1px solid #CCCCCC;
}</string>
</property>
<property name="text">
<string/>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2" colspan="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>277</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>