1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-23 03:37:15 +01:00

Bug 2398 fixed

This commit is contained in:
2008-03-06 18:05:12 +00:00
parent 869cae5039
commit 7333ca5c6c
4 changed files with 21 additions and 11 deletions

View File

@ -172,7 +172,8 @@ FWWindow::FWWindow(): m_space(0),
m_space = new QMdiArea(this);
setCentralWidget(m_space);
newProjectPanel();
ProjectPanel *proj = newProjectPanel();
showSub(proj);
setSafeMode(false);
setStartupFileName("");
@ -209,19 +210,23 @@ FWWindow::~FWWindow()
ProjectPanel *FWWindow::newProjectPanel()
{
QMdiSubWindow *sub = new QMdiSubWindow;
ProjectPanel *projectW = new ProjectPanel(m_space);
projectW->initMain(this);
return projectW;
}
void FWWindow::showSub(ProjectPanel *projectW)
{
QMdiSubWindow *sub = new QMdiSubWindow;
sub->setWidget(projectW);
sub->setAttribute(Qt::WA_DeleteOnClose);
m_space->addSubWindow(sub);
sub->showMaximized();
QIcon p(":Icons/Firewall/icon-tree");
sub->setWindowIcon(p);
return projectW;
}
ProjectPanel* FWWindow::activeProject()
{
QMdiSubWindow *w = m_space->currentSubWindow();
@ -304,6 +309,7 @@ void FWWindow::fileNew()
{
ProjectPanel *proj = newProjectPanel();
proj->fileNew();
showSub(proj);
}
void FWWindow::addToRCSActionSetEn(bool en)
@ -329,7 +335,8 @@ void FWWindow::fileSaveActionSetEn(bool en)
void FWWindow::fileOpen()
{
ProjectPanel *proj = newProjectPanel();
proj->fileOpen();
if (proj->fileOpen())
showSub(proj);
}
void FWWindow::fileClose()

View File

@ -76,6 +76,7 @@ class FWWindow : public QMainWindow {
void clearFirewallTabs();
ProjectPanel* activeProject();
ProjectPanel *newProjectPanel();
void showSub(ProjectPanel *projectW);
public slots:
virtual void search();

View File

@ -932,7 +932,7 @@ void ProjectPanel::fileNew()
mainW->fileSaveActionSetEn( !rcs->isRO() && !rcs->isTemp() );
}
void ProjectPanel::fileOpen()
bool ProjectPanel::fileOpen()
{
if (fwbdebug) qDebug("ProjectPanel::fileOpen(): start");
@ -940,13 +940,13 @@ void ProjectPanel::fileOpen()
RCSFilePreview fp(this);
if ( fd.exec() != QDialog::Accepted )
return;
return false;
bool hasRCS = fp.showFileRLog( fd.selectedFiles()[0] );
if ( (!hasRCS) || (fp.exec() == QDialog::Accepted) )
{
if (!saveIfModified() || !checkin(true)) return;
if (!saveIfModified() || !checkin(true)) return false;
if (!systemFile && rcs!=NULL) fileClose();
//try to get simple rcs instance from RCS preview
@ -959,7 +959,7 @@ void ProjectPanel::fileOpen()
//if RCS isn't still formed, it's an error
if (rcs==NULL)
return;
return false;
/***********************************************************************
* TODO : add an option "RCS support"
@ -975,7 +975,7 @@ void ProjectPanel::fileOpen()
{
/* if there was an exception, abort operation. E.g. RCS::co may throw
* exception */
return;
return false;
}
/***********************************************************************/
@ -983,7 +983,9 @@ void ProjectPanel::fileOpen()
showFirewalls( true );
if (rcs->isTemp()) unlink(rcs->getFileName().toLatin1().constData());
return true;
}
return false;
}
void ProjectPanel::fileClose()

View File

@ -274,7 +274,7 @@ public:
virtual void fileProp();
virtual void fileNew();
virtual void fileOpen();
virtual bool fileOpen();
virtual void fileClose();
virtual void fileSave();