mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 13:24:15 -05:00
Decided again creating new Gxs dialogs.
Decided on final form of GXS group create Added Post and Comment create disabled wiki git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5791 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
1b865612c5
commit
8170697029
@ -2,7 +2,7 @@ CONFIG += qt gui uic qrc resources uitools idle bitdht
|
||||
|
||||
# Below is for GXS services.
|
||||
CONFIG += photoshare
|
||||
CONFIG += wikipoos
|
||||
#CONFIG += wikipoos
|
||||
#CONFIG += thewire
|
||||
CONFIG += identities
|
||||
#CONFIG += forumsv2
|
||||
@ -194,11 +194,11 @@ freebsd-* {
|
||||
# ###########################################
|
||||
|
||||
bitdht {
|
||||
LIBS += ../../libbitdht/src/lib/libbitdht.a
|
||||
PRE_TARGETDEPS *= ../../libbitdht/src/lib/libbitdht.a
|
||||
#LIBS += ../../libbitdht/src/lib/libbitdht.a
|
||||
#PRE_TARGETDEPS *= ../../libbitdht/src/lib/libbitdht.a
|
||||
|
||||
#LIBS += C:\Development\Rs\v0.5-gxs-b1\libbitdht\libbitdht-build-desktop\lib\libbitdht.a
|
||||
#PRE_TARGETDEPS *= C:\Development\Rs\v0.5-gxs-b1\libbitdht\libbitdht-build-desktop\lib\libbitdht.a
|
||||
LIBS += C:\Development\Rs\v0.5-gxs-b1\libbitdht\libbitdht-build-desktop\lib\libbitdht.a
|
||||
PRE_TARGETDEPS *= C:\Development\Rs\v0.5-gxs-b1\libbitdht\libbitdht-build-desktop\lib\libbitdht.a
|
||||
|
||||
# Chris version.
|
||||
#LIBS += ../../libbitdht/libbitdht-build-desktop/lib/libbitdht.a
|
||||
@ -420,7 +420,7 @@ HEADERS += rshare.h \
|
||||
gui/groups/CreateGroup.h \
|
||||
gui/dht/DhtWindow.h \
|
||||
gui/bwctrl/BwCtrlWindow.h \
|
||||
gui/GetStartedDialog.h \
|
||||
gui/GetStartedDialog.h
|
||||
|
||||
|
||||
|
||||
@ -703,7 +703,8 @@ SOURCES += main.cpp \
|
||||
gui/groups/CreateGroup.cpp \
|
||||
gui/dht/DhtWindow.cpp \
|
||||
gui/bwctrl/BwCtrlWindow.cpp \
|
||||
gui/GetStartedDialog.cpp
|
||||
gui/GetStartedDialog.cpp \
|
||||
|
||||
|
||||
|
||||
|
||||
@ -989,18 +990,24 @@ posted {
|
||||
gui/Posted/PostedComments.h \
|
||||
util/TokenQueueVEG.h \
|
||||
gui/Posted/PostedGroupDialog.h \
|
||||
gui/Posted/PostedCreatePostDialog.h \
|
||||
gui/Posted/PostedCreateCommentDialog.h
|
||||
|
||||
FORMS += gui/Posted/PostedDialog.ui \
|
||||
gui/Posted/PostedListDialog.ui \
|
||||
gui/Posted/PostedItem.ui \
|
||||
gui/Posted/PostedComments.ui \
|
||||
gui/Posted/PostedCreatePostDialog.ui \
|
||||
gui/Posted/PostedCreateCommentDialog.ui
|
||||
|
||||
SOURCES += gui/Posted/PostedDialog.cpp \
|
||||
gui/Posted/PostedListDialog.cpp \
|
||||
gui/Posted/PostedItem.cpp \
|
||||
gui/Posted/PostedComments.cpp \
|
||||
util/TokenQueueVEG.cpp \
|
||||
gui/Posted/PostedGroupDialog.cpp
|
||||
gui/Posted/PostedGroupDialog.cpp \
|
||||
gui/Posted/PostedCreatePostDialog.cpp \
|
||||
gui/Posted/PostedCreateCommentDialog.cpp
|
||||
|
||||
}
|
||||
|
||||
@ -1008,19 +1015,18 @@ gxsgui {
|
||||
|
||||
HEADERS += gui/gxs/GxsGroupDialog.h \
|
||||
gui/gxs/GxsCommentTreeWidget.h \
|
||||
gui/gxs/WikiGroupDialog.h \
|
||||
# gui/gxs/WikiGroupDialog.h \
|
||||
|
||||
# gui/gxs/ForumV2GroupDialog.h \
|
||||
# gui/gxs/GxsMsgDialog.h \
|
||||
|
||||
FORMS += gui/gxs/GxsGroupDialog.ui \
|
||||
|
||||
FORMS += gui/gxs/GxsGroupDialog.ui \
|
||||
# gui/gxs/GxsMsgDialog.ui \
|
||||
# gui/gxs/GxsCommentTreeWidget.ui \
|
||||
|
||||
SOURCES += gui/gxs/GxsGroupDialog.cpp \
|
||||
gui/gxs/GxsCommentTreeWidget.cpp \
|
||||
gui/gxs/WikiGroupDialog.cpp \
|
||||
# gui/gxs/WikiGroupDialog.cpp \
|
||||
|
||||
#gui/gxs/ForumV2GroupDialog.cpp \
|
||||
# gui/gxs/GxsMsgDialog.cpp \
|
||||
|
14
retroshare-gui/src/gui/Posted/PostedCreateCommentDialog.cpp
Normal file
14
retroshare-gui/src/gui/Posted/PostedCreateCommentDialog.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#include "PostedCreateCommentDialog.h"
|
||||
#include "ui_PostedCreateCommentDialog.h"
|
||||
|
||||
PostedCreateCommentDialog::PostedCreateCommentDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::PostedCreateCommentDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
PostedCreateCommentDialog::~PostedCreateCommentDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
22
retroshare-gui/src/gui/Posted/PostedCreateCommentDialog.h
Normal file
22
retroshare-gui/src/gui/Posted/PostedCreateCommentDialog.h
Normal file
@ -0,0 +1,22 @@
|
||||
#ifndef POSTEDCREATECOMMENTDIALOG_H
|
||||
#define POSTEDCREATECOMMENTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class PostedCreateCommentDialog;
|
||||
}
|
||||
|
||||
class PostedCreateCommentDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PostedCreateCommentDialog(QWidget *parent = 0);
|
||||
~PostedCreateCommentDialog();
|
||||
|
||||
private:
|
||||
Ui::PostedCreateCommentDialog *ui;
|
||||
};
|
||||
|
||||
#endif // POSTEDCREATECOMMENTDIALOG_H
|
71
retroshare-gui/src/gui/Posted/PostedCreateCommentDialog.ui
Normal file
71
retroshare-gui/src/gui/Posted/PostedCreateCommentDialog.ui
Normal file
@ -0,0 +1,71 @@
|
||||
<ui version="4.0">
|
||||
<author/>
|
||||
<comment/>
|
||||
<exportmacro/>
|
||||
<class>PostedCreateCommentDialog</class>
|
||||
<widget class="QDialog" name="PostedCreateCommentDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>240</y>
|
||||
<width>341</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<pixmapfunction/>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>PostedCreateCommentDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>PostedCreateCommentDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
21
retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp
Normal file
21
retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include "PostedCreatePostDialog.h"
|
||||
#include "ui_PostedCreatePostDialog.h"
|
||||
|
||||
PostedCreatePostDialog::PostedCreatePostDialog(TokenQueue* tokenQ, RsPosted *posted, QWidget *parent):
|
||||
QDialog(parent), mTokenQueue(tokenQ), mPosted(posted),
|
||||
ui(new Ui::PostedCreatePostDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
void PostedCreatePostDialog::createPost()
|
||||
{
|
||||
|
||||
|
||||
close();
|
||||
}
|
||||
|
||||
PostedCreatePostDialog::~PostedCreatePostDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
38
retroshare-gui/src/gui/Posted/PostedCreatePostDialog.h
Normal file
38
retroshare-gui/src/gui/Posted/PostedCreatePostDialog.h
Normal file
@ -0,0 +1,38 @@
|
||||
#ifndef POSTEDCREATEPOSTDIALOG_H
|
||||
#define POSTEDCREATEPOSTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "retroshare/rsposted.h"
|
||||
#include "util/TokenQueue.h"
|
||||
|
||||
namespace Ui {
|
||||
class PostedCreatePostDialog;
|
||||
}
|
||||
|
||||
class PostedCreatePostDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
/*!
|
||||
* @param tokenQ parent callee token
|
||||
* @param posted
|
||||
*/
|
||||
explicit PostedCreatePostDialog(TokenQueue* tokenQ, RsPosted* posted, QWidget *parent = 0);
|
||||
~PostedCreatePostDialog();
|
||||
|
||||
private:
|
||||
|
||||
void createPost();
|
||||
|
||||
private:
|
||||
Ui::PostedCreatePostDialog *ui;
|
||||
|
||||
QString mLink;
|
||||
QString mNotes;
|
||||
RsPosted* mPosted;
|
||||
TokenQueue* mTokenQueue;
|
||||
};
|
||||
|
||||
#endif // POSTEDCREATEPOSTDIALOG_H
|
96
retroshare-gui/src/gui/Posted/PostedCreatePostDialog.ui
Normal file
96
retroshare-gui/src/gui/Posted/PostedCreatePostDialog.ui
Normal file
@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>PostedCreatePostDialog</class>
|
||||
<widget class="QDialog" name="PostedCreatePostDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>406</width>
|
||||
<height>168</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Create Post</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">Link</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Notes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="textEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>PostedCreatePostDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>PostedCreatePostDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
@ -25,58 +25,30 @@
|
||||
#include <retroshare/rsposted.h>
|
||||
#include <iostream>
|
||||
|
||||
PostedGroupDialog::PostedGroupDialog(TokenQueue* tokenQueue, QWidget *parent)
|
||||
:GxsGroupDialog(tokenQueue, parent, GXS_GROUP_DIALOG_CREATE_MODE)
|
||||
#define POSTED_ENABLE_FLAG ( 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)
|
||||
|
||||
#define POSTED_CREATE_DEFAULT_FLAG ( GXS_GROUP_DEFAULTS_DISTRIB_LOCAL | \
|
||||
GXS_GROUP_DEFAULTS_PUBLISH_REQUIRED | \
|
||||
GXS_GROUP_DEFAULTS_PERSONAL_IFNOPUB | \
|
||||
GXS_GROUP_DEFAULTS_COMMENTS_NO | \
|
||||
0)
|
||||
|
||||
PostedGroupDialog::PostedGroupDialog(TokenQueue* tokenQueue, RsPosted* posted, QWidget *parent)
|
||||
:GxsGroupDialog(tokenQueue, POSTED_ENABLE_FLAG, POSTED_CREATE_DEFAULT_FLAG, parent),
|
||||
mPosted(posted)
|
||||
{
|
||||
|
||||
// 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_LOCAL |
|
||||
GXS_GROUP_DEFAULTS_PUBLISH_REQUIRED |
|
||||
GXS_GROUP_DEFAULTS_PERSONAL_IFNOPUB |
|
||||
GXS_GROUP_DEFAULTS_COMMENTS_NO |
|
||||
0);
|
||||
|
||||
setFlags(enabledFlags, defaultsFlags);
|
||||
|
||||
}
|
||||
|
||||
PostedGroupDialog::PostedGroupDialog(const RsPostedGroup &grp, QWidget *parent)
|
||||
:GxsGroupDialog(NULL, parent, GXS_GROUP_DIALOG_SHOW_MODE), mGrp(grp)
|
||||
PostedGroupDialog::PostedGroupDialog(const RsPostedGroup& grp, uint32_t mode, QWidget *parent)
|
||||
:GxsGroupDialog(grp.mMeta, mode, parent), mGrp(grp)
|
||||
{
|
||||
|
||||
// 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_LOCAL |
|
||||
GXS_GROUP_DEFAULTS_PUBLISH_REQUIRED |
|
||||
GXS_GROUP_DEFAULTS_PERSONAL_IFNOPUB |
|
||||
GXS_GROUP_DEFAULTS_COMMENTS_NO |
|
||||
0);
|
||||
|
||||
setFlags(enabledFlags, defaultsFlags);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -100,10 +72,6 @@ QString PostedGroupDialog::service_getDescription()
|
||||
return QString();
|
||||
}
|
||||
|
||||
RsGroupMetaData PostedGroupDialog::service_getMeta()
|
||||
{
|
||||
return mGrp.mMeta;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -35,12 +35,12 @@ public:
|
||||
/*!
|
||||
* This constructs a create dialog
|
||||
*/
|
||||
PostedGroupDialog(TokenQueue* tokenQueue, QWidget *parent = NULL);
|
||||
PostedGroupDialog(TokenQueue* tokenQueue, RsPosted* posted, QWidget *parent = NULL);
|
||||
|
||||
/*!
|
||||
* This constructs a show dialog which displays an already existing group
|
||||
*/
|
||||
PostedGroupDialog(const RsPostedGroup& grp, QWidget *parent = NULL);
|
||||
PostedGroupDialog(const RsPostedGroup& grp, uint32_t mode, QWidget *parent = NULL);
|
||||
|
||||
protected:
|
||||
|
||||
@ -59,16 +59,10 @@ protected:
|
||||
*/
|
||||
virtual QString service_getDescription();
|
||||
|
||||
/*!
|
||||
* Used in show mode, returns a meta type
|
||||
* @return the meta of existing grpMeta
|
||||
*/
|
||||
virtual RsGroupMetaData service_getMeta();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
RsPostedGroup mGrp;
|
||||
RsPosted* mPosted;
|
||||
|
||||
};
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "PostedListDialog.h"
|
||||
|
||||
#include "gui/Posted/PostedGroupDialog.h"
|
||||
#include "gui/Posted/PostedCreatePostDialog.h"
|
||||
|
||||
#include <retroshare/rsposted.h>
|
||||
#include <gxs/rsgxsflags.h>
|
||||
@ -107,46 +108,17 @@ void PostedListDialog::groupListCustomPopupMenu( QPoint /*point*/ )
|
||||
{
|
||||
QMenu contextMnu( this );
|
||||
|
||||
QAction *action = contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Subscribe to Forum"), this, SLOT(subscribeToForum()));
|
||||
//action->setDisabled (mCurrTopicId.empty() || IS_FORUM_SUBSCRIBED(subscribeFlags));
|
||||
|
||||
action = contextMnu.addAction(QIcon(IMAGE_UNSUBSCRIBE), tr("Unsubscribe to Forum"), this, SLOT(unsubscribeToForum()));
|
||||
//action->setEnabled (!mCurrTopicId.empty() && IS_FORUM_SUBSCRIBED(subscribeFlags));
|
||||
|
||||
contextMnu.addSeparator();
|
||||
|
||||
contextMnu.addAction(QIcon(IMAGE_NEWFORUM), tr("New Forum"), this, SLOT(newforum()));
|
||||
|
||||
action = contextMnu.addAction(QIcon(IMAGE_INFO), tr("Show Forum Details"), this, SLOT(showForumDetails()));
|
||||
action->setEnabled (!mCurrTopicId.empty ());
|
||||
|
||||
action = contextMnu.addAction(QIcon(":/images/settings16.png"), tr("Edit Forum Details"), this, SLOT(editForumDetails()));
|
||||
//action->setEnabled (!mCurrTopicId.empty () && IS_FORUM_ADMIN(subscribeFlags));
|
||||
|
||||
QAction *shareKeyAct = new QAction(QIcon(":/images/gpgp_key_generate.png"), tr("Share Forum"), &contextMnu);
|
||||
connect( shareKeyAct, SIGNAL( triggered() ), this, SLOT( shareKey() ) );
|
||||
//shareKeyAct->setEnabled(!mCurrTopicId.empty() && IS_FORUM_ADMIN(subscribeFlags));
|
||||
contextMnu.addAction( shareKeyAct);
|
||||
|
||||
QAction *restoreKeysAct = new QAction(QIcon(":/images/settings16.png"), tr("Restore Publish Rights for Forum" ), &contextMnu);
|
||||
connect( restoreKeysAct , SIGNAL( triggered() ), this, SLOT( restoreForumKeys() ) );
|
||||
//restoreKeysAct->setEnabled(!mCurrTopicId.empty() && !IS_FORUM_ADMIN(subscribeFlags));
|
||||
contextMnu.addAction( restoreKeysAct);
|
||||
|
||||
action = contextMnu.addAction(QIcon(IMAGE_COPYLINK), tr("Copy RetroShare Link"), this, SLOT(copyForumLink()));
|
||||
action->setEnabled(!mCurrTopicId.empty());
|
||||
|
||||
contextMnu.addSeparator();
|
||||
|
||||
action = contextMnu.addAction(QIcon(":/images/message-mail-read.png"), tr("Mark all as read"), this, SLOT(markMsgAsReadAll()));
|
||||
//action->setEnabled (!mCurrTopicId.empty () && IS_FORUM_SUBSCRIBED(subscribeFlags));
|
||||
|
||||
action = contextMnu.addAction(QIcon(":/images/message-mail.png"), tr("Mark all as unread"), this, SLOT(markMsgAsUnreadAll()));
|
||||
//action->setEnabled (!mCurrTopicId.empty () && IS_FORUM_SUBSCRIBED(subscribeFlags));
|
||||
QAction *action = contextMnu.addAction(QIcon(IMAGE_MESSAGE), tr("Create Post"), this, SLOT(createPost()));
|
||||
action->setDisabled (mCurrTopicId.empty());
|
||||
|
||||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void PostedListDialog::createPost()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void PostedListDialog::updateDisplay()
|
||||
{
|
||||
std::list<std::string> groupIds;
|
||||
@ -277,7 +249,7 @@ void PostedListDialog::periodChanged( int index )
|
||||
|
||||
void PostedListDialog::newGroup()
|
||||
{
|
||||
PostedGroupDialog cf (mPostedQueue, this);
|
||||
PostedGroupDialog cf (mPostedQueue, rsPosted, this);
|
||||
cf.exec ();
|
||||
}
|
||||
|
||||
@ -288,7 +260,7 @@ void PostedListDialog::showGroupDetails()
|
||||
return;
|
||||
}
|
||||
|
||||
PostedGroupDialog cf(mGroups[mCurrTopicId], this);
|
||||
PostedGroupDialog cf(mGroups[mCurrTopicId], GXS_GROUP_DIALOG_SHOW_MODE, this);
|
||||
cf.exec ();
|
||||
}
|
||||
|
||||
|
@ -76,6 +76,7 @@ void periodChanged( int index );
|
||||
void newGroup();
|
||||
void showGroupDetails();
|
||||
void editGroupDetails();
|
||||
void createPost();
|
||||
|
||||
private:
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
#include "GxsCreateGroupDialog.h"
|
||||
#include "ui_GxsCreateGroupDialog.h"
|
||||
|
||||
GxsCreateGroupDialog::GxsCreateGroupDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::GxsCreateGroupDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
GxsCreateGroupDialog::~GxsCreateGroupDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void GxsCreateGroupDialog::changeEvent(QEvent *e)
|
||||
{
|
||||
QDialog::changeEvent(e);
|
||||
switch (e->type()) {
|
||||
case QEvent::LanguageChange:
|
||||
ui->retranslateUi(this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
#ifndef GXSCREATEGROUPDIALOG_H
|
||||
#define GXSCREATEGROUPDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class GxsCreateGroupDialog;
|
||||
}
|
||||
|
||||
class GxsCreateGroupDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
GxsCreateGroupDialog(QWidget *parent = 0);
|
||||
~GxsCreateGroupDialog();
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
Ui::GxsCreateGroupDialog *ui;
|
||||
};
|
||||
|
||||
#endif // GXSCREATEGROUPDIALOG_H
|
@ -1,18 +0,0 @@
|
||||
<ui version="4.0">
|
||||
<class>GxsCreateGroupDialog</class>
|
||||
<widget class="QDialog" name="GxsCreateGroupDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -50,8 +50,8 @@
|
||||
#define GXSGROUP_LOADGROUP 2
|
||||
|
||||
/** Constructor */
|
||||
GxsGroupDialog::GxsGroupDialog(TokenQueue* tokenQueue, QWidget *parent, uint32_t mode)
|
||||
: QDialog(parent), mTokenQueue(tokenQueue), mMode(mode)
|
||||
GxsGroupDialog::GxsGroupDialog(TokenQueue *tokenQueue, uint32_t enableFlags, uint16_t defaultFlags, QWidget *parent)
|
||||
: QDialog(parent), 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);
|
||||
@ -64,7 +64,8 @@ GxsGroupDialog::GxsGroupDialog(TokenQueue* tokenQueue, QWidget *parent, uint32_
|
||||
connect( ui.groupLogo, SIGNAL(clicked() ), this , SLOT(addGroupLogo()));
|
||||
connect( ui.addLogoButton, SIGNAL(clicked() ), this , SLOT(addGroupLogo()));
|
||||
|
||||
if (!ui.pubKeyShare_cb->isChecked()) {
|
||||
if (!ui.pubKeyShare_cb->isChecked())
|
||||
{
|
||||
ui.contactsdockWidget->hide();
|
||||
this->resize(this->size().width() - ui.contactsdockWidget->size().width(), this->size().height());
|
||||
}
|
||||
@ -74,32 +75,13 @@ GxsGroupDialog::GxsGroupDialog(TokenQueue* tokenQueue, QWidget *parent, uint32_
|
||||
ui.keyShareList->setModus(FriendSelectionWidget::MODUS_CHECK);
|
||||
ui.keyShareList->start();
|
||||
|
||||
|
||||
/* Setup Reasonable Defaults */
|
||||
|
||||
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 );
|
||||
|
||||
|
||||
uint32_t defaultsFlags = ( GXS_GROUP_DEFAULTS_DISTRIB_PUBLIC |
|
||||
GXS_GROUP_DEFAULTS_PUBLISH_THREADS |
|
||||
GXS_GROUP_DEFAULTS_PERSONAL_IFNOPUB |
|
||||
GXS_GROUP_DEFAULTS_COMMENTS_YES |
|
||||
0);
|
||||
|
||||
setFlags(enabledFlags, defaultsFlags);
|
||||
setMode(mode);
|
||||
}
|
||||
|
||||
void GxsGroupDialog::setFlags(uint32_t enabledFlags, uint32_t defaultsFlags)
|
||||
{
|
||||
mEnabledFlags = enabledFlags;
|
||||
mDefaultsFlags = defaultsFlags;
|
||||
GxsGroupDialog::GxsGroupDialog(const RsGroupMetaData &grpMeta, uint32_t mode, QWidget *parent)
|
||||
: QDialog(parent), mMode(mode), mGrpMeta(grpMeta) {
|
||||
|
||||
}
|
||||
|
||||
void GxsGroupDialog::setMode(uint32_t mode)
|
||||
@ -120,7 +102,7 @@ void GxsGroupDialog::setMode(uint32_t mode)
|
||||
ui.createButton->setText(tr("Close"));
|
||||
}
|
||||
break;
|
||||
|
||||
//TODO
|
||||
// case GXS_GROUP_DIALOG_EDIT_MODE:
|
||||
// {
|
||||
// ui.createButton->setText(tr("Submit Changes"));
|
||||
@ -269,17 +251,6 @@ void GxsGroupDialog::newGroup()
|
||||
|
||||
}
|
||||
|
||||
|
||||
void GxsGroupDialog::loadExistingGroupMetaData(const RsGroupMetaData &meta)
|
||||
{
|
||||
/* should set stuff - according to parameters */
|
||||
setGroupSignFlags(meta.mSignFlags);
|
||||
ui.groupName->setText(QString::fromUtf8(meta.mGroupName.c_str()));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void GxsGroupDialog::submitGroup()
|
||||
{
|
||||
std::cerr << "GxsGroupDialog::submitGroup()";
|
||||
|
@ -55,6 +55,8 @@ public:
|
||||
};
|
||||
|
||||
|
||||
/*** Group flags affect what is visually enabled that gets input into the grpMeta ***/
|
||||
|
||||
#define GXS_GROUP_FLAGS_ICON 0x00000001
|
||||
#define GXS_GROUP_FLAGS_DESCRIPTION 0x00000002
|
||||
#define GXS_GROUP_FLAGS_DISTRIBUTION 0x00000004
|
||||
@ -65,6 +67,10 @@ public:
|
||||
|
||||
#define GXS_GROUP_FLAGS_EXTRA 0x00000100
|
||||
|
||||
/*** Default flags are used to determine privacy of group, signatures required ***
|
||||
*** whether publish or id and whether comments are allowed or not ***/
|
||||
|
||||
|
||||
#define GXS_GROUP_DEFAULTS_DISTRIB_MASK 0x0000000f
|
||||
#define GXS_GROUP_DEFAULTS_PUBLISH_MASK 0x000000f0
|
||||
#define GXS_GROUP_DEFAULTS_PERSONAL_MASK 0x00000f00
|
||||
@ -105,27 +111,29 @@ public:
|
||||
*/
|
||||
class GxsGroupDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
/*!
|
||||
*
|
||||
* @param tokenQueue This should be the token service of the services Dialog \n
|
||||
* Constructs a GxsGroupDialog for creating group
|
||||
* @param tokenQueue This should be the TokenQueue of the (parent) service
|
||||
* in order to receive acknowledgement of group creation, if set to NULL with create mode \n
|
||||
* creation will not happen
|
||||
* @param enableFlags This determines what options are enabled such as Icon, Description, publish type and key sharing
|
||||
* @param defaultFlags This deter
|
||||
* @param parent The parent dialog
|
||||
* @param mode
|
||||
*/
|
||||
GxsGroupDialog(TokenQueue* tokenQueue, QWidget *parent = NULL, uint32_t mode = GXS_GROUP_DIALOG_SHOW_MODE);
|
||||
GxsGroupDialog(TokenQueue* tokenQueue, uint32_t enableFlags, uint16_t defaultFlags, QWidget *parent = NULL);
|
||||
|
||||
/*!
|
||||
*
|
||||
* @param enabledFlags This determines what options are enabled
|
||||
* @param readonlyFlags This determines what is modifiable is particularly relevant to what mode the
|
||||
* @param defaultFlags
|
||||
* Contructs a GxsGroupDialog for display a group or editing
|
||||
* @param grpMeta This is used to fill out the dialog
|
||||
* @param mode This determines whether the dialog starts in show or edit mode (Edit not supported yet)
|
||||
* @param parent
|
||||
*/
|
||||
void setFlags(uint32_t enabledFlags, uint32_t defaultFlags);
|
||||
GxsGroupDialog(const RsGroupMetaData& grpMeta, uint32_t mode = GXS_GROUP_DIALOG_SHOW_MODE, QWidget *parent = NULL);
|
||||
|
||||
private:
|
||||
void newGroup();
|
||||
@ -134,8 +142,8 @@ private:
|
||||
// Functions that can be overloaded for specific stuff.
|
||||
|
||||
protected slots:
|
||||
void submitGroup();
|
||||
void addGroupLogo();
|
||||
void submitGroup();
|
||||
void addGroupLogo();
|
||||
|
||||
protected:
|
||||
|
||||
@ -150,7 +158,7 @@ protected:
|
||||
/*!
|
||||
* This should return a group logo \n
|
||||
* Will be called when GxsGroupDialog is initialised in show mode
|
||||
*
|
||||
* @return The logo for the service
|
||||
*/
|
||||
virtual QPixmap service_getLogo() = 0;
|
||||
|
||||
@ -160,18 +168,6 @@ protected:
|
||||
*/
|
||||
virtual QString service_getDescription() = 0;
|
||||
|
||||
/*!
|
||||
* Used in show mode, returns a meta type
|
||||
* @return the meta of existing grpMeta
|
||||
*/
|
||||
virtual RsGroupMetaData service_getMeta() = 0;
|
||||
|
||||
/*!
|
||||
* Loads meta data for group to GUI dialog
|
||||
* @param meta the meta loaded fir group
|
||||
*/
|
||||
void loadExistingGroupMetaData(const RsGroupMetaData &meta);
|
||||
|
||||
|
||||
private slots:
|
||||
|
||||
@ -196,6 +192,7 @@ private:
|
||||
std::list<std::string> mShareList;
|
||||
QPixmap picture;
|
||||
TokenQueue *mTokenQueue;
|
||||
RsGroupMetaData mGrpMeta;
|
||||
|
||||
uint32_t mMode;
|
||||
uint32_t mEnabledFlags;
|
||||
|
@ -1,26 +0,0 @@
|
||||
#include "GxsViewGroup.h"
|
||||
#include "ui_GxsViewGroup.h"
|
||||
|
||||
GxsViewGroup::GxsViewGroup(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::GxsViewGroup)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
GxsViewGroup::~GxsViewGroup()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void GxsViewGroup::changeEvent(QEvent *e)
|
||||
{
|
||||
QWidget::changeEvent(e);
|
||||
switch (e->type()) {
|
||||
case QEvent::LanguageChange:
|
||||
ui->retranslateUi(this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
#ifndef GXSVIEWGROUP_H
|
||||
#define GXSVIEWGROUP_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class GxsViewGroup;
|
||||
}
|
||||
|
||||
class GxsViewGroup : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
GxsViewGroup(QWidget *parent = 0);
|
||||
~GxsViewGroup();
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
Ui::GxsViewGroup *ui;
|
||||
};
|
||||
|
||||
#endif // GXSVIEWGROUP_H
|
@ -1,21 +0,0 @@
|
||||
<ui version="4.0">
|
||||
<author/>
|
||||
<comment/>
|
||||
<exportmacro/>
|
||||
<class>GxsViewGroup</class>
|
||||
<widget class="QWidget" name="GxsViewGroup">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
</widget>
|
||||
<pixmapfunction/>
|
||||
<connections/>
|
||||
</ui>
|
@ -97,9 +97,9 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WFlags flags)
|
||||
ui.stackPages->add(postedDialog = new PostedDialog(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_LIBRARY), tr("Posted Links"), grp));
|
||||
|
||||
WikiDialog *wikiDialog = NULL;
|
||||
ui.stackPages->add(wikiDialog = new WikiDialog(ui.stackPages),
|
||||
createPageAction(QIcon(IMAGE_LIBRARY), tr("Wiki Pages"), grp));
|
||||
// WikiDialog *wikiDialog = NULL;
|
||||
// ui.stackPages->add(wikiDialog = new WikiDialog(ui.stackPages),
|
||||
// createPageAction(QIcon(IMAGE_LIBRARY), tr("Wiki Pages"), grp));
|
||||
|
||||
// THESE HAVE TO BE CONVERTED TO VEG FORMAT
|
||||
#if USE_VEG_SERVICE
|
||||
|
Loading…
x
Reference in New Issue
Block a user