Fixed crash in GxsGroupDialog in the second constructor.

Changed mode on GxsGroupDialog to enum.
Added different header text for every mode in PostedGroupDialog, WikiGroupDialog and GxsForumGroupDialog.
Removed not needed files of GxsForums.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5908 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-11-28 22:27:19 +00:00
parent ef9ebf4cf3
commit 799cf15555
16 changed files with 127 additions and 691 deletions

View File

@ -967,20 +967,14 @@ identities {
gxsforums {
HEADERS += gui/GxsForumsDialog.h \
gui/gxsforums/GxsForumDetails.h \
gui/gxsforums/EditGxsForumDetails.h \
gui/gxsforums/CreateGxsForumMsg.h \
gui/gxsforums/GxsForumThreadWidget.h
FORMS += gui/GxsForumsDialog.ui \
gui/gxsforums/GxsForumDetails.ui \
gui/gxsforums/EditGxsForumDetails.ui \
gui/gxsforums/CreateGxsForumMsg.ui \
gui/gxsforums/GxsForumThreadWidget.ui
SOURCES += gui/GxsForumsDialog.cpp \
gui/gxsforums/GxsForumDetails.cpp \
gui/gxsforums/EditGxsForumDetails.cpp \
gui/gxsforums/CreateGxsForumMsg.cpp \
gui/gxsforums/GxsForumThreadWidget.cpp
}

View File

@ -235,8 +235,6 @@ void GxsForumsDialog::forceUpdateDisplay()
/* update Forums List */
insertForums();
/* update threads as well */
//#TODO insertThreads();
}
void GxsForumsDialog::forumInfoToGroupItemInfo(const RsGroupMetaData &forumInfo, GroupItemInfo &groupItemInfo)
@ -258,19 +256,6 @@ void GxsForumsDialog::forumInfoToGroupItemInfo(const RsGroupMetaData &forumInfo,
{
groupItemInfo.icon = QIcon(IMAGE_FORUM);
}
// groupItemInfo.id = QString::fromStdString(forumInfo.forumId);
// groupItemInfo.name = QString::fromStdWString(forumInfo.forumName);
// groupItemInfo.description = QString::fromStdWString(forumInfo.forumDesc);
// groupItemInfo.popularity = forumInfo.pop;
// groupItemInfo.lastpost = QDateTime::fromTime_t(forumInfo.lastPost);
//
// if (forumInfo.forumFlags & RS_DISTRIB_AUTHEN_REQ) {
// groupItemInfo.name += " (" + tr("AUTHD") + ")";
// groupItemInfo.icon = QIcon(IMAGE_FORUMAUTHD);
// } else {
// groupItemInfo.icon = QIcon(IMAGE_FORUM);
// }
}
/***** INSERT FORUM LISTS *****/
@ -470,7 +455,7 @@ void GxsForumsDialog::showForumDetails()
RsGxsForumGroup grp;
grp.mMeta.mGroupId = mForumId;
GxsForumGroupDialog cf(grp, this);
GxsForumGroupDialog cf(grp, GxsGroupDialog::MODE_SHOW, this);
cf.exec ();
}
@ -483,10 +468,7 @@ void GxsForumsDialog::editForumDetails()
RsGxsForumGroup grp;
grp.mMeta.mGroupId = mForumId;
GxsForumGroupDialog cf(grp, this);
//GxsForumGroupDialog cf (mForumQueue, this, mCurrForumId, GXS_GROUP_DIALOG_EDIT_MODE);
GxsForumGroupDialog cf(grp, GxsGroupDialog::MODE_EDIT, this);
cf.exec ();
}

View File

@ -46,14 +46,24 @@ PostedGroupDialog::PostedGroupDialog(TokenQueue* tokenQueue, RsPosted* posted,
{
}
PostedGroupDialog::PostedGroupDialog(const RsPostedGroup& grp, uint32_t mode, QWidget *parent)
PostedGroupDialog::PostedGroupDialog(const RsPostedGroup& grp, Mode mode, QWidget *parent)
:GxsGroupDialog(grp.mMeta, mode, parent), mGrp(grp)
{
}
QString PostedGroupDialog::serviceHeader()
{
return tr("Create New Posted Topic");
switch (mode())
{
case MODE_CREATE:
return tr("Create New Posted Topic");
case MODE_SHOW:
return tr("Posted Topic");
case MODE_EDIT:
return tr("Edit Posted Topic");
}
return "";
}

View File

@ -40,7 +40,7 @@ public:
/*!
* This constructs a show dialog which displays an already existing group
*/
PostedGroupDialog(const RsPostedGroup& grp, uint32_t mode, QWidget *parent = NULL);
PostedGroupDialog(const RsPostedGroup& grp, Mode mode, QWidget *parent = NULL);
protected:
virtual QString serviceHeader();

View File

@ -152,7 +152,7 @@ void PostedListDialog::showGroupDetails()
return;
}
PostedGroupDialog cf(mGroups[mCurrTopicId], GXS_GROUP_DIALOG_SHOW_MODE, this);
PostedGroupDialog cf(mGroups[mCurrTopicId], GxsGroupDialog::MODE_SHOW, this);
cf.exec ();
}

