mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-20 04:14:27 -04:00
Added update capability to forums ui
Added timestamp check for group update in nxs decided to add control variable to allow meta changes in updates rather than none git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs_finale@6803 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
2a841d7ab3
commit
9470e5562a
12 changed files with 208 additions and 22 deletions
|
@ -148,13 +148,13 @@ void GxsGroupDialog::initMode()
|
|||
{
|
||||
ui.buttonBox->setStandardButtons(QDialogButtonBox::Close);
|
||||
}
|
||||
break;
|
||||
//TODO
|
||||
// case MODE_EDIT:
|
||||
// {
|
||||
// ui.createButton->setText(tr("Submit Changes"));
|
||||
// }
|
||||
// break;
|
||||
break;
|
||||
case MODE_EDIT:
|
||||
{
|
||||
ui.buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
ui.buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Submit Group Changes"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -320,14 +320,47 @@ void GxsGroupDialog::submitGroup()
|
|||
break;
|
||||
|
||||
case MODE_EDIT:
|
||||
{
|
||||
/* TEMP: just close if down */
|
||||
cancelDialog();
|
||||
{
|
||||
|
||||
editGroup();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void GxsGroupDialog::editGroup()
|
||||
{
|
||||
std::cerr << "GxsGroupDialog::editGroup()" << std::endl;
|
||||
|
||||
QString name = misc::removeNewLine(ui.groupName->text());
|
||||
uint32_t flags = GXS_SERV::FLAG_PRIVACY_PUBLIC;
|
||||
|
||||
if(name.isEmpty())
|
||||
{
|
||||
/* error message */
|
||||
QMessageBox::warning(this, "RetroShare", tr("Please add a Name"), QMessageBox::Ok, QMessageBox::Ok);
|
||||
return; //Don't add a empty name!!
|
||||
}
|
||||
|
||||
uint32_t token;
|
||||
RsGroupMetaData meta;
|
||||
|
||||
// Fill in the MetaData as best we can.
|
||||
meta.mGroupName = std::string(name.toUtf8());
|
||||
|
||||
meta.mGroupFlags = flags;
|
||||
meta.mSignFlags = getGroupSignFlags();
|
||||
|
||||
if (service_CreateGroup(token, meta))
|
||||
{
|
||||
// get the Queue to handle response.
|
||||
if(mTokenQueue != NULL)
|
||||
mTokenQueue->queueRequest(token, TOKENREQ_GROUPINFO, RS_TOKREQ_ANSTYPE_ACK, GXSGROUP_NEWGROUPID);
|
||||
}
|
||||
|
||||
close();
|
||||
}
|
||||
|
||||
void GxsGroupDialog::createGroup()
|
||||
{
|
||||
std::cerr << "GxsGroupDialog::createGroup()";
|
||||
|
|
|
@ -202,6 +202,7 @@ private:
|
|||
void setupVisibility();
|
||||
void clearForm();
|
||||
void createGroup();
|
||||
void editGroup();
|
||||
void sendShareList(std::string forumId);
|
||||
void loadNewGroupId(const uint32_t &token);
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <QMessageBox>
|
||||
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
|
||||
#include "GxsChannelDialog.h"
|
||||
#include "gui/feeds/GxsChannelPostItem.h"
|
||||
|
|
|
@ -52,6 +52,13 @@ const uint32_t ForumCreateDefaultsFlags = ( GXS_GROUP_DEFAULTS_DISTRIB_PUBLIC
|
|||
GXS_GROUP_DEFAULTS_COMMENTS_NO |
|
||||
0);
|
||||
|
||||
|
||||
const uint32_t ForumEditEnabledFlags = ( GXS_GROUP_FLAGS_ICON |
|
||||
GXS_GROUP_FLAGS_DESCRIPTION |
|
||||
0);
|
||||
|
||||
const uint32_t ForumEditDefaultsFlags = 0;
|
||||
|
||||
GxsForumGroupDialog::GxsForumGroupDialog(TokenQueue *tokenQueue, QWidget *parent)
|
||||
:GxsGroupDialog(tokenQueue, ForumCreateEnabledFlags, ForumCreateDefaultsFlags, parent)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue