Applied changes from the trunk to the GXS forums.

Cleaned old and unused files.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5868 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-11-21 18:55:52 +00:00
parent ae0e93ac41
commit 55d562238e
44 changed files with 1744 additions and 9594 deletions

View File

@ -967,19 +967,16 @@ gxsforums {
HEADERS += gui/GxsForumsDialog.h \
gui/gxsforums/GxsForumDetails.h \
gui/gxsforums/EditGxsForumDetails.h \
gui/gxsforums/CreateGxsForum.h \
gui/gxsforums/CreateGxsForumMsg.h \
FORMS += gui/GxsForumsDialog.ui \
gui/gxsforums/GxsForumDetails.ui \
gui/gxsforums/EditGxsForumDetails.ui \
gui/gxsforums/CreateGxsForum.ui \
gui/gxsforums/CreateGxsForumMsg.ui \
SOURCES += gui/GxsForumsDialog.cpp \
gui/gxsforums/GxsForumDetails.cpp \
gui/gxsforums/EditGxsForumDetails.cpp \
gui/gxsforums/CreateGxsForum.cpp \
gui/gxsforums/CreateGxsForumMsg.cpp \
}

File diff suppressed because it is too large Load Diff

View File

@ -1,271 +0,0 @@
/****************************************************************
* 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 _FORUMSV2DIALOG_H
#define _FORUMSV2DIALOG_H
#include <QThread>
#include "mainpage.h"
#include "RsAutoUpdatePage.h"
#include "ui_ForumsV2Dialog.h"
#include <inttypes.h>
#include "util/TokenQueue.h"
#include <retroshare/rsforumsv2.h>
class ForumInfo;
/* These are all the parameters that are required for thread loading.
* They are kept static for the load duration.
*/
class ForumsV2ThreadLoadParameters
{
public:
std::string ForumId;
std::string FocusMsgId;
uint32_t SubscribeFlags;
int ViewType;
uint32_t FilterColumn;
std::map<uint32_t, QTreeWidgetItem *> MsgTokens;
QList<QTreeWidgetItem*> Items;
QList<QTreeWidgetItem*> ItemToExpand;
bool FillComplete;
bool FlatView;
bool UseChildTS;
bool ExpandNewMessages;
};
class ForumsV2Dialog : public RsAutoUpdatePage, public TokenResponse
{
Q_OBJECT
public:
ForumsV2Dialog(QWidget *parent = 0);
~ForumsV2Dialog();
bool navigate(const std::string& forumId, const std::string& msgId);
/* overloaded from RsAuthUpdatePage */
virtual void updateDisplay();
// Callback for all Loads.
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
protected:
bool eventFilter(QObject *obj, QEvent *ev);
private slots:
/** Create the context popup menu and it's submenus */
void forumListCustomPopupMenu( QPoint point );
void threadListCustomPopupMenu( QPoint point );
void restoreForumKeys();
void newforum();
void changedForum(const QString &id);
void changedThread();
void clickedThread (QTreeWidgetItem *item, int column);
void replytomessage();
void replyMessageData(const RsForumV2Msg &msg);
//void print();
//void printpreview();
//void removemessage();
void markMsgAsRead();
void markMsgAsReadChildren();
void markMsgAsReadAll();
void markMsgAsUnread();
void markMsgAsUnreadAll();
void markMsgAsUnreadChildren();
void copyForumLink();
void copyMessageLink();
/* handle splitter */
void togglethreadview();
void createthread();
void createmessage();
void subscribeToForum();
void unsubscribeToForum();
void showForumDetails();
void editForumDetails();
void previousMessage ();
void nextMessage ();
void nextUnreadMessage();
void downloadAllFiles();
void changedViewBox();
void filterColumnChanged();
//void filterRegExpChanged();
///void clearFilter();
void generateMassData();
void fillThreadFinished();
void fillThreadProgress(int current, int count);
void shareKey();
private:
void insertForums();
void insertThreads();
void insertPost();
void insertPostData(const RsForumV2Msg &msg); // Second Half.
// Utility Fns.
QString titleFromInfo(const RsMsgMetaData &meta);
QString messageFromInfo(const RsForumV2Msg &msg);
void forumMsgReadStatusChanged(const QString &forumId, const QString &msgId, int status);
void updateMessageSummaryList(std::string forumId);
//void forumInfoToGroupItemInfo(const ForumInfo &forumInfo, GroupItemInfo &groupItemInfo);
void forumInfoToGroupItemInfo(const RsGroupMetaData &forumInfo, GroupItemInfo &groupItemInfo);
void forumSubscribe(bool subscribe);
void FillThreads(QList<QTreeWidgetItem *> &ThreadList, bool bExpandNewMessages, QList<QTreeWidgetItem*> &itemToExpand);
void FillChildren(QTreeWidgetItem *Parent, QTreeWidgetItem *NewParent, bool bExpandNewMessages, QList<QTreeWidgetItem*> &itemToExpand);
int getSelectedMsgCount(QList<QTreeWidgetItem*> *pRows, QList<QTreeWidgetItem*> *pRowsRead, QList<QTreeWidgetItem*> *pRowsUnread);
void setMsgAsReadUnread(QList<QTreeWidgetItem*> &Rows, bool bRead);
void markMsgAsReadUnread(bool bRead, bool bChildren, bool bForum);
void CalculateIconsAndFonts(QTreeWidgetItem *pItem = NULL);
void CalculateIconsAndFonts(QTreeWidgetItem *pItem, bool &bHasReadChilddren, bool &bHasUnreadChilddren);
void processSettings(bool bLoad);
void togglethreadview_internal();
void filterItems(const QString& text);
bool filterItem(QTreeWidgetItem *pItem, const QString &text, int filterColumn);
// New Request/Response Loading Functions.
void insertForumsData(const std::list<RsGroupMetaData> &forumList);
void insertForumThreads(const RsGroupMetaData &fi);
void requestGroupSummary();
void loadGroupSummary(const uint32_t &token);
void requestGroupSummary_CurrentForum(const std::string &forumId);
void loadGroupSummary_CurrentForum(const uint32_t &token);
void loadCurrentForumThreads(const std::string &forumId);
void requestGroupThreadData_InsertThreads(const std::string &forumId);
void loadGroupThreadData_InsertThreads(const uint32_t &token);
void loadForumBaseThread(const RsForumV2Msg &msg);
void requestChildData_InsertThreads(uint32_t &token, const std::string &parentId);
void loadChildData_InsertThreads(const uint32_t &token);
void loadForumChildMsg(const RsForumV2Msg &msg, QTreeWidgetItem *parent);
void requestMsgData_InsertPost(const std::string &msgId);
void loadMsgData_InsertPost(const uint32_t &token);
void requestMsgData_ReplyMessage(const std::string &msgId);
void loadMsgData_ReplyMessage(const uint32_t &token);
bool convertMsgToThreadWidget(const RsForumV2Msg &msgInfo, std::string authorName,
bool useChildTS, uint32_t filterColumn, QTreeWidgetItem *item);
TokenQueue *mForumQueue;
bool m_bProcessSettings;
QTreeWidgetItem *yourForums;
QTreeWidgetItem *subscribedForums;
QTreeWidgetItem *popularForums;
QTreeWidgetItem *otherForums;
std::string mCurrForumId;
std::string mCurrThreadId;
int subscribeFlags;
QFont m_ForumNameFont;
int lastViewType;
std::string lastForumID;
bool inMsgAsReadUnread;
//ForumsV2FillThread *fillThread;
// New Datatypes to replace the FillThread.
bool mThreadLoading;
ForumsV2ThreadLoadParameters mThreadLoad;
/** Qt Designer generated object */
Ui::ForumsV2Dialog ui;
};
#if 0
class ForumsV2FillThread : public QThread
{
Q_OBJECT
public:
ForumsV2FillThread(ForumsV2Dialog *parent);
~ForumsV2FillThread();
void run();
void stop();
bool wasStopped() { return stopped; }
signals:
void progress(int current, int count);
public:
std::string forumId;
int filterColumn;
int subscribeFlags;
bool fillComplete;
int viewType;
bool expandNewMessages;
std::string focusMsgId;
QList<QTreeWidgetItem*> Items;
QList<QTreeWidgetItem*> ItemToExpand;
private:
volatile bool stopped;
};
#endif
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -45,112 +45,126 @@ class ForumInfo;
class GxsForumsThreadLoadParameters
{
public:
public:
std::string ForumId;
std::string FocusMsgId;
std::string ForumId;
std::string FocusMsgId;
uint32_t SubscribeFlags;
int ViewType;
uint32_t FilterColumn;
uint32_t SubscribeFlags;
int ViewType;
uint32_t FilterColumn;
std::map<uint32_t, QTreeWidgetItem *> MsgTokens;
QList<QTreeWidgetItem*> Items;
QList<QTreeWidgetItem*> ItemToExpand;
std::map<uint32_t, QTreeWidgetItem *> MsgTokens;
QList<QTreeWidgetItem*> Items;
QList<QTreeWidgetItem*> ItemToExpand;
bool FillComplete;
bool FlatView;
bool UseChildTS;
bool ExpandNewMessages;
bool FillComplete;
bool FlatView;
bool UseChildTS;
bool ExpandNewMessages;
};
class GxsForumsDialog : public RsAutoUpdatePage, public TokenResponse
{
Q_OBJECT
Q_OBJECT
Q_PROPERTY(QColor textColorRead READ textColorRead WRITE setTextColorRead)
Q_PROPERTY(QColor textColorUnread READ textColorUnread WRITE setTextColorUnread)
Q_PROPERTY(QColor textColorUnreadChildren READ textColorUnreadChildren WRITE setTextColorUnreadChildren)
Q_PROPERTY(QColor textColorNotSubscribed READ textColorNotSubscribed WRITE setTextColorNotSubscribed)
Q_PROPERTY(QColor textColorMissing READ textColorMissing WRITE setTextColorMissing)
public:
GxsForumsDialog(QWidget *parent = 0);
~GxsForumsDialog();
GxsForumsDialog(QWidget *parent = 0);
~GxsForumsDialog();
bool navigate(const std::string& forumId, const std::string& msgId);
//#AFTER MERGE virtual UserNotify *getUserNotify(QObject *parent);
/* overloaded from RsAuthUpdatePage */
virtual void updateDisplay();
bool navigate(const std::string& forumId, const std::string& msgId);
/* overloaded from RsAuthUpdatePage */
virtual void updateDisplay();
// Callback for all Loads.
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
QColor textColorRead() const { return mTextColorRead; }
QColor textColorUnread() const { return mTextColorUnread; }
QColor textColorUnreadChildren() const { return mTextColorUnreadChildren; }
QColor textColorNotSubscribed() const { return mTextColorNotSubscribed; }
QColor textColorMissing() const { return mTextColorMissing; }
void setTextColorRead(QColor color) { mTextColorRead = color; }
void setTextColorUnread(QColor color) { mTextColorUnread = color; }
void setTextColorUnreadChildren(QColor color) { mTextColorUnreadChildren = color; }
void setTextColorNotSubscribed(QColor color) { mTextColorNotSubscribed = color; }
void setTextColorMissing(QColor color) { mTextColorMissing = color; }
protected:
bool eventFilter(QObject *obj, QEvent *ev);
bool eventFilter(QObject *obj, QEvent *ev);
void changeEvent(QEvent *e);
private slots:
void forceUpdateDisplay(); // TEMP HACK FN.
void forceUpdateDisplay(); // TEMP HACK FN.
/** Create the context popup menu and it's submenus */
void forumListCustomPopupMenu( QPoint point );
void threadListCustomPopupMenu( QPoint point );
void restoreForumKeys();
void newforum();
/** Create the context popup menu and it's submenus */
void forumListCustomPopupMenu( QPoint point );
void threadListCustomPopupMenu( QPoint point );
void restoreForumKeys();
void newforum();
void changedForum(const QString &id);
void changedThread();
void clickedThread (QTreeWidgetItem *item, int column);
void changedForum(const QString &id);
void changedThread();
void clickedThread (QTreeWidgetItem *item, int column);
void replytomessage();
void replytomessage();
void replyMessageData(const RsGxsForumMsg &msg);
//void print();
//void printpreview();
//void print();
//void printpreview();
//void removemessage();
void markMsgAsRead();
void markMsgAsReadChildren();
void markMsgAsReadAll();
void markMsgAsUnread();
void markMsgAsUnreadAll();
void markMsgAsUnreadChildren();
void copyForumLink();
void copyMessageLink();
//void removemessage();
void markMsgAsRead();
void markMsgAsReadChildren();
void markMsgAsReadAll();
void markMsgAsUnread();
void markMsgAsUnreadAll();
void markMsgAsUnreadChildren();
void copyForumLink();
void copyMessageLink();
/* handle splitter */
void togglethreadview();
/* handle splitter */
void togglethreadview();
void createthread();
void createmessage();
void createthread();
void createmessage();
void subscribeToForum();
void unsubscribeToForum();
void subscribeToForum();
void unsubscribeToForum();
void showForumDetails();
void editForumDetails();
void showForumDetails();
void editForumDetails();
void previousMessage ();
void nextMessage ();
void nextUnreadMessage();
void downloadAllFiles();
void previousMessage ();
void nextMessage ();
void nextUnreadMessage();
void downloadAllFiles();
void changedViewBox();
void changedViewBox();
void filterColumnChanged();
//void filterRegExpChanged();
///void clearFilter();
void filterColumnChanged(int column);
void filterItems(const QString &text);
void generateMassData();
void generateMassData();
void fillThreadFinished();
void fillThreadProgress(int current, int count);
void fillThreadFinished();
void fillThreadProgress(int current, int count);
void shareKey();
void shareKey();
private:
void insertForums();
void insertThreads();
void insertPost();
void insertForums();
void insertThreads();
void insertPost();
void insertPostData(const RsGxsForumMsg &msg); // Second Half.
// Utility Fns.
@ -159,25 +173,23 @@ private:
void forumMsgReadStatusChanged(const QString &forumId, const QString &msgId, int status);
void updateMessageSummaryList(std::string forumId);
//void forumInfoToGroupItemInfo(const ForumInfo &forumInfo, GroupItemInfo &groupItemInfo);
void forumInfoToGroupItemInfo(const RsGroupMetaData &forumInfo, GroupItemInfo &groupItemInfo);
void updateMessageSummaryList(std::string forumId);
// void forumInfoToGroupItemInfo(const ForumInfo &forumInfo, GroupItemInfo &groupItemInfo);
void forumInfoToGroupItemInfo(const RsGroupMetaData &forumInfo, GroupItemInfo &groupItemInfo);
void forumSubscribe(bool subscribe);
void FillThreads(QList<QTreeWidgetItem *> &ThreadList, bool bExpandNewMessages, QList<QTreeWidgetItem*> &itemToExpand);
void FillChildren(QTreeWidgetItem *Parent, QTreeWidgetItem *NewParent, bool bExpandNewMessages, QList<QTreeWidgetItem*> &itemToExpand);
void forumSubscribe(bool subscribe);
void FillThreads(QList<QTreeWidgetItem *> &ThreadList, bool bExpandNewMessages, QList<QTreeWidgetItem*> &itemToExpand);
void FillChildren(QTreeWidgetItem *Parent, QTreeWidgetItem *NewParent, bool bExpandNewMessages, QList<QTreeWidgetItem*> &itemToExpand);
int getSelectedMsgCount(QList<QTreeWidgetItem*> *pRows, QList<QTreeWidgetItem*> *pRowsRead, QList<QTreeWidgetItem*> *pRowsUnread);
int getSelectedMsgCount(QList<QTreeWidgetItem*> *pRows, QList<QTreeWidgetItem*> *pRowsRead, QList<QTreeWidgetItem*> *pRowsUnread);
void setMsgReadStatus(QList<QTreeWidgetItem*> &Rows, bool bRead);
void markMsgAsReadUnread(bool bRead, bool bChildren, bool bForum);
void CalculateIconsAndFonts(QTreeWidgetItem *pItem = NULL);
void CalculateIconsAndFonts(QTreeWidgetItem *pItem, bool &bHasReadChilddren, bool &bHasUnreadChilddren);
void setMsgReadStatus(QList<QTreeWidgetItem*> &Rows, bool bRead);
void markMsgAsReadUnread(bool bRead, bool bChildren, bool bForum);
void CalculateIconsAndFonts(QTreeWidgetItem *pItem = NULL);
void CalculateIconsAndFonts(QTreeWidgetItem *pItem, bool &bHasReadChilddren, bool &bHasUnreadChilddren);
void processSettings(bool bLoad);
void togglethreadview_internal();
void processSettings(bool bLoad);
void togglethreadview_internal();
void filterItems(const QString& text);
bool filterItem(QTreeWidgetItem *pItem, const QString &text, int filterColumn);
// New Request/Response Loading Functions.
@ -204,75 +216,40 @@ private:
void requestMsgData_ReplyMessage(const RsGxsGrpMsgIdPair &msgId);
void loadMsgData_ReplyMessage(const uint32_t &token);
bool convertMsgToThreadWidget(const RsGxsForumMsg &msgInfo,
bool useChildTS, uint32_t filterColumn, GxsIdTreeWidgetItem *item);
//bool convertMsgToThreadWidget(const RsGxsForumMsg &msgInfo, std::string authorName,
// bool useChildTS, uint32_t filterColumn, QTreeWidgetItem *item);
bool convertMsgToThreadWidget(const RsGxsForumMsg &msgInfo, bool useChildTS, uint32_t filterColumn, GxsIdTreeWidgetItem *item);
// bool convertMsgToThreadWidget(const RsGxsForumMsg &msgInfo, std::string authorName, bool useChildTS, uint32_t filterColumn, QTreeWidgetItem *item);
TokenQueue *mForumQueue;
bool m_bProcessSettings;
QTreeWidgetItem *yourForums;
QTreeWidgetItem *subscribedForums;
QTreeWidgetItem *popularForums;
QTreeWidgetItem *otherForums;
std::string mCurrForumId;
std::string mCurrThreadId;
int subscribeFlags;
QFont m_ForumNameFont;
int lastViewType;
std::string lastForumID;
bool m_bProcessSettings;
bool inMsgAsReadUnread;
//GxsForumsFillThread *fillThread;
// New Datatypes to replace the FillThread.
bool mThreadLoading;
GxsForumsThreadLoadParameters mThreadLoad;
QTreeWidgetItem *yourForums;
QTreeWidgetItem *subscribedForums;
QTreeWidgetItem *popularForums;
QTreeWidgetItem *otherForums;
RSTreeWidgetItemCompareRole *threadCompareRole;
std::string mCurrForumId;
std::string mCurrThreadId;
int subscribeFlags;
/** Qt Designer generated object */
Ui::GxsForumsDialog ui;
};
int lastViewType;
std::string lastForumID;
#if 0
class GxsForumsFillThread : public QThread
{
Q_OBJECT
// New Datatypes to replace the FillThread.
bool mThreadLoading;
GxsForumsThreadLoadParameters mThreadLoad;
public:
GxsForumsFillThread(GxsForumsDialog *parent);
~GxsForumsFillThread();
/* Color definitions (for standard see qss.default) */
QColor mTextColorRead;
QColor mTextColorUnread;
QColor mTextColorUnreadChildren;
QColor mTextColorNotSubscribed;
QColor mTextColorMissing;
void run();
void stop();
bool wasStopped() { return stopped; }
signals:
void progress(int current, int count);
public:
std::string forumId;
int filterColumn;
int subscribeFlags;
bool fillComplete;
int viewType;
bool expandNewMessages;
std::string focusMsgId;
QList<QTreeWidgetItem*> Items;
QList<QTreeWidgetItem*> ItemToExpand;
private:
volatile bool stopped;
/** Qt Designer generated object */
Ui::GxsForumsDialog ui;
};
#endif
#endif

