mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-13 16:39:43 -05:00
Added Online since Label to ProfileWidget
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3198 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
1edca45020
commit
6202a0b201
@ -34,16 +34,17 @@
|
||||
/* Define the format used for displaying the date and time */
|
||||
#define DATETIME_FMT "MMM dd hh:mm:ss"
|
||||
|
||||
|
||||
/** Default constructor */
|
||||
ProfileWidget::ProfileWidget(QWidget *parent, Qt::WFlags flags)
|
||||
: QWidget(parent, flags)
|
||||
{
|
||||
/* Invoke Qt Designer generated QObject setup routine */
|
||||
ui.setupUi(this);
|
||||
/* Invoke Qt Designer generated QObject setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
connect(ui.editstatuspushButton,SIGNAL(clicked()), this, SLOT(statusmessagedlg()));
|
||||
|
||||
//loadDialog();
|
||||
connect(ui.editstatuspushButton,SIGNAL(clicked()), this, SLOT(statusmessagedlg()));
|
||||
|
||||
}
|
||||
|
||||
/** Destructor. */
|
||||
@ -52,62 +53,63 @@ ProfileWidget::~ProfileWidget()
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ProfileWidget::closeEvent (QCloseEvent * event)
|
||||
{
|
||||
QWidget::closeEvent(event);
|
||||
QWidget::closeEvent(event);
|
||||
}
|
||||
|
||||
void ProfileWidget::showEvent ( QShowEvent * event )
|
||||
{
|
||||
|
||||
RsPeerDetails detail;
|
||||
if (rsPeers->getPeerDetails(rsPeers->getOwnId(),detail))
|
||||
{
|
||||
if (rsPeers->getPeerDetails(rsPeers->getOwnId(),detail))
|
||||
{
|
||||
|
||||
ui.name->setText(QString::fromStdString(detail.name));
|
||||
ui.name->setText(QString::fromStdString(detail.name));
|
||||
ui.country->setText(QString::fromStdString(detail.location));
|
||||
|
||||
ui.peerid->setText(QString::fromStdString(detail.id));
|
||||
ui.peerid->setText(QString::fromStdString(detail.id));
|
||||
|
||||
// Dont Show a timestamp in RS calculate the day
|
||||
QDateTime date = QDateTime::fromTime_t(detail.lastConnect);
|
||||
QString stime = date.toString(Qt::LocalDate);
|
||||
|
||||
/* set retroshare version */
|
||||
std::map<std::string, std::string>::iterator vit;
|
||||
std::map<std::string, std::string> versions;
|
||||
/* set retroshare version */
|
||||
std::map<std::string, std::string>::iterator vit;
|
||||
std::map<std::string, std::string> versions;
|
||||
bool retv = rsDisc->getDiscVersions(versions);
|
||||
if (retv && versions.end() != (vit = versions.find(detail.id)))
|
||||
{
|
||||
ui.version->setText(QString::fromStdString(vit->second));
|
||||
}
|
||||
|
||||
ui.ipAddressList->clear();
|
||||
for(std::list<std::string>::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it)
|
||||
ui.ipAddressList->addItem(QString::fromStdString(*it));
|
||||
ui.ipAddressList->clear();
|
||||
for(std::list<std::string>::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it)
|
||||
ui.ipAddressList->addItem(QString::fromStdString(*it));
|
||||
|
||||
|
||||
/* set local address */
|
||||
ui.localAddress->setText(QString::fromStdString(detail.localAddr));
|
||||
ui.localPort -> setText(QString::number(detail.localPort));
|
||||
ui.localPort -> setText(QString::number(detail.localPort));
|
||||
/* set the server address */
|
||||
ui.extAddress->setText(QString::fromStdString(detail.extAddr));
|
||||
ui.extPort -> setText(QString::number(detail.extPort));
|
||||
/* set DynDNS */
|
||||
ui.dyndns->setText(QString::fromStdString(detail.dyndns));
|
||||
ui.dyndns->setCursorPosition (0);
|
||||
ui.extPort -> setText(QString::number(detail.extPort));
|
||||
/* set DynDNS */
|
||||
ui.dyndns->setText(QString::fromStdString(detail.dyndns));
|
||||
ui.dyndns->setCursorPosition (0);
|
||||
|
||||
std::list<std::string> ids;
|
||||
ids.clear();
|
||||
std::list<std::string> ids;
|
||||
ids.clear();
|
||||
rsPeers->getGPGAcceptedList(ids);
|
||||
int friends = ids.size();
|
||||
|
||||
std::ostringstream out;
|
||||
out << friends << "";
|
||||
ui.friendsEdit->setText(QString::fromStdString(out.str()));
|
||||
|
||||
ui.onlinesince->setText(QDateTime::currentDateTime().toString(DATETIME_FMT));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -32,27 +32,25 @@ class ProfileWidget : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/** Default constructor */
|
||||
ProfileWidget(QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||
/** Default destructor */
|
||||
~ProfileWidget();
|
||||
/** Default constructor */
|
||||
ProfileWidget(QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||
/** Default destructor */
|
||||
~ProfileWidget();
|
||||
|
||||
|
||||
protected:
|
||||
void closeEvent (QCloseEvent * event);
|
||||
void closeEvent (QCloseEvent * event);
|
||||
|
||||
private slots:
|
||||
|
||||
void showEvent ( QShowEvent * event );
|
||||
void statusmessagedlg();
|
||||
void showEvent ( QShowEvent * event );
|
||||
void statusmessagedlg();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::ProfileWidget ui;
|
||||
/** Qt Designer generated object */
|
||||
Ui::ProfileWidget ui;
|
||||
|
||||
};
|
||||
|
||||
|
@ -96,7 +96,7 @@ border: 1px solid #CCCCCC;
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>498</width>
|
||||
<height>569</height>
|
||||
<height>574</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
@ -264,7 +264,7 @@ background-color: white;
|
||||
border: 2px solid #CCCCCC;}</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="0" column="0" colspan="3">
|
||||
<item row="0" column="0" colspan="4">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
@ -295,7 +295,7 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
@ -306,7 +306,7 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="friendsEdit">
|
||||
<property name="font">
|
||||
<font>
|
||||
@ -319,7 +319,7 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<item row="2" column="2" colspan="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@ -332,7 +332,7 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
@ -343,7 +343,7 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="version">
|
||||
<property name="font">
|
||||
<font>
|
||||
@ -356,7 +356,7 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<item row="3" column="2" colspan="2">
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@ -369,6 +369,43 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; color:#76746c;">Online since</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="onlinesince">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2" colspan="2">
|
||||
<spacer name="horizontalSpacer_10">
|
||||
<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>
|
||||
</widget>
|
||||
</item>
|
||||
@ -620,7 +657,11 @@ p, li { white-space: pre-wrap; }
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Addresses list</string>
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; color:#76746c;">Addresses list</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -660,6 +701,10 @@ p, li { white-space: pre-wrap; }
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
Loading…
Reference in New Issue
Block a user