View File

@ -60,15 +60,25 @@ GxsForumGroupDialog::GxsForumGroupDialog(TokenQueue *tokenQueue, QWidget *parent
}
GxsForumGroupDialog::GxsForumGroupDialog(const RsGxsForumGroup &group, QWidget *parent)
:GxsGroupDialog(group.mMeta, GXS_GROUP_DIALOG_SHOW_MODE, parent)
GxsForumGroupDialog::GxsForumGroupDialog(const RsGxsForumGroup &group, Mode mode, QWidget *parent)
:GxsGroupDialog(group.mMeta, mode, parent)
{
return;
}
QString GxsForumGroupDialog::serviceHeader()
{
return tr("Create New Forum");
switch (mode())
{
case MODE_CREATE:
return tr("Create New Forum");
case MODE_SHOW:
return tr("Forum");
case MODE_EDIT:
return tr("Edit Forum");
}
return "";
}
QPixmap GxsForumGroupDialog::serviceImage()

View File

@ -32,7 +32,7 @@ class GxsForumGroupDialog : public GxsGroupDialog
public:
GxsForumGroupDialog(TokenQueue *tokenQueue, QWidget *parent);
GxsForumGroupDialog(const RsGxsForumGroup &group, QWidget *parent);
GxsForumGroupDialog(const RsGxsForumGroup &group, Mode mode, QWidget *parent);
protected:
virtual QString serviceHeader();

View File

