mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-13 16:39:48 +02:00
Bug 2398 fixed
This commit is contained in:
+11
-4
@@ -172,7 +172,8 @@ FWWindow::FWWindow(): m_space(0),
|
|||||||
|
|
||||||
m_space = new QMdiArea(this);
|
m_space = new QMdiArea(this);
|
||||||
setCentralWidget(m_space);
|
setCentralWidget(m_space);
|
||||||
newProjectPanel();
|
ProjectPanel *proj = newProjectPanel();
|
||||||
|
showSub(proj);
|
||||||
|
|
||||||
setSafeMode(false);
|
setSafeMode(false);
|
||||||
setStartupFileName("");
|
setStartupFileName("");
|
||||||
@@ -209,17 +210,21 @@ FWWindow::~FWWindow()
|
|||||||
|
|
||||||
ProjectPanel *FWWindow::newProjectPanel()
|
ProjectPanel *FWWindow::newProjectPanel()
|
||||||
{
|
{
|
||||||
QMdiSubWindow *sub = new QMdiSubWindow;
|
|
||||||
ProjectPanel *projectW = new ProjectPanel(m_space);
|
ProjectPanel *projectW = new ProjectPanel(m_space);
|
||||||
projectW->initMain(this);
|
projectW->initMain(this);
|
||||||
|
|
||||||
|
return projectW;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FWWindow::showSub(ProjectPanel *projectW)
|
||||||
|
{
|
||||||
|
QMdiSubWindow *sub = new QMdiSubWindow;
|
||||||
sub->setWidget(projectW);
|
sub->setWidget(projectW);
|
||||||
sub->setAttribute(Qt::WA_DeleteOnClose);
|
sub->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
m_space->addSubWindow(sub);
|
m_space->addSubWindow(sub);
|
||||||
sub->showMaximized();
|
sub->showMaximized();
|
||||||
QIcon p(":Icons/Firewall/icon-tree");
|
QIcon p(":Icons/Firewall/icon-tree");
|
||||||
sub->setWindowIcon(p);
|
sub->setWindowIcon(p);
|
||||||
return projectW;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectPanel* FWWindow::activeProject()
|
ProjectPanel* FWWindow::activeProject()
|
||||||
@@ -304,6 +309,7 @@ void FWWindow::fileNew()
|
|||||||
{
|
{
|
||||||
ProjectPanel *proj = newProjectPanel();
|
ProjectPanel *proj = newProjectPanel();
|
||||||
proj->fileNew();
|
proj->fileNew();
|
||||||
|
showSub(proj);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FWWindow::addToRCSActionSetEn(bool en)
|
void FWWindow::addToRCSActionSetEn(bool en)
|
||||||
@@ -329,7 +335,8 @@ void FWWindow::fileSaveActionSetEn(bool en)
|
|||||||
void FWWindow::fileOpen()
|
void FWWindow::fileOpen()
|
||||||
{
|
{
|
||||||
ProjectPanel *proj = newProjectPanel();
|
ProjectPanel *proj = newProjectPanel();
|
||||||
proj->fileOpen();
|
if (proj->fileOpen())
|
||||||
|
showSub(proj);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FWWindow::fileClose()
|
void FWWindow::fileClose()
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ class FWWindow : public QMainWindow {
|
|||||||
void clearFirewallTabs();
|
void clearFirewallTabs();
|
||||||
ProjectPanel* activeProject();
|
ProjectPanel* activeProject();
|
||||||
ProjectPanel *newProjectPanel();
|
ProjectPanel *newProjectPanel();
|
||||||
|
void showSub(ProjectPanel *projectW);
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
virtual void search();
|
virtual void search();
|
||||||
|
|||||||
@@ -932,7 +932,7 @@ void ProjectPanel::fileNew()
|
|||||||
mainW->fileSaveActionSetEn( !rcs->isRO() && !rcs->isTemp() );
|
mainW->fileSaveActionSetEn( !rcs->isRO() && !rcs->isTemp() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectPanel::fileOpen()
|
bool ProjectPanel::fileOpen()
|
||||||
{
|
{
|
||||||
if (fwbdebug) qDebug("ProjectPanel::fileOpen(): start");
|
if (fwbdebug) qDebug("ProjectPanel::fileOpen(): start");
|
||||||
|
|
||||||
@@ -940,13 +940,13 @@ void ProjectPanel::fileOpen()
|
|||||||
RCSFilePreview fp(this);
|
RCSFilePreview fp(this);
|
||||||
|
|
||||||
if ( fd.exec() != QDialog::Accepted )
|
if ( fd.exec() != QDialog::Accepted )
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
bool hasRCS = fp.showFileRLog( fd.selectedFiles()[0] );
|
bool hasRCS = fp.showFileRLog( fd.selectedFiles()[0] );
|
||||||
|
|
||||||
if ( (!hasRCS) || (fp.exec() == QDialog::Accepted) )
|
if ( (!hasRCS) || (fp.exec() == QDialog::Accepted) )
|
||||||
{
|
{
|
||||||
if (!saveIfModified() || !checkin(true)) return;
|
if (!saveIfModified() || !checkin(true)) return false;
|
||||||
if (!systemFile && rcs!=NULL) fileClose();
|
if (!systemFile && rcs!=NULL) fileClose();
|
||||||
|
|
||||||
//try to get simple rcs instance from RCS preview
|
//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 isn't still formed, it's an error
|
||||||
if (rcs==NULL)
|
if (rcs==NULL)
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* TODO : add an option "RCS support"
|
* 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
|
/* if there was an exception, abort operation. E.g. RCS::co may throw
|
||||||
* exception */
|
* exception */
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
|
||||||
@@ -983,7 +983,9 @@ void ProjectPanel::fileOpen()
|
|||||||
showFirewalls( true );
|
showFirewalls( true );
|
||||||
|
|
||||||
if (rcs->isTemp()) unlink(rcs->getFileName().toLatin1().constData());
|
if (rcs->isTemp()) unlink(rcs->getFileName().toLatin1().constData());
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectPanel::fileClose()
|
void ProjectPanel::fileClose()
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ public:
|
|||||||
|
|
||||||
virtual void fileProp();
|
virtual void fileProp();
|
||||||
virtual void fileNew();
|
virtual void fileNew();
|
||||||
virtual void fileOpen();
|
virtual bool fileOpen();
|
||||||
|
|
||||||
virtual void fileClose();
|
virtual void fileClose();
|
||||||
virtual void fileSave();
|
virtual void fileSave();
|
||||||
|
|||||||
Reference in New Issue
Block a user