View File

@ -10,501 +10,6 @@
<height>420</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>2</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>139</red>
<green>139</green>
<blue>139</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>128</blue>
</color>
</brush>
</colorrole>
<colorrole role="HighlightedText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>231</red>
<green>231</green>
<blue>231</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>139</red>
<green>139</green>
<blue>139</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>192</red>
<green>192</green>
<blue>192</blue>
</color>
</brush>
</colorrole>
<colorrole role="HighlightedText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>231</red>
<green>231</green>
<blue>231</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>139</red>
<green>139</green>
<blue>139</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>128</blue>
</color>
</brush>
</colorrole>
<colorrole role="HighlightedText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>231</red>
<green>231</green>
<blue>231</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font>
</property>
<property name="contextMenuPolicy">
<enum>Qt::DefaultContextMenu</enum>
</property>
<layout class="QGridLayout">
<property name="leftMargin">
<number>9</number>
@ -524,14 +29,8 @@
<height>300</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QFrame#frame{border: none;}</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::NoFrame</enum>
</property>
<layout class="QGridLayout">
<property name="margin">
@ -541,70 +40,51 @@
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="chheaderframe">
<property name="styleSheet">
<string notr="true"> QFrame#chheaderframe{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #FEFEFE, stop:1 #E8E8E8);
border: 1px solid #CCCCCC;}
</string>
</property>
<widget class="QFrame" name="titleBarFrame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="margin">
<number>2</number>
</property>
<item row="0" column="0">
<layout class="QGridLayout">
<property name="verticalSpacing">
<number>0</number>
<item>
<widget class="QLabel" name="titleBarPixmap">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/konversation.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="forumslabel">
<property name="font">
<font>
<family>Arial</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Arial'; font-weight:600;&quot;&gt;Forums&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/konversation.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<item>
<widget class="QLabel" name="titleBarLabel">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Forums</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -617,39 +97,33 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="displayButton">
<item>
<widget class="QToolButton" name="displayButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Display</string>
</property>
<property name="styleSheet">
<string notr="true">QPushButton::menu-indicator {
subcontrol-origin: padding;
subcontrol-position: bottom right;
}
QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open {
position: relative;
top: 2px; left: 2px; /* shift the arrow by 2 px */
}
QPushButton:hover {
border: 1px solid #CCCCCC;
}</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/looknfeel.png</normaloff>:/images/looknfeel.png</iconset>
</property>
<property name="flat">
<property name="iconSize">
<size>
<width>32</width>
<height>16</height>
</size>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="5">
<item>
<widget class="QToolButton" name="newForumButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
@ -661,6 +135,12 @@ p, li { white-space: pre-wrap; }
<iconset resource="images.qrc">
<normaloff>:/images/new_forum16.png</normaloff>:/images/new_forum16.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>16</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
@ -677,17 +157,6 @@ p, li { white-space: pre-wrap; }
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="iconSize" stdset="0">
<size>
<width>-1</width>
<height>-1</height>
</size>
</property>
</widget>
</item>
</layout>
@ -720,9 +189,6 @@ p, li { white-space: pre-wrap; }
<height>1677215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
@ -1022,93 +488,47 @@ p, li { white-space: pre-wrap; }
</layout>
</item>
<item row="0" column="0">
<widget class="QFrame" name="frame_2">
<widget class="QFrame" name="toolBarFrame">
<property name="minimumSize">
<size>
<width>0</width>
<height>32</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"> QFrame#frame_2{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #FEFEFE, stop:1 #E8E8E8);
border: 1px solid #CCCCCC;}</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="margin">
<number>2</number>
</property>
<item row="0" column="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>2</number>
<item>
<widget class="QToolButton" name="newthreadButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/find-16.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="LineEditClear" name="filterLineEdit">
<property name="toolTip">
<string>Search forums</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="4">
<widget class="QComboBox" name="filterColumnComboBox">
<property name="minimumSize">
<property name="toolTip">
<string>Start new Thread for Selected Forum</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/mail_new.png</normaloff>:/images/mail_new.png</iconset>
</property>
<property name="iconSize">
<size>
<width>0</width>
<height>0</height>
<width>24</width>
<height>16</height>
</size>
</property>
<property name="font">
<font>
<family>MS Shell Dlg 2</family>
</font>
<property name="autoRaise">
<bool>true</bool>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>Date</string>
</property>
</item>
<item>
<property name="text">
<string>Title</string>
</property>
</item>
<item>
<property name="text">
<string>Author</string>
</property>
</item>
<item>
<property name="text">
<string>Content</string>
</property>
</item>
</widget>
</item>
<item row="0" column="2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -1124,26 +544,10 @@ border: 1px solid #CCCCCC;}</string>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QToolButton" name="newthreadButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<item>
<widget class="LineEditClear" name="filterLineEdit">
<property name="toolTip">
<string>Start new Thread for Selected Forum</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/mail_new.png</normaloff>:/images/mail_new.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
<string>Search forums</string>
</property>
</widget>
</item>
@ -1186,9 +590,6 @@ border: 1px solid #CCCCCC;}</string>
</item>
<item row="5" column="0">
<widget class="QLabel" name="threadTitle">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
@ -1229,20 +630,20 @@ border: 1px solid #CCCCCC;}</string>
</widget>
<customwidgets>
<customwidget>
<class>GroupTreeWidget</class>
<extends>QWidget</extends>
<header>gui/common/GroupTreeWidget.h</header>
<container>1</container>
<class>LinkTextBrowser</class>
<extends>QTextBrowser</extends>
<header>gui/common/LinkTextBrowser.h</header>
</customwidget>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header>gui/common/LineEditClear.h</header>
<header location="global">gui/common/LineEditClear.h</header>
</customwidget>
<customwidget>
<class>LinkTextBrowser</class>
<extends>QTextBrowser</extends>
<header>gui/common/LinkTextBrowser.h</header>
<class>GroupTreeWidget</class>
<extends>QWidget</extends>
<header>gui/common/GroupTreeWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>

View File

@ -41,7 +41,7 @@
0)
PostedGroupDialog::PostedGroupDialog(TokenQueue* tokenQueue, RsPosted* posted, QWidget *parent)
:GxsGroupDialog(tokenQueue, POSTED_ENABLE_FLAG, POSTED_CREATE_DEFAULT_FLAG, parent, "Create New Posted Topic"),
:GxsGroupDialog(tokenQueue, POSTED_ENABLE_FLAG, POSTED_CREATE_DEFAULT_FLAG, parent),
mPosted(posted)
{
}
@ -51,6 +51,15 @@ PostedGroupDialog::PostedGroupDialog(const RsPostedGroup& grp, uint32_t mode, QW
{
}
QString PostedGroupDialog::serviceHeader()
{
return tr("Create New Posted Topic");
}
QPixmap PostedGroupDialog::serviceImage()
{
return QPixmap();
}
bool PostedGroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta)
{

View File

@ -43,7 +43,8 @@ public:
PostedGroupDialog(const RsPostedGroup& grp, uint32_t mode, QWidget *parent = NULL);
protected:
virtual QString serviceHeader();
virtual QPixmap serviceImage();
bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta);
private:

View File

@ -1,230 +0,0 @@
/****************************************************************
* 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 <QMessageBox>
#include "util/misc.h"
#include "CreateForumV2.h"
#include "gui/common/PeerDefs.h"
#include <algorithm>
#include <retroshare/rsforumsv2.h>
#include <retroshare/rspeers.h>
#include <iostream>
#define CREATEFORUMSV2_NEWFORUMID 1
/** Constructor */
CreateForumV2::CreateForumV2(QWidget *parent)
: QDialog(parent)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
mForumQueue = new TokenQueue(rsForumsV2, this);
// connect up the buttons.
connect( ui.cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancelForum( ) ) );
connect( ui.createButton, SIGNAL( clicked ( bool ) ), this, SLOT( createForum( ) ) );
connect( ui.pubKeyShare_cb, SIGNAL( clicked() ), this, SLOT( setShareList( ) ));
if (!ui.pubKeyShare_cb->isChecked()) {
ui.contactsdockWidget->hide();
this->resize(this->size().width() - ui.contactsdockWidget->size().width(), this->size().height());
}
/* initialize key share list */
ui.keyShareList->setHeaderText(tr("Contacts:"));
ui.keyShareList->setModus(FriendSelectionWidget::MODUS_CHECK);
ui.keyShareList->start();
newForum();
}
void CreateForumV2::newForum()
{
/* enforce Public for the moment */
ui.typePublic->setChecked(true);
ui.typePrivate->setEnabled(false);
ui.typeEncrypted->setEnabled(true);
#ifdef RS_RELEASE_VERSION
ui.typePrivate->setVisible(false);
ui.typeEncrypted->setVisible(true);
#endif
ui.msgAnon->setChecked(true);
//ui.msgAuth->setEnabled(false);
ui.forumName->clear();
ui.forumDesc->clear();
ui.forumName->setFocus();
}
void CreateForumV2::createForum()
{
QString name = misc::removeNewLine(ui.forumName->text());
QString desc = ui.forumDesc->toPlainText(); //toHtml();
uint32_t flags = 0;
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!!
}
if (ui.typePublic->isChecked()) {
flags |= RS_DISTRIB_PUBLIC;
} else if (ui.typePrivate->isChecked()) {
flags |= RS_DISTRIB_PRIVATE;
} else if (ui.typeEncrypted->isChecked()) {
flags |= RS_DISTRIB_ENCRYPTED;
}
if (ui.msgAuth->isChecked()) {
flags |= RS_DISTRIB_AUTHEN_REQ;
} else if (ui.msgAnon->isChecked()) {
flags |= RS_DISTRIB_AUTHEN_ANON;
}
if (rsForumsV2) {
uint32_t token;
RsForumV2Group grp;
grp.mMeta.mGroupName = std::string(name.toUtf8());
grp.mDescription = std::string(desc.toUtf8());
grp.mMeta.mGroupFlags = flags;
rsForumsV2->createGroup(token, grp, true);
// get the Queue to handle response.
mForumQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_SUMMARY, CREATEFORUMSV2_NEWFORUMID);
}
}
void CreateForumV2::completeCreateNewForum(const RsGroupMetaData &newForumMeta)
{
sendShareList(newForumMeta.mGroupId);
close();
}
void CreateForumV2::sendShareList(std::string forumId)
{
if (!rsForumsV2)
{
std::cerr << "CreateForumV2::sendShareList() ForumsV2 not active";
std::cerr << std::endl;
return;
}
if (ui.pubKeyShare_cb->isChecked())
{
std::list<std::string> shareList;
ui.keyShareList->selectedSslIds(shareList, false);
rsForumsV2->groupShareKeys(forumId, shareList);
}
close();
}
void CreateForumV2::setShareList()
{
if (ui.pubKeyShare_cb->isChecked()){
this->resize(this->size().width() + ui.contactsdockWidget->size().width(), this->size().height());
ui.contactsdockWidget->show();
} else { // hide share widget
ui.contactsdockWidget->hide();
this->resize(this->size().width() - ui.contactsdockWidget->size().width(), this->size().height());
}
}
void CreateForumV2::cancelForum()
{
close();
}
void CreateForumV2::loadNewForumId(const uint32_t &token)
{
std::cerr << "CreateForumV2::loadNewForumId()";
std::cerr << std::endl;
std::list<RsGroupMetaData> groupInfo;
rsForumsV2->getGroupSummary(token, groupInfo);
if (groupInfo.size() == 1)
{
RsGroupMetaData fi = groupInfo.front();
completeCreateNewForum(fi);
}
else
{
std::cerr << "CreateForumV2::loadNewForumId() ERROR INVALID Number of Forums Created";
std::cerr << std::endl;
}
}
void CreateForumV2::loadRequest(const TokenQueue *queue, const TokenRequest &req)
{
std::cerr << "CreateForumV2::loadRequest() UserType: " << req.mUserType;
std::cerr << std::endl;
if (queue == mForumQueue)
{
/* now switch on req */
switch(req.mUserType)
{
case CREATEFORUMSV2_NEWFORUMID:
loadNewForumId(req.mToken);
break;
default:
std::cerr << "CreateForumV2::loadRequest() UNKNOWN UserType ";
std::cerr << std::endl;
}
}
}

View File

@ -1,67 +0,0 @@
/****************************************************************
* 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 _CREATE_FORUMV2_DIALOG_H
#define _CREATE_FORUMV2_DIALOG_H
#include "ui_CreateForumV2.h"
#include "util/TokenQueue.h"
class CreateForumV2 : public QDialog, public TokenResponse
{
Q_OBJECT
public:
CreateForumV2(QWidget *parent = 0);
void newForum(); /* cleanup */
// Callback for all Loads.
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
private slots:
/* actions to take.... */
void createForum();
void cancelForum();
// set private forum key share list
void setShareList();
private:
void sendShareList(std::string forumId);
void completeCreateNewForum(const RsGroupMetaData &newForumMeta);
void loadNewForumId(const uint32_t &token);
std::list<std::string> mShareList;
QPixmap picture;
TokenQueue *mForumQueue;
/** Qt Designer generated object */
Ui::CreateForumV2 ui;
};
#endif

View File

@ -1,374 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CreateForumV2</class>
<widget class="QDialog" name="CreateForumV2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>672</width>
<height>495</height>
</rect>
</property>
<property name="windowTitle">
<string>Create new Forum</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">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="frame_2">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>64</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QFrame#frame_2{background-image: url(:/images/connect/connectFriendBanner.png);}</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>6</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="labelicon">
<property name="maximumSize">
<size>
<width>48</width>
<height>48</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/konversation64.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="textlabelcreatforums">
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Arial'; font-size:24pt; font-weight:600; color:#ffffff;&quot;&gt;New Forum&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="forumName"/>
</item>
</layout>
</item>
<item row="0" column="3" rowspan="6">
<widget class="QDockWidget" name="contactsdockWidget">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>524287</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>220</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>check peers you would like to share private publish key with</string>
</property>
<property name="floating">
<bool>false</bool>
</property>
<property name="features">
<set>QDockWidget::NoDockWidgetFeatures</set>
</property>
<property name="windowTitle">
<string>Share Key With</string>
</property>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QGridLayout" name="_2">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="FriendSelectionWidget" name="keyShareList" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>4</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>16777215</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>220</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="1" column="0" colspan="3">
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Description</string>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="forumDesc"/>
</item>
</layout>
</item>
<item row="2" column="0" colspan="3">
<widget class="QGroupBox" name="tyoeGroupBox">
<property name="title">
<string>Type:</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="margin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QRadioButton" name="typePublic">
<property name="text">
<string>Public - Anyone can read and publish (Shared Publish Key)</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="typePrivate">
<property name="text">
<string>Restricted - Anyone can read, limited publishing (Private Publish Key)</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QRadioButton" name="typeEncrypted">
<property name="text">
<string>Private - (Private Publish Key required to view Messages)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="QGroupBox" name="msgGroupBox_2">
<property name="title">
<string>Key Sharing</string>
</property>
<layout class="QVBoxLayout" name="_5">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="pubKeyShare_cb">
<property name="toolTip">
<string>Key recipients can publish to restricted-type channels, and can view and publish for private-type channels</string>
</property>
<property name="text">
<string>Share Private Publish Key</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QGroupBox" name="msgGroupBox">
<property name="title">
<string>Allowed Messages</string>
</property>
<layout class="QVBoxLayout" name="_4">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>6</number>
</property>
<item>
<widget class="QRadioButton" name="msgAuth">
<property name="text">
<string>Authenticated Messages</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="msgAnon">
<property name="text">
<string>Anonymous Messages</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="5" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>238</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="1">
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QPushButton" name="createButton">
<property name="text">
<string>Create</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>FriendSelectionWidget</class>
<extends>QWidget</extends>
<header>gui/common/FriendSelectionWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -1,424 +0,0 @@
/****************************************************************
* 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 "CreateForumV2Msg.h"
#include <QMenu>
#include <QMessageBox>
#include <QFile>
#include <QDesktopWidget>
#include <QDropEvent>
#include <QPushButton>
#include <retroshare/rsforumsv2.h>
#include <retroshare/rspeers.h>
#include "gui/settings/rsharesettings.h"
#include "gui/RetroShareLink.h"
#include "gui/common/Emoticons.h"
#include "util/misc.h"
#include <sys/stat.h>
#include <iostream>
#define CREATEFORUMV2MSG_FORUMINFO 1
#define CREATEFORUMV2MSG_PARENTMSG 2
/** Constructor */
CreateForumV2Msg::CreateForumV2Msg(std::string fId, std::string pId)
: QMainWindow(NULL), mForumId(fId), mParentId(pId)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
setAttribute(Qt::WA_DeleteOnClose, true);
/* Setup Queue */
mForumQueue = new TokenQueue(rsForumsV2, this);
Settings->loadWidgetInformation(this);
connect( ui.forumMessage, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( forumMessageCostumPopupMenu( QPoint ) ) );
connect(ui.hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
// connect up the buttons.
connect( ui.postmessage_action, SIGNAL( triggered (bool) ), this, SLOT( createMsg( ) ) );
connect( ui.close_action, SIGNAL( triggered (bool) ), this, SLOT( cancelMsg( ) ) );
connect( ui.emoticonButton, SIGNAL(clicked()), this, SLOT(smileyWidgetForums()));
connect( ui.attachFileButton, SIGNAL(clicked() ), this , SLOT(addFile()));
connect( ui.pastersButton, SIGNAL(clicked() ), this , SLOT(pasteLink()));
setAcceptDrops(true);
ui.hashBox->setDropWidget(this);
ui.hashBox->setAutoHide(false);
mParentMsgLoaded = false;
mForumMetaLoaded = false;
newMsg();
}
/** context menu searchTablewidget2 **/
void CreateForumV2Msg::forumMessageCostumPopupMenu( QPoint /*point*/ )
{
QMenu *contextMnu = ui.forumMessage->createStandardContextMenu();
contextMnu->addSeparator();
QAction *pasteLinkAct = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink()));
QAction *pasteLinkFullAct = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste full RetroShare Link"), this, SLOT(pasteLinkFull()));
contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste own certificate link"), this, SLOT(pasteOwnCertificateLink()));
if (RSLinkClipboard::empty()) {
pasteLinkAct->setDisabled (true);
pasteLinkFullAct->setDisabled (true);
}
contextMnu->exec(QCursor::pos());
delete(contextMnu);
}
void CreateForumV2Msg::newMsg()
{
/* clear all */
mParentMsgLoaded = false;
mForumMetaLoaded = false;
/* request Data */
{
RsTokReqOptions opts;
std::list<std::string> groupIds;
groupIds.push_back(mForumId);
std::cerr << "ForumsV2Dialog::newMsg() Requesting Group Summary(" << mForumId << ")";
std::cerr << std::endl;
uint32_t token;
mForumQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, groupIds, CREATEFORUMV2MSG_FORUMINFO);
}
if (mParentId != "")
{
RsTokReqOptions opts;
std::list<std::string> msgIds;
msgIds.push_back(mParentId);
std::cerr << "ForumsV2Dialog::newMsg() Requesting Parent Summary(" << mParentId << ")";
std::cerr << std::endl;
uint32_t token;
//mForumQueue->requestMsgRelatedInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, CREATEFORUMV2MSG_PARENTMSG);
}
}
void CreateForumV2Msg::saveForumInfo(const RsGroupMetaData &meta)
{
mForumMeta = meta;
mForumMetaLoaded = true;
loadFormInformation();
}
void CreateForumV2Msg::saveParentMsg(const RsForumV2Msg &msg)
{
mParentMsg = msg;
mParentMsgLoaded = true;
loadFormInformation();
}
void CreateForumV2Msg::loadFormInformation()
{
if ((!mParentMsgLoaded) && (mParentId != ""))
{
std::cerr << "CreateForumV2Msg::loadMsgInformation() ParentMsg not Loaded Yet";
std::cerr << std::endl;
return;
}
if (!mForumMetaLoaded)
{
std::cerr << "CreateForumV2Msg::loadMsgInformation() ForumMeta not Loaded Yet";
std::cerr << std::endl;
return;
}
std::cerr << "CreateForumV2Msg::loadMsgInformation() Data Available!";
std::cerr << std::endl;
QString name = QString::fromUtf8(mForumMeta.mGroupName.c_str());
QString subj;
if (mParentId != "")
{
QString title = QString::fromUtf8(mParentMsg.mMeta.mMsgName.c_str());
name += " " + tr("In Reply to") + ": ";
name += title;
QString text = title;
if (text.startsWith("Re:", Qt::CaseInsensitive))
{
subj = title;
}
else
{
subj = "Re: " + title;
}
}
ui.forumName->setText(misc::removeNewLine(name));
ui.forumSubject->setText(misc::removeNewLine(subj));
if (!ui.forumSubject->text().isEmpty())
{
ui.forumMessage->setFocus();
}
else
{
ui.forumSubject->setFocus();
}
if (mForumMeta.mGroupFlags & RS_DISTRIB_AUTHEN_REQ)
{
ui.signBox->setChecked(true);
ui.signBox->setEnabled(false);
}
else
{
/* Uncheck sign box by default for anonymous forums */
ui.signBox->setChecked(false);
ui.signBox->setEnabled(true);
}
ui.forumMessage->setText("");
}
void CreateForumV2Msg::createMsg()
{
QString name = misc::removeNewLine(ui.forumSubject->text());
QString desc = ui.forumMessage->toHtml();
if(desc == QTextDocument(ui.forumMessage->toPlainText()).toHtml())
desc = ui.forumMessage->toPlainText() ;
if(name.isEmpty())
{ /* error message */
QMessageBox::warning(this, tr("RetroShare"),tr("Please set a Forum Subject and Forum Message"),
QMessageBox::Ok, QMessageBox::Ok);
return; //Don't add a empty Subject!!
}
RsForumV2Msg msg;
msg.mMeta.mGroupId = mForumId;
msg.mMeta.mParentId = mParentId;
msg.mMeta.mMsgId = "";
if (mParentMsgLoaded)
{
msg.mMeta.mThreadId = mParentMsg.mMeta.mThreadId;
}
msg.mMeta.mMsgName = std::string(name.toUtf8());
msg.mMsg = std::string(desc.toUtf8());
msg.mMeta.mMsgFlags = RS_DISTRIB_AUTHEN_REQ;
if ((msg.mMsg == "") && (msg.mMeta.mMsgName == ""))
return; /* do nothing */
uint32_t token;
rsForumsV2->createMsg(token, msg, true);
close();
// Previous Info - for reference.
//ForumMsgInfo msgInfo;
//msgInfo.forumId = mForumId;
//msgInfo.threadId = "";
//msgInfo.parentId = mParentId;
//msgInfo.msgId = "";
//msgInfo.title = name.toStdWString();
//msgInfo.msg = desc.toStdWString();
//msgInfo.msgflags = 0;
//if (ui.signBox->isChecked())
//{
// msgInfo.msgflags = RS_DISTRIB_AUTHEN_REQ;
//}
//if ((msgInfo.msg == L"") && (msgInfo.title == L""))
// return; /* do nothing */
//if (rsForumsV2->ForumMessageSend(msgInfo) == true) {
// close();
//}
}
void CreateForumV2Msg::closeEvent (QCloseEvent * /*event*/)
{
Settings->saveWidgetInformation(this);
}
void CreateForumV2Msg::cancelMsg()
{
close();
}
void CreateForumV2Msg::smileyWidgetForums()
{
Emoticons::showSmileyWidget(this, ui.emoticonButton, SLOT(addSmileys()), false);
}
void CreateForumV2Msg::addSmileys()
{
ui.forumMessage->textCursor().insertText(qobject_cast<QPushButton*>(sender())->toolTip().split("|").first());
}
void CreateForumV2Msg::addFile()
{
QStringList files;
if (misc::getOpenFileNames(this, RshareSettings::LASTDIR_EXTRAFILE, tr("Add Extra File"), "", files)) {
ui.hashBox->addAttachments(files);
}
}
void CreateForumV2Msg::fileHashingFinished(QList<HashedFile> hashedFiles)
{
std::cerr << "CreateForumV2Msg::fileHashingFinished() started." << std::endl;
QString mesgString;
QList<HashedFile>::iterator it;
for (it = hashedFiles.begin(); it != hashedFiles.end(); ++it) {
HashedFile& hashedFile = *it;
RetroShareLink link;
if (link.createFile(hashedFile.filename, hashedFile.size, QString::fromStdString(hashedFile.hash))) {
mesgString += link.toHtmlSize() + "<br>";
}
}
#ifdef CHAT_DEBUG
std::cerr << "CreateForumV2Msg::anchorClicked mesgString : " << mesgString.toStdString() << std::endl;
#endif
if (!mesgString.isEmpty()) {
ui.forumMessage->textCursor().insertHtml(mesgString);
}
ui.forumMessage->setFocus( Qt::OtherFocusReason );
}
void CreateForumV2Msg::pasteLink()
{
ui.forumMessage->insertHtml(RSLinkClipboard::toHtml()) ;
}
void CreateForumV2Msg::pasteLinkFull()
{
ui.forumMessage->insertHtml(RSLinkClipboard::toHtmlFull()) ;
}
void CreateForumV2Msg::pasteOwnCertificateLink()
{
RetroShareLink link ;
std::string ownId = rsPeers->getOwnId() ;
if( link.createCertificate(ownId) ) {
ui.forumMessage->insertHtml(link.toHtml() + " ");
}
}
void CreateForumV2Msg::loadForumInfo(const uint32_t &token)
{
std::cerr << "CreateForumV2Msg::loadForumInfo()";
std::cerr << std::endl;
std::list<RsGroupMetaData> groupInfo;
rsForumsV2->getGroupSummary(token, groupInfo);
if (groupInfo.size() == 1)
{
RsGroupMetaData fi = groupInfo.front();
saveForumInfo(fi);
}
else
{
std::cerr << "CreateForumV2Msg::loadForumInfo() ERROR INVALID Number of Forums";
std::cerr << std::endl;
}
}
void CreateForumV2Msg::loadParentMsg(const uint32_t &token)
{
std::cerr << "CreateForumV2Msg::loadParentMsg()";
std::cerr << std::endl;
// Only grab one.... ignore more (shouldn't be any).
RsForumV2Msg msg;
rsForumsV2->getMsgData(token, msg);
saveParentMsg(msg);
}
void CreateForumV2Msg::loadRequest(const TokenQueue *queue, const TokenRequest &req)
{
std::cerr << "CreateForumV2::loadRequest() UserType: " << req.mUserType;
std::cerr << std::endl;
if (queue == mForumQueue)
{
/* now switch on req */
switch(req.mUserType)
{
case CREATEFORUMV2MSG_FORUMINFO:
loadForumInfo(req.mToken);
break;
case CREATEFORUMV2MSG_PARENTMSG:
loadParentMsg(req.mToken);
break;
default:
std::cerr << "CreateForumV2::loadRequest() UNKNOWN UserType ";
std::cerr << std::endl;
}
}
}

View File

@ -1,86 +0,0 @@
/****************************************************************
* 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 _CREATE_FORUMV2_MSG_DIALOG_H
#define _CREATE_FORUMV2_MSG_DIALOG_H
#include "ui_CreateForumV2Msg.h"
#include "util/TokenQueue.h"
#include <retroshare/rsforumsv2.h>
class CreateForumV2Msg : public QMainWindow, public TokenResponse
{
Q_OBJECT
public:
CreateForumV2Msg(std::string fId, std::string pId);
void newMsg(); /* cleanup */
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
private slots:
/** Create the context popup menu and it's submenus */
void forumMessageCostumPopupMenu( QPoint point );
void fileHashingFinished(QList<HashedFile> hashedFiles);
/* actions to take.... */
void createMsg();
void cancelMsg();
void pasteLink();
void pasteLinkFull();
void pasteOwnCertificateLink();
void smileyWidgetForums();
void addSmileys();
void addFile();
protected:
void closeEvent (QCloseEvent * event);
private:
void saveForumInfo(const RsGroupMetaData &meta);
void saveParentMsg(const RsForumV2Msg &msg);
void loadFormInformation();
void loadForumInfo(const uint32_t &token);
void loadParentMsg(const uint32_t &token);
std::string mForumId;
std::string mParentId;
bool mParentMsgLoaded;
bool mForumMetaLoaded;
RsForumV2Msg mParentMsg;
RsGroupMetaData mForumMeta;
TokenQueue *mForumQueue;
/** Qt Designer generated object */
Ui::CreateForumV2Msg ui;
};
#endif

View File

@ -1,333 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CreateForumV2Msg</class>
<widget class="QMainWindow" name="CreateForumV2Msg">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>482</width>
<height>448</height>
</rect>
</property>
<property name="windowTitle">
<string>Post Forum Message</string>
</property>
<property name="windowIcon">
<iconset resource="../images.qrc">
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
</property>
<property name="styleSheet">
<string notr="true">QToolBar#toolBar{background-image: url(:/images/connect/connectFriendBanner.png)}</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout_5">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QFrame" name="frame_4">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="topMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item row="0" column="0">
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Forum</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="forumName">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Subject</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="forumSubject"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QFrame" name="frame_2">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>38</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QFrame#frame_2{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #FEFEFE, stop:1 #E8E8E8);
border: 1px solid #CCCCCC;}</string>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout">
<property name="margin">
<number>6</number>
</property>
<item>
<widget class="QToolButton" name="attachFileButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Attach File</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="emoticonButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/emoticons/kopete/kopete020.png</normaloff>:/images/emoticons/kopete/kopete020.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="signBox">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Sign Message</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/pgp.png</normaloff>:/images/pgp.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>15</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="pastersButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Paste RetroShare Link</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/pasterslink.png</normaloff>:/images/pasterslink.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QFrame" name="frame_3">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="topMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Forum Post</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTextEdit" name="forumMessage">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="html">
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Attach files via drag and drop</string>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0">
<widget class="HashBox" name="hashBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>You can attach files via drag and drop here in this window</string>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QToolBar" name="toolBar">
<property name="windowTitle">
<string notr="true">toolBar</string>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="postmessage_action"/>
<addaction name="close_action"/>
</widget>
<action name="postmessage_action">
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/mail_send24.png</normaloff>:/images/mail_send24.png</iconset>
</property>
<property name="text">
<string>Post Forum Msg</string>
</property>
</action>
<action name="close_action">
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/button_cancel.png</normaloff>:/images/button_cancel.png</iconset>
</property>
<property name="text">
<string>Close</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>HashBox</class>
<extends>QScrollArea</extends>
<header location="global">gui/common/HashBox.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -1,89 +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 "EditForumV2Details.h"
#include <retroshare/rsforumsv2.h>
#include "util/misc.h"
#include <list>
#include <iostream>
#include <string>
/** Default constructor */
EditForumV2Details::EditForumV2Details(std::string forumId, QWidget *parent, Qt::WFlags flags)
: QDialog(parent, flags), m_forumId(forumId)
{
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);
connect(ui.applyButton, SIGNAL(clicked()), this, SLOT(applyDialog()));
loadForum();
}
void EditForumV2Details::loadForum()
{
if (!rsForumsV2) {
return;
}
#warning "EditForumV2Details incomplete"
#if 0
ForumInfo info;
rsForumsV2->getForumInfo(m_forumId, info);
// set name
ui.nameline->setText(QString::fromStdWString(info.forumName));
// set description
ui.DescriptiontextEdit->setText(QString::fromStdWString(info.forumDesc));
#endif
}
void EditForumV2Details::applyDialog()
{
if (!rsForumsV2) {
return;
}
// if text boxes have not been edited leave alone
if (!ui.nameline->isModified() && !ui.DescriptiontextEdit->document()->isModified()) {
return;
}
#warning "EditForumV2Details incomplete"
#if 0
ForumInfo info;
info.forumName = misc::removeNewLine(ui.nameline->text()).toStdWString();
info.forumDesc = ui.DescriptiontextEdit->document()->toPlainText().toStdWString();
rsForumsV2->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 _EDITFORUMV2DETAILS_H
#define _EDITFORUMV2DETAILS_H
#include <QDialog>
#include "ui_EditForumV2Details.h"
class EditForumV2Details : public QDialog
{
Q_OBJECT
public:
/** Default constructor */
EditForumV2Details(std::string forumId = "", QWidget *parent = 0, Qt::WFlags flags = 0);
signals:
void configChanged();
private slots:
void applyDialog();
private:
void loadForum();
std::string m_forumId;
/** Qt Designer generated object */
Ui::EditForumV2Details ui;
};
#endif

View File

@ -1,130 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EditForumV2Details</class>
<widget class="QDialog" name="EditForumV2Details">
<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">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>311</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="applyButton">
<property name="text">
<string>OK</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>true</bool>
</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>
<connection>
<sender>cancelButton</sender>
<signal>clicked()</signal>
<receiver>EditForumDetails</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>307</x>
<y>333</y>
</hint>
<hint type="destinationlabel">
<x>217</x>
<y>177</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -1,146 +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 "ForumV2Details.h"
#include <retroshare/rsiface.h>
#include <retroshare/rspeers.h>
#include <retroshare/rsdisc.h>
#include <retroshare/rsforumsv2.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 */
ForumV2Details::ForumV2Details(QWidget *parent, Qt::WFlags flags)
: QDialog(parent, flags)
{
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);
connect(ui.applyButton, SIGNAL(clicked()), this, SLOT(applyDialog()));
connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(closeinfodlg()));
ui.applyButton->setToolTip(tr("Apply and 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
ForumV2Details::show()
{
//loadSettings();
if(!this->isVisible()) {
QDialog::show();
}
}
void ForumV2Details::closeEvent (QCloseEvent * event)
{
QWidget::closeEvent(event);
}
void ForumV2Details::closeinfodlg()
{
close();
}
void ForumV2Details::showDetails(std::string mCurrForumId)
{
fId = mCurrForumId;
loadDialog();
}
void ForumV2Details::loadDialog()
{
if (!rsForumsV2)
{
return;
}
#warning "ForumV2Details Incomplete"
#if 0
ForumInfo fi;
rsForumsV2->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) {
QDateTime qtime;
qtime.setTime_t(fi.lastPost);
QString timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss");
ui.postline->setText(timestamp);
}
// 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
}
void ForumV2Details::applyDialog()
{
/* reload now */
loadDialog();
/* close the Dialog after the Changes applied */
closeinfodlg();
}

View File

@ -1,67 +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 _FORUMV2DETAILS_H
#define _FORUMV2DETAILS_H
#include <QDialog>
#include "ui_ForumV2Details.h"
class ForumV2Details : public QDialog
{
Q_OBJECT
public:
/** Default constructor */
ForumV2Details(QWidget *parent = 0, Qt::WFlags flags = 0);
/** Default destructor */
void showDetails(std::string mCurrForumId);
signals:
void configChanged() ;
public slots:
/** Overloaded QWidget.show */
void show();
protected:
void closeEvent (QCloseEvent * event);
private slots:
void closeinfodlg();
void applyDialog();
private:
void loadDialog();
std::string fId;
/** Qt Designer generated object */
Ui::ForumV2Details ui;
};
#endif

View File

@ -1,201 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ForumV2Details</class>
<widget class="QDialog" name="ForumV2Details">
<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">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>311</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="applyButton">
<property name="text">
<string>OK</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -1,100 +0,0 @@
/****************************************************************
* 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 "ForumV2GroupDialog.h"
#include <retroshare/rsforumsv2.h>
#include <iostream>
ForumV2GroupDialog::ForumV2GroupDialog(QWidget *parent)
:GxsGroupDialog(rsForumsV2, parent)
{
// To start with we only have open forums - with distribution controls.
uint32_t enabledFlags = ( 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 readonlyFlags = 0;
uint32_t defaultsFlags = ( 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);
setFlags(enabledFlags, readonlyFlags, defaultsFlags);
}
bool ForumV2GroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta)
{
// Specific Function.
RsForumV2Group grp;
grp.mMeta = meta;
//grp.mDescription = std::string(desc.toUtf8());
rsForumsV2->createGroup(token, grp, true);
return true;
}
void ForumV2GroupDialog::service_loadExistingGroup(const uint32_t &token)
{
std::cerr << "ForumV2GroupDialog::service_loadExistingGroup()";
std::cerr << std::endl;
RsForumV2Group group;
if (!rsForumsV2->getGroupData(token, group))
{
std::cerr << "ForumV2GroupDialog::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 */
}

View File

