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 "connect/ConfCertDialog.h"
#include "profile/ProfileView.h" #include "profile/ProfileView.h"
#include "profile/ProfileWidget.h" #include "profile/ProfileWidget.h"
#include "profile/StatusMessage.h"
#include "GenCertDialog.h" #include "GenCertDialog.h"
#include "gui/connect/ConnectFriendWizard.h" #include "gui/connect/ConnectFriendWizard.h"
@ -88,12 +90,16 @@ PeersDialog::PeersDialog(QWidget *parent)
/* Invoke the Qt Designer generated object setup routine */ /* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this); ui.setupUi(this);
/* Create RshareSettings object */
_settings = new RshareSettings();
last_status_send_time = 0 ; last_status_send_time = 0 ;
connect( ui.peertreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( peertreeWidgetCostumPopupMenu( QPoint ) ) ); connect( ui.peertreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( peertreeWidgetCostumPopupMenu( QPoint ) ) );
connect( ui.peertreeWidget, SIGNAL( itemDoubleClicked ( QTreeWidgetItem *, int)), this, SLOT(chatfriend())); connect( ui.peertreeWidget, SIGNAL( itemDoubleClicked ( QTreeWidgetItem *, int)), this, SLOT(chatfriend()));
connect( ui.avatartoolButton, SIGNAL(clicked()), SLOT(getAvatar())); connect( ui.avatartoolButton, SIGNAL(clicked()), SLOT(getAvatar()));
connect( ui.mypersonalstatuslabel, SIGNAL(clicked()), SLOT(statusmessage()));
/* hide the Tree +/- */ /* hide the Tree +/- */
ui.peertreeWidget -> setRootIsDecorated( false ); ui.peertreeWidget -> setRootIsDecorated( false );
@ -176,6 +182,7 @@ PeersDialog::PeersDialog(QWidget *parent)
menu->addAction(ui.actionCreate_new_Profile); menu->addAction(ui.actionCreate_new_Profile);
ui.menupushButton->setMenu(menu); ui.menupushButton->setMenu(menu);
updateAvatar(); updateAvatar();
loadmypersonalstatus(); loadmypersonalstatus();
@ -329,7 +336,7 @@ void PeersDialog::insertPeers()
item -> setTextAlignment(1, Qt::AlignCenter | Qt::AlignVCenter ); item -> setTextAlignment(1, Qt::AlignCenter | Qt::AlignVCenter );
/* (1) Person */ /* (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))); QString::fromStdString(rsMsgs->getCustomStateString(detail.id)));
/* (2) Auto Connect */ /* (2) Auto Connect */
@ -1364,3 +1371,9 @@ void PeersDialog::loadmypersonalstatus()
ui.mypersonalstatuslabel->setText(QString::fromStdString(rsMsgs->getCustomStateString())); ui.mypersonalstatuslabel->setText(QString::fromStdString(rsMsgs->getCustomStateString()));
} }
void PeersDialog::statusmessage()
{
static StatusMessage *statusmsgdialog = new StatusMessage();
statusmsgdialog->show();
}

View File

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

View File

@ -700,10 +700,13 @@ background: white;}</string>
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<property name="margin"> <property name="leftMargin">
<number>1</number> <number>1</number>
</property> </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"> <widget class="QToolButton" name="avatartoolButton">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@ -737,61 +740,33 @@ background: white;}</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1" colspan="2">
<layout class="QVBoxLayout" name="verticalLayout"> <widget class="QLabel" name="nicklabel">
<item> <property name="minimumSize">
<widget class="QLabel" name="nicklabel"> <size>
<property name="minimumSize"> <width>0</width>
<size> <height>32</height>
<width>0</width> </size>
<height>32</height> </property>
</size> <property name="maximumSize">
</property> <size>
<property name="maximumSize"> <width>16777215</width>
<size> <height>42</height>
<width>16777215</width> </size>
<height>42</height> </property>
</size> <property name="styleSheet">
</property> <string notr="true"/>
<property name="styleSheet"> </property>
<string notr="true"/> <property name="text">
</property> <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;
<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; &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; } 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;/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> &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> </property>
</widget> </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>
</item> </item>
<item row="0" column="2"> <item row="0" column="3">
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -804,6 +779,37 @@ p, li { white-space: pre-wrap; }
</property> </property>
</spacer> </spacer>
</item> </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> </layout>
</widget> </widget>
</item> </item>