mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-10 01:55:19 -04:00
updated to make sure it compiled
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@732 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d14a1ffb39
commit
d7bcd50ad7
5 changed files with 63 additions and 117 deletions
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
#include <QtGui>
|
||||
|
@ -38,29 +38,29 @@ BlogDialog::BlogDialog(QWidget *parent)
|
|||
setupUi(this);
|
||||
|
||||
connect(postButton, SIGNAL(clicked()), this, SLOT(postBlog()));
|
||||
|
||||
|
||||
/* mLayout -> to add widgets to */
|
||||
mLayout = new QVBoxLayout;
|
||||
//mLayout->setSpacing(0);
|
||||
//mLayout->setMargin(0);
|
||||
|
||||
|
||||
QWidget *middleWidget = new QWidget();
|
||||
middleWidget->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum);
|
||||
middleWidget->setLayout(mLayout);
|
||||
|
||||
|
||||
QScrollArea *scrollArea = new QScrollArea;
|
||||
//scrollArea->setBackgroundRole(QPalette::Dark);
|
||||
scrollArea->setWidget(middleWidget);
|
||||
scrollArea->setWidgetResizable(true);
|
||||
scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
|
||||
|
||||
QVBoxLayout *layout2 = new QVBoxLayout;
|
||||
layout2->addWidget(scrollArea);
|
||||
layout2->setSpacing(0);
|
||||
layout2->setMargin(0);
|
||||
|
||||
|
||||
frame->setLayout(layout2);
|
||||
|
||||
|
||||
addDummyData();
|
||||
|
||||
updateBlogsStatic();
|
||||
|
@ -83,79 +83,79 @@ void BlogDialog::updateBlogsStatic(void)
|
|||
|
||||
#if 0
|
||||
rsQblog->getFilterSwitch();
|
||||
|
||||
|
||||
std::map<std::string, std::string> UsrStatus;
|
||||
|
||||
|
||||
if(!rsQblog->getStatus(UsrStatus))
|
||||
std::cerr << "failed to get usr status" << std::endl;
|
||||
|
||||
|
||||
clear(); //create a clear screen
|
||||
|
||||
|
||||
/* retrieve usr names and populate usr list bar */
|
||||
|
||||
std::list<std::string> usrList;
|
||||
|
||||
std::list<std::string> usrList;
|
||||
QString TempVar; // to convert numerics to string note: tbd find way to avoid temporary
|
||||
|
||||
|
||||
if (!rsPeers)
|
||||
{
|
||||
/* not ready yet! */
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(!rsPeers->getFriendList(usrList))
|
||||
std::cerr << "failed to get friend list";
|
||||
|
||||
|
||||
|
||||
|
||||
usrList.push_back(rsPeers->getOwnId()); // add your id
|
||||
|
||||
|
||||
/* populate the blog msgs screen */
|
||||
|
||||
|
||||
std::map< std::string, std::multimap<long int, std::string> > blogs; // to store blogs
|
||||
|
||||
|
||||
if(!rsQblog->getBlogs(blogs))
|
||||
std::cerr << "failed to get blogs" << std::endl;
|
||||
|
||||
|
||||
/* 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
|
||||
blogText->setCurrentFont(mUsrFont); // make bold for username
|
||||
blogText->append("\n" + TempVar); // write usr name to screen
|
||||
std::cerr << "creating usr tree" << std::endl;
|
||||
|
||||
|
||||
/*print blog time-posted/msgs to screen*/
|
||||
|
||||
std::multimap<long int, std::string>::reverse_iterator blogIt = blogs[*it].rbegin();
|
||||
|
||||
|
||||
std::multimap<long int, std::string>::reverse_iterator blogIt = blogs[*it].rbegin();
|
||||
|
||||
if(blogs[*it].empty())
|
||||
{
|
||||
std::cerr << "usr blog empty!" << std::endl;
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
for( ; blogIt != blogs[*it].rend(); blogIt++)
|
||||
{
|
||||
{
|
||||
std::cerr << "now printing blogs" << std::endl;
|
||||
time_t postedTime = blogIt->first;
|
||||
time(&postedTime); //convert to human readable time
|
||||
blogText->setTextColor(QColor(255, 0, 0, 255)); //
|
||||
blogText->setTextColor(QColor(255, 0, 0, 255)); //
|
||||
blogText->setCurrentFont(mUsrFont); // make bold for posted date
|
||||
blogText->append("\nPosted: " + QString (ctime(&postedTime))); // print time of blog to screen
|
||||
blogText->append("\nPosted: " + QString (ctime(&postedTime))); // print time of blog to screen
|
||||
blogText->setCurrentFont(mCurrentFont); // reset the font for blog messages
|
||||
blogText->setTextColor(QColor(0, 0, 0, 255)); // set back color to black
|
||||
blogText->append(blogIt->second.c_str()); // print blog msg to screen
|
||||
}
|
||||
|
||||
}
|
||||
blogText->append(blogIt->second.c_str()); // print blog msg to screen
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void BlogDialog::addDummyData()
|
||||
{
|
||||
BlogMsgItem *bm1 = new BlogMsgItem(this, 0, "peerId", "msgId", true);
|
||||
|
@ -189,6 +189,7 @@ void BlogDialog::openChat(std::string peerId)
|
|||
|
||||
void BlogDialog::postBlog()
|
||||
{
|
||||
|
||||
openMsg(FEEDHOLDER_MSG_BLOG, "", "");
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
|||
#include "mainpage.h"
|
||||
#include "ui_BlogDialog.h"
|
||||
|
||||
#include "gui/feeds/FeedHolder.h"
|
||||
#include "../gui/feeds/FeedHolder.h"
|
||||
class BlogMsgItem;
|
||||
|
||||
|
||||
|
@ -42,12 +42,12 @@ public:
|
|||
virtual void openChat(std::string peerId);
|
||||
virtual void openMsg(uint32_t type, std::string grpId, std::string inReplyTo);
|
||||
|
||||
void updateBlogsStatic();
|
||||
void updateBlogsStatic();
|
||||
|
||||
private slots:
|
||||
|
||||
void updateBlogs();
|
||||
void postBlog();
|
||||
void updateBlogs();
|
||||
void postBlog();
|
||||
|
||||
private:
|
||||
void addDummyData();
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
|
@ -44,10 +44,10 @@ ProfileEdit::ProfileEdit(QWidget *parent)
|
|||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
|
||||
connect( ui.profileTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( profileCustomPopupMenu( QPoint ) ) );
|
||||
|
||||
// connect up the buttons.
|
||||
|
||||
// connect up the buttons.
|
||||
connect(ui.addButton, SIGNAL(clicked()), this, SLOT(profileEntryAdd()));
|
||||
connect(ui.moveDownButton, SIGNAL(clicked()), this, SLOT(profileEntryMoveDown()));
|
||||
connect(ui.moveUpButton, SIGNAL(clicked()), this, SLOT(profileEntryMoveUp()));
|
||||
|
@ -99,8 +99,6 @@ void ProfileEdit::update()
|
|||
std::list< std::pair<std::wstring, std::wstring> > profile;
|
||||
std::list< std::pair<std::wstring, std::wstring> >::iterator pit;
|
||||
|
||||
rsQblog -> getPeerProfile(pId, profile);
|
||||
|
||||
QList<QTreeWidgetItem *> itemList;
|
||||
for(pit = profile.begin(); pit != profile.end(); pit++)
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
|
@ -45,13 +45,13 @@ ProfileView::ProfileView(QWidget *parent)
|
|||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
|
||||
connect( ui.photoLabel, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( imageCustomPopupMenu( QPoint ) ) );
|
||||
connect( ui.profileTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( profileCustomPopupMenu( QPoint ) ) );
|
||||
connect( ui.fileTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( fileCustomPopupMenu( QPoint ) ) );
|
||||
//
|
||||
|
||||
// connect up the buttons.
|
||||
|
||||
// connect up the buttons.
|
||||
connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(closeView()));
|
||||
|
||||
/* Hide platform specific features */
|
||||
|
@ -176,7 +176,7 @@ void ProfileView::update()
|
|||
//{
|
||||
// isOwnId = true;
|
||||
//}
|
||||
|
||||
|
||||
mIsOwnId = true; /* switche on context menues */
|
||||
|
||||
if (!rsQblog)
|
||||
|
@ -185,7 +185,7 @@ void ProfileView::update()
|
|||
return;
|
||||
}
|
||||
|
||||
uint32_t PostTs;
|
||||
uint32_t PostTs;
|
||||
std::wstring BlogPost;
|
||||
std::list< std::pair<std::wstring, std::wstring> > profile;
|
||||
std::list< std::pair<std::wstring, std::wstring> >::iterator pit;
|
||||
|
@ -193,8 +193,6 @@ void ProfileView::update()
|
|||
std::list<FileInfo>::iterator fit;
|
||||
|
||||
rsQblog -> getPeerLatestBlog(pId, PostTs, BlogPost);
|
||||
rsQblog -> getPeerProfile(pId, profile);
|
||||
rsQblog -> getPeerFavourites(pId, files);
|
||||
|
||||
ui.idLineEdit->setText(QString::fromStdString(pId));
|
||||
ui.nameLineEdit->setText(QString::fromStdString("username"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue