From de288d196d185ffbf2f77b4154ec84e9506e80ba Mon Sep 17 00:00:00 2001 From: defnax Date: Mon, 25 Jan 2010 22:08:23 +0000 Subject: [PATCH] added to show personal status of each friend when its avaible git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2128 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/MessengerWindow.cpp | 55 +++++++--------------- retroshare-gui/src/gui/MessengerWindow.h | 3 +- retroshare-gui/src/gui/MessengerWindow.ui | 14 +----- 3 files changed, 22 insertions(+), 50 deletions(-) diff --git a/retroshare-gui/src/gui/MessengerWindow.cpp b/retroshare-gui/src/gui/MessengerWindow.cpp index 411157a0d..77029fa98 100644 --- a/retroshare-gui/src/gui/MessengerWindow.cpp +++ b/retroshare-gui/src/gui/MessengerWindow.cpp @@ -115,9 +115,6 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags) QHeaderView * _header = ui.messengertreeWidget->header () ; _header->setResizeMode (0, QHeaderView::Interactive); - //_header->setResizeMode (1, QHeaderView::Interactive); - //_header->setResizeMode (2, QHeaderView::Interactive); - //_header->setResizeMode (3, QHeaderView::Interactive); _header->resizeSection ( 0, 200 ); @@ -128,7 +125,7 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags) ui.statuscomboBox->setMinimumWidth(20); - ui.messagecomboBox->setMinimumWidth(20); + ui.messagelineEdit->setMinimumWidth(20); ui.searchlineEdit->setMinimumWidth(20); updateAvatar(); @@ -136,6 +133,7 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags) itemFont = QFont("ARIAL", 10); itemFont.setBold(true); + loadmystatus(); /* Hide platform specific features */ #ifdef Q_WS_WIN @@ -227,13 +225,15 @@ void MessengerWindow::insertPeers() /* add all the labels */ /* (0) Person */ - item -> setText(0, QString::fromStdString(details.name)); - /* (1) Org */ - //item -> setText(1, QString::fromStdString(details.org)); - /* (2) Location */ - //item -> setText(2, QString::fromStdString(details.location)); - /* (3) Email */ - //item -> setText(3, QString::fromStdString(details.email)); + if (rsMsgs->getCustomStateString(details.id) != "") + { + item -> setText( 0, QString::fromStdString(details.name) + tr(" - ") + QString::fromStdString(rsMsgs->getCustomStateString(details.id))); + } + else + { + item -> setText(0, QString::fromStdString(details.name)); + } + /* Hidden ones: RsCertId */ item -> setText(4, QString::fromStdString(details.id)); @@ -522,37 +522,12 @@ void MessengerWindow::changeAvatarClicked() /** Add a Friend ShortCut */ void MessengerWindow::addFriend2() { - /* call load Certificate */ -#if 0 - std::string id; - if (connectionsDialog) - { - id = connectionsDialog->loadneighbour(); - } - - /* call make Friend */ - if (id != "") - { - connectionsDialog->showpeerdetails(id); - } - virtual int NeighLoadPEMString(std::string pem, std::string &id) = 0; -#else -/* - static AddFriendDialog *addDialog2 = - new AddFriendDialog(networkDialog2, this); - - std::string invite = ""; - addDialog2->setInfo(invite); - addDialog2->show(); - */ ConnectFriendWizard* connwiz = new ConnectFriendWizard(this); - // set widget to be deleted after close connwiz->setAttribute( Qt::WA_DeleteOnClose, true); - connwiz->show(); -#endif + } LogoBar & MessengerWindow::getLogoBar() const { @@ -601,3 +576,9 @@ void MessengerWindow::getAvatar() updateAvatar() ; } } + +/** Loads own personal status */ +void MessengerWindow::loadmystatus() +{ + ui.messagelineEdit->setText(QString::fromStdString(rsMsgs->getCustomStateString())); +} diff --git a/retroshare-gui/src/gui/MessengerWindow.h b/retroshare-gui/src/gui/MessengerWindow.h index 6a8be5bf4..5082c7300 100644 --- a/retroshare-gui/src/gui/MessengerWindow.h +++ b/retroshare-gui/src/gui/MessengerWindow.h @@ -97,7 +97,8 @@ private slots: void changeAvatarClicked(); void updateAvatar(); - + + void loadmystatus(); private: diff --git a/retroshare-gui/src/gui/MessengerWindow.ui b/retroshare-gui/src/gui/MessengerWindow.ui index f60ec6100..a815c1b20 100644 --- a/retroshare-gui/src/gui/MessengerWindow.ui +++ b/retroshare-gui/src/gui/MessengerWindow.ui @@ -189,18 +189,8 @@ p, li { white-space: pre-wrap; } - - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Share a personal message with your contacts</p></body></html> - - - true - - + +