diff --git a/build_num b/build_num index cbb41e42e..8d20026c4 100644 --- a/build_num +++ b/build_num @@ -1 +1 @@ -#define BUILD_NUM 560 +#define BUILD_NUM 562 diff --git a/doc/ChangeLog b/doc/ChangeLog index 619246e7f..1fda0d72b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,23 @@ +2008-10-03 Vadim Kurland + + * ProjectPanel_file_ops.cpp (ProjectPanel::chooseNewFileName): + fixed bug #2144358 "Double check with 'save as'". The GUI used to + ask twice if user wants to overwrite the file in Save As operation + if file with given name already existed. + + * FWWindow.cpp (FWWindow::projectWindowClosed): fixed bug #2144114 + "fwbuilder * exits if the last object file is closed". The GUI + will not terminate after the last window is closed but instead + will just show empty main window. + + * fwbedit.cpp (main): fixed bug #2143894: "fwbedit list does not + show objects". Command "fwbedit list -f file" did not print + anything unless option "-F" was supplied. This change adds default + value for this option so that when it is missing, the command + prints object path. + + * fwbedit.1: fixed bug #2143961: a typo in the man page fwbedit.1 + 2008-10-02 Vadim Kurland * instDialog.cpp (instDialog::finishInstall): fixed bug #2125604: diff --git a/doc/fwbedit.1 b/doc/fwbedit.1 index 71d0fdc1e..35ed2c379 100644 --- a/doc/fwbedit.1 +++ b/doc/fwbedit.1 @@ -263,7 +263,7 @@ fwbedit list -f x.fwb -o /User/Services/ICMP -c -F "name='%name%' icmp_type=%ic .PP Add IPv6 address to one of the interfaces of firewall object "firewall": .PP -fwbedit new -f x.fwb -p /User/Firewalls/firewall/eth3 -t IPv6 -n eth3-v6-addr -o 2001:470:1f05:590::2,64 +fwbedit new -f x.fwb -p /User/Firewalls/firewall/eth3 -t IPv6 -n eth3-v6-addr -a 2001:470:1f05:590::2,64 .PP Add reference to the Host object 'A' to the group 'B': diff --git a/src/fwbedit/fwbedit.cpp b/src/fwbedit/fwbedit.cpp index 2ffe21c29..8ae86b441 100644 --- a/src/fwbedit/fwbedit.cpp +++ b/src/fwbedit/fwbedit.cpp @@ -379,7 +379,7 @@ int main(int argc, char * const *argv) string comment_txt; bool list_children = false; bool recursive = false; - string list_format; + string list_format = "%path%"; bool full_dump = false; if (argc<=2) diff --git a/src/gui/FWWindow.cpp b/src/gui/FWWindow.cpp index 3208ff728..f8182b322 100644 --- a/src/gui/FWWindow.cpp +++ b/src/gui/FWWindow.cpp @@ -335,11 +335,9 @@ QString FWWindow::getDestDir(const QString &fname) return ""; } -QString FWWindow::chooseNewFileName(const QString &fname, - bool checkPresence,const QString &title) +QString FWWindow::chooseNewFileName(const QString &fname, const QString &title) { - if (activeProject()) - return activeProject()->chooseNewFileName(fname, checkPresence, title); + if (activeProject()) return activeProject()->chooseNewFileName(fname,title); return ""; } @@ -1684,14 +1682,14 @@ void FWWindow::checkForUpgrade(const QString& server_response) } /* - * This slot is called after one of the mdi windows is closed. + * This slot is called after one of the mdi windows is closed. This + * is where the decision is made as to wether we should terminate the + * program when the last MDI window is closed. Bug #2144114 "fwbuilder + * exits if the last object file is closed" requests for the program + * to continue after the last window is closed. */ void FWWindow::projectWindowClosed() { - if (fwbdebug) qDebug("FWWindow::projectWindowClosed()"); - - if (m_space->subWindowList().size() == 0) - QCoreApplication::exit(0); +// if (m_space->subWindowList().size() == 0) QCoreApplication::exit(0); } - diff --git a/src/gui/FWWindow.h b/src/gui/FWWindow.h index d7752b500..e706f2ef6 100644 --- a/src/gui/FWWindow.h +++ b/src/gui/FWWindow.h @@ -204,8 +204,7 @@ public slots: void ensureObjectVisibleInRules(libfwbuilder::FWReference *obj); void ensureRuleIsVisible(libfwbuilder::Rule *rule, int col=0); - QString chooseNewFileName(const QString &fname, - bool checkPresence, const QString &title); + QString chooseNewFileName(const QString &fname, const QString &title); void setFileName(const QString &fname); bool saveIfModified(); diff --git a/src/gui/ProjectPanel.h b/src/gui/ProjectPanel.h index 73fd092ee..771b6d7e2 100644 --- a/src/gui/ProjectPanel.h +++ b/src/gui/ProjectPanel.h @@ -260,9 +260,7 @@ public: bool saveIfModified(); QString getDestDir(const QString &fname); - QString chooseNewFileName(const QString &fname, - bool checkPresence, - const QString &title); + QString chooseNewFileName(const QString &fname, const QString &title); void setFileName(const QString &fname); void restoreDepends(libfwbuilder::FWObject *obj_old, libfwbuilder::FWObject *nobj, diff --git a/src/gui/ProjectPanel_file_ops.cpp b/src/gui/ProjectPanel_file_ops.cpp index acb6ede2b..fcf6d170e 100644 --- a/src/gui/ProjectPanel_file_ops.cpp +++ b/src/gui/ProjectPanel_file_ops.cpp @@ -102,34 +102,16 @@ bool ProjectPanel::saveIfModified() QString ProjectPanel::chooseNewFileName(const QString &fname, - bool checkPresence, const QString &title) { QString destdir = getDestDir(fname); + // Note that QFileDialog::getSaveFileName asks for confirmation + // if the file already exists. QString fn = QFileDialog::getSaveFileName( this, title, destdir, tr( "FWB Files (*.fwb);;All Files (*)" ) ); - if ( fn.isEmpty() ) return ""; - QFileInfo finfo(fn); - - //if (finfo.extension(false)!="fwb") fn=fn+".fwb"; - if (finfo.suffix()!="fwb") fn=fn+".fwb"; - - finfo.setFile(fn); - - if ( ! checkPresence || ! finfo.exists() || - QMessageBox::warning( - this,"Firewall Builder", - tr("The file %1 already exists.\nDo you want to overwrite it ?") - .arg(fn.toLatin1().constData()), - tr("&Yes"), tr("&No"), QString::null, - 0, 1 )==0 ) - { - return fn; - } - - return ""; + return fn; } @@ -148,8 +130,7 @@ bool ProjectPanel::fileNew() if (fwbdebug) qDebug("ProjectPanel::fileNew()"); QString nfn = chooseNewFileName( - st->getWDir(), true, - tr("Choose name and location for the new file")); + st->getWDir(), tr("Choose name and location for the new file")); if ( !nfn.isEmpty() ) { @@ -308,8 +289,7 @@ void ProjectPanel::fileSaveAs() QString oldFileName = rcs->getFileName(); QString nfn = chooseNewFileName( - oldFileName, true, - tr("Choose name and location for the file")); + oldFileName, tr("Choose name and location for the file")); if (!nfn.isEmpty()) { @@ -1103,8 +1083,8 @@ void ProjectPanel::load(QWidget*, RCS* _rcs, FWObjectDatabase* clone) tr("&Continue"), QString::null,QString::null, 0, 1 ); - nfn=chooseNewFileName(fn,true, - tr("Choose name and location for the new file")); + nfn=chooseNewFileName( + fn, tr("Choose name and location for the new file")); if (nfn.isEmpty()) { QString oldFileName = ofinfo.absoluteFilePath() + ".bak"; @@ -1400,8 +1380,7 @@ void ProjectPanel::load(QWidget*, RCS *_rcs) 0, 1 ); nfn = chooseNewFileName( - fn,true, - tr("Choose name and location for the new file")); + fn, tr("Choose name and location for the new file")); if (nfn.isEmpty()) { QString oldFileName = ofinfo.absoluteFilePath()