* Added a function to not allow to create a Forum/Channel without a Name.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@848 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2008-11-28 01:49:17 +00:00
parent e03d808ad3
commit 2a6381db2d
2 changed files with 24 additions and 0 deletions

View File

@ -19,6 +19,7 @@
* Boston, MA 02110-1301, USA.
****************************************************************/
#include <QMessageBox>
#include "CreateForum.h"
@ -40,6 +41,15 @@ CreateForum::CreateForum(QWidget *parent, bool isForum)
}
void CreateForum::show()
{
//loadSettings();
if(!this->isVisible()) {
QWidget::show();
}
}
void CreateForum::newForum()
{
@ -75,6 +85,16 @@ void CreateForum::createForum()
QString desc = ui.forumDesc->toPlainText(); //toHtml();
uint32_t flags = 0;
if(name.isEmpty())
{ /* error message */
int ret = QMessageBox::warning(this, tr("RetroShare"),
tr("Please add a Name"),
QMessageBox::Ok, QMessageBox::Ok);
return; //Don't add a empty name!!
}
else
if (ui.typePublic->isChecked())
{
flags |= RS_DISTRIB_PUBLIC;

View File

@ -36,6 +36,10 @@ public:
void newForum(); /* cleanup */
public slots:
/** Overloaded QWidget.show */
void show();
private slots:
/* actions to take.... */