Added missing files

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7330 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2014-05-04 23:09:54 +00:00
parent 50bb541c4e
commit 3675b1fd0f
2 changed files with 179 additions and 0 deletions

View File

@ -0,0 +1,128 @@
/****************************************************************
* 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 "GxsForumsDialog.h"
#include "GxsForumGroupDialog.h"
#include "GxsForumThreadWidget.h"
#include "gui/settings/rsharesettings.h"
#include "gui/notifyqt.h"
#include "gui/channels/ShareKey.h"
// These should be in retroshare/ folder.
//#include "retroshare/rsgxsflags.h"
//#define DEBUG_FORUMS
/** Constructor */
GxsForumsDialog::GxsForumsDialog(QWidget *parent)
: GxsGroupFrameDialog(rsGxsForums, parent)
{
connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
settingsChanged();
}
GxsForumsDialog::~GxsForumsDialog()
{
}
//UserNotify *GxsForumsDialog::getUserNotify(QObject *parent)
//{
// return new GxsForumUserNotify(parent);
//}
QString GxsForumsDialog::text(TextType type)
{
switch (type) {
case TEXT_NAME:
return tr("Forums");
case TEXT_NEW:
return tr("Create Forum");
case TEXT_TODO:
return "<b>Open points:</b><ul>"
"<li>Restore forum keys"
"<li>Display AUTHD"
"<li>Copy/navigate forum link"
"<li>Display author of post"
"<li>Display count of unread messages"
"<li>Don't show own posts as unread"
"<li>Remove messages"
"</ul>";
case TEXT_YOUR_GROUP:
return tr("My Forums");
case TEXT_SUBSCRIBED_GROUP:
return tr("Subscribed Forums");
case TEXT_POPULAR_GROUP:
return tr("Popular Forums");
case TEXT_OTHER_GROUP:
return tr("Other Forums");
}
return "";
}
QString GxsForumsDialog::icon(IconType type)
{
switch (type) {
case ICON_NAME:
return ":/images/konversation.png";
case ICON_NEW:
return ":/images/new_forum16.png";
case ICON_YOUR_GROUP:
return ":/images/folder16.png";
case ICON_SUBSCRIBED_GROUP:
return ":/images/folder_red.png";
case ICON_POPULAR_GROUP:
return ":/images/folder_green.png";
case ICON_OTHER_GROUP:
return ":/images/folder_yellow.png";
case ICON_DEFAULT:
return ":/images/konversation.png";
}
return "";
}
void GxsForumsDialog::settingsChanged()
{
setSingleTab(!Settings->getForumOpenAllInNewTab());
}
GxsGroupDialog *GxsForumsDialog::createNewGroupDialog(TokenQueue *tokenQueue)
{
return new GxsForumGroupDialog(tokenQueue, this);
}
GxsGroupDialog *GxsForumsDialog::createGroupDialog(TokenQueue *tokenQueue, RsTokenService *tokenService, GxsGroupDialog::Mode mode, RsGxsGroupId groupId)
{
return new GxsForumGroupDialog(tokenQueue, tokenService, mode, groupId, this);
}
int GxsForumsDialog::shareKeyType()
{
return FORUM_KEY_SHARE;
}
GxsMessageFrameWidget *GxsForumsDialog::createMessageFrameWidget(const RsGxsGroupId &groupId)
{
return new GxsForumThreadWidget(groupId);
}

View File

@ -0,0 +1,51 @@
/****************************************************************
* 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 _GXSFORUMSDIALOG_H
#define _GXSFORUMSDIALOG_H
#include "gui/gxs/GxsGroupFrameDialog.h"
class GxsForumsDialog : public GxsGroupFrameDialog
{
Q_OBJECT
public:
GxsForumsDialog(QWidget *parent = 0);
~GxsForumsDialog();
// virtual UserNotify *getUserNotify(QObject *parent);
private slots:
void settingsChanged();
private:
/* GxsGroupFrameDialog */
virtual QString text(TextType type);
virtual QString icon(IconType type);
virtual QString settingsGroupName() { return "GxsForumsDialog"; }
virtual GxsGroupDialog *createNewGroupDialog(TokenQueue *tokenQueue);
virtual GxsGroupDialog *createGroupDialog(TokenQueue *tokenQueue, RsTokenService *tokenService, GxsGroupDialog::Mode mode, RsGxsGroupId groupId);
virtual int shareKeyType();
virtual GxsMessageFrameWidget *createMessageFrameWidget(const RsGxsGroupId &groupId);
};
#endif