From 2a6381db2daac3a46e8c528ecfed857308321019 Mon Sep 17 00:00:00 2001 From: defnax Date: Fri, 28 Nov 2008 01:49:17 +0000 Subject: [PATCH] * 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 --- retroshare-gui/src/gui/forums/CreateForum.cpp | 20 +++++++++++++++++++ retroshare-gui/src/gui/forums/CreateForum.h | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/retroshare-gui/src/gui/forums/CreateForum.cpp b/retroshare-gui/src/gui/forums/CreateForum.cpp index e8edb58ef..855789cc3 100644 --- a/retroshare-gui/src/gui/forums/CreateForum.cpp +++ b/retroshare-gui/src/gui/forums/CreateForum.cpp @@ -19,6 +19,7 @@ * Boston, MA 02110-1301, USA. ****************************************************************/ +#include #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; diff --git a/retroshare-gui/src/gui/forums/CreateForum.h b/retroshare-gui/src/gui/forums/CreateForum.h index 4c0abaad0..db110de3b 100644 --- a/retroshare-gui/src/gui/forums/CreateForum.h +++ b/retroshare-gui/src/gui/forums/CreateForum.h @@ -36,6 +36,10 @@ public: void newForum(); /* cleanup */ +public slots: + /** Overloaded QWidget.show */ + void show(); + private slots: /* actions to take.... */