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
+10 -9
View File
@@ -226,9 +226,9 @@ void FWWindow::showSub(ProjectPanel *projectW)
m_space->addSubWindow(sub); m_space->addSubWindow(sub);
QIcon p(":Icons/Firewall/icon-tree"); QIcon p(":Icons/Firewall/icon-tree");
sub->setWindowIcon(p); sub->setWindowIcon(p);
if (projectW->getRCS()!=NULL) // if (projectW->getRCS()!=NULL)
{ // {
QString FileName = projectW->getRCS()->getFileName(); //QString FileName = projectW->getRCS()->getFileName();
if (st->getInt("Window/maximized")==0) if (st->getInt("Window/maximized")==0)
{ {
sub->showMaximized(); sub->showMaximized();
@@ -236,13 +236,14 @@ void FWWindow::showSub(ProjectPanel *projectW)
else else
{ {
sub->show(); sub->show();
projectW->loadState(); //if (projectW->getRCS()!=NULL)
projectW->loadState();
} }
} // }
else // else
{ // {
sub->showMaximized(); // sub->showMaximized();
} // }
} }
+6 -3
View File
@@ -124,10 +124,13 @@ void NetworkDialogIPv6::validate(bool *res)
tr("&Continue"), 0, 0, tr("&Continue"), 0, 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; *res=false;
QMessageBox::critical(this, "Firewall Builder", QMessageBox::critical(this, "Firewall Builder",
+23 -17
View File
@@ -3187,7 +3187,7 @@ void ProjectPanel::findWhereUsed(FWObject * obj)
} }
void ProjectPanel::showEvent( QShowEvent *ev) void ProjectPanel::showEvent( QShowEvent *ev)
{ { if (rcs!=NULL)
if (!firstLoad) if (!firstLoad)
{ {
firstLoad=true ; firstLoad=true ;
@@ -3260,6 +3260,16 @@ QString ProjectPanel::getFileName()
void ProjectPanel::saveState () void ProjectPanel::saveState ()
{ {
if (isMaximized ())
{
st->setInt("Window/maximized",0);
}
else
{
st->setInt("Window/maximized",1);
}
if (rcs!=NULL) if (rcs!=NULL)
{ {
QString FileName = rcs->getFileName(); QString FileName = rcs->getFileName();
@@ -3270,15 +3280,8 @@ void ProjectPanel::saveState ()
st->setInt("Window/"+FileName+"/width",mdiWindow->width ()); st->setInt("Window/"+FileName+"/width",mdiWindow->width ());
st->setInt("Window/"+FileName+"/height",mdiWindow->height ()); st->setInt("Window/"+FileName+"/height",mdiWindow->height ());
} }
if (isMaximized ())
{
st->setInt("Window/maximized",0);
}
else
{
st->setInt("Window/maximized",1);
}
}
oe->hide(); oe->hide();
fd->hide(); fd->hide();
@@ -3293,11 +3296,14 @@ void ProjectPanel::saveState ()
if (sl[0] || sl[1]) if (sl[0] || sl[1])
st->setStr("Layout/ObjInfoSplitter"+getFileName(), arg ); st->setStr("Layout/ObjInfoSplitter"+getFileName(), arg );
}
} }
void ProjectPanel::loadState () void ProjectPanel::loadState ()
{ {
QString FileName = rcs->getFileName(); QString FileName ;
if (rcs!=NULL)
FileName =rcs->getFileName();
if (FileName!="") if (FileName!="")
{ {
if (!mdiWindow->isMaximized ()) if (!mdiWindow->isMaximized ())
@@ -3320,14 +3326,14 @@ void ProjectPanel::loadState ()
if (FileName=="") if (FileName=="")
{ {
if (!mdiWindow->isMaximized ()) if (st->getInt("Window/maximized")!=0)
{ {
int y = st->getInt("Window/"+FileName+"/y"); int y = st->getInt("Window/"+FileName+"/y");
int y2 = st->getInt("Window/"+FileName+"/y"); int y2 = st->getInt("Window/"+FileName+"/y");
firstResize=true ; firstResize=true ;
//mdiWindow->resize (600,400); //mdiWindow->resize (600,400);
//mdiWindow->resize (600,400); //mdiWindow->resize (600,400);
mdiWindow->setGeometry (10,10,600,600); mdiWindow->setGeometry (10,10,600,600);
//mdiWindow->resize (600,800); //mdiWindow->resize (600,800);
} }
} }
@@ -3346,7 +3352,7 @@ void ProjectPanel::resizeEvent ( QResizeEvent * event )
{ {
loadState(); loadState();
} }
if (firstResize&&rcs!=NULL) if (firstResize)
{ {
saveState(); saveState();
} }