@ -1,44 +0,0 @@
/****************************************************************
* 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 _FORUMV2_GROUP_DIALOG_H
#define _FORUMV2_GROUP_DIALOG_H
#include "GxsGroupDialog.h"
class ForumV2GroupDialog : public GxsGroupDialog
{
Q_OBJECT
public:
ForumV2GroupDialog(QWidget *parent);
protected:
virtual bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta);
// virtual bool service_CompleteCreateGroup(const RsGroupMetaData &meta);
virtual void service_loadExistingGroup(const uint32_t &token);
};
#endif

View File

@ -55,18 +55,26 @@ const uint32_t ForumCreateDefaultsFlags = ( GXS_GROUP_DEFAULTS_DISTRIB_PUBLIC
GxsForumGroupDialog::GxsForumGroupDialog(TokenQueue *tokenQueue, QWidget *parent)
:GxsGroupDialog(tokenQueue, ForumCreateEnabledFlags, ForumCreateDefaultsFlags, parent, "Create New Forum")
:GxsGroupDialog(tokenQueue, ForumCreateEnabledFlags, ForumCreateDefaultsFlags, parent)
{
}
GxsForumGroupDialog::GxsForumGroupDialog(const RsGxsForumGroup &group, QWidget *parent)
:GxsGroupDialog(group.mMeta, GXS_GROUP_DIALOG_SHOW_MODE, parent)
:GxsGroupDialog(group.mMeta, GXS_GROUP_DIALOG_SHOW_MODE, parent)
{
return;
}
QString GxsForumGroupDialog::serviceHeader()
{
return tr("Create New Forum");
}
QPixmap GxsForumGroupDialog::serviceImage()
{
return QPixmap(":/images/konversation64.png");
}
bool GxsForumGroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta)
{
@ -78,5 +86,3 @@ bool GxsForumGroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMeta
rsGxsForums->createGroup(token, grp);
return true;
}

View File

@ -35,7 +35,9 @@ public:
GxsForumGroupDialog(const RsGxsForumGroup &group, QWidget *parent);
protected:
virtual bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta);
virtual QString serviceHeader();
virtual QPixmap serviceImage();
virtual bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta);
};
#endif

View File

@ -50,27 +50,20 @@
#define GXSGROUP_LOADGROUP 2
/** Constructor */
GxsGroupDialog::GxsGroupDialog(TokenQueue *tokenQueue, uint32_t enableFlags, uint16_t defaultFlags, QWidget *parent, const QString &serviceHeader)
: QDialog(parent), mTokenQueue(tokenQueue), mMode(GXS_GROUP_DIALOG_CREATE_MODE), mEnabledFlags(enableFlags), mDefaultsFlags(defaultFlags), mReadonlyFlags(0)
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)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
// connect up the buttons.
connect( ui.cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancelDialog( ) ) );
connect( ui.createButton, SIGNAL( clicked ( bool ) ), this, SLOT( submitGroup( ) ) );
connect( ui.buttonBox, SIGNAL(accepted()), this, SLOT(submitGroup()));
connect( ui.buttonBox, SIGNAL(rejected()), this, SLOT(cancelDialog()));
connect( ui.pubKeyShare_cb, SIGNAL( clicked() ), this, SLOT( setShareList( ) ));
connect( ui.groupLogo, SIGNAL(clicked() ), this , SLOT(addGroupLogo()));
connect( ui.addLogoButton, SIGNAL(clicked() ), this , SLOT(addGroupLogo()));
if(!serviceHeader.isEmpty())
ui.mServiceHeader->setText(serviceHeader);
setWindowTitle(serviceHeader);
//ui.headerFrame->setHeaderImage(QPixmap(":/WikiPoos/images/resource-group-new_48.png"));
//ui.headerFrame->setHeaderText(tr("Create"));
if (!ui.pubKeyShare_cb->isChecked())
{
ui.contactsdockWidget->hide();
@ -93,13 +86,22 @@ GxsGroupDialog::GxsGroupDialog(const RsGroupMetaData &grpMeta, uint32_t mode, QW
ui.idChooser->loadIds(0,"");
}
void GxsGroupDialog::showEvent(QShowEvent*)
{
QString header = serviceHeader();
ui.headerFrame->setHeaderText(header);
setWindowTitle(header);
ui.headerFrame->setHeaderImage(serviceImage());
}
void GxsGroupDialog::setMode(uint32_t mode)
{
switch(mMode)
{
case GXS_GROUP_DIALOG_CREATE_MODE:
{
ui.createButton->setText(tr("Create Group"));
ui.buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
ui.buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Create Group"));
newGroup();
}
break;
@ -107,8 +109,7 @@ void GxsGroupDialog::setMode(uint32_t mode)
default:
case GXS_GROUP_DIALOG_SHOW_MODE:
{
ui.cancelButton->setVisible(false);
ui.createButton->setText(tr("Close"));
ui.buttonBox->setStandardButtons(QDialogButtonBox::Close);
}
break;
//TODO
@ -354,7 +355,6 @@ uint32_t GxsGroupDialog::getGroupSignFlags()
void GxsGroupDialog::setGroupSignFlags(uint32_t signFlags)
{
if (signFlags & RSGXS_GROUP_SIGN_PUBLISH_ENCRYPTED) {
ui.publish_encrypt->setChecked(true);
} else if (signFlags & RSGXS_GROUP_SIGN_PUBLISH_ALLSIGNED) {
@ -388,7 +388,6 @@ void GxsGroupDialog::setGroupSignFlags(uint32_t signFlags)
}
}
void GxsGroupDialog::cancelDialog()
{
std::cerr << "GxsGroupDialog::cancelDialog() Should Close!";
@ -397,7 +396,6 @@ void GxsGroupDialog::cancelDialog()
close();
}
void GxsGroupDialog::addGroupLogo()
{
QPixmap img = misc::getOpenThumbnailedPicture(this, tr("Load Group Logo"), 64, 64);
@ -408,7 +406,7 @@ void GxsGroupDialog::addGroupLogo()
picture = img;
// to show the selected
ui.groupLogo->setIcon(picture);
ui.groupLogo->setPixmap(picture);
}
QPixmap GxsGroupDialog::getLogo()
@ -447,7 +445,7 @@ void GxsGroupDialog::wikitype()
ui.groupLogo->hide();
ui.addLogoButton->hide();
ui.headerImage->setPixmap(QPixmap(":/images/resource-group-new_48.png")) ;
ui.headerFrame->setHeaderImage(QPixmap(":/images/resource-group-new_48.png")) ;
ui.pubKeyShare_cb->setText(tr("Add Wiki Moderators"));
ui.contactsdockWidget->setWindowTitle(tr("Select Wiki Moderators"));
}

View File

@ -125,7 +125,7 @@ public:
* @param parent The parent dialog
* @param mode
*/
GxsGroupDialog(TokenQueue* tokenQueue, uint32_t enableFlags, uint16_t defaultFlags, QWidget *parent = NULL, const QString& serviceHeader = "");
GxsGroupDialog(TokenQueue* tokenQueue, uint32_t enableFlags, uint16_t defaultFlags, QWidget *parent = NULL);
/*!
* Contructs a GxsGroupDialog for display a group or editing
@ -147,6 +147,10 @@ protected slots:
void addGroupLogo();
protected:
virtual void showEvent(QShowEvent*);
virtual QString serviceHeader() = 0;
virtual QPixmap serviceImage() = 0;
/*!
* Main purpose is to help tansfer meta data to service

View File

@ -25,53 +25,7 @@
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="headerFrame">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>64</height>
</size>
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="headerImage">
<property name="maximumSize">
<size>
<width>48</width>
<height>48</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="mServiceHeader">
<property name="text">
<string>Create New</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="HeaderFrame" name="headerFrame"/>
</item>
<item row="2" column="0">
<widget class="QFrame" name="frame">
@ -103,7 +57,7 @@
<number>0</number>
</property>
<item row="0" column="0" rowspan="2">
<widget class="QToolButton" name="groupLogo">
<widget class="QLabel" name="groupLogo">
<property name="minimumSize">
<size>
<width>64</width>
@ -116,24 +70,17 @@
<height>64</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">
border: 2px solid white;
border-radius: 10px;
</string>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="text">
<string/>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/channels.png</normaloff>:/images/channels.png</iconset>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/channels.png</pixmap>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
@ -195,11 +142,7 @@ border-radius: 10px;
<item>
<widget class="QCheckBox" name="pubKeyShare_cb">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Key recipients can publish to restricted-type Wiki Group, and can view and publish for private-type channels&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>Key recipients can publish to restricted-type Wiki Group, and can view and publish for private-type channels</string>
</property>
<property name="text">
<string>Share Publish Key</string>
@ -518,33 +461,10 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="7" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>238</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="1">
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QPushButton" name="createButton">
<property name="text">
<string>Create</string>
</property>
<property name="default">
<bool>true</bool>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
@ -554,26 +474,26 @@ p, li { white-space: pre-wrap; }
</layout>
</widget>
<customwidgets>
<customwidget>
<class>GxsIdChooser</class>
<extends>QComboBox</extends>
<header>gui/gxs/GxsIdChooser.h</header>
</customwidget>
<customwidget>
<class>HeaderFrame</class>
<extends>QFrame</extends>
<header>gui/common/HeaderFrame.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>FriendSelectionWidget</class>
<extends>QWidget</extends>
<header>gui/common/FriendSelectionWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>GxsIdChooser</class>
<extends>QComboBox</extends>
<header>gui/gxs/GxsIdChooser.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../images.qrc"/>
<include location="../WikiPoos/Wiki_images.qrc"/>
<include location="../WikiPoos/Wiki_images.qrc"/>
<include location="../WikiPoos/Wiki_images.qrc"/>
<include location="../WikiPoos/Wiki_images.qrc"/>
<include location="../WikiPoos/Wiki_images.qrc"/>
<include location="../WikiPoos/Wiki_images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -21,31 +21,28 @@
#include "GxsIdTreeWidgetItem.h"
#include <algorithm>
#include <retroshare/rspeers.h>
#include <iostream>
/** Constructor */
GxsIdTreeWidgetItem::GxsIdTreeWidgetItem(QTreeWidget *parent)
:QTreeWidgetItem(parent), QObject(NULL), mTimer(NULL), mCount(0), mColumn(0)
GxsIdTreeWidgetItem::GxsIdTreeWidgetItem(const RSTreeWidgetItemCompareRole *compareRole, QTreeWidget *parent)
:RSTreeWidgetItem(compareRole, parent), QObject(NULL), mTimer(NULL), mCount(0), mColumn(0)
{
mTimer = new QTimer(this);
mTimer->setSingleShot(true);
connect(mTimer, SIGNAL(timeout()), this, SLOT(loadId()));
return;
init();
}
GxsIdTreeWidgetItem::GxsIdTreeWidgetItem(QTreeWidgetItem *parent)
:QTreeWidgetItem(parent), QObject(NULL), mTimer(NULL), mCount(0), mColumn(0)
GxsIdTreeWidgetItem::GxsIdTreeWidgetItem(const RSTreeWidgetItemCompareRole *compareRole, QTreeWidgetItem *parent)
:RSTreeWidgetItem(compareRole, parent), QObject(NULL), mTimer(NULL), mCount(0), mColumn(0)
{
init();
}
void GxsIdTreeWidgetItem::init()
{
mTimer = new QTimer(this);
mTimer->setSingleShot(true);
connect(mTimer, SIGNAL(timeout()), this, SLOT(loadId()));
return;
}
void GxsIdTreeWidgetItem::setId(const RsGxsId &id, int column)
@ -135,7 +132,6 @@ void GxsIdTreeWidgetItem::loadId()
{
/* timer event to try again */
mTimer->setInterval(mCount * 1000);
mTimer->start();
mTimer->start();
}
}

View File

@ -23,17 +23,18 @@
#ifndef _GXS_ID_TREEWIDGETITEM_H
#define _GXS_ID_TREEWIDGETITEM_H
#include <QTreeWidget>
#include <QTimer>
#include <retroshare/rsidentity.h>
class GxsIdTreeWidgetItem : public QObject, public QTreeWidgetItem
#include "gui/common/RSTreeWidgetItem.h"
class GxsIdTreeWidgetItem : public QObject, public RSTreeWidgetItem
{
Q_OBJECT
Q_OBJECT
public:
GxsIdTreeWidgetItem(QTreeWidget *parent = NULL);
GxsIdTreeWidgetItem(QTreeWidgetItem *parent);
GxsIdTreeWidgetItem(const RSTreeWidgetItemCompareRole *compareRole, QTreeWidget *parent = NULL);
GxsIdTreeWidgetItem(const RSTreeWidgetItemCompareRole *compareRole, QTreeWidgetItem *parent);
void setId(const RsGxsId &id, int column);
bool getId(RsGxsId &id);
@ -42,6 +43,7 @@ private slots:
void loadId();
private:
void init();
QTimer *mTimer;
RsGxsId mId;

View File

@ -52,7 +52,7 @@ uint32_t WikiCreateDefaultsFlags = ( GXS_GROUP_DEFAULTS_DISTRIB_PUBLIC |
WikiGroupDialog::WikiGroupDialog(TokenQueue *tokenQueue, QWidget *parent)
:GxsGroupDialog(tokenQueue, WikiCreateEnabledFlags, WikiCreateDefaultsFlags, parent, "Create New Wiki Group")
:GxsGroupDialog(tokenQueue, WikiCreateEnabledFlags, WikiCreateDefaultsFlags, parent)
{
// To start with we only have open forums - with distribution controls.
@ -93,7 +93,6 @@ WikiGroupDialog::WikiGroupDialog(TokenQueue *tokenQueue, QWidget *parent)
WikiGroupDialog::WikiGroupDialog(const RsWikiCollection &collection, QWidget *parent)
:GxsGroupDialog(collection.mMeta, GXS_GROUP_DIALOG_SHOW_MODE, parent)
{
#if 0
@ -118,6 +117,15 @@ WikiGroupDialog::WikiGroupDialog(const RsWikiCollection &collection, QWidget *pa
}
QString WikiGroupDialog::serviceHeader()
{
return tr("Create New Wiki Group");
}
QPixmap WikiGroupDialog::serviceImage()
{
return QPixmap();
}
bool WikiGroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta)
{
@ -132,5 +140,3 @@ bool WikiGroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMetaData
return true;
}

View File

@ -35,7 +35,9 @@ public:
WikiGroupDialog(const RsWikiCollection &collection, QWidget *parent);
protected:
virtual bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta);
virtual QString serviceHeader();
virtual QPixmap serviceImage();
virtual bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta);
private:

View File

@ -1,234 +0,0 @@
/****************************************************************
* 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 <QMessageBox>
#include "util/misc.h"
#include "CreateGxsForum.h"
#include "gui/common/PeerDefs.h"
#include <algorithm>
#include <retroshare/rsgxsforums.h>
#include <retroshare/rspeers.h>
#include <iostream>
#define CREATEGXSFORUMS_NEWFORUMID 1
/** Constructor */
CreateGxsForum::CreateGxsForum(QWidget *parent)
: QDialog(parent)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
mForumQueue = new TokenQueue(rsGxsForums->getTokenService(), this);
// connect up the buttons.
connect( ui.cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancelForum( ) ) );
connect( ui.createButton, SIGNAL( clicked ( bool ) ), this, SLOT( createForum( ) ) );
connect( ui.pubKeyShare_cb, SIGNAL( clicked() ), this, SLOT( setShareList( ) ));
if (!ui.pubKeyShare_cb->isChecked()) {
ui.contactsdockWidget->hide();
this->resize(this->size().width() - ui.contactsdockWidget->size().width(), this->size().height());
}
/* initialize key share list */
ui.keyShareList->setHeaderText(tr("Contacts:"));
ui.keyShareList->setModus(FriendSelectionWidget::MODUS_CHECK);
ui.keyShareList->start();
newForum();
}
void CreateGxsForum::newForum()
{
/* enforce Public for the moment */
ui.typePublic->setChecked(true);
ui.typePrivate->setEnabled(false);
ui.typeEncrypted->setEnabled(true);
#ifdef RS_RELEASE_VERSION
ui.typePrivate->setVisible(false);
ui.typeEncrypted->setVisible(true);
#endif
ui.msgAnon->setChecked(true);
//ui.msgAuth->setEnabled(false);
ui.forumName->clear();
ui.forumDesc->clear();
ui.forumName->setFocus();
}
void CreateGxsForum::createForum()
{
QString name = misc::removeNewLine(ui.forumName->text());
QString desc = ui.forumDesc->toPlainText(); //toHtml();
uint32_t flags = 0;
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!!
}
#ifdef TOGXS
if (ui.typePublic->isChecked()) {
flags |= RS_DISTRIB_PUBLIC;
} else if (ui.typePrivate->isChecked()) {
flags |= RS_DISTRIB_PRIVATE;
} else if (ui.typeEncrypted->isChecked()) {
flags |= RS_DISTRIB_ENCRYPTED;
}
if (ui.msgAuth->isChecked()) {
flags |= RS_DISTRIB_AUTHEN_REQ;
} else if (ui.msgAnon->isChecked()) {
flags |= RS_DISTRIB_AUTHEN_ANON;
}
#endif
if (rsGxsForums) {
uint32_t token;
RsGxsForumGroup grp;
grp.mMeta.mGroupName = std::string(name.toUtf8());
grp.mDescription = std::string(desc.toUtf8());
grp.mMeta.mGroupFlags = flags;
rsGxsForums->createGroup(token, grp);
// get the Queue to handle response.
mForumQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_SUMMARY, CREATEGXSFORUMS_NEWFORUMID);
}
}
void CreateGxsForum::completeCreateNewForum(const RsGroupMetaData &newForumMeta)
{
sendShareList(newForumMeta.mGroupId);
close();
}
void CreateGxsForum::sendShareList(std::string forumId)
{
if (!rsGxsForums)
{
std::cerr << "CreateGxsForum::sendShareList() GxsForums not active";
std::cerr << std::endl;
return;
}
if (ui.pubKeyShare_cb->isChecked())
{
std::list<std::string> shareList;
ui.keyShareList->selectedSslIds(shareList, false);
#ifdef TOGXS
rsGxsForums->groupShareKeys(forumId, shareList);
#endif
}
close();
}
void CreateGxsForum::setShareList()
{
if (ui.pubKeyShare_cb->isChecked()){
this->resize(this->size().width() + ui.contactsdockWidget->size().width(), this->size().height());
ui.contactsdockWidget->show();
} else { // hide share widget
ui.contactsdockWidget->hide();
this->resize(this->size().width() - ui.contactsdockWidget->size().width(), this->size().height());
}
}
void CreateGxsForum::cancelForum()
{
close();
}
void CreateGxsForum::loadNewForumId(const uint32_t &token)
{
std::cerr << "CreateGxsForum::loadNewForumId()";
std::cerr << std::endl;
std::list<RsGroupMetaData> groupInfo;
rsGxsForums->getGroupSummary(token, groupInfo);
if (groupInfo.size() == 1)
{
RsGroupMetaData fi = groupInfo.front();
completeCreateNewForum(fi);
}
else
{
std::cerr << "CreateGxsForum::loadNewForumId() ERROR INVALID Number of Forums Created";
std::cerr << std::endl;
}
}
void CreateGxsForum::loadRequest(const TokenQueue *queue, const TokenRequest &req)
{
std::cerr << "CreateGxsForum::loadRequest() UserType: " << req.mUserType;
std::cerr << std::endl;
if (queue == mForumQueue)
{
/* now switch on req */
switch(req.mUserType)
{
case CREATEGXSFORUMS_NEWFORUMID:
loadNewForumId(req.mToken);
break;
default:
std::cerr << "CreateGxsForum::loadRequest() UNKNOWN UserType ";
std::cerr << std::endl;
}
}
}

View File

@ -1,67 +0,0 @@
/****************************************************************
* 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 _CREATE_GXSFORUM_DIALOG_H
#define _CREATE_GXSFORUM_DIALOG_H
#include "ui_CreateGxsForum.h"
#include "util/TokenQueue.h"
class CreateGxsForum : public QDialog, public TokenResponse
{
Q_OBJECT
public:
CreateGxsForum(QWidget *parent = 0);
void newForum(); /* cleanup */
// Callback for all Loads.
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
private slots:
/* actions to take.... */
void createForum();
void cancelForum();
// set private forum key share list
void setShareList();
private:
void sendShareList(std::string forumId);
void completeCreateNewForum(const RsGroupMetaData &newForumMeta);
void loadNewForumId(const uint32_t &token);
std::list<std::string> mShareList;
QPixmap picture;
TokenQueue *mForumQueue;
/** Qt Designer generated object */
Ui::CreateGxsForum ui;
};
#endif

View File

@ -1,374 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CreateGxsForum</class>
<widget class="QDialog" name="CreateGxsForum">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>672</width>
<height>495</height>
</rect>
</property>
<property name="windowTitle">
<string>Create new Forum</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">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="frame_2">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>64</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QFrame#frame_2{background-image: url(:/images/connect/connectFriendBanner.png);}</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>6</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="labelicon">
<property name="maximumSize">
<size>
<width>48</width>
<height>48</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/konversation64.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="textlabelcreatforums">
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Arial'; font-size:24pt; font-weight:600; color:#ffffff;&quot;&gt;New Forum&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="forumName"/>
</item>
</layout>
</item>
<item row="0" column="3" rowspan="6">
<widget class="QDockWidget" name="contactsdockWidget">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>524287</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>220</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>check peers you would like to share private publish key with</string>
</property>
<property name="floating">
<bool>false</bool>
</property>
<property name="features">
<set>QDockWidget::NoDockWidgetFeatures</set>
</property>
<property name="windowTitle">
<string>Share Key With</string>
</property>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QGridLayout" name="_2">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="FriendSelectionWidget" name="keyShareList" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>4</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>16777215</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>220</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="1" column="0" colspan="3">
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Description</string>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="forumDesc"/>
</item>
</layout>
</item>
<item row="2" column="0" colspan="3">
<widget class="QGroupBox" name="tyoeGroupBox">
<property name="title">
<string>Type:</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="margin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QRadioButton" name="typePublic">
<property name="text">
<string>Public - Anyone can read and publish (Shared Publish Key)</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="typePrivate">
<property name="text">
<string>Restricted - Anyone can read, limited publishing (Private Publish Key)</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QRadioButton" name="typeEncrypted">
<property name="text">
<string>Private - (Private Publish Key required to view Messages)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="QGroupBox" name="msgGroupBox_2">
<property name="title">
<string>Key Sharing</string>
</property>
<layout class="QVBoxLayout" name="_5">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="pubKeyShare_cb">
<property name="toolTip">
<string>Key recipients can publish to restricted-type channels, and can view and publish for private-type channels</string>
</property>
<property name="text">
<string>Share Private Publish Key</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QGroupBox" name="msgGroupBox">
<property name="title">
<string>Allowed Messages</string>
</property>
<layout class="QVBoxLayout" name="_4">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>6</number>
</property>
<item>
<widget class="QRadioButton" name="msgAuth">
<property name="text">
<string>Authenticated Messages</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="msgAnon">
<property name="text">
<string>Anonymous Messages</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="5" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>238</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="1">
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QPushButton" name="createButton">
<property name="text">
<string>Create</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>FriendSelectionWidget</class>
<extends>QWidget</extends>
<header>gui/common/FriendSelectionWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -35,6 +35,7 @@
#include "gui/RetroShareLink.h"
#include "gui/common/Emoticons.h"
#include "util/HandleRichText.h"
#include "util/misc.h"
#include <sys/stat.h>
@ -46,8 +47,8 @@
/** Constructor */
CreateGxsForumMsg::CreateGxsForumMsg(std::string fId, std::string pId)
: QMainWindow(NULL), mForumId(fId), mParentId(pId)
CreateGxsForumMsg::CreateGxsForumMsg(const std::string &fId, const std::string &pId)
: QDialog(NULL, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint), mForumId(fId), mParentId(pId)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
@ -56,6 +57,12 @@ CreateGxsForumMsg::CreateGxsForumMsg(std::string fId, std::string pId)
/* Setup Queue */
mForumQueue = new TokenQueue(rsGxsForums->getTokenService(), this);
QString text = pId.empty() ? tr("Start New Thread") : tr("Post Forum Message");
setWindowTitle(text);
ui.headerFrame->setHeaderImage(QPixmap(":/images/konversation64.png"));
ui.headerFrame->setHeaderText(text);
Settings->loadWidgetInformation(this);
connect( ui.forumMessage, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( forumMessageCostumPopupMenu( QPoint ) ) );
@ -63,8 +70,8 @@ CreateGxsForumMsg::CreateGxsForumMsg(std::string fId, std::string pId)
connect(ui.hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
// connect up the buttons.
connect( ui.postmessage_action, SIGNAL( triggered (bool) ), this, SLOT( createMsg( ) ) );
connect( ui.close_action, SIGNAL( triggered (bool) ), this, SLOT( cancelMsg( ) ) );
connect( ui.buttonBox, SIGNAL(accepted()), this, SLOT(createMsg()));
connect( ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
connect( ui.emoticonButton, SIGNAL(clicked()), this, SLOT(smileyWidgetForums()));
connect( ui.attachFileButton, SIGNAL(clicked() ), this , SLOT(addFile()));
connect( ui.pastersButton, SIGNAL(clicked() ), this , SLOT(pasteLink()));
@ -80,9 +87,9 @@ CreateGxsForumMsg::CreateGxsForumMsg(std::string fId, std::string pId)
}
/** context menu searchTablewidget2 **/
void CreateGxsForumMsg::forumMessageCostumPopupMenu( QPoint /*point*/ )
void CreateGxsForumMsg::forumMessageCostumPopupMenu(QPoint point)
{
QMenu *contextMnu = ui.forumMessage->createStandardContextMenu();
QMenu *contextMnu = ui.forumMessage->createStandardContextMenu(point);
contextMnu->addSeparator();
QAction *pasteLinkAct = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink()));
@ -233,10 +240,9 @@ void CreateGxsForumMsg::loadFormInformation()
void CreateGxsForumMsg::createMsg()
{
QString name = misc::removeNewLine(ui.forumSubject->text());
QString desc = ui.forumMessage->toHtml();
QString desc;
if(desc == QTextDocument(ui.forumMessage->toPlainText()).toHtml())
desc = ui.forumMessage->toPlainText() ;
RsHtml::optimizeHtml(ui.forumMessage, desc);
if(name.isEmpty())
{ /* error message */
@ -324,11 +330,6 @@ void CreateGxsForumMsg::closeEvent (QCloseEvent * /*event*/)
Settings->saveWidgetInformation(this);
}
void CreateGxsForumMsg::cancelMsg()
{
close();
}
void CreateGxsForumMsg::smileyWidgetForums()
{
Emoticons::showSmileyWidget(this, ui.emoticonButton, SLOT(addSmileys()), false);

View File

@ -29,13 +29,12 @@
#include <retroshare/rsgxsforums.h>
class CreateGxsForumMsg : public QMainWindow, public TokenResponse
class CreateGxsForumMsg : public QDialog, public TokenResponse
{
Q_OBJECT
public:
CreateGxsForumMsg(std::string fId, std::string pId);
CreateGxsForumMsg(const std::string &fId, const std::string &pId);
void newMsg(); /* cleanup */
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
@ -47,7 +46,6 @@ private slots:
void fileHashingFinished(QList<HashedFile> hashedFiles);
/* actions to take.... */
void createMsg();
void cancelMsg();
void pasteLink();
void pasteLinkFull();
void pasteOwnCertificateLink();
@ -60,7 +58,6 @@ protected:
void closeEvent (QCloseEvent * event);
private:
void saveForumInfo(const RsGroupMetaData &meta);
void saveParentMsg(const RsGxsForumMsg &msg);
void loadFormInformation();

View File

@ -1,16 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CreateGxsForumMsg</class>
<widget class="QMainWindow" name="CreateGxsForumMsg">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
<widget class="QDialog" name="CreateGxsForumMsg">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>482</width>
<height>497</height>
<height>448</height>
</rect>
</property>
<property name="windowTitle">
@ -20,24 +17,27 @@
<iconset resource="../images.qrc">
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
</property>
<property name="styleSheet">
<string notr="true">QToolBar#toolBar{background-image: url(:/images/connect/connectFriendBanner.png)}</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout_5">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QFrame" name="frame_4">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="HeaderFrame" name="headerFrame"/>
</item>
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QFrame" name="subjectFrame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
@ -45,64 +45,49 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="topMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Forum</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="forumName">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
<widget class="QLabel" name="forumLabel">
<property name="text">
<string>Forum</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="forumName">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Subject</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="forumSubject"/>
</item>
</layout>
<widget class="QLabel" name="subjectLabel">
<property name="text">
<string>Subject</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="forumSubject"/>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QFrame" name="frame_2">
<item>
<widget class="QFrame" name="toolBarFrame">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>38</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QFrame#frame_2{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #FEFEFE, stop:1 #E8E8E8);
border: 1px solid #CCCCCC;}</string>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Sunken</enum>
</property>
<layout class="QHBoxLayout">
<property name="margin">
@ -219,107 +204,65 @@ border: 1px solid #CCCCCC;}</string>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QFrame" name="frame_3">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<item>
<widget class="QGroupBox" name="messageGroupBox">
<property name="title">
<string>Forum Post</string>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="topMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Forum Post</string>
<widget class="QTextEdit" name="forumMessage">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTextEdit" name="forumMessage">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="html">
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
<property name="html">
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Attach files via drag and drop</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0">
<widget class="HashBox" name="hashBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>You can attach files via drag and drop here in this window</string>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="hashGroupBox">
<property name="title">
<string>Attach files via drag and drop</string>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0">
<widget class="HashBox" name="hashBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>You can attach files via drag and drop here in this window</string>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QToolBar" name="toolBar">
<property name="windowTitle">
<string notr="true">toolBar</string>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="postmessage_action"/>
<addaction name="close_action"/>
</widget>
<action name="postmessage_action">
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/mail_send24.png</normaloff>:/images/mail_send24.png</iconset>
</property>
<property name="text">
<string>Post Forum Msg</string>
</property>
</action>
<action name="close_action">
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/button_cancel.png</normaloff>:/images/button_cancel.png</iconset>
</property>
<property name="text">
<string>Close</string>
</property>
</action>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
@ -327,6 +270,12 @@ p, li { white-space: pre-wrap; }
<extends>QComboBox</extends>
<header>gui/gxs/GxsIdChooser.h</header>
</customwidget>
<customwidget>
<class>HeaderFrame</class>
<extends>QFrame</extends>
<header>gui/common/HeaderFrame.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>HashBox</class>
<extends>QScrollArea</extends>

View File

@ -31,13 +31,14 @@
/** Default constructor */
EditGxsForumDetails::EditGxsForumDetails(std::string forumId, QWidget *parent, Qt::WFlags flags)
: QDialog(parent, flags), m_forumId(forumId)
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.applyButton, SIGNAL(clicked()), this, SLOT(applyDialog()));
connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(applyDialog()));
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
loadForum();
}

