Significant changes to the GUI to introduce new display style.

* Completed much of General Msg Dialog.
 * Completed much of ChannelFeed.
 * Added Channel Messages to News Feed.
 * Connected Blog/Channels to GeneralMsgDialog.
 * Improved SubFileItem display.
 * Completed ChanGroup/Menu/MsgItems.
 * Added SubDestItem for use in GeneralMsgDialog.
 * Generalise CreateForum to cover Channels as well.
 * Restricted CreateForum to public forums/private channels.
 * Demo of Drag-N-Drop Files for Linux (filesystem->GenMsgDialog)
 * Updates to rsiface stuff (blog/channels/types)



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@621 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-06-24 04:36:45 +00:00
parent b9ccbd54e8
commit c6a595c7db
26 changed files with 1489 additions and 206 deletions

View file

@ -23,10 +23,11 @@
#include "CreateForum.h"
#include "rsiface/rsforums.h"
#include "rsiface/rschannels.h"
/** Constructor */
CreateForum::CreateForum(QWidget *parent)
: QWidget(parent)
CreateForum::CreateForum(QWidget *parent, bool isForum)
: QWidget(parent), mIsForum(isForum)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
@ -42,40 +43,74 @@ CreateForum::CreateForum(QWidget *parent)
void CreateForum::newForum()
{
/* clear all */
ui.forumTypePublic->setChecked(true);
ui.forumMsgAnon->setChecked(true);
if (mIsForum)
{
/* enforce Public for the moment */
ui.typePublic->setChecked(true);
ui.typePrivate->setEnabled(false);
ui.typeEncrypted->setEnabled(false);
ui.msgAnon->setChecked(true);
ui.msgAuth->setEnabled(false);
}
else
{
/* enforce Private for the moment */
ui.typePrivate->setChecked(true);
ui.typePublic->setEnabled(false);
ui.typeEncrypted->setEnabled(false);
ui.msgAnon->setChecked(true);
ui.msgAuth->setEnabled(false);
ui.msgGroupBox->hide();
}
}
void CreateForum::createForum()
{
QString name = ui.forumName->text();
QString desc = ui.forumDesc->toHtml();
QString desc = ui.forumDesc->toPlainText(); //toHtml();
uint32_t flags = 0;
if (ui.forumTypePublic->isChecked())
if (ui.typePublic->isChecked())
{
flags |= RS_DISTRIB_PUBLIC;
}
else if (ui.forumTypePrivate->isChecked())
else if (ui.typePrivate->isChecked())
{
flags |= RS_DISTRIB_PRIVATE;
}
else if (ui.forumTypeEncrypted->isChecked())
else if (ui.typeEncrypted->isChecked())
{
flags |= RS_DISTRIB_ENCRYPTED;
}
if (ui.forumMsgAuth->isChecked())
if (ui.msgAuth->isChecked())
{
flags |= RS_DISTRIB_AUTHEN_REQ;
}
else if (ui.forumMsgAnon->isChecked())
else if (ui.msgAnon->isChecked())
{
flags |= RS_DISTRIB_AUTHEN_ANON;
}
rsForums->createForum(name.toStdWString(), desc.toStdWString(), flags);
if (mIsForum)
{
if (rsForums)
{
rsForums->createForum(name.toStdWString(), desc.toStdWString(), flags);
}
}
else
{
if (rsChannels)
{
rsChannels->createChannel(name.toStdWString(), desc.toStdWString(), flags);
}
}
close();
return;

View file

@ -32,7 +32,7 @@ class CreateForum : public QWidget
Q_OBJECT
public:
CreateForum(QWidget *parent = 0);
CreateForum(QWidget *parent = 0, bool isForum = true);
void newForum(); /* cleanup */
@ -46,6 +46,8 @@ private:
/** Qt Designer generated object */
Ui::CreateForum ui;
bool mIsForum;
};
#endif

View file

@ -510,7 +510,7 @@
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>Forum Name</string>
<string>Name</string>
</property>
</widget>
</item>
@ -524,7 +524,7 @@
<item>
<widget class="QLabel" name="label_5" >
<property name="text" >
<string>Forum Description</string>
<string>Description</string>
</property>
</widget>
</item>
@ -534,29 +534,29 @@
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2" >
<widget class="QGroupBox" name="tyoeGroupBox" >
<property name="title" >
<string>Forum Type:</string>
<string>Type:</string>
</property>
<layout class="QVBoxLayout" >
<item>
<widget class="QRadioButton" name="forumTypePublic" >
<widget class="QRadioButton" name="typePublic" >
<property name="text" >
<string>Public Forum (Shared Publish Key)</string>
<string>Public - Anyone can read and publish (Shared Publish Key)</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="forumTypePrivate" >
<widget class="QRadioButton" name="typePrivate" >
<property name="text" >
<string>Private Forum (Private Publish Key)</string>
<string>Restricted - Anyone can read, limited publishing (Private Publish Key)</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="forumTypeEncrypted" >
<widget class="QRadioButton" name="typeEncrypted" >
<property name="text" >
<string>Encrypted Forum (Private Publish Key required to view Messages)</string>
<string>Private - (Private Publish Key required to view Messages)</string>
</property>
</widget>
</item>
@ -564,20 +564,20 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox" >
<widget class="QGroupBox" name="msgGroupBox" >
<property name="title" >
<string>Allowed Messages</string>
</property>
<layout class="QVBoxLayout" >
<item>
<widget class="QRadioButton" name="forumMsgAuth" >
<widget class="QRadioButton" name="msgAuth" >
<property name="text" >
<string>Authemticated Messages</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="forumMsgAnon" >
<widget class="QRadioButton" name="msgAnon" >
<property name="text" >
<string>Anonymous Messages</string>
</property>
@ -604,7 +604,7 @@
<item>
<widget class="QPushButton" name="cancelButton" >
<property name="text" >
<string>Cancel Forum</string>
<string>Cancel</string>
</property>
</widget>
</item>
@ -624,7 +624,7 @@
<item>
<widget class="QPushButton" name="createButton" >
<property name="text" >
<string>Create Forum</string>
<string>Create</string>
</property>
<property name="default" >
<bool>true</bool>