Big Chunk of GUI work.

- Ported Forums to GxsForums. Not functioning yet, waiting on some GXS core functions.
 - Fixed up plumbing in Wiki.
 - Minor fixes to TokenQueue



git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5812 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2012-11-12 20:47:55 +00:00
parent d8dc2a0420
commit 8d556955c5
30 changed files with 6823 additions and 510 deletions

View file

@ -0,0 +1,83 @@
/****************************************************************
* 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 "GxsForumGroupDialog.h"
#include <retroshare/rsgxsforums.h>
#include <iostream>
// To start with we only have open forums - with distribution controls.
const uint32_t ForumCreateEnabledFlags = ( GXS_GROUP_FLAGS_ICON |
GXS_GROUP_FLAGS_DESCRIPTION |
GXS_GROUP_FLAGS_DISTRIBUTION |
// GXS_GROUP_FLAGS_PUBLISHSIGN |
GXS_GROUP_FLAGS_SHAREKEYS |
// GXS_GROUP_FLAGS_PERSONALSIGN |
// GXS_GROUP_FLAGS_COMMENTS |
0);
const uint32_t ForumCreateDefaultsFlags = ( GXS_GROUP_DEFAULTS_DISTRIB_PUBLIC |
//GXS_GROUP_DEFAULTS_DISTRIB_GROUP |
//GXS_GROUP_DEFAULTS_DISTRIB_LOCAL |
GXS_GROUP_DEFAULTS_PUBLISH_OPEN |
//GXS_GROUP_DEFAULTS_PUBLISH_THREADS |
//GXS_GROUP_DEFAULTS_PUBLISH_REQUIRED |
//GXS_GROUP_DEFAULTS_PUBLISH_ENCRYPTED |
//GXS_GROUP_DEFAULTS_PERSONAL_GPG |
GXS_GROUP_DEFAULTS_PERSONAL_REQUIRED |
//GXS_GROUP_DEFAULTS_PERSONAL_IFNOPUB |
//GXS_GROUP_DEFAULTS_COMMENTS_YES |
GXS_GROUP_DEFAULTS_COMMENTS_NO |
0);
GxsForumGroupDialog::GxsForumGroupDialog(TokenQueue *tokenQueue, QWidget *parent)
:GxsGroupDialog(tokenQueue, ForumCreateEnabledFlags, ForumCreateDefaultsFlags, parent)
{
}
GxsForumGroupDialog::GxsForumGroupDialog(const RsGxsForumGroup &group, QWidget *parent)
:GxsGroupDialog(group.mMeta, GXS_GROUP_DIALOG_SHOW_MODE, parent)
{
return;
}
bool GxsForumGroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta)
{
// Specific Function.
RsGxsForumGroup grp;
grp.mMeta = meta;
//grp.mDescription = std::string(desc.toUtf8());
rsGxsForums->createGroup(token, grp);
return true;
}

View file

@ -0,0 +1,42 @@
/****************************************************************
* 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 _GXSFORUM_GROUP_DIALOG_H
#define _GXSFORUM_GROUP_DIALOG_H
#include "GxsGroupDialog.h"
#include <retroshare/rsgxsforums.h>
class GxsForumGroupDialog : public GxsGroupDialog
{
Q_OBJECT
public:
GxsForumGroupDialog(TokenQueue *tokenQueue, QWidget *parent);
GxsForumGroupDialog(const RsGxsForumGroup &group, QWidget *parent);
protected:
virtual bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta);
};
#endif

View file

@ -285,6 +285,9 @@ void GxsGroupDialog::submitGroup()
void GxsGroupDialog::createGroup()
{
std::cerr << "GxsGroupDialog::createGroup()";
std::cerr << std::endl;
QString name = misc::removeNewLine(ui.groupName->text());
uint32_t flags = 0;

View file

@ -24,12 +24,39 @@
#include <retroshare/rswiki.h>
#include <iostream>
const uint32_t WikiCreateEnabledFlags = ( GXS_GROUP_FLAGS_ICON |
GXS_GROUP_FLAGS_DESCRIPTION |
GXS_GROUP_FLAGS_DISTRIBUTION |
// GXS_GROUP_FLAGS_PUBLISHSIGN |
GXS_GROUP_FLAGS_SHAREKEYS |
// GXS_GROUP_FLAGS_PERSONALSIGN |
// GXS_GROUP_FLAGS_COMMENTS |
0);
uint32_t WikiCreateDefaultsFlags = ( GXS_GROUP_DEFAULTS_DISTRIB_PUBLIC |
//GXS_GROUP_DEFAULTS_DISTRIB_GROUP |
//GXS_GROUP_DEFAULTS_DISTRIB_LOCAL |
GXS_GROUP_DEFAULTS_PUBLISH_OPEN |
//GXS_GROUP_DEFAULTS_PUBLISH_THREADS |
//GXS_GROUP_DEFAULTS_PUBLISH_REQUIRED |
//GXS_GROUP_DEFAULTS_PUBLISH_ENCRYPTED |
//GXS_GROUP_DEFAULTS_PERSONAL_GPG |
GXS_GROUP_DEFAULTS_PERSONAL_REQUIRED |
//GXS_GROUP_DEFAULTS_PERSONAL_IFNOPUB |
//GXS_GROUP_DEFAULTS_COMMENTS_YES |
GXS_GROUP_DEFAULTS_COMMENTS_NO |
0);
WikiGroupDialog::WikiGroupDialog(TokenQueue *tokenQueue, QWidget *parent)
:GxsGroupDialog(tokenQueue, parent, GXS_GROUP_DIALOG_CREATE_MODE)
:GxsGroupDialog(tokenQueue, WikiCreateEnabledFlags, WikiCreateDefaultsFlags, parent)
{
// To start with we only have open forums - with distribution controls.
#if 0
uint32_t enabledFlags = ( GXS_GROUP_FLAGS_ICON |
GXS_GROUP_FLAGS_DESCRIPTION |
GXS_GROUP_FLAGS_DISTRIBUTION |
@ -60,12 +87,15 @@ WikiGroupDialog::WikiGroupDialog(TokenQueue *tokenQueue, QWidget *parent)
//setFlags(enabledFlags, readonlyFlags, defaultsFlags);
setFlags(enabledFlags, defaultsFlags);
#endif
}
WikiGroupDialog::WikiGroupDialog(const RsWikiCollection &collection, QWidget *parent)
:GxsGroupDialog(NULL, parent, GXS_GROUP_DIALOG_SHOW_MODE)
:GxsGroupDialog(collection.mMeta, GXS_GROUP_DIALOG_SHOW_MODE, parent)
{
#if 0
// To start with we only have open forums - with distribution controls.
@ -84,6 +114,7 @@ WikiGroupDialog::WikiGroupDialog(const RsWikiCollection &collection, QWidget *pa
0);
setFlags(enabledFlags, defaultsFlags);
#endif
}
@ -94,48 +125,12 @@ bool WikiGroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMetaData
RsWikiCollection grp;
grp.mMeta = meta;
//grp.mDescription = std::string(desc.toUtf8());
std::cerr << "WikiGroupDialog::service_CreateGroup() storing to Queue";
std::cerr << std::endl;
rsWiki->submitCollection(token, grp);
return true;
}
QPixmap WikiGroupDialog::service_getLogo()
{
return QPixmap(); // null pixmap
}
QString WikiGroupDialog::service_getDescription()
{
return QString();
}
RsGroupMetaData WikiGroupDialog::service_getMeta()
{
return mGrp.mMeta;
}
#if 0
void WikiGroupDialog::service_loadExistingGroup(const uint32_t &token)
{
std::cerr << "WikiGroupDialog::service_loadExistingGroup()";
std::cerr << std::endl;
RsWikiCollection group;
if (!rsWiki->getGroupData(token, group))
{
std::cerr << "WikiGroupDialog::service_loadExistingGroup() ERROR Getting Group";
std::cerr << std::endl;
return;
}
/* must call metadata loader */
loadExistingGroupMetaData(group.mMeta);
/* now load any extra data we feel like */
}
#endif

View file

@ -36,11 +36,6 @@ public:
protected:
virtual bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta);
virtual QPixmap service_getLogo();
virtual QString service_getDescription();
virtual RsGroupMetaData service_getMeta();
//virtual void service_loadExistingGroup(const uint32_t &token);
private: