mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-22 03:07:20 +01:00
* utils.cpp (validateName): fixed #1751 "Dont allow interface names to be blank". The GUI should not allow the name of any
> object to be blank.
This commit is contained in:
parent
5b9f34a274
commit
b5c6430a8e
@ -1,3 +1,9 @@
|
||||
2010-09-30 Vadim Kurland <vadim@vk.crocodile.org>
|
||||
|
||||
* utils.cpp (validateName): fixed #1751 "Don't allow interface
|
||||
names to be blank". The GUI should not allow the name of any
|
||||
object to be blank.
|
||||
|
||||
2010-09-29 Vadim Kurland <vadim@vk.crocodile.org>
|
||||
|
||||
* ProjectPanel.cpp (ProjectPanel::inspect): fixed #1718 "Inspect
|
||||
|
||||
@ -225,6 +225,23 @@ bool isTreeReadWrite(QWidget *parent, FWObject *obj)
|
||||
*/
|
||||
bool validateName(QWidget *parent, FWObject *obj, const QString &newname)
|
||||
{
|
||||
if (newname.isEmpty())
|
||||
{
|
||||
// show warning dialog only if app has focus
|
||||
if (QApplication::focusWidget() != NULL)
|
||||
{
|
||||
parent->blockSignals(true);
|
||||
|
||||
QMessageBox::warning(
|
||||
parent, "Firewall Builder",
|
||||
QObject::tr("Object name should not be blank"),
|
||||
QObject::tr("&Continue"), NULL, NULL, 0, 2 );
|
||||
|
||||
parent->blockSignals(false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
FWObject *p = obj->getParent();
|
||||
for (FWObject::iterator i=p->begin(); i!=p->end(); ++i)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user