mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Improvements to BlogDialog Layout,
Added new blog interface to GUI. Added ProfileView/Edit to Retroshare.pro git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@589 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9f8f0e46f5
commit
20aa2a031b
@ -99,6 +99,8 @@ HEADERS += rshare.h \
|
||||
util/RsAction.h \
|
||||
util/printpreview.h \
|
||||
gui/bwgraph/bwgraph.h \
|
||||
gui/profile/ProfileView.h \
|
||||
gui/profile/ProfileEdit.h \
|
||||
gui/chat/PopupChatDialog.h \
|
||||
gui/connect/ConnectDialog.h \
|
||||
gui/connect/ConfCertDialog.h \
|
||||
@ -177,6 +179,8 @@ FORMS += gui/ChatDialog.ui \
|
||||
gui/MessagesDialog.ui \
|
||||
gui/HelpDialog.ui \
|
||||
gui/bwgraph/bwgraph.ui \
|
||||
gui/profile/ProfileView.ui \
|
||||
gui/profile/ProfileEdit.ui \
|
||||
gui/chat/PopupChatDialog.ui \
|
||||
gui/connect/ConnectDialog.ui \
|
||||
gui/connect/ConfCertDialog.ui \
|
||||
@ -263,6 +267,8 @@ SOURCES += main.cpp \
|
||||
util/RsAction.cpp \
|
||||
util/printpreview.cpp \
|
||||
gui/bwgraph/bwgraph.cpp \
|
||||
gui/profile/ProfileView.cpp \
|
||||
gui/profile/ProfileEdit.cpp \
|
||||
gui/chat/PopupChatDialog.cpp \
|
||||
gui/connect/ConnectDialog.cpp \
|
||||
gui/connect/ConfCertDialog.cpp \
|
||||
|
@ -35,7 +35,7 @@ BlogDialog::BlogDialog(QWidget *parent)
|
||||
setupUi(this);
|
||||
|
||||
connect(sendBtn, SIGNAL(clicked()), this, SLOT(sendBlog()));
|
||||
connect(statusBtn, SIGNAL(clicked()), this, SLOT(setStatus()));
|
||||
//connect(statusBtn, SIGNAL(clicked()), this, SLOT(setStatus()));
|
||||
connect(boldBtn, SIGNAL(clicked()), this, SLOT(setFont()));
|
||||
connect(underlineBtn, SIGNAL(clicked()), this, SLOT(setFont()));
|
||||
connect(italicBtn, SIGNAL(clicked()), this, SLOT(setFont()));
|
||||
@ -171,10 +171,15 @@ void BlogDialog::addUser(const std::string &usr)
|
||||
void BlogDialog::clear(void)
|
||||
{
|
||||
blogText->clear();
|
||||
userList->clear();
|
||||
}
|
||||
|
||||
void BlogDialog::update(void)
|
||||
{
|
||||
updateUserList();
|
||||
updateBlogs();
|
||||
}
|
||||
|
||||
void BlogDialog::updateBlogs(void)
|
||||
{
|
||||
rsQblog->getFilterSwitch();
|
||||
|
||||
@ -212,6 +217,8 @@ void BlogDialog::update(void)
|
||||
/* print usr name and their blogs to screen */
|
||||
for(std::list<std::string>::iterator it = usrList.begin(); it !=usrList.end(); it++)
|
||||
{
|
||||
|
||||
|
||||
TempVar = rsPeers->getPeerName(*it).c_str(); // store usr name in temporary
|
||||
blogText->setTextColor(QColor(255, 0, 0, 255));
|
||||
blogText->setCurrentFont(mUsrFont); // make bold for username
|
||||
@ -221,7 +228,6 @@ void BlogDialog::update(void)
|
||||
/*print blog time-posted/msgs to screen*/
|
||||
|
||||
std::multimap<long int, std::string>::reverse_iterator blogIt = blogs[*it].rbegin();
|
||||
addUser(rsPeers->getPeerName(*it)); // add usr to Qwidget tree
|
||||
|
||||
if(blogs[*it].empty())
|
||||
{
|
||||
@ -246,5 +252,52 @@ void BlogDialog::update(void)
|
||||
}
|
||||
|
||||
|
||||
void BlogDialog::updateUserList(void)
|
||||
{
|
||||
/* retrieve usr names and populate usr list bar */
|
||||
|
||||
std::list<std::string> usrList;
|
||||
/* get existing list ... */
|
||||
std::list<std::string> filterList;
|
||||
|
||||
std::list<std::string>::iterator it;
|
||||
if ((!rsPeers) || (!rsQblog))
|
||||
{
|
||||
/* not ready yet! */
|
||||
return;
|
||||
}
|
||||
|
||||
rsPeers->getFriendList(usrList);
|
||||
usrList.push_back(rsPeers->getOwnId()); // add your id
|
||||
|
||||
//rsQblog->getFilterList(filterList);
|
||||
|
||||
|
||||
userList->clear();
|
||||
|
||||
/* print usr name and their blogs to screen */
|
||||
for(it = usrList.begin(); it !=usrList.end(); it++)
|
||||
{
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(userList);
|
||||
|
||||
bool active = false;
|
||||
if (filterList.end() != std::find(filterList.begin(), filterList.end(), *it))
|
||||
active = true;
|
||||
|
||||
item->setText(0, QString::fromStdString(rsPeers->getPeerName(*it))); // add usr to Qwidget tree
|
||||
item->setText(1, QString::fromStdString(*it)); // add usr id.
|
||||
|
||||
if (active)
|
||||
{
|
||||
item -> setCheckState(0, Qt::Checked);
|
||||
}
|
||||
else
|
||||
{
|
||||
item -> setCheckState(0, Qt::Unchecked);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -45,6 +45,8 @@ public slots:
|
||||
void update();
|
||||
|
||||
void showprofile(std::string id);
|
||||
void updateUserList();
|
||||
void updateBlogs();
|
||||
|
||||
private slots:
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -30,6 +30,8 @@
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
||||
#include "rsiface/rstypes.h"
|
||||
|
||||
|
||||
/* delcare interafce for everyone o use */
|
||||
@ -104,7 +106,36 @@ extern RsQblog *rsQblog;
|
||||
* @param blogs contains the blog msgs of usr along with time posted for sorting
|
||||
*/
|
||||
virtual bool getBlogs(std::map< std::string, std::multimap<long int, std:: string> > &blogs) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Stuff DrBob Added for Profile View!
|
||||
*/
|
||||
|
||||
/**
|
||||
* get users Latest Blog Post.
|
||||
* @param id the usr whose idetails you want to get.
|
||||
* @param ts Timestamp of the Blog Post.
|
||||
* @param post the actual Blog Post.
|
||||
*/
|
||||
|
||||
virtual bool getPeerLatestBlog(std::string id, uint32_t &ts, std::wstring &post) = 0;
|
||||
|
||||
/**
|
||||
* get users Profile.
|
||||
* @param id the user id
|
||||
* @param entries set of profile information.
|
||||
*/
|
||||
virtual bool getPeerProfile(std::string id, std::list< std::pair<std::wstring, std::wstring> > &entries) = 0;
|
||||
/**
|
||||
* get users fav files
|
||||
* @param id the user whose info you want.
|
||||
* @param favs list of Files
|
||||
*/
|
||||
virtual bool getPeerFavourites(std::string id, std::list<FileInfo> &favs) = 0;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif /*RSQBLOG_H_*/
|
||||
|
Loading…
Reference in New Issue
Block a user