diff --git a/retroshare-gui/src/RetroShare.pro b/retroshare-gui/src/RetroShare.pro index 87ab75547..f91209128 100644 --- a/retroshare-gui/src/RetroShare.pro +++ b/retroshare-gui/src/RetroShare.pro @@ -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 } diff --git a/retroshare-gui/src/gui/GxsForumsDialog.cpp b/retroshare-gui/src/gui/GxsForumsDialog.cpp index 6d3a4949f..949887a1c 100644 --- a/retroshare-gui/src/gui/GxsForumsDialog.cpp +++ b/retroshare-gui/src/gui/GxsForumsDialog.cpp @@ -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 (); } diff --git a/retroshare-gui/src/gui/Posted/PostedGroupDialog.cpp b/retroshare-gui/src/gui/Posted/PostedGroupDialog.cpp index 080447989..bf788971a 100644 --- a/retroshare-gui/src/gui/Posted/PostedGroupDialog.cpp +++ b/retroshare-gui/src/gui/Posted/PostedGroupDialog.cpp @@ -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 ""; } diff --git a/retroshare-gui/src/gui/Posted/PostedGroupDialog.h b/retroshare-gui/src/gui/Posted/PostedGroupDialog.h index 3ed4faed3..495d1a330 100644 --- a/retroshare-gui/src/gui/Posted/PostedGroupDialog.h +++ b/retroshare-gui/src/gui/Posted/PostedGroupDialog.h @@ -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(); diff --git a/retroshare-gui/src/gui/Posted/PostedListDialog.cpp b/retroshare-gui/src/gui/Posted/PostedListDialog.cpp index 059c356e6..586fb54d3 100644 --- a/retroshare-gui/src/gui/Posted/PostedListDialog.cpp +++ b/retroshare-gui/src/gui/Posted/PostedListDialog.cpp @@ -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 (); } diff --git a/retroshare-gui/src/gui/gxs/GxsForumGroupDialog.cpp b/retroshare-gui/src/gui/gxs/GxsForumGroupDialog.cpp index a9dceae31..d440c6c11 100644 --- a/retroshare-gui/src/gui/gxs/GxsForumGroupDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsForumGroupDialog.cpp @@ -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() diff --git a/retroshare-gui/src/gui/gxs/GxsForumGroupDialog.h b/retroshare-gui/src/gui/gxs/GxsForumGroupDialog.h index 2dc8d1a27..2277b38bd 100644 --- a/retroshare-gui/src/gui/gxs/GxsForumGroupDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsForumGroupDialog.h @@ -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(); diff --git a/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp index 0cf782840..3c392201c 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp @@ -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(); diff --git a/retroshare-gui/src/gui/gxs/GxsGroupDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupDialog.h index 4c89e2ac0..4af920686 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupDialog.h @@ -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 mShareList; QPixmap picture; - TokenQueue *mTokenQueue; - RsGroupMetaData mGrpMeta; + TokenQueue *mTokenQueue; + RsGroupMetaData mGrpMeta; uint32_t mMode; uint32_t mEnabledFlags; diff --git a/retroshare-gui/src/gui/gxs/WikiGroupDialog.cpp b/retroshare-gui/src/gui/gxs/WikiGroupDialog.cpp index d5f68e084..95a1b4399 100644 --- a/retroshare-gui/src/gui/gxs/WikiGroupDialog.cpp +++ b/retroshare-gui/src/gui/gxs/WikiGroupDialog.cpp @@ -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,12 +119,22 @@ 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() { - return QPixmap(":/images/resource-group_64.png"); + return QPixmap(":/images/resource-group_64.png"); } bool WikiGroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta) diff --git a/retroshare-gui/src/gui/gxsforums/EditGxsForumDetails.cpp b/retroshare-gui/src/gui/gxsforums/EditGxsForumDetails.cpp deleted file mode 100644 index 840a7f47f..000000000 --- a/retroshare-gui/src/gui/gxsforums/EditGxsForumDetails.cpp +++ /dev/null @@ -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 - -#include "util/misc.h" - -#include -#include -#include - - -/** 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(); -} diff --git a/retroshare-gui/src/gui/gxsforums/EditGxsForumDetails.h b/retroshare-gui/src/gui/gxsforums/EditGxsForumDetails.h deleted file mode 100644 index b21fadafc..000000000 --- a/retroshare-gui/src/gui/gxsforums/EditGxsForumDetails.h +++ /dev/null @@ -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 - -#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 - diff --git a/retroshare-gui/src/gui/gxsforums/EditGxsForumDetails.ui b/retroshare-gui/src/gui/gxsforums/EditGxsForumDetails.ui deleted file mode 100644 index 483e94a2f..000000000 --- a/retroshare-gui/src/gui/gxsforums/EditGxsForumDetails.ui +++ /dev/null @@ -1,87 +0,0 @@ - - - EditGxsForumDetails - - - - 0 - 0 - 436 - 355 - - - - Forum Details - - - - :/images/rstray3.png:/images/rstray3.png - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - 0 - - - - - :/images/info16.png:/images/info16.png - - - Edit Forum Details - - - - - - Forum Info - - - - - - Forum Name - - - - - - - - - - Forum Description - - - - - - - - - - - - - - - - - - - - - - diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumDetails.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumDetails.cpp deleted file mode 100644 index ed45f8dfd..000000000 --- a/retroshare-gui/src/gui/gxsforums/GxsForumDetails.cpp +++ /dev/null @@ -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 -#include -#include -#include - -#include -#include - -#include -#include -#include - - -/* 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 - -} diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumDetails.h b/retroshare-gui/src/gui/gxsforums/GxsForumDetails.h deleted file mode 100644 index d7c014262..000000000 --- a/retroshare-gui/src/gui/gxsforums/GxsForumDetails.h +++ /dev/null @@ -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 - -#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 - diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumDetails.ui b/retroshare-gui/src/gui/gxsforums/GxsForumDetails.ui deleted file mode 100644 index b6dfb4c1e..000000000 --- a/retroshare-gui/src/gui/gxsforums/GxsForumDetails.ui +++ /dev/null @@ -1,175 +0,0 @@ - - - GxsForumDetails - - - - 0 - 0 - 436 - 355 - - - - Forum Details - - - - :/images/rstray3.png:/images/rstray3.png - - - - - - 0 - - - - - :/images/info16.png:/images/info16.png - - - Forum Details - - - - - - Forum Info - - - - - - Forum Name - - - - - - - - - - Popularity - - - - - - - true - - - - - - - Last Post - - - - - - - true - - - - - - - Forum ID - - - - - - - - - - Forum Description - - - - - - - - - - - - - - - - - :/images/encrypted22.png:/images/encrypted22.png - - - Security - - - - - - Allowed Messages - - - - - - Authenticated Messages - - - - - - - Anonymous Messages - - - true - - - - - - - - - - Qt::Vertical - - - - 358 - 172 - - - - - - - - - - - - - - QDialogButtonBox::Close - - - - - - - - - - - -