mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 08:59:37 -05:00
Reworked Wiki Edit Dialog.
- Added EditHistory SideBar (Will remove from main page). - Added Preview / Edit modes. (to add renderer) - changed layout a bit. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5923 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
30ea727333
commit
c955e3b5a4
@ -26,22 +26,100 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
|
#define WIKIEDITDIALOG_GROUP 0x0001
|
||||||
|
#define WIKIEDITDIALOG_PAGE 0x0002
|
||||||
|
#define WIKIEDITDIALOG_BASEHISTORY 0x0003
|
||||||
|
#define WIKIEDITDIALOG_EDITTREE 0x0005
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
WikiEditDialog::WikiEditDialog(QWidget *parent)
|
WikiEditDialog::WikiEditDialog(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
connect(ui.pushButton_Cancel, SIGNAL( clicked( void ) ), this, SLOT( cancelEdit( void ) ) );
|
connect(ui.pushButton_Cancel, SIGNAL( clicked( void ) ), this, SLOT( cancelEdit( void ) ) );
|
||||||
connect(ui.pushButton_Revert, SIGNAL( clicked( void ) ), this, SLOT( revertEdit( void ) ) );
|
connect(ui.pushButton_Revert, SIGNAL( clicked( void ) ), this, SLOT( revertEdit( void ) ) );
|
||||||
connect(ui.pushButton_Submit, SIGNAL( clicked( void ) ), this, SLOT( submitEdit( void ) ) );
|
connect(ui.pushButton_Submit, SIGNAL( clicked( void ) ), this, SLOT( submitEdit( void ) ) );
|
||||||
|
connect(ui.pushButton_Preview, SIGNAL( clicked( void ) ), this, SLOT( previewToggle( void ) ) );
|
||||||
|
connect(ui.pushButton_History, SIGNAL( clicked( void ) ), this, SLOT( historyToggle( void ) ) );
|
||||||
|
|
||||||
mWikiQueue = new TokenQueue(rsWiki->getTokenService(), this);
|
mWikiQueue = new TokenQueue(rsWiki->getTokenService(), this);
|
||||||
mRepublishMode = false;
|
mRepublishMode = false;
|
||||||
|
mPreviewMode = false;
|
||||||
|
mPageLoading = false;
|
||||||
|
mCurrentText = "";
|
||||||
|
|
||||||
|
ui.groupBox_History->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WikiEditDialog::historyToggle()
|
||||||
|
{
|
||||||
|
std::cerr << "WikiEditDialog::historyToggle()";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
if (ui.groupBox_History->isHidden())
|
||||||
|
{
|
||||||
|
ui.groupBox_History->show();
|
||||||
|
ui.pushButton_History->setText(tr("Hide Edit History"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui.groupBox_History->hide();
|
||||||
|
ui.pushButton_History->setText(tr("Show Edit History"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void WikiEditDialog::previewToggle()
|
||||||
|
{
|
||||||
|
std::cerr << "WikiEditDialog::previewToggle()";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
if (mPreviewMode)
|
||||||
|
{
|
||||||
|
mPreviewMode = false;
|
||||||
|
ui.pushButton_Preview->setText(tr("Preview"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Save existing Text into buffer.
|
||||||
|
mCurrentText = ui.textEdit->toPlainText();
|
||||||
|
mPreviewMode = true;
|
||||||
|
ui.pushButton_Preview->setText(tr("Edit Page"));
|
||||||
|
}
|
||||||
|
if (!mPageLoading)
|
||||||
|
{
|
||||||
|
redrawPage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void WikiEditDialog::redrawPage()
|
||||||
|
{
|
||||||
|
std::cerr << "WikiEditDialog::redrawPage()";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
if (mPreviewMode)
|
||||||
|
{
|
||||||
|
/* render as HTML */
|
||||||
|
QString renderedText = "RENDERED TEXT:\n";
|
||||||
|
renderedText += mCurrentText;
|
||||||
|
ui.textEdit->setPlainText(renderedText);
|
||||||
|
|
||||||
|
/* disable edit */
|
||||||
|
ui.textEdit->setReadOnly(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* plain text - for editing */
|
||||||
|
ui.textEdit->setPlainText(mCurrentText);
|
||||||
|
|
||||||
|
/* enable edit */
|
||||||
|
ui.textEdit->setReadOnly(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void WikiEditDialog::setGroup(RsWikiCollection &group)
|
void WikiEditDialog::setGroup(RsWikiCollection &group)
|
||||||
{
|
{
|
||||||
std::cerr << "WikiEditDialog::setGroup(): " << group;
|
std::cerr << "WikiEditDialog::setGroup(): " << group;
|
||||||
@ -63,7 +141,8 @@ void WikiEditDialog::setPreviousPage(RsWikiSnapshot &page)
|
|||||||
|
|
||||||
ui.lineEdit_Page->setText(QString::fromStdString(mWikiSnapshot.mMeta.mMsgName));
|
ui.lineEdit_Page->setText(QString::fromStdString(mWikiSnapshot.mMeta.mMsgName));
|
||||||
ui.lineEdit_PrevVersion->setText(QString::fromStdString(mWikiSnapshot.mMeta.mMsgId));
|
ui.lineEdit_PrevVersion->setText(QString::fromStdString(mWikiSnapshot.mMeta.mMsgId));
|
||||||
ui.textEdit->setPlainText(QString::fromStdString(mWikiSnapshot.mPage));
|
mCurrentText = QString::fromUtf8(mWikiSnapshot.mPage.c_str());
|
||||||
|
redrawPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -73,11 +152,17 @@ void WikiEditDialog::setNewPage()
|
|||||||
mRepublishMode = false;
|
mRepublishMode = false;
|
||||||
ui.lineEdit_Page->setText("");
|
ui.lineEdit_Page->setText("");
|
||||||
ui.lineEdit_PrevVersion->setText("");
|
ui.lineEdit_PrevVersion->setText("");
|
||||||
ui.textEdit->setPlainText("");
|
|
||||||
|
mCurrentText = "";
|
||||||
|
redrawPage();
|
||||||
|
ui.treeWidget_History->clear();
|
||||||
|
ui.groupBox_History->hide();
|
||||||
|
ui.pushButton_History->setText(tr("Show Edit History"));
|
||||||
|
|
||||||
ui.headerFrame->setHeaderImage(QPixmap(":/images/appointment-new_64.png"));
|
ui.headerFrame->setHeaderImage(QPixmap(":/images/appointment-new_64.png"));
|
||||||
ui.headerFrame->setHeaderText(tr("Create New Wiki Page"));
|
ui.headerFrame->setHeaderText(tr("Create New Wiki Page"));
|
||||||
setWindowTitle(tr("Create New Wiki Page"));
|
setWindowTitle(tr("Create New Wiki Page"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -99,12 +184,14 @@ void WikiEditDialog::revertEdit()
|
|||||||
{
|
{
|
||||||
if (mNewPage)
|
if (mNewPage)
|
||||||
{
|
{
|
||||||
ui.textEdit->setPlainText("");
|
mCurrentText = "";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui.textEdit->setPlainText(QString::fromStdString(mWikiSnapshot.mPage));
|
ui.textEdit->setPlainText(QString::fromStdString(mWikiSnapshot.mPage));
|
||||||
|
mCurrentText = QString::fromUtf8(mWikiSnapshot.mPage.c_str());
|
||||||
}
|
}
|
||||||
|
redrawPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -224,7 +311,7 @@ void WikiEditDialog::requestGroup(const std::string &groupId)
|
|||||||
RsTokReqOptions opts;
|
RsTokReqOptions opts;
|
||||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||||
uint32_t token;
|
uint32_t token;
|
||||||
mWikiQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, ids, 0);
|
mWikiQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, ids, WIKIEDITDIALOG_GROUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WikiEditDialog::loadGroup(const uint32_t &token)
|
void WikiEditDialog::loadGroup(const uint32_t &token)
|
||||||
@ -258,7 +345,8 @@ void WikiEditDialog::requestPage(const RsGxsGrpMsgIdPair &msgId)
|
|||||||
vect_msgIds.push_back(msgId.second);
|
vect_msgIds.push_back(msgId.second);
|
||||||
|
|
||||||
uint32_t token;
|
uint32_t token;
|
||||||
mWikiQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, 0);
|
mWikiQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, WIKIEDITDIALOG_PAGE);
|
||||||
|
mPageLoading = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WikiEditDialog::loadPage(const uint32_t &token)
|
void WikiEditDialog::loadPage(const uint32_t &token)
|
||||||
@ -276,10 +364,210 @@ void WikiEditDialog::loadPage(const uint32_t &token)
|
|||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setPreviousPage(snapshots[0]);
|
|
||||||
|
RsWikiSnapshot &page = snapshots[0];
|
||||||
|
setPreviousPage(page);
|
||||||
|
|
||||||
|
/* request the history now */
|
||||||
|
mThreadMsgIdPair.first = page.mMeta.mGroupId;
|
||||||
|
if (page.mMeta.mThreadId.empty())
|
||||||
|
{
|
||||||
|
mThreadMsgIdPair.second = page.mMeta.mOrigMsgId;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mThreadMsgIdPair.second = page.mMeta.mThreadId;
|
||||||
|
}
|
||||||
|
requestBaseHistory(mThreadMsgIdPair);
|
||||||
|
}
|
||||||
|
mPageLoading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*********************** LOAD EDIT HISTORY **********************/
|
||||||
|
|
||||||
|
#define WIKIEDITTREE_COL_ORIGPAGEID 0
|
||||||
|
#define WIKIEDITTREE_COL_PAGEID 1
|
||||||
|
#define WIKIEDITTREE_COL_PARENTID 2
|
||||||
|
|
||||||
|
void WikiEditDialog::requestBaseHistory(const RsGxsGrpMsgIdPair &origMsgId)
|
||||||
|
{
|
||||||
|
RsTokReqOptions opts;
|
||||||
|
opts.mReqType = GXS_REQUEST_TYPE_MSG_RELATED_DATA;
|
||||||
|
opts.mOptions = RS_TOKREQOPT_MSG_VERSIONS;
|
||||||
|
std::vector<RsGxsGrpMsgIdPair> msgIds;
|
||||||
|
msgIds.push_back(origMsgId);
|
||||||
|
uint32_t token;
|
||||||
|
mWikiQueue->requestMsgRelatedInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, WIKIEDITDIALOG_BASEHISTORY);
|
||||||
|
ui.treeWidget_History->clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void WikiEditDialog::loadBaseHistory(const uint32_t &token)
|
||||||
|
{
|
||||||
|
std::cerr << "WikiEditDialog::loadBaseHistory()";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
std::vector<RsWikiSnapshot> snapshots;
|
||||||
|
std::vector<RsWikiSnapshot>::iterator vit;
|
||||||
|
if (!rsWiki->getRelatedSnapshots(token, snapshots))
|
||||||
|
{
|
||||||
|
// ERROR
|
||||||
|
std::cerr << "WikiEditDialog::loadBaseHistory() ERROR";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(vit = snapshots.begin(); vit != snapshots.end(); vit++)
|
||||||
|
{
|
||||||
|
RsWikiSnapshot &page = *vit;
|
||||||
|
|
||||||
|
std::cerr << "WikiEditDialog::loadBaseHistory() TopLevel Result: PageTitle: " << page.mMeta.mMsgName;
|
||||||
|
std::cerr << " GroupId: " << page.mMeta.mGroupId;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
std::cerr << "\tOrigMsgId: " << page.mMeta.mOrigMsgId;
|
||||||
|
std::cerr << " MsgId: " << page.mMeta.mMsgId;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
std::cerr << "\tThreadId: " << page.mMeta.mThreadId;
|
||||||
|
std::cerr << " ParentId: " << page.mMeta.mParentId;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
QTreeWidgetItem *modItem = new QTreeWidgetItem();
|
||||||
|
modItem->setText(WIKIEDITTREE_COL_ORIGPAGEID, QString::fromStdString(page.mMeta.mOrigMsgId));
|
||||||
|
modItem->setText(WIKIEDITTREE_COL_PAGEID, QString::fromStdString(page.mMeta.mMsgId));
|
||||||
|
modItem->setText(WIKIEDITTREE_COL_PARENTID, QString::fromStdString(page.mMeta.mParentId));
|
||||||
|
ui.treeWidget_History->addTopLevelItem(modItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* then we need to request all pages from this thread */
|
||||||
|
requestEditTreeData();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void WikiEditDialog::requestEditTreeData() //const RsGxsGroupId &groupId)
|
||||||
|
{
|
||||||
|
// SWITCH THIS TO A THREAD REQUEST - WHEN WE CAN!
|
||||||
|
|
||||||
|
RsTokReqOptions opts;
|
||||||
|
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||||
|
opts.mOptions = RS_TOKREQOPT_MSG_LATEST;
|
||||||
|
|
||||||
|
std::list<RsGxsGroupId> groupIds;
|
||||||
|
groupIds.push_back(mThreadMsgIdPair.first);
|
||||||
|
|
||||||
|
uint32_t token;
|
||||||
|
mWikiQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, groupIds, WIKIEDITDIALOG_EDITTREE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void WikiEditDialog::loadEditTreeData(const uint32_t &token)
|
||||||
|
{
|
||||||
|
std::cerr << "WikiEditDialog::loadEditTreeData()";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
std::vector<RsWikiSnapshot> snapshots;
|
||||||
|
std::vector<RsWikiSnapshot>::iterator vit;
|
||||||
|
if (!rsWiki->getSnapshots(token, snapshots))
|
||||||
|
{
|
||||||
|
// ERROR
|
||||||
|
std::cerr << "WikiEditDialog::loadEditTreeData() ERROR";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cerr << "WikiEditDialog::loadEditTreeData() Loaded " << snapshots.size();
|
||||||
|
std::cerr << std::endl;
|
||||||
|
std::cerr << "WikiEditDialog::loadEditTreeData() Using ThreadId: " << mThreadMsgIdPair.second;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
std::map<RsGxsMessageId, QTreeWidgetItem *> items;
|
||||||
|
std::map<RsGxsMessageId, QTreeWidgetItem *>::iterator iit;
|
||||||
|
std::list<QTreeWidgetItem *> unparented;
|
||||||
|
std::list<QTreeWidgetItem *>::iterator uit;
|
||||||
|
|
||||||
|
// Grab the existing TopLevelItems, and insert into map.
|
||||||
|
int itemCount = ui.treeWidget_History->topLevelItemCount();
|
||||||
|
for (int nIndex = 0; nIndex < itemCount; nIndex++)
|
||||||
|
{
|
||||||
|
QTreeWidgetItem *item = ui.treeWidget_History->topLevelItem(nIndex);
|
||||||
|
|
||||||
|
/* index by MsgId --> ONLY For Wiki Thread Head Items... SPECIAL HACK FOR HERE! */
|
||||||
|
std::string msgId = item->text(WIKIEDITTREE_COL_PAGEID).toStdString();
|
||||||
|
items[msgId] = item;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for(vit = snapshots.begin(); vit != snapshots.end(); vit++)
|
||||||
|
{
|
||||||
|
RsWikiSnapshot &snapshot = *vit;
|
||||||
|
|
||||||
|
std::cerr << "Result: PageTitle: " << snapshot.mMeta.mMsgName;
|
||||||
|
std::cerr << " GroupId: " << snapshot.mMeta.mGroupId;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
std::cerr << "\tOrigMsgId: " << snapshot.mMeta.mOrigMsgId;
|
||||||
|
std::cerr << " MsgId: " << snapshot.mMeta.mMsgId;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
std::cerr << "\tThreadId: " << snapshot.mMeta.mThreadId;
|
||||||
|
std::cerr << " ParentId: " << snapshot.mMeta.mParentId;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
if (snapshot.mMeta.mParentId == "")
|
||||||
|
{
|
||||||
|
/* Ignore! */
|
||||||
|
std::cerr << "Ignoring ThreadHead Item";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (snapshot.mMeta.mThreadId != mThreadMsgIdPair.second)
|
||||||
|
{
|
||||||
|
/* Ignore! */
|
||||||
|
std::cerr << "Ignoring Different Thread Item";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* create an Entry */
|
||||||
|
QTreeWidgetItem *modItem = new QTreeWidgetItem();
|
||||||
|
modItem->setText(WIKIEDITTREE_COL_ORIGPAGEID, QString::fromStdString(snapshot.mMeta.mOrigMsgId));
|
||||||
|
modItem->setText(WIKIEDITTREE_COL_PAGEID, QString::fromStdString(snapshot.mMeta.mMsgId));
|
||||||
|
modItem->setText(WIKIEDITTREE_COL_PARENTID, QString::fromStdString(snapshot.mMeta.mParentId));
|
||||||
|
|
||||||
|
/* find the parent */
|
||||||
|
iit = items.find(snapshot.mMeta.mParentId);
|
||||||
|
if (iit != items.end())
|
||||||
|
{
|
||||||
|
(iit->second)->addChild(modItem);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unparented.push_back(modItem);
|
||||||
|
}
|
||||||
|
items[snapshot.mMeta.mOrigMsgId] = modItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(uit = unparented.begin(); uit != unparented.end(); uit++)
|
||||||
|
{
|
||||||
|
std::string parentId = (*uit)->text(WIKIEDITTREE_COL_PARENTID).toStdString();
|
||||||
|
|
||||||
|
iit = items.find(parentId);
|
||||||
|
if (iit != items.end())
|
||||||
|
{
|
||||||
|
(iit->second)->addChild(*uit);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* ERROR */
|
||||||
|
std::cerr << "Unparented!!!";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void WikiEditDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
void WikiEditDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||||
{
|
{
|
||||||
std::cerr << "WikiEditDialog::loadRequest()";
|
std::cerr << "WikiEditDialog::loadRequest()";
|
||||||
@ -287,19 +575,27 @@ void WikiEditDialog::loadRequest(const TokenQueue *queue, const TokenRequest &re
|
|||||||
|
|
||||||
if (queue == mWikiQueue)
|
if (queue == mWikiQueue)
|
||||||
{
|
{
|
||||||
/* now switch on req */
|
switch(req.mUserType)
|
||||||
switch(req.mType)
|
|
||||||
{
|
{
|
||||||
case TOKENREQ_GROUPINFO:
|
case WIKIEDITDIALOG_GROUP:
|
||||||
loadGroup(req.mToken);
|
loadGroup(req.mToken);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WIKIEDITDIALOG_PAGE:
|
||||||
|
loadPage(req.mToken);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WIKIEDITDIALOG_BASEHISTORY:
|
||||||
|
loadBaseHistory(req.mToken);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WIKIEDITDIALOG_EDITTREE:
|
||||||
|
loadEditTreeData(req.mToken);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
std::cerr << "WikiEditDialog::loadRequest() ERROR: INVALID TYPE";
|
||||||
|
std::cerr << std::endl;
|
||||||
break;
|
break;
|
||||||
case TOKENREQ_MSGINFO:
|
|
||||||
loadPage(req.mToken);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
std::cerr << "WikiEditDialog::loadRequest() ERROR: INVALID TYPE";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -307,3 +603,7 @@ void WikiEditDialog::loadRequest(const TokenQueue *queue, const TokenRequest &re
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,9 +48,13 @@ private slots:
|
|||||||
void cancelEdit();
|
void cancelEdit();
|
||||||
void revertEdit();
|
void revertEdit();
|
||||||
void submitEdit();
|
void submitEdit();
|
||||||
|
void previewToggle();
|
||||||
|
void historyToggle();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
void redrawPage();
|
||||||
|
|
||||||
void setGroup(RsWikiCollection &group);
|
void setGroup(RsWikiCollection &group);
|
||||||
void setPreviousPage(RsWikiSnapshot &page);
|
void setPreviousPage(RsWikiSnapshot &page);
|
||||||
|
|
||||||
@ -59,9 +63,23 @@ void loadPage(const uint32_t &token);
|
|||||||
void requestGroup(const std::string &groupId);
|
void requestGroup(const std::string &groupId);
|
||||||
void loadGroup(const uint32_t &token);
|
void loadGroup(const uint32_t &token);
|
||||||
|
|
||||||
|
void requestBaseHistory(const RsGxsGrpMsgIdPair &origMsgId);
|
||||||
|
void loadBaseHistory(const uint32_t &token);
|
||||||
|
void requestEditTreeData();
|
||||||
|
void loadEditTreeData(const uint32_t &token);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool mNewPage;
|
bool mNewPage;
|
||||||
|
|
||||||
|
bool mPreviewMode;
|
||||||
|
bool mPageLoading;
|
||||||
|
|
||||||
bool mRepublishMode;
|
bool mRepublishMode;
|
||||||
|
|
||||||
|
QString mCurrentText;
|
||||||
|
|
||||||
|
RsGxsGrpMsgIdPair mThreadMsgIdPair;
|
||||||
RsGxsMessageId mRepublishOrigId;
|
RsGxsMessageId mRepublishOrigId;
|
||||||
|
|
||||||
RsWikiCollection mWikiCollection;
|
RsWikiCollection mWikiCollection;
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>647</width>
|
<width>731</width>
|
||||||
<height>618</height>
|
<height>701</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -28,6 +28,9 @@
|
|||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<zorder>frame</zorder>
|
||||||
|
<zorder>frame</zorder>
|
||||||
|
<zorder>frame</zorder>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
@ -38,154 +41,192 @@
|
|||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item row="0" column="0">
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QSplitter" name="splitter_History">
|
||||||
<property name="title">
|
<property name="sizePolicy">
|
||||||
<string>Wiki Page</string>
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<property name="orientation">
|
||||||
<item row="0" column="0">
|
<enum>Qt::Horizontal</enum>
|
||||||
<widget class="QLabel" name="label_5">
|
</property>
|
||||||
<property name="text">
|
<widget class="QGroupBox" name="groupBox_History">
|
||||||
<string>Wiki Group:</string>
|
<property name="font">
|
||||||
</property>
|
<font>
|
||||||
<property name="buddy">
|
<weight>75</weight>
|
||||||
<cstring>groupBox</cstring>
|
<bold>true</bold>
|
||||||
</property>
|
</font>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<property name="title">
|
||||||
<item row="0" column="1">
|
<string>Page Edit History</string>
|
||||||
<widget class="QLineEdit" name="lineEdit_Group">
|
</property>
|
||||||
<property name="readOnly">
|
<layout class="QVBoxLayout" name="verticalLayout_3" stretch="0">
|
||||||
<bool>true</bool>
|
<item>
|
||||||
</property>
|
<widget class="QTreeWidget" name="treeWidget_History">
|
||||||
</widget>
|
<column>
|
||||||
</item>
|
<property name="text">
|
||||||
<item row="0" column="2" colspan="2">
|
<string>By</string>
|
||||||
<spacer name="horizontalSpacer">
|
</property>
|
||||||
<property name="orientation">
|
</column>
|
||||||
<enum>Qt::Horizontal</enum>
|
<column>
|
||||||
</property>
|
<property name="text">
|
||||||
<property name="sizeHint" stdset="0">
|
<string>When</string>
|
||||||
<size>
|
</property>
|
||||||
<width>168</width>
|
</column>
|
||||||
<height>20</height>
|
</widget>
|
||||||
</size>
|
</item>
|
||||||
</property>
|
</layout>
|
||||||
</spacer>
|
</widget>
|
||||||
</item>
|
<widget class="QFrame" name="frame_3">
|
||||||
<item row="1" column="0">
|
<property name="frameShape">
|
||||||
<widget class="QLabel" name="label">
|
<enum>QFrame::StyledPanel</enum>
|
||||||
<property name="text">
|
</property>
|
||||||
<string>Page Name:</string>
|
<property name="frameShadow">
|
||||||
</property>
|
<enum>QFrame::Raised</enum>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,0">
|
||||||
<item row="1" column="1">
|
<item>
|
||||||
<widget class="QLineEdit" name="lineEdit_Page">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="sizePolicy">
|
<property name="title">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
<string>Wiki Page</string>
|
||||||
<horstretch>10</horstretch>
|
</property>
|
||||||
<verstretch>0</verstretch>
|
<layout class="QFormLayout" name="formLayout">
|
||||||
</sizepolicy>
|
<item row="0" column="0">
|
||||||
</property>
|
<widget class="QLabel" name="label_5">
|
||||||
</widget>
|
<property name="text">
|
||||||
</item>
|
<string>Wiki Group:</string>
|
||||||
<item row="1" column="2">
|
</property>
|
||||||
<widget class="QLabel" name="label_3">
|
<property name="buddy">
|
||||||
<property name="text">
|
<cstring>groupBox</cstring>
|
||||||
<string>Edit ID</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
<item row="0" column="1">
|
||||||
<item row="1" column="3">
|
<widget class="QLineEdit" name="lineEdit_Group">
|
||||||
<widget class="QComboBox" name="comboBox_Id"/>
|
<property name="readOnly">
|
||||||
</item>
|
<bool>true</bool>
|
||||||
<item row="2" column="0">
|
</property>
|
||||||
<widget class="QLabel" name="label_2">
|
</widget>
|
||||||
<property name="text">
|
</item>
|
||||||
<string>Previous Version</string>
|
<item row="1" column="0">
|
||||||
</property>
|
<widget class="QLabel" name="label">
|
||||||
</widget>
|
<property name="text">
|
||||||
</item>
|
<string>Page Name:</string>
|
||||||
<item row="2" column="1">
|
</property>
|
||||||
<widget class="QLineEdit" name="lineEdit_PrevVersion">
|
</widget>
|
||||||
<property name="sizePolicy">
|
</item>
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
<item row="1" column="1">
|
||||||
<horstretch>10</horstretch>
|
<widget class="QLineEdit" name="lineEdit_Page">
|
||||||
<verstretch>0</verstretch>
|
<property name="sizePolicy">
|
||||||
</sizepolicy>
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
</property>
|
<horstretch>10</horstretch>
|
||||||
<property name="readOnly">
|
<verstretch>0</verstretch>
|
||||||
<bool>true</bool>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="2">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Prev ID</string>
|
<string>Previous Version</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="3">
|
<item row="2" column="1">
|
||||||
<widget class="QLineEdit" name="lineEdit_PrevId">
|
<widget class="QLineEdit" name="lineEdit_PrevVersion">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
<horstretch>1</horstretch>
|
<horstretch>10</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton_History">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show Edit History</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>178</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton_Preview">
|
||||||
|
<property name="text">
|
||||||
|
<string>Preview</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QTextEdit" name="textEdit"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton_Cancel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Cancel</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton_Revert">
|
||||||
|
<property name="text">
|
||||||
|
<string>Revert</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>228</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton_Submit">
|
||||||
|
<property name="text">
|
||||||
|
<string>Submit</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QTextEdit" name="textEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButton_Cancel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Cancel</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButton_Revert">
|
|
||||||
<property name="text">
|
|
||||||
<string>Revert</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>228</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButton_Submit">
|
|
||||||
<property name="text">
|
|
||||||
<string>Submit</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user