1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-21 10:47:16 +01:00

bugfix 2561,2533

This commit is contained in:
2008-05-17 01:42:12 +00:00
parent 9ff519669b
commit b8502039ed
3 changed files with 40 additions and 30 deletions

View File

@ -226,9 +226,9 @@ void FWWindow::showSub(ProjectPanel *projectW)
m_space->addSubWindow(sub);
QIcon p(":Icons/Firewall/icon-tree");
sub->setWindowIcon(p);
if (projectW->getRCS()!=NULL)
{
QString FileName = projectW->getRCS()->getFileName();
// if (projectW->getRCS()!=NULL)
// {
//QString FileName = projectW->getRCS()->getFileName();
if (st->getInt("Window/maximized")==0)
{
sub->showMaximized();
@ -236,13 +236,14 @@ void FWWindow::showSub(ProjectPanel *projectW)
else
{
sub->show();
projectW->loadState();
//if (projectW->getRCS()!=NULL)
projectW->loadState();
}
}
else
{
sub->showMaximized();
}
// }
// else
// {
// sub->showMaximized();
// }
}

View File

@ -124,10 +124,13 @@ void NetworkDialogIPv6::validate(bool *res)
tr("&Continue"), 0, 0,
0 );
}
try
bool ok = false;
int range =m_dialog->netmask->text().toInt(&ok);
if (ok&&range>=0&&range<128)
{
Inet6Addr( m_dialog->netmask->text().toLatin1().constData() );
} catch (FWException &ex)
}
else
{
*res=false;
QMessageBox::critical(this, "Firewall Builder",

View File

@ -3187,7 +3187,7 @@ void ProjectPanel::findWhereUsed(FWObject * obj)
}
void ProjectPanel::showEvent( QShowEvent *ev)
{
{ if (rcs!=NULL)
if (!firstLoad)
{
firstLoad=true ;
@ -3260,6 +3260,16 @@ QString ProjectPanel::getFileName()
void ProjectPanel::saveState ()
{
if (isMaximized ())
{
st->setInt("Window/maximized",0);
}
else
{
st->setInt("Window/maximized",1);
}
if (rcs!=NULL)
{
QString FileName = rcs->getFileName();
@ -3270,15 +3280,8 @@ void ProjectPanel::saveState ()
st->setInt("Window/"+FileName+"/width",mdiWindow->width ());
st->setInt("Window/"+FileName+"/height",mdiWindow->height ());
}
if (isMaximized ())
{
st->setInt("Window/maximized",0);
}
else
{
st->setInt("Window/maximized",1);
}
}
oe->hide();
fd->hide();
@ -3292,12 +3295,15 @@ void ProjectPanel::saveState ()
arg = QString("%1,%2").arg(sl[0]).arg(sl[1]);
if (sl[0] || sl[1])
st->setStr("Layout/ObjInfoSplitter"+getFileName(), arg );
}
}
void ProjectPanel::loadState ()
{
QString FileName = rcs->getFileName();
QString FileName ;
if (rcs!=NULL)
FileName =rcs->getFileName();
if (FileName!="")
{
if (!mdiWindow->isMaximized ())
@ -3320,14 +3326,14 @@ void ProjectPanel::loadState ()
if (FileName=="")
{
if (!mdiWindow->isMaximized ())
if (st->getInt("Window/maximized")!=0)
{
int y = st->getInt("Window/"+FileName+"/y");
int y2 = st->getInt("Window/"+FileName+"/y");
firstResize=true ;
int y = st->getInt("Window/"+FileName+"/y");
int y2 = st->getInt("Window/"+FileName+"/y");
firstResize=true ;
//mdiWindow->resize (600,400);
//mdiWindow->resize (600,400);
mdiWindow->setGeometry (10,10,600,600);
mdiWindow->setGeometry (10,10,600,600);
//mdiWindow->resize (600,800);
}
}
@ -3346,7 +3352,7 @@ void ProjectPanel::resizeEvent ( QResizeEvent * event )
{
loadState();
}
if (firstResize&&rcs!=NULL)
if (firstResize)
{
saveState();
}