mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-19 09:47:20 +01:00
* 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
This commit is contained in:
parent
ef8fa91b9d
commit
84ea4be6df
@ -1,3 +1,23 @@
|
||||
2008-10-03 Vadim Kurland <vadim@vk.crocodile.org>
|
||||
|
||||
* 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 <vadim@vk.crocodile.org>
|
||||
|
||||
* instDialog.cpp (instDialog::finishInstall): fixed bug #2125604:
|
||||
|
||||
@ -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':
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user