@ -51,11 +51,25 @@
/** Constructor */
GxsGroupDialog::GxsGroupDialog(TokenQueue *tokenQueue, uint32_t enableFlags, uint16_t defaultFlags, QWidget *parent)
: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint), mTokenQueue(tokenQueue), mMode(GXS_GROUP_DIALOG_CREATE_MODE), mEnabledFlags(enableFlags), mDefaultsFlags(defaultFlags), mReadonlyFlags(0)
: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint), mTokenQueue(tokenQueue), mMode(MODE_CREATE), mEnabledFlags(enableFlags), mReadonlyFlags(0), mDefaultsFlags(defaultFlags)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
init();
}
GxsGroupDialog::GxsGroupDialog(const RsGroupMetaData &grpMeta, Mode mode, QWidget *parent)
: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint), mTokenQueue(NULL), mGrpMeta(grpMeta), mMode(mode), mEnabledFlags(0), mReadonlyFlags(0), mDefaultsFlags(0)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
init();
}
void GxsGroupDialog::init()
{
// connect up the buttons.
connect( ui.buttonBox, SIGNAL(accepted()), this, SLOT(submitGroup()));
connect( ui.buttonBox, SIGNAL(rejected()), this, SLOT(cancelDialog()));
@ -77,13 +91,9 @@ GxsGroupDialog::GxsGroupDialog(TokenQueue *tokenQueue, uint32_t enableFlags, uin
/* Setup Reasonable Defaults */
ui.idChooser->loadIds(0,"");
}
ui.idChooser->loadIds(0,"");
GxsGroupDialog::GxsGroupDialog(const RsGroupMetaData &grpMeta, uint32_t mode, QWidget *parent)
: QDialog(parent), mMode(mode), mGrpMeta(grpMeta) {
ui.idChooser->loadIds(0,"");
initMode();
}
void GxsGroupDialog::showEvent(QShowEvent*)
@ -94,11 +104,11 @@ void GxsGroupDialog::showEvent(QShowEvent*)
ui.headerFrame->setHeaderImage(serviceImage());
}
void GxsGroupDialog::setMode(uint32_t mode)
void GxsGroupDialog::initMode()
{
switch(mMode)
switch (mode())
{
case GXS_GROUP_DIALOG_CREATE_MODE:
case MODE_CREATE:
{
ui.buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
ui.buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Create Group"));
@ -106,14 +116,13 @@ void GxsGroupDialog::setMode(uint32_t mode)
}
break;
default:
case GXS_GROUP_DIALOG_SHOW_MODE:
case MODE_SHOW:
{
ui.buttonBox->setStandardButtons(QDialogButtonBox::Close);
}
break;
//TODO
// case GXS_GROUP_DIALOG_EDIT_MODE:
// case MODE_EDIT:
// {
// ui.createButton->setText(tr("Submit Changes"));
// }
@ -129,7 +138,6 @@ void GxsGroupDialog::clearForm()
ui.groupName->setFocus();
}
void GxsGroupDialog::setupDefaults()
{
/* Enable / Show Parts based on Flags */
@ -267,24 +275,23 @@ void GxsGroupDialog::submitGroup()
std::cerr << std::endl;
/* switch depending on mode */
switch(mMode)
switch (mode())
{
case GXS_GROUP_DIALOG_CREATE_MODE:
case MODE_CREATE:
{
/* just close if down */
createGroup();
}
break;
default:
case GXS_GROUP_DIALOG_SHOW_MODE:
case MODE_SHOW:
{
/* just close if down */
cancelDialog();
}
break;
case GXS_GROUP_DIALOG_EDIT_MODE:
case MODE_EDIT:
{
/* TEMP: just close if down */
cancelDialog();

View File

@ -92,10 +92,6 @@ public:
#define GXS_GROUP_DEFAULTS_COMMENTS_YES 0x00001000
#define GXS_GROUP_DEFAULTS_COMMENTS_NO 0x00002000
#define GXS_GROUP_DIALOG_CREATE_MODE 1
#define GXS_GROUP_DIALOG_SHOW_MODE 2
#define GXS_GROUP_DIALOG_EDIT_MODE 3
/*!
* The aim of this dialog is to be convenient to encapsulate group
* creation code for several GXS services such forums, channels
@ -111,67 +107,77 @@ public:
*/
class GxsGroupDialog : public QDialog
{
Q_OBJECT
Q_OBJECT
public:
enum Mode {
MODE_CREATE,
MODE_SHOW,
MODE_EDIT
};
public:
/*!
* Constructs a GxsGroupDialog for creating group
* @param tokenQueue This should be the TokenQueue of the (parent) service
* in order to receive acknowledgement of group creation, if set to NULL with create mode \n
* creation will not happen
* @param enableFlags This determines what options are enabled such as Icon, Description, publish type and key sharing
* @param defaultFlags This deter
* @param parent The parent dialog
* @param mode
*/
GxsGroupDialog(TokenQueue* tokenQueue, uint32_t enableFlags, uint16_t defaultFlags, QWidget *parent = NULL);
/*!
* Constructs a GxsGroupDialog for creating group
* @param tokenQueue This should be the TokenQueue of the (parent) service
* in order to receive acknowledgement of group creation, if set to NULL with create mode \n
* creation will not happen
* @param enableFlags This determines what options are enabled such as Icon, Description, publish type and key sharing
* @param defaultFlags This deter
* @param parent The parent dialog
* @param mode
*/
GxsGroupDialog(TokenQueue* tokenQueue, uint32_t enableFlags, uint16_t defaultFlags, QWidget *parent = NULL);
/*!
* Contructs a GxsGroupDialog for display a group or editing
* @param grpMeta This is used to fill out the dialog
* @param mode This determines whether the dialog starts in show or edit mode (Edit not supported yet)
* @param parent
*/
GxsGroupDialog(const RsGroupMetaData& grpMeta, uint32_t mode = GXS_GROUP_DIALOG_SHOW_MODE, QWidget *parent = NULL);
void wikitype();
/*!
* Contructs a GxsGroupDialog for display a group or editing
* @param grpMeta This is used to fill out the dialog
* @param mode This determines whether the dialog starts in show or edit mode (Edit not supported yet)
* @param parent
*/
GxsGroupDialog(const RsGroupMetaData& grpMeta, Mode mode, QWidget *parent = NULL);
void wikitype();
uint32_t mode() { return mMode; }
private:
void newGroup();
void setMode(uint32_t mode);
void newGroup();
void init();
void initMode();
// Functions that can be overloaded for specific stuff.
// Functions that can be overloaded for specific stuff.
protected slots:
void submitGroup();
void addGroupLogo();
void submitGroup();
void addGroupLogo();
protected:
virtual void showEvent(QShowEvent*);
virtual void showEvent(QShowEvent*);
virtual QString serviceHeader() = 0;
virtual QPixmap serviceImage() = 0;
virtual QString serviceHeader() = 0;
virtual QPixmap serviceImage() = 0;
/*!
* Main purpose is to help tansfer meta data to service
*
* @param token This should be set to the token retrieved
* @param meta The deriving GXS service should set their grp meta to this value
*/
virtual bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta) = 0;
/*!
* Main purpose is to help tansfer meta data to service
*
* @param token This should be set to the token retrieved
* @param meta The deriving GXS service should set their grp meta to this value
*/
virtual bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta) = 0;
/*!
* This returns a group logo from the ui \n
* Should be calleld by deriving service
* @return The logo for the service
*/
QPixmap getLogo();
/*!
* This returns a group logo from the ui \n
* Should be calleld by deriving service
* @return The logo for the service
*/
QPixmap getLogo();
/*!
* This returns a group description string from the ui
* @return group description string
*/
virtual QString getDescription();
/*!
* This returns a group description string from the ui
* @return group description string
*/
virtual QString getDescription();
private slots:
@ -196,8 +202,8 @@ private:
std::list<std::string> mShareList;
QPixmap picture;
TokenQueue *mTokenQueue;
RsGroupMetaData mGrpMeta;
TokenQueue *mTokenQueue;
RsGroupMetaData mGrpMeta;
uint32_t mMode;
uint32_t mEnabledFlags;

View File

@ -92,7 +92,7 @@ WikiGroupDialog::WikiGroupDialog(TokenQueue *tokenQueue, QWidget *parent)
}
WikiGroupDialog::WikiGroupDialog(const RsWikiCollection &collection, QWidget *parent)
:GxsGroupDialog(collection.mMeta, GXS_GROUP_DIALOG_SHOW_MODE, parent)
:GxsGroupDialog(collection.mMeta, MODE_SHOW, parent)
{
#if 0
@ -119,7 +119,17 @@ WikiGroupDialog::WikiGroupDialog(const RsWikiCollection &collection, QWidget *pa
QString WikiGroupDialog::serviceHeader()
{
return tr("Create New Wiki Group");
switch (mode())
{
case MODE_CREATE:
return tr("Create New Wiki Group");
case MODE_SHOW:
return tr("Wiki Group");
case MODE_EDIT:
return tr("Edit Wiki Group");
}
return "";
}
QPixmap WikiGroupDialog::serviceImage()

View File

@ -1,90 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2010 RetroShare Team
*
* 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 "EditGxsForumDetails.h"
#include <retroshare/rsgxsforums.h>
#include "util/misc.h"
#include <list>
#include <iostream>
#include <string>
/** Default constructor */
EditGxsForumDetails::EditGxsForumDetails(std::string forumId, QWidget *parent)
: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint), m_forumId(forumId)
{
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);
connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(applyDialog()));
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
loadForum();
}
void EditGxsForumDetails::loadForum()
{
if (!rsGxsForums) {
return;
}
#warning "EditGxsForumDetails incomplete"
#if 0
ForumInfo info;
rsGxsForums->getForumInfo(m_forumId, info);
// set name
ui.nameline->setText(QString::fromStdWString(info.forumName));
// set description
ui.DescriptiontextEdit->setText(QString::fromStdWString(info.forumDesc));
#endif
}
void EditGxsForumDetails::applyDialog()
{
if (!rsGxsForums) {
return;
}
// if text boxes have not been edited leave alone
if (!ui.nameline->isModified() && !ui.DescriptiontextEdit->document()->isModified()) {
return;
}
#warning "EditGxsForumDetails incomplete"
#if 0
ForumInfo info;
info.forumName = misc::removeNewLine(ui.nameline->text()).toStdWString();
info.forumDesc = ui.DescriptiontextEdit->document()->toPlainText().toStdWString();
rsGxsForums->setForumInfo(m_forumId, info);
#endif
/* close the Dialog after the Changes applied */
close();
}

View File

@ -1,53 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2010 RetroShare Team
*
* 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 _EDITGXSFORUMDETAILS_H
#define _EDITGXSFORUMDETAILS_H
#include <QDialog>
#include "ui_EditGxsForumDetails.h"
class EditGxsForumDetails : public QDialog
{
Q_OBJECT
public:
/** Default constructor */
EditGxsForumDetails(std::string forumId = "", QWidget *parent = 0);
signals:
void configChanged();
private slots:
void applyDialog();
private:
void loadForum();
std::string m_forumId;
/** Qt Designer generated object */
Ui::EditGxsForumDetails ui;
};
#endif

View File

@ -1,87 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EditGxsForumDetails</class>
<widget class="QDialog" name="EditGxsForumDetails">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>436</width>
<height>355</height>
</rect>
</property>
<property name="windowTitle">
<string>Forum Details</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">
<item row="1" column="0">
<layout class="QGridLayout" name="_2">
<item row="0" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QTabWidget" name="stabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/info16.png</normaloff>:/images/info16.png</iconset>
</attribute>
<attribute name="title">
<string>Edit Forum Details</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Forum Info</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Forum Name</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="nameline"/>
</item>
<item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Forum Description</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTextEdit" name="DescriptiontextEdit"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -1,120 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2009 RetroShare Team
*
* 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 "GxsForumDetails.h"
//#AFTER MERGE #include "util/DateTime.h"
#include <retroshare/rsiface.h>
#include <retroshare/rspeers.h>
#include <retroshare/rsdisc.h>
#include <retroshare/rsgxsforums.h>
#include <QTime>
#include <QDateTime>
#include <list>
#include <iostream>
#include <string>
/* Define the format used for displaying the date and time */
#define DATETIME_FMT "MMM dd hh:mm:ss"
/** Default constructor */
GxsForumDetails::GxsForumDetails(QWidget *parent)
: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
{
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
ui.nameline ->setReadOnly(true);
ui.popline ->setReadOnly(true);
ui.postline ->setReadOnly(true);
ui.IDline ->setReadOnly(true);
ui.DescriptiontextEdit ->setReadOnly(true);
ui.radioButton_authd->setEnabled(false);
ui.radioButton_anonymous->setEnabled(false);
}
/**
Overloads the default show() slot so we can set opacity*/
void
GxsForumDetails::show()
{
//loadSettings();
if(!this->isVisible()) {
QDialog::show();
}
}
void GxsForumDetails::showDetails(std::string mCurrForumId)
{
fId = mCurrForumId;
loadDialog();
}
void GxsForumDetails::loadDialog()
{
if (!rsGxsForums)
{
return;
}
#warning "GxsForumDetails Incomplete"
#if 0
ForumInfo fi;
rsGxsForums->getForumInfo(fId, fi);
// Set Forum Name
ui.nameline->setText(QString::fromStdWString(fi.forumName));
// Set Popularity
ui.popline->setText(QString::number(fi.pop));
// Set Last Post Date
if (fi.lastPost) {
ui.postline->setText(DateTime::formatLongDateTime(fi.lastPost));
}
// Set Forum ID
ui.IDline->setText(QString::fromStdString(fi.forumId));
// Set Forum Description
ui.DescriptiontextEdit->setText(QString::fromStdWString(fi.forumDesc));
if (fi.forumFlags & RS_DISTRIB_AUTHEN_REQ)
{
ui.radioButton_authd->setChecked(true);
ui.radioButton_anonymous->setChecked(false);
}
if (fi.forumFlags & RS_DISTRIB_AUTHEN_ANON)
{
ui.radioButton_authd->setChecked(false);
ui.radioButton_anonymous->setChecked(true);
}
#endif
}

View File

@ -1,58 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2009 RetroShare Team
*
* 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 _GXSFORUMDETAILS_H
#define _GXSFORUMDETAILS_H
#include <QDialog>
#include "ui_GxsForumDetails.h"
class GxsForumDetails : public QDialog
{
Q_OBJECT
public:
/** Default constructor */
GxsForumDetails(QWidget *parent = 0);
void showDetails(std::string mCurrForumId);
signals:
void configChanged() ;
public slots:
/** Overloaded QWidget.show */
void show();
private:
void loadDialog();
std::string fId;
/** Qt Designer generated object */
Ui::GxsForumDetails ui;
};
#endif

View File

@ -1,175 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>GxsForumDetails</class>
<widget class="QDialog" name="GxsForumDetails">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>436</width>
<height>355</height>
</rect>
</property>
<property name="windowTitle">
<string>Forum Details</string>
</property>
<property name="windowIcon">
<iconset resource="../images.qrc">
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QTabWidget" name="stabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/info16.png</normaloff>:/images/info16.png</iconset>
</attribute>
<attribute name="title">
<string>Forum Details</string>
</attribute>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Forum Info</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Forum Name</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="nameline"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Popularity</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="popline">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Last Post</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="postline">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Forum ID</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="IDline"/>
</item>
<item row="4" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Forum Description</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QTextEdit" name="DescriptiontextEdit"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="Seite">
<attribute name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/encrypted22.png</normaloff>:/images/encrypted22.png</iconset>
</attribute>
<attribute name="title">
<string>Security</string>
</attribute>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Allowed Messages</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QRadioButton" name="radioButton_authd">
<property name="text">
<string>Authenticated Messages</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="radioButton_anonymous">
<property name="text">
<string>Anonymous Messages</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>358</width>
<height>172</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item row="1" column="0">
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>