From 6202a0b201d9e4d7ffd705f18b59e8f5c4571c42 Mon Sep 17 00:00:00 2001 From: defnax Date: Thu, 24 Jun 2010 15:38:38 +0000 Subject: [PATCH] Added Online since Label to ProfileWidget git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3198 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- .../src/gui/profile/ProfileWidget.cpp | 50 ++++++++------- .../src/gui/profile/ProfileWidget.h | 20 +++--- .../src/gui/profile/ProfileWidget.ui | 63 ++++++++++++++++--- 3 files changed, 89 insertions(+), 44 deletions(-) diff --git a/retroshare-gui/src/gui/profile/ProfileWidget.cpp b/retroshare-gui/src/gui/profile/ProfileWidget.cpp index e1bb18296..482bd823e 100644 --- a/retroshare-gui/src/gui/profile/ProfileWidget.cpp +++ b/retroshare-gui/src/gui/profile/ProfileWidget.cpp @@ -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::iterator vit; - std::map versions; + /* set retroshare version */ + std::map::iterator vit; + std::map 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::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it) - ui.ipAddressList->addItem(QString::fromStdString(*it)); + ui.ipAddressList->clear(); + for(std::list::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 ids; - ids.clear(); + std::list 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)); - } + } } diff --git a/retroshare-gui/src/gui/profile/ProfileWidget.h b/retroshare-gui/src/gui/profile/ProfileWidget.h index 6bddf513a..0b80864e5 100644 --- a/retroshare-gui/src/gui/profile/ProfileWidget.h +++ b/retroshare-gui/src/gui/profile/ProfileWidget.h @@ -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; }; diff --git a/retroshare-gui/src/gui/profile/ProfileWidget.ui b/retroshare-gui/src/gui/profile/ProfileWidget.ui index 8f6265133..901249d05 100644 --- a/retroshare-gui/src/gui/profile/ProfileWidget.ui +++ b/retroshare-gui/src/gui/profile/ProfileWidget.ui @@ -96,7 +96,7 @@ border: 1px solid #CCCCCC; 0 0 498 - 569 + 574 @@ -264,7 +264,7 @@ background-color: white; border: 2px solid #CCCCCC;} - + @@ -295,7 +295,7 @@ p, li { white-space: pre-wrap; } - + <!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; } - + @@ -319,7 +319,7 @@ p, li { white-space: pre-wrap; } - + Qt::Horizontal @@ -332,7 +332,7 @@ p, li { white-space: pre-wrap; } - + <!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; } - + @@ -356,7 +356,7 @@ p, li { white-space: pre-wrap; } - + Qt::Horizontal @@ -369,6 +369,43 @@ p, li { white-space: pre-wrap; } + + + + <!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> + + + + + + + + 75 + true + + + + TextLabel + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -620,7 +657,11 @@ p, li { white-space: pre-wrap; } - Addresses list + <!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> @@ -660,6 +701,10 @@ p, li { white-space: pre-wrap; } + + + +