View File

@ -32,7 +32,7 @@ class EditGxsForumDetails : public QDialog
public:
/** Default constructor */
EditGxsForumDetails(std::string forumId = "", QWidget *parent = 0, Qt::WFlags flags = 0);
EditGxsForumDetails(std::string forumId = "", QWidget *parent = 0);
signals:
void configChanged();

View File

@ -21,35 +21,9 @@
<item row="1" column="0">
<layout class="QGridLayout" name="_2">
<item row="0" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>311</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="applyButton">
<property name="text">
<string>OK</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>true</bool>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
@ -109,22 +83,5 @@
<resources>
<include location="../images.qrc"/>
</resources>
<connections>
<connection>
<sender>cancelButton</sender>
<signal>clicked()</signal>
<receiver>EditForumDetails</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>307</x>
<y>333</y>
</hint>
<hint type="destinationlabel">
<x>217</x>
<y>177</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View File

@ -19,6 +19,7 @@
* Boston, MA 02110-1301, USA.
****************************************************************/
#include "GxsForumDetails.h"
//#AFTER MERGE #include "util/DateTime.h"
#include <retroshare/rsiface.h>
#include <retroshare/rspeers.h>
@ -37,16 +38,13 @@
#define DATETIME_FMT "MMM dd hh:mm:ss"
/** Default constructor */
GxsForumDetails::GxsForumDetails(QWidget *parent, Qt::WFlags flags)
: QDialog(parent, flags)
GxsForumDetails::GxsForumDetails(QWidget *parent)
: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
{
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);
connect(ui.applyButton, SIGNAL(clicked()), this, SLOT(applyDialog()));
connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(closeinfodlg()));
ui.applyButton->setToolTip(tr("Apply and Close"));
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
ui.nameline ->setReadOnly(true);
ui.popline ->setReadOnly(true);
@ -72,16 +70,6 @@ GxsForumDetails::show()
}
}
void GxsForumDetails::closeEvent (QCloseEvent * event)
{
QWidget::closeEvent(event);
}
void GxsForumDetails::closeinfodlg()
{
close();
}
void GxsForumDetails::showDetails(std::string mCurrForumId)
{
fId = mCurrForumId;
@ -108,10 +96,7 @@ void GxsForumDetails::loadDialog()
// Set Last Post Date
if (fi.lastPost) {
QDateTime qtime;
qtime.setTime_t(fi.lastPost);
QString timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss");
ui.postline->setText(timestamp);
ui.postline->setText(DateTime::formatLongDateTime(fi.lastPost));
}
// Set Forum ID
@ -133,14 +118,3 @@ void GxsForumDetails::loadDialog()
#endif
}
void GxsForumDetails::applyDialog()
{
/* reload now */
loadDialog();
/* close the Dialog after the Changes applied */
closeinfodlg();
}

View File

@ -33,8 +33,7 @@ class GxsForumDetails : public QDialog
public:
/** Default constructor */
GxsForumDetails(QWidget *parent = 0, Qt::WFlags flags = 0);
/** Default destructor */
GxsForumDetails(QWidget *parent = 0);
void showDetails(std::string mCurrForumId);
@ -45,14 +44,6 @@ public slots:
/** Overloaded QWidget.show */
void show();
protected:
void closeEvent (QCloseEvent * event);
private slots:
void closeinfodlg();
void applyDialog();
private:
void loadDialog();

View File

@ -158,35 +158,9 @@
<item row="1" column="0">
<layout class="QGridLayout">
<item row="0" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>311</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="applyButton">
<property name="text">
<string>OK</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>true</bool>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>