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:
chrisparker126 2010-05-02 12:21:20 +00:00
parent bfa2da61f5
commit 352c4559ad
2 changed files with 13 additions and 75 deletions

View File

@ -25,11 +25,10 @@
#include "CreateForum.h" #include "CreateForum.h"
#include "rsiface/rsforums.h" #include "rsiface/rsforums.h"
#include "rsiface/rschannels.h"
/** Constructor */ /** Constructor */
CreateForum::CreateForum(QWidget *parent, bool isForum) CreateForum::CreateForum(QWidget *parent)
: QDialog(parent), mIsForum(isForum) : QDialog(parent)
{ {
/* Invoke the Qt Designer generated object setup routine */ /* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this); ui.setupUi(this);
@ -38,9 +37,6 @@ CreateForum::CreateForum(QWidget *parent, bool isForum)
connect( ui.cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancelForum( ) ) ); connect( ui.cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancelForum( ) ) );
connect( ui.createButton, SIGNAL( clicked ( bool ) ), this, SLOT( createForum( ) ) ); 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(); newForum();
} }
@ -56,9 +52,6 @@ void CreateForum::show()
void CreateForum::newForum() void CreateForum::newForum()
{
if (mIsForum)
{ {
/* enforce Public for the moment */ /* enforce Public for the moment */
ui.typePublic->setChecked(true); ui.typePublic->setChecked(true);
@ -68,24 +61,10 @@ void CreateForum::newForum()
ui.msgAnon->setChecked(true); ui.msgAnon->setChecked(true);
//ui.msgAuth->setEnabled(false); //ui.msgAuth->setEnabled(false);
ui.groupBoxLogo->hide();
ui.forumName->clear(); ui.forumName->clear();
ui.forumDesc->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() void CreateForum::createForum()
{ {
@ -125,20 +104,10 @@ void CreateForum::createForum()
flags |= RS_DISTRIB_AUTHEN_ANON; flags |= RS_DISTRIB_AUTHEN_ANON;
} }
if (mIsForum)
{
if (rsForums) if (rsForums)
{ {
rsForums->createForum(name.toStdWString(), desc.toStdWString(), flags); rsForums->createForum(name.toStdWString(), desc.toStdWString(), flags);
} }
}
else
{
if (rsChannels)
{
rsChannels->createChannel(name.toStdWString(), desc.toStdWString(), flags);
}
}
close(); close();
return; return;
@ -151,27 +120,3 @@ void CreateForum::cancelForum()
return; 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.
}
}

View File

@ -32,7 +32,7 @@ class CreateForum : public QDialog
Q_OBJECT Q_OBJECT
public: public:
CreateForum(QWidget *parent = 0, bool isForum = true); CreateForum(QWidget *parent = 0);
void newForum(); /* cleanup */ void newForum(); /* cleanup */
@ -51,13 +51,6 @@ private slots:
void createForum(); void createForum();
void cancelForum(); void cancelForum();
void addChannelLogo();
private:
bool mIsForum;
}; };
#endif #endif