mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
removed support for channels
- this is now explicitly only for forums git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2829 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
bfa2da61f5
commit
352c4559ad
@ -25,11 +25,10 @@
|
||||
#include "CreateForum.h"
|
||||
|
||||
#include "rsiface/rsforums.h"
|
||||
#include "rsiface/rschannels.h"
|
||||
|
||||
/** Constructor */
|
||||
CreateForum::CreateForum(QWidget *parent, bool isForum)
|
||||
: QDialog(parent), mIsForum(isForum)
|
||||
CreateForum::CreateForum(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
@ -38,9 +37,6 @@ CreateForum::CreateForum(QWidget *parent, bool isForum)
|
||||
connect( ui.cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancelForum( ) ) );
|
||||
connect( ui.createButton, SIGNAL( clicked ( bool ) ), this, SLOT( createForum( ) ) );
|
||||
|
||||
connect( ui.LogoButton, SIGNAL(clicked() ), this , SLOT(addChannelLogo()));
|
||||
connect( ui.ChannelLogoButton, SIGNAL(clicked() ), this , SLOT(addChannelLogo()));
|
||||
|
||||
newForum();
|
||||
|
||||
}
|
||||
@ -56,9 +52,6 @@ void CreateForum::show()
|
||||
|
||||
|
||||
void CreateForum::newForum()
|
||||
{
|
||||
|
||||
if (mIsForum)
|
||||
{
|
||||
/* enforce Public for the moment */
|
||||
ui.typePublic->setChecked(true);
|
||||
@ -68,24 +61,10 @@ void CreateForum::newForum()
|
||||
|
||||
ui.msgAnon->setChecked(true);
|
||||
//ui.msgAuth->setEnabled(false);
|
||||
ui.groupBoxLogo->hide();
|
||||
|
||||
ui.forumName->clear();
|
||||
ui.forumDesc->clear();
|
||||
}
|
||||
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()
|
||||
{
|
||||
@ -125,20 +104,10 @@ void CreateForum::createForum()
|
||||
flags |= RS_DISTRIB_AUTHEN_ANON;
|
||||
}
|
||||
|
||||
if (mIsForum)
|
||||
{
|
||||
if (rsForums)
|
||||
{
|
||||
rsForums->createForum(name.toStdWString(), desc.toStdWString(), flags);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rsChannels)
|
||||
{
|
||||
rsChannels->createChannel(name.toStdWString(), desc.toStdWString(), flags);
|
||||
}
|
||||
}
|
||||
|
||||
close();
|
||||
return;
|
||||
@ -151,27 +120,3 @@ void CreateForum::cancelForum()
|
||||
return;
|
||||
}
|
||||
|
||||
void CreateForum::addChannelLogo()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, "Load File", QDir::homePath(), "Pictures (*.png *.xpm *.jpg)");
|
||||
if(!fileName.isEmpty())
|
||||
{
|
||||
picture = QPixmap(fileName).scaled(64,64, Qt::IgnoreAspectRatio);
|
||||
|
||||
// to show the selected
|
||||
ui.ChannelLogoButton->setIcon(picture);
|
||||
|
||||
std::cerr << "Sending avatar image down the pipe" << std::endl ;
|
||||
|
||||
// send avatar down the pipe for other peers to get it.
|
||||
QByteArray ba;
|
||||
QBuffer buffer(&ba);
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
picture.save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
|
||||
std::cerr << "Image size = " << ba.size() << std::endl ;
|
||||
|
||||
//rsMsgs->setOwnAvatarData((unsigned char *)(ba.data()),ba.size()) ; // last char 0 included.
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ class CreateForum : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CreateForum(QWidget *parent = 0, bool isForum = true);
|
||||
CreateForum(QWidget *parent = 0);
|
||||
|
||||
void newForum(); /* cleanup */
|
||||
|
||||
@ -51,13 +51,6 @@ private slots:
|
||||
void createForum();
|
||||
void cancelForum();
|
||||
|
||||
void addChannelLogo();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
bool mIsForum;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user