diff --git a/retroshare-gui/src/gui/forums/CreateForum.cpp b/retroshare-gui/src/gui/forums/CreateForum.cpp index 6b8463940..a08657205 100644 --- a/retroshare-gui/src/gui/forums/CreateForum.cpp +++ b/retroshare-gui/src/gui/forums/CreateForum.cpp @@ -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); @@ -37,9 +36,6 @@ CreateForum::CreateForum(QWidget *parent, bool isForum) // connect up the buttons. 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(); @@ -57,34 +53,17 @@ void CreateForum::show() void CreateForum::newForum() { + /* enforce Public for the moment */ + ui.typePublic->setChecked(true); - if (mIsForum) - { - /* enforce Public for the moment */ - ui.typePublic->setChecked(true); + ui.typePrivate->setEnabled(false); + ui.typeEncrypted->setEnabled(false); - ui.typePrivate->setEnabled(false); - ui.typeEncrypted->setEnabled(false); + ui.msgAnon->setChecked(true); + //ui.msgAuth->setEnabled(false); - 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(); - } + ui.forumName->clear(); + ui.forumDesc->clear(); } void CreateForum::createForum() @@ -125,19 +104,9 @@ void CreateForum::createForum() flags |= RS_DISTRIB_AUTHEN_ANON; } - if (mIsForum) + if (rsForums) { - if (rsForums) - { - rsForums->createForum(name.toStdWString(), desc.toStdWString(), flags); - } - } - else - { - if (rsChannels) - { - rsChannels->createChannel(name.toStdWString(), desc.toStdWString(), flags); - } + rsForums->createForum(name.toStdWString(), desc.toStdWString(), flags); } close(); @@ -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. - - } -} diff --git a/retroshare-gui/src/gui/forums/CreateForum.h b/retroshare-gui/src/gui/forums/CreateForum.h index e91b265da..e418b701b 100644 --- a/retroshare-gui/src/gui/forums/CreateForum.h +++ b/retroshare-gui/src/gui/forums/CreateForum.h @@ -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