mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-23 11:47:24 +01:00
see #803 take user name for the batch install from the dialog, overriding the name set in the fw object settings
This commit is contained in:
parent
a5b9d1eddb
commit
301d037988
@ -57,6 +57,7 @@
|
||||
#include <QTimer>
|
||||
#include <QMessageBox>
|
||||
#include <QDir>
|
||||
#include <QtDebug>
|
||||
|
||||
|
||||
using namespace std;
|
||||
@ -65,7 +66,11 @@ using namespace libfwbuilder;
|
||||
|
||||
bool FirewallInstallerUnx::packInstallJobsList(Firewall* fw)
|
||||
{
|
||||
if (fwbdebug) qDebug("FirewallInstallerUnx::packInstallJobList");
|
||||
if (fwbdebug)
|
||||
{
|
||||
qDebug() << "FirewallInstallerUnx::packInstallJobList";
|
||||
qDebug() << "cnf->user=" << cnf->user;
|
||||
}
|
||||
|
||||
job_list.clear();
|
||||
|
||||
|
||||
@ -94,6 +94,8 @@ instDialog::instDialog(QWidget* p,
|
||||
m_dialog = new Ui::instDialog_q;
|
||||
m_dialog->setupUi(this);
|
||||
|
||||
batch_inst_opt_dlg = NULL;
|
||||
|
||||
project = mw->activeProject();
|
||||
|
||||
setControlWidgets(this,
|
||||
@ -234,6 +236,7 @@ instDialog::instDialog(QWidget* p,
|
||||
|
||||
instDialog::~instDialog()
|
||||
{
|
||||
if (batch_inst_opt_dlg != NULL) delete batch_inst_opt_dlg;
|
||||
delete m_dialog;
|
||||
}
|
||||
|
||||
|
||||
@ -51,6 +51,7 @@
|
||||
#include "fwbuilder/FWObjectDatabase.h"
|
||||
|
||||
class FirewallInstaller;
|
||||
class instBatchOptionsDialog;
|
||||
|
||||
class QEventLoop;
|
||||
class QTextEdit;
|
||||
@ -92,7 +93,8 @@ class instDialog : public QDialog, public FakeWizard
|
||||
Page1Operation page_1_op;
|
||||
FirewallInstaller *installer;
|
||||
ProjectPanel *project;
|
||||
|
||||
instBatchOptionsDialog *batch_inst_opt_dlg;
|
||||
|
||||
// proc is used to launch external oprocess, such as compiler or
|
||||
// user-defined installer script
|
||||
QProcess proc;
|
||||
|
||||
@ -50,6 +50,7 @@
|
||||
#include <QTextCodec>
|
||||
#include <QTimer>
|
||||
#include <QMessageBox>
|
||||
#include <QtDebug>
|
||||
|
||||
|
||||
using namespace std;
|
||||
@ -57,12 +58,15 @@ using namespace libfwbuilder;
|
||||
|
||||
bool instDialog::runInstaller(Firewall *fw)
|
||||
{
|
||||
if (fwbdebug) qDebug("instDialog::runInstaller");
|
||||
|
||||
cnf.fwobj = fw;
|
||||
cnf.maddr = "";
|
||||
|
||||
if (!getInstOptions(fw))
|
||||
if (fwbdebug)
|
||||
qDebug() << "instDialog::runInstaller: built-in installer"
|
||||
<< fw->getName().c_str()
|
||||
<< " cnf.user=" << cnf.user;
|
||||
|
||||
if (!getInstOptions(fw))
|
||||
{
|
||||
QTimer::singleShot( 0, this, SLOT(mainLoopInstall()));
|
||||
return false;
|
||||
@ -103,8 +107,8 @@ bool instDialog::runInstaller(Firewall *fw)
|
||||
|
||||
addToLog("\n");
|
||||
|
||||
if (fwbdebug) qDebug("built-in installer firewall %s",
|
||||
fw->getName().c_str());
|
||||
if (fwbdebug)
|
||||
qDebug() << "instDialog::runInstaller:" << " cnf.user=" << cnf.user;
|
||||
|
||||
if (installer!=NULL)
|
||||
delete installer;
|
||||
|
||||
@ -67,6 +67,7 @@
|
||||
#include <QTextBlockFormat>
|
||||
#include <QBrush>
|
||||
#include <QTextFormat>
|
||||
#include <QtDebug>
|
||||
|
||||
#include "fwbuilder/Resources.h"
|
||||
#include "fwbuilder/FWObjectDatabase.h"
|
||||
@ -857,8 +858,15 @@ bool instDialog::getInstOptions(Firewall *fw)
|
||||
readInstallerOptionsFromSettings();
|
||||
readInstallerOptionsFromFirewallObject(fw);
|
||||
|
||||
if (!m_dialog->batchInstall->isChecked())
|
||||
if (m_dialog->batchInstall->isChecked() && batch_inst_opt_dlg)
|
||||
{
|
||||
// in batch install mode we use the same dialog to fill cnf
|
||||
// without showing it to the user again
|
||||
readInstallerOptionsFromDialog(fw, batch_inst_opt_dlg);
|
||||
} else
|
||||
{
|
||||
// In non-batch mode installer options from the dialog
|
||||
// overwrite options set in the fw object itself.
|
||||
instOptionsDialog *inst_opt_dlg = new instOptionsDialog(this, &cnf);
|
||||
if (inst_opt_dlg->exec()==QDialog::Rejected)
|
||||
{
|
||||
@ -880,18 +888,23 @@ bool instDialog::getBatchInstOptions()
|
||||
|
||||
readInstallerOptionsFromSettings();
|
||||
|
||||
instBatchOptionsDialog *inst_opt_dlg = new instBatchOptionsDialog(this,
|
||||
&cnf);
|
||||
if (inst_opt_dlg->exec()==QDialog::Rejected)
|
||||
if (batch_inst_opt_dlg != NULL) delete batch_inst_opt_dlg;
|
||||
|
||||
batch_inst_opt_dlg = new instBatchOptionsDialog(this, &cnf);
|
||||
|
||||
if (batch_inst_opt_dlg->exec()==QDialog::Rejected)
|
||||
{
|
||||
delete inst_opt_dlg;
|
||||
stopProcessFlag = true;
|
||||
showPage(0);
|
||||
return false;
|
||||
}
|
||||
// clear aternative address in the dialog
|
||||
inst_opt_dlg->m_dialog->altAddress->setText("");
|
||||
readInstallerOptionsFromDialog(NULL, inst_opt_dlg);
|
||||
batch_inst_opt_dlg->m_dialog->altAddress->setText("");
|
||||
readInstallerOptionsFromDialog(NULL, batch_inst_opt_dlg);
|
||||
|
||||
if (fwbdebug)
|
||||
qDebug() << "instDialog::getBatchInstOptions(): cnf.user=" << cnf.user;
|
||||
|
||||
return verifyManagementAddress();
|
||||
}
|
||||
|
||||
|
||||
@ -29892,7 +29892,7 @@ echo '%FWBPROMPT%'; sh /tmp/%FWSCRIPT%
|
||||
<Option name="action_on_reject"></Option>
|
||||
<Option name="activationCmd"></Option>
|
||||
<Option name="add_check_state_rule">true</Option>
|
||||
<Option name="admUser">vadim</Option>
|
||||
<Option name="admUser"></Option>
|
||||
<Option name="altAddress"></Option>
|
||||
<Option name="bridging_fw">False</Option>
|
||||
<Option name="check_shading">True</Option>
|
||||
@ -29900,7 +29900,10 @@ echo '%FWBPROMPT%'; sh /tmp/%FWSCRIPT%
|
||||
<Option name="classify_mark_terminating">False</Option>
|
||||
<Option name="cmdline">-xt</Option>
|
||||
<Option name="compiler"></Option>
|
||||
<Option name="configure_bonding_interfaces">False</Option>
|
||||
<Option name="configure_bridge_interfaces">False</Option>
|
||||
<Option name="configure_interfaces">True</Option>
|
||||
<Option name="configure_vlan_interfaces">False</Option>
|
||||
<Option name="debug">False</Option>
|
||||
<Option name="drop_invalid">True</Option>
|
||||
<Option name="eliminate_duplicates">true</Option>
|
||||
@ -29982,6 +29985,8 @@ echo '%FWBPROMPT%'; sh /tmp/%FWSCRIPT%
|
||||
<Option name="prolog_script"></Option>
|
||||
<Option name="prompt1">$ </Option>
|
||||
<Option name="prompt2"> # </Option>
|
||||
<Option name="scpArgs"></Option>
|
||||
<Option name="script_name_on_firewall"></Option>
|
||||
<Option name="solaris_ip_forward">1</Option>
|
||||
<Option name="sshArgs"></Option>
|
||||
<Option name="ulog_cprange">0</Option>
|
||||
@ -38996,7 +39001,7 @@ echo '%FWBPROMPT%'; sh /tmp/%FWSCRIPT%
|
||||
<Option name="action_on_reject"></Option>
|
||||
<Option name="activationCmd"></Option>
|
||||
<Option name="add_check_state_rule">true</Option>
|
||||
<Option name="admUser">vadim</Option>
|
||||
<Option name="admUser"></Option>
|
||||
<Option name="altAddress"></Option>
|
||||
<Option name="bridging_fw">False</Option>
|
||||
<Option name="check_shading">True</Option>
|
||||
@ -39004,7 +39009,10 @@ echo '%FWBPROMPT%'; sh /tmp/%FWSCRIPT%
|
||||
<Option name="classify_mark_terminating">False</Option>
|
||||
<Option name="cmdline">-xt</Option>
|
||||
<Option name="compiler"></Option>
|
||||
<Option name="configure_bonding_interfaces">False</Option>
|
||||
<Option name="configure_bridge_interfaces">False</Option>
|
||||
<Option name="configure_interfaces">True</Option>
|
||||
<Option name="configure_vlan_interfaces">False</Option>
|
||||
<Option name="debug">False</Option>
|
||||
<Option name="drop_invalid">True</Option>
|
||||
<Option name="eliminate_duplicates">true</Option>
|
||||
@ -39087,6 +39095,8 @@ echo '%FWBPROMPT%'; sh /tmp/%FWSCRIPT%
|
||||
<Option name="prolog_script"></Option>
|
||||
<Option name="prompt1">$ </Option>
|
||||
<Option name="prompt2"> # </Option>
|
||||
<Option name="scpArgs"></Option>
|
||||
<Option name="script_name_on_firewall"></Option>
|
||||
<Option name="solaris_ip_forward">1</Option>
|
||||
<Option name="sshArgs"></Option>
|
||||
<Option name="ulog_cprange">0</Option>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user