mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Added blogs to unfinished to assist with debian builds
- blog currently uses qt 4.6 (qwebview) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2402 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
aeb0f44259
commit
791f91981b
585
retroshare-gui/src/gui/unfinished/blogs/BlogsDialog.cpp
Normal file
585
retroshare-gui/src/gui/unfinished/blogs/BlogsDialog.cpp
Normal file
@ -0,0 +1,585 @@
|
||||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2008 Robert Fernie
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
#include <QtGui>
|
||||
#include <QContextMenuEvent>
|
||||
#include <QCursor>
|
||||
#include <QMenu>
|
||||
#include <QMouseEvent>
|
||||
#include <QPixmap>
|
||||
#include <QPoint>
|
||||
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
|
||||
#include "rsiface/rsblogs.h"
|
||||
#include "rsiface/rspeers.h" //to retrieve peer/usrId info
|
||||
|
||||
#include "BlogsDialog.h"
|
||||
|
||||
#include "BlogsMsgItem.h"
|
||||
#include "CreateBlog.h"
|
||||
#include "CreateBlogMsg.h"
|
||||
|
||||
#include "gui/ChanGroupDelegate.h"
|
||||
#include "gui/GeneralMsgDialog.h"
|
||||
|
||||
|
||||
/** Constructor */
|
||||
BlogsDialog::BlogsDialog(QWidget *parent)
|
||||
: MainPage (parent)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
setupUi(this);
|
||||
|
||||
connect(actionCreate_Channel, SIGNAL(triggered()), this, SLOT(createChannel()));
|
||||
connect(postButton, SIGNAL(clicked()), this, SLOT(createMsg()));
|
||||
connect(subscribeButton, SIGNAL( clicked( void ) ), this, SLOT( subscribeChannel ( void ) ) );
|
||||
connect(unsubscribeButton, SIGNAL( clicked( void ) ), this, SLOT( unsubscribeChannel ( void ) ) );
|
||||
|
||||
|
||||
mBlogId = "";
|
||||
mPeerId = rsPeers->getOwnId(); // add your id
|
||||
|
||||
model = new QStandardItemModel(0, 2, this);
|
||||
model->setHeaderData(0, Qt::Horizontal, tr("Name"), Qt::DisplayRole);
|
||||
model->setHeaderData(1, Qt::Horizontal, tr("ID"), Qt::DisplayRole);
|
||||
|
||||
treeView->setModel(model);
|
||||
treeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
|
||||
treeView->setItemDelegate(new ChanGroupDelegate());
|
||||
//treeView->setRootIsDecorated(false);
|
||||
|
||||
// hide header and id column
|
||||
treeView->setHeaderHidden(true);
|
||||
treeView->hideColumn(1);
|
||||
|
||||
QStandardItem *item1 = new QStandardItem(tr("Own Blogs"));
|
||||
QStandardItem *item2 = new QStandardItem(tr("Subscribed Blogs"));
|
||||
QStandardItem *item3 = new QStandardItem(tr("Popular Blogs"));
|
||||
QStandardItem *item4 = new QStandardItem(tr("Other Blogs"));
|
||||
|
||||
model->appendRow(item1);
|
||||
model->appendRow(item2);
|
||||
model->appendRow(item3);
|
||||
model->appendRow(item4);
|
||||
|
||||
connect(treeView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(selectChannel(const QModelIndex &)));
|
||||
connect(treeView, SIGNAL(activated(const QModelIndex &)), this, SLOT(toggleSelection(const QModelIndex &)));
|
||||
connect(treeView, SIGNAL(customContextMenuRequested( QPoint ) ), this, SLOT( channelListCustomPopupMenu( QPoint ) ) );
|
||||
|
||||
//added from ahead
|
||||
updateChannelList();
|
||||
|
||||
mChannelFont = QFont("MS SANS SERIF", 22);
|
||||
nameLabel->setFont(mChannelFont);
|
||||
|
||||
nameLabel->setMinimumWidth(20);
|
||||
|
||||
itemFont = QFont("ARIAL", 10);
|
||||
itemFont.setBold(true);
|
||||
item1->setFont(itemFont);
|
||||
item2->setFont(itemFont);
|
||||
item3->setFont(itemFont);
|
||||
item4->setFont(itemFont);
|
||||
|
||||
item1->setForeground(QBrush(QColor(79, 79, 79)));
|
||||
item2->setForeground(QBrush(QColor(79, 79, 79)));
|
||||
item3->setForeground(QBrush(QColor(79, 79, 79)));
|
||||
item4->setForeground(QBrush(QColor(79, 79, 79)));
|
||||
|
||||
QMenu *channelmenu = new QMenu();
|
||||
channelmenu->addAction(actionCreate_Channel);
|
||||
channelmenu->addSeparator();
|
||||
channelpushButton->setMenu(channelmenu);
|
||||
|
||||
|
||||
QTimer *timer = new QTimer(this);
|
||||
timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate()));
|
||||
timer->start(1000);
|
||||
}
|
||||
|
||||
void BlogsDialog::channelListCustomPopupMenu( QPoint point )
|
||||
{
|
||||
QMenu contextMnu( this );
|
||||
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
|
||||
|
||||
QAction *channeldetailsAct = new QAction(QIcon(":/images/info16.png"), tr( "Show Channel Details" ), this );
|
||||
connect( channeldetailsAct , SIGNAL( triggered() ), this, SLOT( showChannelDetails() ) );
|
||||
|
||||
contextMnu.clear();
|
||||
contextMnu.addAction( channeldetailsAct );
|
||||
|
||||
contextMnu.exec( mevent->globalPos() );
|
||||
|
||||
|
||||
}
|
||||
|
||||
void BlogsDialog::createChannel()
|
||||
{
|
||||
CreateBlog *cf = new CreateBlog(NULL, false);
|
||||
|
||||
cf->setWindowTitle(tr("Create a new Blog"));
|
||||
cf->show();
|
||||
}
|
||||
|
||||
void BlogsDialog::channelSelection()
|
||||
{
|
||||
/* which item was selected? */
|
||||
|
||||
|
||||
/* update mBlogId */
|
||||
|
||||
updateChannelMsgs();
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************************/
|
||||
/*************************************************************************************/
|
||||
/*************************************************************************************/
|
||||
|
||||
void BlogsDialog::deleteFeedItem(QWidget *item, uint32_t type)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void BlogsDialog::openChat(std::string peerId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void BlogsDialog::openMsg(uint32_t type, std::string grpId, std::string inReplyTo)
|
||||
{
|
||||
#ifdef CHAN_DEBUG
|
||||
std::cerr << "BlogsDialog::openMsg()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
GeneralMsgDialog *msgDialog = new GeneralMsgDialog(NULL);
|
||||
|
||||
|
||||
msgDialog->addDestination(type, grpId, inReplyTo);
|
||||
|
||||
msgDialog->show();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void BlogsDialog::createMsg()
|
||||
{
|
||||
if (mBlogId == "")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CreateBlogMsg *msgDialog = new CreateBlogMsg(mBlogId);
|
||||
|
||||
msgDialog->show();
|
||||
return;
|
||||
}
|
||||
|
||||
void BlogsDialog::selectChannel( std::string cId)
|
||||
{
|
||||
mBlogId = cId;
|
||||
|
||||
updateChannelMsgs();
|
||||
}
|
||||
|
||||
void BlogsDialog::selectChannel(const QModelIndex &index)
|
||||
{
|
||||
int row = index.row();
|
||||
int col = index.column();
|
||||
if (col != 1) {
|
||||
QModelIndex sibling = index.sibling(row, 1);
|
||||
if (sibling.isValid())
|
||||
mBlogId = sibling.data().toString().toStdString();
|
||||
} else
|
||||
mBlogId = index.data().toString().toStdString();
|
||||
updateChannelMsgs();
|
||||
}
|
||||
|
||||
void BlogsDialog::checkUpdate()
|
||||
{
|
||||
std::list<std::string> blogIds;
|
||||
std::list<std::string>::iterator it;
|
||||
if (!rsBlogs)
|
||||
return;
|
||||
|
||||
if (rsBlogs->blogsChanged(blogIds))
|
||||
{
|
||||
/* update Blogs List */
|
||||
updateChannelList();
|
||||
|
||||
it = std::find(blogIds.begin(), blogIds.end(), mBlogId);
|
||||
if (it != blogIds.end())
|
||||
{
|
||||
updateChannelMsgs();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BlogsDialog::updateChannelList()
|
||||
{
|
||||
|
||||
std::list<BlogInfo> channelList;
|
||||
std::list<BlogInfo>::iterator it;
|
||||
if (!rsBlogs)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
rsBlogs->getBlogList(channelList);
|
||||
|
||||
/* get the ids for our lists */
|
||||
std::list<std::string> adminIds;
|
||||
std::list<std::string> subIds;
|
||||
std::list<std::string> popIds;
|
||||
std::list<std::string> otherIds;
|
||||
std::multimap<uint32_t, std::string> popMap;
|
||||
|
||||
for(it = channelList.begin(); it != channelList.end(); it++)
|
||||
{
|
||||
/* sort it into Publish (Own), Subscribed, Popular and Other */
|
||||
uint32_t flags = it->blogFlags;
|
||||
|
||||
if (flags & RS_DISTRIB_ADMIN)
|
||||
{
|
||||
adminIds.push_back(it->blogId);
|
||||
}
|
||||
else if (flags & RS_DISTRIB_SUBSCRIBED)
|
||||
{
|
||||
subIds.push_back(it->blogId);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* rate the others by popularity */
|
||||
popMap.insert(std::make_pair(it->pop, it->blogId));
|
||||
}
|
||||
}
|
||||
|
||||
/* iterate backwards through popMap - take the top 5 or 10% of list */
|
||||
uint32_t popCount = 5;
|
||||
if (popCount < popMap.size() / 10)
|
||||
{
|
||||
popCount = popMap.size() / 10;
|
||||
}
|
||||
|
||||
uint32_t i = 0;
|
||||
uint32_t popLimit = 0;
|
||||
std::multimap<uint32_t, std::string>::reverse_iterator rit;
|
||||
for(rit = popMap.rbegin(); ((rit != popMap.rend()) && (i < popCount)); rit++, i++)
|
||||
{
|
||||
popIds.push_back(rit->second);
|
||||
}
|
||||
|
||||
if (rit != popMap.rend())
|
||||
{
|
||||
popLimit = rit->first;
|
||||
}
|
||||
|
||||
for(it = channelList.begin(); it != channelList.end(); it++)
|
||||
{
|
||||
/* ignore the ones we've done already */
|
||||
uint32_t flags = it->blogFlags;
|
||||
|
||||
if (flags & RS_DISTRIB_ADMIN)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if (flags & RS_DISTRIB_SUBSCRIBED)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (it->pop < popLimit)
|
||||
{
|
||||
otherIds.push_back(it->blogId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* now we have our lists ---> update entries */
|
||||
|
||||
updateChannelListOwn(adminIds);
|
||||
updateChannelListSub(subIds);
|
||||
updateChannelListPop(popIds);
|
||||
updateChannelListOther(otherIds);
|
||||
}
|
||||
|
||||
void BlogsDialog::updateChannelListOwn(std::list<std::string> &ids)
|
||||
{
|
||||
std::list<std::string>::iterator iit;
|
||||
|
||||
/* remove rows with groups before adding new ones */
|
||||
model->item(OWN)->removeRows(0, model->item(OWN)->rowCount());
|
||||
|
||||
for (iit = ids.begin(); iit != ids.end(); iit ++) {
|
||||
#ifdef CHAN_DEBUG
|
||||
std::cerr << "BlogsDialog::updateChannelListOwn(): " << *iit << std::endl;
|
||||
#endif
|
||||
QStandardItem *ownGroup = model->item(OWN);
|
||||
QList<QStandardItem *> channel;
|
||||
QStandardItem *item1 = new QStandardItem();
|
||||
QStandardItem *item2 = new QStandardItem();
|
||||
|
||||
BlogInfo ci;
|
||||
if (rsBlogs && rsBlogs->getBlogInfo(*iit, ci)) {
|
||||
item1->setData(QVariant(QString::fromStdWString(ci.blogName)), Qt::DisplayRole);
|
||||
item2->setData(QVariant(QString::fromStdString(ci.blogId)), Qt::DisplayRole);
|
||||
item1->setToolTip(tr("Popularity: %1\nFetches: %2\nAvailable: %3"
|
||||
).arg(QString::number(ci.pop)).arg(9999).arg(9999));
|
||||
} else {
|
||||
item1->setData(QVariant(QString("Unknown Blog")), Qt::DisplayRole);
|
||||
item2->setData(QVariant(QString::fromStdString(*iit)), Qt::DisplayRole);
|
||||
item1->setToolTip("Unknown Blog\nNo Description");
|
||||
}
|
||||
|
||||
channel.append(item1);
|
||||
channel.append(item2);
|
||||
ownGroup->appendRow(channel);
|
||||
}
|
||||
}
|
||||
|
||||
void BlogsDialog::updateChannelListSub(std::list<std::string> &ids)
|
||||
{
|
||||
std::list<std::string>::iterator iit;
|
||||
|
||||
/* remove rows with groups before adding new ones */
|
||||
model->item(SUBSCRIBED)->removeRows(0, model->item(SUBSCRIBED)->rowCount());
|
||||
|
||||
for (iit = ids.begin(); iit != ids.end(); iit ++) {
|
||||
#ifdef CHAN_DEBUG
|
||||
std::cerr << "BlogsDialog::updateChannelListSub(): " << *iit << std::endl;
|
||||
#endif
|
||||
QStandardItem *ownGroup = model->item(SUBSCRIBED);
|
||||
QList<QStandardItem *> channel;
|
||||
QStandardItem *item1 = new QStandardItem();
|
||||
QStandardItem *item2 = new QStandardItem();
|
||||
|
||||
BlogInfo ci;
|
||||
if (rsBlogs && rsBlogs->getBlogInfo(*iit, ci)) {
|
||||
item1->setData(QVariant(QString::fromStdWString(ci.blogName)), Qt::DisplayRole);
|
||||
item2->setData(QVariant(QString::fromStdString(ci.blogId)), Qt::DisplayRole);
|
||||
item1->setToolTip(tr("Popularity: %1\nFetches: %2\nAvailable: %3"
|
||||
).arg(QString::number(ci.pop)).arg(9999).arg(9999));
|
||||
} else {
|
||||
item1->setData(QVariant(QString("Unknown Channel")), Qt::DisplayRole);
|
||||
item2->setData(QVariant(QString::fromStdString(*iit)), Qt::DisplayRole);
|
||||
item1->setToolTip("Unknown Channel\nNo Description");
|
||||
}
|
||||
|
||||
channel.append(item1);
|
||||
channel.append(item2);
|
||||
ownGroup->appendRow(channel);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void BlogsDialog::updateChannelListPop(std::list<std::string> &ids)
|
||||
{
|
||||
std::list<std::string>::iterator iit;
|
||||
|
||||
/* remove rows with groups before adding new ones */
|
||||
model->item(POPULAR)->removeRows(0, model->item(POPULAR)->rowCount());
|
||||
|
||||
for (iit = ids.begin(); iit != ids.end(); iit ++) {
|
||||
#ifdef CHAN_DEBUG
|
||||
std::cerr << "BlogsDialog::updateChannelListPop(): " << *iit << std::endl;
|
||||
#endif
|
||||
QStandardItem *ownGroup = model->item(POPULAR);
|
||||
QList<QStandardItem *> channel;
|
||||
QStandardItem *item1 = new QStandardItem();
|
||||
QStandardItem *item2 = new QStandardItem();
|
||||
|
||||
BlogInfo ci;
|
||||
if (rsBlogs && rsBlogs->getBlogInfo(*iit, ci)) {
|
||||
item1->setData(QVariant(QString::fromStdWString(ci.blogName)), Qt::DisplayRole);
|
||||
item2->setData(QVariant(QString::fromStdString(ci.blogId)), Qt::DisplayRole);
|
||||
item1->setToolTip(tr("Popularity: %1\nFetches: %2\nAvailable: %3"
|
||||
).arg(QString::number(ci.pop)).arg(9999).arg(9999));
|
||||
} else {
|
||||
item1->setData(QVariant(QString("Unknown Channel")), Qt::DisplayRole);
|
||||
item2->setData(QVariant(QString::fromStdString(*iit)), Qt::DisplayRole);
|
||||
item1->setToolTip("Unknown Channel\nNo Description");
|
||||
}
|
||||
|
||||
channel.append(item1);
|
||||
channel.append(item2);
|
||||
ownGroup->appendRow(channel);
|
||||
}
|
||||
}
|
||||
|
||||
void BlogsDialog::updateChannelListOther(std::list<std::string> &ids)
|
||||
{
|
||||
std::list<std::string>::iterator iit;
|
||||
|
||||
/* remove rows with groups before adding new ones */
|
||||
model->item(OTHER)->removeRows(0, model->item(OTHER)->rowCount());
|
||||
|
||||
for (iit = ids.begin(); iit != ids.end(); iit ++) {
|
||||
#ifdef CHAN_DEBUG
|
||||
std::cerr << "BlogsDialog::updateChannelListOther(): " << *iit << std::endl;
|
||||
#endif
|
||||
QStandardItem *ownGroup = model->item(OTHER);
|
||||
QList<QStandardItem *> channel;
|
||||
QStandardItem *item1 = new QStandardItem();
|
||||
QStandardItem *item2 = new QStandardItem();
|
||||
|
||||
BlogInfo ci;
|
||||
if (rsBlogs && rsBlogs->getBlogInfo(*iit, ci)) {
|
||||
item1->setData(QVariant(QString::fromStdWString(ci.blogName)), Qt::DisplayRole);
|
||||
item2->setData(QVariant(QString::fromStdString(ci.blogId)), Qt::DisplayRole);
|
||||
item1->setToolTip(tr("Popularity: %1\nFetches: %2\nAvailable: %3"
|
||||
).arg(QString::number(ci.pop)).arg(9999).arg(9999));
|
||||
} else {
|
||||
item1->setData(QVariant(QString("Unknown Blog")), Qt::DisplayRole);
|
||||
item2->setData(QVariant(QString::fromStdString(*iit)), Qt::DisplayRole);
|
||||
item1->setToolTip("Unknown Blog\nNo Description");
|
||||
}
|
||||
|
||||
channel.append(item1);
|
||||
channel.append(item2);
|
||||
ownGroup->appendRow(channel);
|
||||
}
|
||||
}
|
||||
|
||||
void BlogsDialog::updateChannelMsgs()
|
||||
{
|
||||
if (!rsBlogs)
|
||||
return;
|
||||
|
||||
BlogInfo ci;
|
||||
if (!rsBlogs->getBlogInfo(mBlogId, ci))
|
||||
{
|
||||
postButton->setEnabled(false);
|
||||
subscribeButton->setEnabled(false);
|
||||
unsubscribeButton->setEnabled(false);
|
||||
nameLabel->setText("No Blog Selected");
|
||||
iconLabel->setEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
iconLabel->setEnabled(true);
|
||||
|
||||
/* set textcolor for Blog name */
|
||||
QString channelStr("<span style=\"font-size:22pt; font-weight:500;"
|
||||
"color:white;\">%1</span>");
|
||||
|
||||
/* set Blog name */
|
||||
QString cname = QString::fromStdWString(ci.blogName);
|
||||
nameLabel->setText(channelStr.arg(cname));
|
||||
|
||||
/* do buttons */
|
||||
if (ci.blogFlags & RS_DISTRIB_SUBSCRIBED)
|
||||
{
|
||||
subscribeButton->setEnabled(false);
|
||||
unsubscribeButton->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
subscribeButton->setEnabled(true);
|
||||
unsubscribeButton->setEnabled(false);
|
||||
}
|
||||
|
||||
if (ci.blogFlags & RS_DISTRIB_PUBLISH)
|
||||
{
|
||||
postButton->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
postButton->setEnabled(false);
|
||||
}
|
||||
|
||||
/* replace all the messages with new ones */
|
||||
std::list<BlogsMsgItem *>::iterator mit;
|
||||
for(mit = mBlogMsgItems.begin(); mit != mBlogMsgItems.end(); mit++)
|
||||
{
|
||||
delete (*mit);
|
||||
}
|
||||
mBlogMsgItems.clear();
|
||||
|
||||
std::list<BlogMsgSummary> msgs;
|
||||
std::list<BlogMsgSummary>::iterator it;
|
||||
|
||||
rsBlogs->getBlogMsgList(mBlogId, msgs);
|
||||
|
||||
for(it = msgs.begin(); it != msgs.end(); it++)
|
||||
{
|
||||
BlogsMsgItem *cmi = new BlogsMsgItem(this, 0, mPeerId, mBlogId, it->msgId, true);
|
||||
|
||||
mBlogMsgItems.push_back(cmi);
|
||||
verticalLayout_2->addWidget(cmi);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BlogsDialog::unsubscribeChannel()
|
||||
{
|
||||
#ifdef BLOG_DEBUG
|
||||
std::cerr << "BlogsDialog::unsubscribeChannel()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
if (rsBlogs)
|
||||
{
|
||||
rsBlogs->blogSubscribe(mBlogId, false);
|
||||
}
|
||||
updateChannelMsgs();
|
||||
}
|
||||
|
||||
|
||||
void BlogsDialog::subscribeChannel()
|
||||
{
|
||||
#ifdef BLOG_DEBUG
|
||||
std::cerr << "BlogsDialog::subscribeChannel()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
if (rsBlogs)
|
||||
{
|
||||
rsBlogs->blogSubscribe(mBlogId, true);
|
||||
}
|
||||
updateChannelMsgs();
|
||||
}
|
||||
|
||||
|
||||
void BlogsDialog::toggleSelection(const QModelIndex &index)
|
||||
{
|
||||
QItemSelectionModel *selectionModel = treeView->selectionModel();
|
||||
if (index.child(0, 0).isValid())
|
||||
selectionModel->select(index, QItemSelectionModel::Toggle);
|
||||
}
|
||||
|
||||
void BlogsDialog::showChannelDetails()
|
||||
{
|
||||
if (mBlogId == "")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!rsBlogs)
|
||||
return;
|
||||
|
||||
//static ChannelDetails *channelui = new ChannelDetails();
|
||||
|
||||
//channelui->showDetails(mBlogId);
|
||||
//channelui->show();
|
||||
|
||||
}
|
108
retroshare-gui/src/gui/unfinished/blogs/BlogsDialog.h
Normal file
108
retroshare-gui/src/gui/unfinished/blogs/BlogsDialog.h
Normal file
@ -0,0 +1,108 @@
|
||||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2008 Robert Fernie
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#ifndef _BLOGSDIALOG_H
|
||||
#define _BLOGSDIALOG_H
|
||||
|
||||
#include "gui/mainpage.h"
|
||||
#include "ui_BlogsDialog.h"
|
||||
|
||||
#include <QStandardItemModel>
|
||||
|
||||
#include "gui/feeds/FeedHolder.h"
|
||||
|
||||
#define OWN 0
|
||||
#define SUBSCRIBED 1
|
||||
#define POPULAR 2
|
||||
#define OTHER 3
|
||||
|
||||
class BlogsMsgItem;
|
||||
|
||||
|
||||
class BlogsDialog : public MainPage, public FeedHolder, private Ui::BlogsDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/** Default Constructor */
|
||||
BlogsDialog(QWidget *parent = 0);
|
||||
/** Default Destructor */
|
||||
|
||||
|
||||
virtual void deleteFeedItem(QWidget *item, uint32_t type);
|
||||
virtual void openChat(std::string peerId);
|
||||
virtual void openMsg(uint32_t type, std::string grpId, std::string inReplyTo);
|
||||
|
||||
public slots:
|
||||
|
||||
void selectChannel( std::string );
|
||||
void selectChannel(const QModelIndex &);
|
||||
void toggleSelection(const QModelIndex &);
|
||||
|
||||
private slots:
|
||||
|
||||
void channelListCustomPopupMenu( QPoint point );
|
||||
|
||||
void checkUpdate();
|
||||
|
||||
void createChannel();
|
||||
//void sendMsg();
|
||||
|
||||
void channelSelection();
|
||||
|
||||
void subscribeChannel();
|
||||
void unsubscribeChannel();
|
||||
|
||||
void createMsg();
|
||||
|
||||
void showChannelDetails();
|
||||
|
||||
private:
|
||||
|
||||
void updateChannelList();
|
||||
void updateChannelListOwn(std::list<std::string> &ids);
|
||||
void updateChannelListSub(std::list<std::string> &ids);
|
||||
void updateChannelListPop(std::list<std::string> &ids);
|
||||
void updateChannelListOther(std::list<std::string> &ids);
|
||||
|
||||
void updateChannelMsgs();
|
||||
|
||||
QStandardItemModel *model;
|
||||
|
||||
std::string mBlogId; /* current Channel */
|
||||
std::string mPeerId;
|
||||
|
||||
/* Layout Pointers */
|
||||
QBoxLayout *mMsgLayout;
|
||||
|
||||
|
||||
|
||||
std::list<BlogsMsgItem *> mBlogMsgItems;
|
||||
|
||||
QFont mChannelFont;
|
||||
QFont itemFont;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
590
retroshare-gui/src/gui/unfinished/blogs/BlogsDialog.ui
Normal file
590
retroshare-gui/src/gui/unfinished/blogs/BlogsDialog.ui
Normal file
@ -0,0 +1,590 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>BlogsDialog</class>
|
||||
<widget class="QWidget" name="BlogsDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>681</width>
|
||||
<height>476</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizeIncrement">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="chanFrame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>222</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>222</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="sizeIncrement">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>221</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="chheaderframe">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>220</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>220</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>220</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"> QFrame#chheaderframe{
|
||||
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
|
||||
stop:0 #FEFEFE, stop:1 #E8E8E8);
|
||||
|
||||
border: 1px solid #CCCCCC;}
|
||||
|
||||
</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<property name="margin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="_2">
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../images.qrc">:/images/kblogger.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<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-family:'Arial'; font-size:10pt; font-weight:600;">Blogs</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>123</width>
|
||||
<height>13</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="channelpushButton">
|
||||
<property name="toolTip">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton::menu-indicator {
|
||||
subcontrol-origin: padding;
|
||||
subcontrol-position: bottom right;
|
||||
}
|
||||
|
||||
QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open {
|
||||
position: relative;
|
||||
top: 2px; left: 2px; /* shift the arrow by 2 px */
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
border: 1px solid #CCCCCC;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/edit_add24.png</normaloff>:/images/edit_add24.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QTreeView" name="treeView">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QFrame#frame{
|
||||
border: 2px solid #6ACEFF;
|
||||
border-radius: 10px;
|
||||
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
|
||||
stop:0 #0076B1, stop:1 #12A3EB);}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="horizontalSpacing">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="iconLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>64</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>64</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLabel{
|
||||
border: 2px solid white;
|
||||
border-radius: 10px;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../images.qrc">:/images/hi64-app-kblogger.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="nameLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<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:600; 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-family:'DejaVu Sans'; font-size:14pt; color:#ffffff;">Blog Name</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="postButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Post To Channel</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton, QPushButton, QComboBox {
|
||||
border-image: url(:/images/btn_26.png) 4;
|
||||
border-width: 4;
|
||||
padding: 0px 6px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
QToolButton:hover, QPushButton:hover, QComboBox:hover {
|
||||
border-image: url(:/images/btn_26_hover.png) 4;
|
||||
}
|
||||
|
||||
QToolButton:disabled, QPushButton:disabled, QComboBox::disabled {
|
||||
color:gray;
|
||||
}
|
||||
|
||||
QToolButton:pressed, QPushButton:pressed{
|
||||
border-image: url(:/images/btn_26_pressed.png) 4;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/mail_send.png</normaloff>:/images/mail_send.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="unsubscribeButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>26</width>
|
||||
<height>26</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<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-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:9pt;">Unsubcribe To Blog</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton, QPushButton, QComboBox {
|
||||
border-image: url(:/images/btn_26.png) 4;
|
||||
border-width: 4;
|
||||
padding: 0px 6px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
QToolButton:hover, QPushButton:hover, QComboBox:hover {
|
||||
border-image: url(:/images/btn_26_hover.png) 4;
|
||||
}
|
||||
|
||||
QToolButton:disabled, QPushButton:disabled, QComboBox::disabled {
|
||||
color:gray;
|
||||
}
|
||||
|
||||
QToolButton:pressed, QPushButton:pressed{
|
||||
border-image: url(:/images/btn_26_pressed.png) 4;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Unsubscribe</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="subscribeButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>26</width>
|
||||
<height>26</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<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-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:9pt;">Subscribe To Blog</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton, QPushButton, QComboBox {
|
||||
border-image: url(:/images/btn_26.png) 4;
|
||||
border-width: 4;
|
||||
padding: 0px 6px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
QToolButton:hover, QPushButton:hover, QComboBox:hover {
|
||||
border-image: url(:/images/btn_26_hover.png) 4;
|
||||
}
|
||||
|
||||
QToolButton:disabled, QPushButton:disabled, QComboBox::disabled {
|
||||
color:gray;
|
||||
}
|
||||
|
||||
QToolButton:pressed, QPushButton:pressed{
|
||||
border-image: url(:/images/btn_26_pressed.png) 4;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Subscribe</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/konqsidebar_news24.png</normaloff>:/images/konqsidebar_news24.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<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>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QFrame" name="msgFrame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="sizeIncrement">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_8">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>429</width>
|
||||
<height>329</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QWidget#scrollAreaWidgetContents{border: none;}</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>391</width>
|
||||
<height>266</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<action name="actionCreate_Channel">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/kblogger.png</normaloff>:/images/kblogger.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Create New Blog</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create New Blog</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
235
retroshare-gui/src/gui/unfinished/blogs/BlogsMsgItem.cpp
Normal file
235
retroshare-gui/src/gui/unfinished/blogs/BlogsMsgItem.cpp
Normal file
@ -0,0 +1,235 @@
|
||||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2008 Robert Fernie
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
#include <QtGui>
|
||||
#include <QDateTime>
|
||||
|
||||
#include "BlogsMsgItem.h"
|
||||
|
||||
#include "gui/feeds/FeedHolder.h"
|
||||
#include "gui/feeds/SubFileItem.h"
|
||||
|
||||
#include "rsiface/rsblogs.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
/****
|
||||
* #define DEBUG_ITEM 1
|
||||
****/
|
||||
|
||||
/** Constructor */
|
||||
BlogsMsgItem::BlogsMsgItem(FeedHolder *parent, uint32_t feedId, std::string peerId, std::string blogId, std::string msgId, bool isHome)
|
||||
:QWidget(NULL), mParent(parent), mFeedId(feedId),
|
||||
mPeerId(peerId), mBlogId(blogId), mMsgId(msgId), mIsHome(isHome)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
setupUi(this);
|
||||
|
||||
/* general ones */
|
||||
connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) );
|
||||
connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) );
|
||||
//connect( gotoButton, SIGNAL( clicked( void ) ), this, SLOT( gotoHome ( void ) ) );
|
||||
|
||||
/* specific ones */
|
||||
//connect( playButton, SIGNAL( clicked( void ) ), this, SLOT( playMedia ( void ) ) );
|
||||
connect( unsubscribeButton, SIGNAL( clicked( void ) ), this, SLOT( unsubscribeChannel ( void ) ) );
|
||||
|
||||
small();
|
||||
updateItemStatic();
|
||||
updateItem();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void BlogsMsgItem::updateItemStatic()
|
||||
{
|
||||
/* fill in */
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "ChanMsgItem::updateItemStatic()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
BlogMsgInfo cmi;
|
||||
|
||||
if (!rsBlogs)
|
||||
return;
|
||||
|
||||
if (!rsBlogs->getBlogMessage(mBlogId, mMsgId, cmi))
|
||||
return;
|
||||
|
||||
QString title;
|
||||
|
||||
if (!mIsHome)
|
||||
{
|
||||
BlogInfo ci;
|
||||
rsBlogs->getBlogInfo(mBlogId, ci);
|
||||
title = "Channel Feed: ";
|
||||
title += QString::fromStdWString(ci.blogName);
|
||||
titleLabel->setText(title);
|
||||
//subjectLabel->setText(QString::fromStdWString(cmi.subject));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* subject */
|
||||
titleLabel->setText(QString::fromStdWString(cmi.subject));
|
||||
/* Blog Message */
|
||||
textBrowser->setHtml( QString::fromStdWString(cmi.msg));
|
||||
}
|
||||
|
||||
//msgLabel->setText(QString::fromStdWString(cmi.msg));
|
||||
//msgcommentstextEdit->setHtml(QString::fromStdWString(cmi.msg));
|
||||
|
||||
QDateTime qtime;
|
||||
qtime.setTime_t(cmi.ts);
|
||||
QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm:ss");
|
||||
datetimelabel->setText(timestamp);
|
||||
|
||||
|
||||
|
||||
std::list<FileInfo>::iterator it;
|
||||
for(it = cmi.files.begin(); it != cmi.files.end(); it++)
|
||||
{
|
||||
/* add file */
|
||||
SubFileItem *fi = new SubFileItem(it->hash, it->fname, it->size,
|
||||
SFI_STATE_REMOTE | SFI_TYPE_CHANNEL, "");
|
||||
mFileItems.push_back(fi);
|
||||
|
||||
QLayout *layout = expandFrame->layout();
|
||||
layout->addWidget(fi);
|
||||
}
|
||||
|
||||
//playButton->setEnabled(false);
|
||||
|
||||
if (mIsHome)
|
||||
{
|
||||
/* disable buttons */
|
||||
clearButton->setEnabled(false);
|
||||
//gotoButton->setEnabled(false);
|
||||
unsubscribeButton->setEnabled(false);
|
||||
|
||||
clearButton->hide();
|
||||
}
|
||||
|
||||
/* don't really want this at all! */
|
||||
unsubscribeButton->hide();
|
||||
//playButton->hide();
|
||||
}
|
||||
|
||||
|
||||
void BlogsMsgItem::updateItem()
|
||||
{
|
||||
/* fill in */
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "ChanMsgItem::updateItem()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
int msec_rate = 10000;
|
||||
|
||||
/* Very slow Tick to check when all files are downloaded */
|
||||
std::list<SubFileItem *>::iterator it;
|
||||
for(it = mFileItems.begin(); it != mFileItems.end(); it++)
|
||||
{
|
||||
if (!(*it)->done())
|
||||
{
|
||||
/* loop again */
|
||||
QTimer::singleShot( msec_rate, this, SLOT(updateItem( void ) ));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* At this point cannot create a playlist....
|
||||
* so can't enable play for all.
|
||||
|
||||
if (mFileItems.size() > 0)
|
||||
{
|
||||
playButton->setEnabled(true);
|
||||
}
|
||||
***/
|
||||
}
|
||||
|
||||
|
||||
void BlogsMsgItem::small()
|
||||
{
|
||||
expandFrame->hide();
|
||||
}
|
||||
|
||||
void BlogsMsgItem::toggle()
|
||||
{
|
||||
if (expandFrame->isHidden())
|
||||
{
|
||||
expandFrame->show();
|
||||
expandButton->setIcon(QIcon(QString(":/images/edit_remove24.png")));
|
||||
expandButton->setToolTip(tr("Hide"));
|
||||
}
|
||||
else
|
||||
{
|
||||
expandFrame->hide();
|
||||
expandButton->setIcon(QIcon(QString(":/images/edit_add24.png")));
|
||||
expandButton->setToolTip(tr("Expand"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BlogsMsgItem::removeItem()
|
||||
{
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "ChanMsgItem::removeItem()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
hide();
|
||||
if (mParent)
|
||||
{
|
||||
mParent->deleteFeedItem(this, mFeedId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BlogsMsgItem::gotoHome()
|
||||
{
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "ChanMsgItem::gotoHome()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********** SPECIFIC FUNCTIOSN ***********************/
|
||||
|
||||
|
||||
void BlogsMsgItem::unsubscribeChannel()
|
||||
{
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "ChanMsgItem::unsubscribeChannel()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void BlogsMsgItem::playMedia()
|
||||
{
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "ChanMsgItem::playMedia()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
73
retroshare-gui/src/gui/unfinished/blogs/BlogsMsgItem.h
Normal file
73
retroshare-gui/src/gui/unfinished/blogs/BlogsMsgItem.h
Normal file
@ -0,0 +1,73 @@
|
||||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2008 Robert Fernie
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#ifndef _BLOGS_MSG_ITEM_DIALOG_H
|
||||
#define _BLOGS_MSG_ITEM_DIALOG_H
|
||||
|
||||
#include "ui_BlogsMsgItem.h"
|
||||
|
||||
#include <string>
|
||||
#include <stdint.h>
|
||||
|
||||
class FeedHolder;
|
||||
class SubFileItem;
|
||||
|
||||
class BlogsMsgItem : public QWidget, private Ui::BlogsMsgItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/** Default Constructor */
|
||||
BlogsMsgItem(FeedHolder *parent, uint32_t feedId, std::string peerId, std::string blogId, std::string msgId, bool isHome);
|
||||
|
||||
/** Default Destructor */
|
||||
|
||||
void updateItemStatic();
|
||||
void small();
|
||||
|
||||
private slots:
|
||||
/* default stuff */
|
||||
void gotoHome();
|
||||
void removeItem();
|
||||
void toggle();
|
||||
|
||||
void playMedia();
|
||||
void unsubscribeChannel();
|
||||
|
||||
void updateItem();
|
||||
|
||||
private:
|
||||
FeedHolder *mParent;
|
||||
uint32_t mFeedId;
|
||||
|
||||
std::string mBlogId;
|
||||
std::string mMsgId;
|
||||
std::string mPeerId;
|
||||
|
||||
bool mIsHome;
|
||||
|
||||
std::list<SubFileItem *> mFileItems;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
265
retroshare-gui/src/gui/unfinished/blogs/BlogsMsgItem.ui
Normal file
265
retroshare-gui/src/gui/unfinished/blogs/BlogsMsgItem.ui
Normal file
@ -0,0 +1,265 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>BlogsMsgItem</class>
|
||||
<widget class="QWidget" name="BlogsMsgItem">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>516</width>
|
||||
<height>327</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton, QPushButton, QComboBox {
|
||||
border-image: url(:/images/btn_26.png) 4;
|
||||
border-width: 4;
|
||||
padding: 0px 6px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
QToolButton:hover, QPushButton:hover, QComboBox:hover {
|
||||
border-image: url(:/images/btn_26_hover.png) 4;
|
||||
}
|
||||
|
||||
QToolButton:disabled, QPushButton:disabled, QComboBox::disabled {
|
||||
color:gray;
|
||||
}
|
||||
|
||||
QToolButton:pressed, QPushButton:pressed{
|
||||
border-image: url(:/images/btn_26_pressed.png) 4;
|
||||
}</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="horizontalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QFrame#frame{border: 3px solid #407AC1;
|
||||
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
|
||||
stop:0 #FFFFFF, stop:1 #F2F2F2);;
|
||||
border-radius: 10px;}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="0">
|
||||
<widget class="QFrame" name="expandFrame">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QFrame#expandFrame{border: 2px solid #D3D3D3;
|
||||
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
|
||||
stop:0 #FFFFFF, stop:1 #F2F2F2);;
|
||||
border-radius: 10px;}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="msgLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Comments here</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QLabel" name="titleLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
<weight>75</weight>
|
||||
<italic>true</italic>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<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:11pt; font-weight:600; font-style:italic;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#656565;">Blog Subject</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3" colspan="2">
|
||||
<widget class="QLabel" name="datetimelabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<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:600; 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:#666666;">DateTime</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>288</width>
|
||||
<height>21</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QPushButton" name="expandButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Expand</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/edit_add24.png</normaloff>:/images/edit_add24.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="clearButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Remove Item</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/close_normal.png</normaloff>:/images/close_normal.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="unsubscribeButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Unsubscribe From Channel</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/mail_delete.png</normaloff>:/images/mail_delete.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="5">
|
||||
<widget class="QTextBrowser" name="textBrowser">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QTextBrowser#textBrowser{border: 2px solid #D3D3D3;
|
||||
background-color: transparent;
|
||||
border-radius: 10px;}</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
138
retroshare-gui/src/gui/unfinished/blogs/CreateBlog.cpp
Normal file
138
retroshare-gui/src/gui/unfinished/blogs/CreateBlog.cpp
Normal file
@ -0,0 +1,138 @@
|
||||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2008 Robert Fernie
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#include <QtGui>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "CreateBlog.h"
|
||||
|
||||
#include "rsiface/rsblogs.h"
|
||||
|
||||
/** Constructor */
|
||||
CreateBlog::CreateBlog(QWidget *parent, bool isForum)
|
||||
: QDialog(parent), mIsForum(isForum)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
// connect up the buttons.
|
||||
connect( ui.cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancelBlog( ) ) );
|
||||
connect( ui.createButton, SIGNAL( clicked ( bool ) ), this, SLOT( createBlog( ) ) );
|
||||
|
||||
|
||||
newBlog();
|
||||
|
||||
}
|
||||
|
||||
void CreateBlog::show()
|
||||
{
|
||||
//loadSettings();
|
||||
if(!this->isVisible()) {
|
||||
QWidget::show();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CreateBlog::newBlog()
|
||||
{
|
||||
|
||||
if (mIsForum)
|
||||
{
|
||||
/* enforce Public for the moment */
|
||||
ui.typePublic->setChecked(true);
|
||||
|
||||
ui.typePrivate->setEnabled(false);
|
||||
ui.typeEncrypted->setEnabled(false);
|
||||
|
||||
ui.msgAnon->setChecked(true);
|
||||
//ui.msgAuth->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* enforce Private for the moment */
|
||||
ui.typePrivate->setChecked(true);
|
||||
|
||||
ui.typePublic->setEnabled(false);
|
||||
ui.typeEncrypted->setEnabled(false);
|
||||
|
||||
ui.msgAnon->setChecked(true);
|
||||
ui.msgAuth->setEnabled(false);
|
||||
ui.msgGroupBox->hide();
|
||||
}
|
||||
}
|
||||
|
||||
void CreateBlog::createBlog()
|
||||
{
|
||||
QString name = ui.forumName->text();
|
||||
QString desc = ui.forumDesc->toPlainText(); //toHtml();
|
||||
uint32_t flags = 0;
|
||||
|
||||
if(name.isEmpty())
|
||||
{ /* error message */
|
||||
int ret = QMessageBox::warning(this, tr("RetroShare"),
|
||||
tr("Please add a Name"),
|
||||
QMessageBox::Ok, QMessageBox::Ok);
|
||||
|
||||
return; //Don't add a empty name!!
|
||||
}
|
||||
else
|
||||
|
||||
if (ui.typePublic->isChecked())
|
||||
{
|
||||
flags |= RS_DISTRIB_PUBLIC;
|
||||
}
|
||||
else if (ui.typePrivate->isChecked())
|
||||
{
|
||||
flags |= RS_DISTRIB_PRIVATE;
|
||||
}
|
||||
else if (ui.typeEncrypted->isChecked())
|
||||
{
|
||||
flags |= RS_DISTRIB_ENCRYPTED;
|
||||
}
|
||||
|
||||
if (ui.msgAuth->isChecked())
|
||||
{
|
||||
flags |= RS_DISTRIB_AUTHEN_REQ;
|
||||
}
|
||||
else if (ui.msgAnon->isChecked())
|
||||
{
|
||||
flags |= RS_DISTRIB_AUTHEN_ANON;
|
||||
}
|
||||
|
||||
if (rsBlogs)
|
||||
{
|
||||
rsBlogs->createBlog(name.toStdWString(), desc.toStdWString(), flags);
|
||||
}
|
||||
|
||||
|
||||
close();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void CreateBlog::cancelBlog()
|
||||
{
|
||||
close();
|
||||
return;
|
||||
}
|
||||
|
||||
|
61
retroshare-gui/src/gui/unfinished/blogs/CreateBlog.h
Normal file
61
retroshare-gui/src/gui/unfinished/blogs/CreateBlog.h
Normal file
@ -0,0 +1,61 @@
|
||||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2008 Robert Fernie
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#ifndef _CREATE_BLOG_DIALOG_H
|
||||
#define _CREATE_BLOG_DIALOG_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
#include "ui_CreateBlog.h"
|
||||
|
||||
class CreateBlog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CreateBlog(QWidget *parent = 0, bool isForum = true);
|
||||
|
||||
void newBlog(); /* cleanup */
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::CreateBlog ui;
|
||||
|
||||
QPixmap picture;
|
||||
|
||||
public slots:
|
||||
/** Overloaded QWidget.show */
|
||||
void show();
|
||||
|
||||
private slots:
|
||||
|
||||
/* actions to take.... */
|
||||
void createBlog();
|
||||
void cancelBlog();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
bool mIsForum;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
245
retroshare-gui/src/gui/unfinished/blogs/CreateBlog.ui
Normal file
245
retroshare-gui/src/gui/unfinished/blogs/CreateBlog.ui
Normal file
@ -0,0 +1,245 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CreateBlog</class>
|
||||
<widget class="QDialog" name="CreateBlog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>534</width>
|
||||
<height>481</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Create new Blog</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QFrame#frame_2{background-image: url(:/images/connect/connectFriendBanner.png);}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="margin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelicon">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>48</width>
|
||||
<height>48</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../images.qrc">:/images/hi48-app-kblogger.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="textlabelcreatforums">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<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-family:'Arial'; font-size:24pt; font-weight:600; color:#ffffff;">New Blog</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0" colspan="3">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="forumName"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="3">
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Description</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="forumDesc"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3">
|
||||
<widget class="QGroupBox" name="tyoeGroupBox">
|
||||
<property name="title">
|
||||
<string>Type:</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="typePublic">
|
||||
<property name="text">
|
||||
<string>Public - Anyone can read and publish (Shared Publish Key)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="typePrivate">
|
||||
<property name="text">
|
||||
<string>Restricted - Anyone can read, limited publishing (Private Publish Key)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="typeEncrypted">
|
||||
<property name="text">
|
||||
<string>Private - (Private Publish Key required to view Messages)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="3">
|
||||
<widget class="QGroupBox" name="msgGroupBox">
|
||||
<property name="title">
|
||||
<string>Allowed Messages</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="_4">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="msgAuth">
|
||||
<property name="text">
|
||||
<string>Authemticated Messages</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="msgAnon">
|
||||
<property name="text">
|
||||
<string>Anonymous Messages</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>238</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QPushButton" name="cancelButton">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QPushButton" name="createButton">
|
||||
<property name="text">
|
||||
<string>Create</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
1282
retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.cpp
Normal file
1282
retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.cpp
Normal file
File diff suppressed because it is too large
Load Diff
176
retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.h
Normal file
176
retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.h
Normal file
@ -0,0 +1,176 @@
|
||||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2008 Robert Fernie
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#ifndef _CREATEBLOGMSG_H
|
||||
#define _CREATEBLOGMSG_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QMap>
|
||||
#include <QPointer>
|
||||
#include <QObject>
|
||||
#include <gui/settings/rsharesettings.h>
|
||||
|
||||
#include "ui_CreateBlogMsg.h"
|
||||
#include <stdint.h>
|
||||
|
||||
class SubFileItem;
|
||||
class FileInfo;
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QAction)
|
||||
QT_FORWARD_DECLARE_CLASS(QComboBox)
|
||||
QT_FORWARD_DECLARE_CLASS(QFontComboBox)
|
||||
QT_FORWARD_DECLARE_CLASS(QTextEdit)
|
||||
QT_FORWARD_DECLARE_CLASS(QTextCharFormat)
|
||||
QT_FORWARD_DECLARE_CLASS(QMenu)
|
||||
|
||||
class CreateBlogMsg : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/** Default Constructor */
|
||||
CreateBlogMsg(std::string cId, QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||
/** Default Destructor */
|
||||
|
||||
void addAttachment(std::string path);
|
||||
void addAttachment(std::string hash, std::string fname, uint64_t size,
|
||||
bool local, std::string srcId);
|
||||
|
||||
void newBlogMsg();
|
||||
|
||||
QPixmap picture;
|
||||
QSettings setter;
|
||||
|
||||
void Create_New_Image_Tag( const QString urlremoteorlocal );
|
||||
|
||||
protected:
|
||||
virtual void dragEnterEvent(QDragEnterEvent *event);
|
||||
virtual void dropEvent(QDropEvent *event);
|
||||
|
||||
private slots:
|
||||
void addExtraFile();
|
||||
void checkAttachmentReady();
|
||||
|
||||
void cancelMsg();
|
||||
void sendMsg();
|
||||
void addImage();
|
||||
|
||||
void fontSizeIncrease();
|
||||
void fontSizeDecrease();
|
||||
void blockQuote();
|
||||
void toggleCode();
|
||||
void addPostSplitter();
|
||||
|
||||
void setStartupText();
|
||||
void updateTextEdit();
|
||||
|
||||
void fileNew();
|
||||
void fileOpen();
|
||||
bool fileSave();
|
||||
bool fileSaveAs();
|
||||
void filePrint();
|
||||
void filePrintPreview();
|
||||
void filePrintPdf();
|
||||
void printPreview(QPrinter *);
|
||||
|
||||
void textBold();
|
||||
void textUnderline();
|
||||
void textItalic();
|
||||
void textFamily(const QString &f);
|
||||
void textSize(const QString &p);
|
||||
void changeFormatType(int styleIndex );
|
||||
|
||||
|
||||
void textColor();
|
||||
void textAlign(QAction *a);
|
||||
|
||||
void addOrderedList();
|
||||
void addUnorderedList();
|
||||
|
||||
void currentCharFormatChanged(const QTextCharFormat &format);
|
||||
void cursorPositionChanged();
|
||||
|
||||
void clipboardDataChanged();
|
||||
|
||||
|
||||
private:
|
||||
void setupFileActions();
|
||||
void setupEditActions();
|
||||
void setupViewActions();
|
||||
void setupInsertActions();
|
||||
void setupParagraphActions();
|
||||
void setupTextActions();
|
||||
|
||||
void setCurrentFileName(const QString &fileName);
|
||||
bool load(const QString &f);
|
||||
bool maybeSave();
|
||||
|
||||
void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
|
||||
|
||||
void fontChanged(const QFont &f);
|
||||
void colorChanged(const QColor &c);
|
||||
void alignmentChanged(Qt::Alignment a);
|
||||
|
||||
void parseRsFileListAttachments(std::string attachList);
|
||||
|
||||
void sendMessage(std::wstring subject, std::wstring msg, std::list<FileInfo> &files);
|
||||
|
||||
std::string mBlogId;
|
||||
|
||||
std::list<SubFileItem *> mAttachments;
|
||||
|
||||
bool mCheckAttachment;
|
||||
|
||||
QAction *actionSave,
|
||||
*actionTextBold,
|
||||
*actionTextUnderline,
|
||||
*actionTextItalic,
|
||||
*actionTextColor,
|
||||
*actionAlignLeft,
|
||||
*actionAlignCenter,
|
||||
*actionAlignRight,
|
||||
*actionAlignJustify,
|
||||
*actionUndo,
|
||||
*actionRedo,
|
||||
*actionCut,
|
||||
*actionCopy,
|
||||
*actionPaste;
|
||||
|
||||
QComboBox *comboStyle;
|
||||
QFontComboBox *comboFont;
|
||||
QComboBox *comboSize;
|
||||
|
||||
QString fileName;
|
||||
|
||||
QColor codeBackground;
|
||||
QTextCharFormat defaultCharFormat;
|
||||
QTextBlockFormat defaultBlockFormat;
|
||||
QTextCharFormat lastCharFormat;
|
||||
QTextBlockFormat lastBlockFormat;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::CreateBlogMsg ui;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
483
retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.ui
Normal file
483
retroshare-gui/src/gui/unfinished/blogs/CreateBlogMsg.ui
Normal file
@ -0,0 +1,483 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CreateBlogMsg</class>
|
||||
<widget class="QMainWindow" name="CreateBlogMsg">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>666</width>
|
||||
<height>515</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>New Blog Post</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolBar#toolBar{background-image: url(:/images/connect/connectFriendBanner.png);
|
||||
}
|
||||
|
||||
QToolButton {
|
||||
color: white;
|
||||
}
|
||||
|
||||
QToolBar#toolBar_2{
|
||||
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
|
||||
stop:0 #FEFEFE, stop:1 #E8E8E8);
|
||||
|
||||
border: 1px solid #CCCCCC;}</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::South</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Blog Post</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Blog Post to:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="channelName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QTabWidget" name="tabWidget_2">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
<string>Visual Editor</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Blog Message</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Subject :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="subjectEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QTextEdit" name="msgEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabHtml">
|
||||
<attribute name="title">
|
||||
<string>Html Editor</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_10">
|
||||
<item row="0" column="0">
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/attachment.png</normaloff>:/images/attachment.png</iconset>
|
||||
</attribute>
|
||||
<attribute name="title">
|
||||
<string>Attachments</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../images.qrc">:/images/attachment.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>26</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Attachments</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>334</width>
|
||||
<height>26</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="addFileButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>34</width>
|
||||
<height>34</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOn</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>639</width>
|
||||
<height>341</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>438</width>
|
||||
<height>137</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>666</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<widget class="QToolBar" name="toolBar">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>toolBar</string>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<addaction name="actionPublish"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionNew"/>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="toolBar_2">
|
||||
<property name="windowTitle">
|
||||
<string>toolBar_2</string>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<addaction name="actionUndo"/>
|
||||
</widget>
|
||||
<action name="actionBlockquoute">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/textedit/hi22-action-format-text-blockquote.png</normaloff>:/images/textedit/hi22-action-format-text-blockquote.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>blockquoute</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionIncreasefontsize">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/textedit/format_font_size_more.png</normaloff>:/images/textedit/format_font_size_more.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Increase font Size</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDecreasefontsize">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/textedit/format_font_size_less.png</normaloff>:/images/textedit/format_font_size_less.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Decrease font size</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionBold">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/textedit/textbold.png</normaloff>:/images/textedit/textbold.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Bold</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUnderline">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/textedit/textunder.png</normaloff>:/images/textedit/textunder.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Underline</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionItalic">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/textedit/textitalic.png</normaloff>:/images/textedit/textitalic.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Italic</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPublish">
|
||||
<property name="text">
|
||||
<string>Publish</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNew">
|
||||
<property name="text">
|
||||
<string>New</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCode">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/textedit/hi22-action-format-text-code.png</normaloff>:/images/textedit/hi22-action-format-text-code.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Code</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionsplitPost">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/textedit/hi22-action-insert-more-mark.png</normaloff>:/images/textedit/hi22-action-insert-more-mark.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>splitPost</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionOrderedlist">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/textedit/format-list-ordered.png</normaloff>:/images/textedit/format-list-ordered.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ordered List</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUnorderedlist">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/textedit/format-list-unordered.png</normaloff>:/images/textedit/format-list-unordered.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Unordered List</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionClipboard">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/textedit/editcut.png</normaloff>:/images/textedit/editcut.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clipboard</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUndo">
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/textedit/editundo.png</normaloff>:/images/textedit/editundo.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Undo</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
<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