From 30db079476409c12ef3ed35bf26ad8e2d16c361d Mon Sep 17 00:00:00 2001 From: Vadim Kurland Date: Sun, 27 Feb 2011 12:54:08 -0800 Subject: [PATCH] fixes #2159; also using macros for discovery druid page numbers --- VERSION | 2 +- VERSION.h | 2 +- packaging/fwbuilder-static-qt.spec | 2 +- packaging/fwbuilder.control | 2 +- packaging/fwbuilder.spec | 2 +- src/libgui/DiscoveryDruid.cpp | 44 ++++++++++++++++-------------- src/libgui/DiscoveryDruid.h | 16 +++++++++++ 7 files changed, 44 insertions(+), 26 deletions(-) diff --git a/VERSION b/VERSION index 1dbeeca52..e3d9bc6d4 100644 --- a/VERSION +++ b/VERSION @@ -7,7 +7,7 @@ FWB_MICRO_VERSION=0 # build number is like "nano" version number. I am incrementing build # number during development cycle # -BUILD_NUM="3489" +BUILD_NUM="3490" VERSION="$FWB_MAJOR_VERSION.$FWB_MINOR_VERSION.$FWB_MICRO_VERSION.$BUILD_NUM" diff --git a/VERSION.h b/VERSION.h index ba147254a..8b76c1660 100644 --- a/VERSION.h +++ b/VERSION.h @@ -1,2 +1,2 @@ -#define VERSION "4.2.0.3489" +#define VERSION "4.2.0.3490" #define GENERATION "4.2" diff --git a/packaging/fwbuilder-static-qt.spec b/packaging/fwbuilder-static-qt.spec index 53851521d..550f3027d 100644 --- a/packaging/fwbuilder-static-qt.spec +++ b/packaging/fwbuilder-static-qt.spec @@ -3,7 +3,7 @@ %define name fwbuilder -%define version 4.2.0.3489 +%define version 4.2.0.3490 %define release 1 %if "%_vendor" == "MandrakeSoft" diff --git a/packaging/fwbuilder.control b/packaging/fwbuilder.control index be8385790..851c5e394 100644 --- a/packaging/fwbuilder.control +++ b/packaging/fwbuilder.control @@ -4,6 +4,6 @@ Replaces: fwbuilder (<=4.1.1-1), fwbuilder-common, fwbuilder-bsd, fwbuilder-linu Priority: extra Section: checkinstall Maintainer: vadim@fwbuilder.org -Version: 4.2.0.3489-1 +Version: 4.2.0.3490-1 Depends: libqt4-gui (>= 4.3.0), libxml2, libxslt1.1, libsnmp | libsnmp15 Description: Firewall Builder GUI and policy compilers diff --git a/packaging/fwbuilder.spec b/packaging/fwbuilder.spec index 8b37b0b23..a26a886dd 100644 --- a/packaging/fwbuilder.spec +++ b/packaging/fwbuilder.spec @@ -1,6 +1,6 @@ %define name fwbuilder -%define version 4.2.0.3489 +%define version 4.2.0.3490 %define release 1 %if "%_vendor" == "MandrakeSoft" diff --git a/src/libgui/DiscoveryDruid.cpp b/src/libgui/DiscoveryDruid.cpp index ba8067463..107513923 100644 --- a/src/libgui/DiscoveryDruid.cpp +++ b/src/libgui/DiscoveryDruid.cpp @@ -191,17 +191,17 @@ DiscoveryDruid::DiscoveryDruid(QWidget *parent, bool start_with_import) : importPlatformChanged(m_dialog->import_platform->currentIndex()); - showPage(0); - setNextEnabled(0, true); + showPage(CHOOSE_METHOD_PAGE); + setNextEnabled(CHOOSE_METHOD_PAGE, true); if (start_with_import) { m_dialog->dm_import_config->setDown(true); setDiscoveryMethod_Import(); - setAppropriate( 0, false ); + setAppropriate( CHOOSE_METHOD_PAGE, false ); // show the first page of the "import policy" track of the wizard - showPage( 2 ); - setNextEnabled(2, false); + showPage( IMPORT_CONFIG_PAGE ); + setNextEnabled(IMPORT_CONFIG_PAGE, false); cancelButton->show(); } @@ -224,12 +224,14 @@ void DiscoveryDruid::backClicked() void DiscoveryDruid::finishClicked() { - if (current_task == BT_IMPORT && selectedPlatform() == "pix" && currentPage() == 14) + if (current_task == BT_IMPORT && + selectedPlatform() == "pix" && + currentPage() == NETWORK_ZONES_PAGE && + discovered_fw != NULL) { // read and configure network zones list all_interfaces = discovered_fw->getByTypeDeep(Interface::TYPENAME); list::iterator it; - int row = 0; for (it=all_interfaces.begin(); it!=all_interfaces.end(); ++it) { Interface *iface = Interface::cast(*it); @@ -482,7 +484,7 @@ void DiscoveryDruid::changedSelected( const int &page ) switch (page) { - case 1: // Reading file in hosts format + case READ_HOSTS_FILE_PAGE: // Reading file in hosts format { setNextEnabled(page, false); changedHostsFileName(); @@ -490,7 +492,7 @@ void DiscoveryDruid::changedSelected( const int &page ) break; } - case 2: // import config + case IMPORT_CONFIG_PAGE: // import config { m_dialog->obj_name->setFocus(); setBackEnabled(page, true); @@ -498,7 +500,7 @@ void DiscoveryDruid::changedSelected( const int &page ) break; } - case 3: // Import DNS zone + case IMPORT_DNS_ZONE_PAGE: // Import DNS zone { changedDomainName(); m_dialog->domainname->setFocus(); @@ -506,7 +508,7 @@ void DiscoveryDruid::changedSelected( const int &page ) break; } - case 4: // Name server + case NAME_SERVER_PAGE: // Name server { if (page>FromPage) getNameServers(); @@ -519,7 +521,7 @@ void DiscoveryDruid::changedSelected( const int &page ) break; } - case 5: // Network discovery using SNMP + case SNMP_DISCOVERY_PAGE: // Network discovery using SNMP { disconnect(timer,SIGNAL(timeout()),0,0); connect(timer,SIGNAL(timeout()),this,SLOT(checkHostName())); @@ -533,21 +535,21 @@ void DiscoveryDruid::changedSelected( const int &page ) break; } - case 6: // Network scan options + case NETWORK_SCAN_OPTIONS_PAGE: // Network scan options { m_dialog->snmprecursive->setFocus(); //setNextEnabled(page,false); break; } - case 7: // SNMP and DNS reverse lookup queries parameters + case SNMP_PARAMETERS_PAGE: // SNMP and DNS reverse lookup queries parameters { checkSNMPCommunity(); m_dialog->snmpcommunity->setFocus(); break; } - case 8: // Background process (import from hosts and from config file) + case BACKGROUND_PROCESS_PAGE: // Background process (import from hosts and from config file) { m_dialog->discoveryprogress->setValue(-1); m_dialog->discoverylog->clear(); @@ -568,7 +570,7 @@ void DiscoveryDruid::changedSelected( const int &page ) break; } - case 9: // Networks + case CHOOSE_NETWORKS_PAGE: // Networks { fillListOfNetworks(); fillNetworks(); @@ -577,7 +579,7 @@ void DiscoveryDruid::changedSelected( const int &page ) break; } - case 10: // Objects + case CHOOSE_OBJECTS_PAGE: // Objects { if (Networks.size()==0) setBackEnabled(page,false); @@ -588,19 +590,19 @@ void DiscoveryDruid::changedSelected( const int &page ) break; } - case 11: // Adjust Object type + case ADJUST_OBJECT_TYPES_PAGE: // Adjust Object type { setBackEnabled(page,true); fillTypeChangingList(); break; } - case 12: // Target library + case TARGET_LIB_PAGE: // Target library { break; } - case 13: // Objects creation ... + case CREATE_OBJECTS_PAGE: // Objects creation ... { setBackEnabled(page,false); cancelButton->hide(); @@ -611,7 +613,7 @@ void DiscoveryDruid::changedSelected( const int &page ) break; } - case 14: // Network zones for PIX + case NETWORK_ZONES_PAGE: // Network zones for PIX { setBackEnabled(page, false); cancelButton->hide(); diff --git a/src/libgui/DiscoveryDruid.h b/src/libgui/DiscoveryDruid.h index d38f3258f..c17b09d60 100644 --- a/src/libgui/DiscoveryDruid.h +++ b/src/libgui/DiscoveryDruid.h @@ -326,6 +326,22 @@ public slots: }; +#define CHOOSE_METHOD_PAGE 0 +#define READ_HOSTS_FILE_PAGE 1 +#define IMPORT_CONFIG_PAGE 2 +#define IMPORT_DNS_ZONE_PAGE 3 +#define NAME_SERVER_PAGE 4 +#define SNMP_DISCOVERY_PAGE 5 +#define NETWORK_SCAN_OPTIONS_PAGE 6 +#define SNMP_PARAMETERS_PAGE 7 +#define BACKGROUND_PROCESS_PAGE 8 +#define CHOOSE_NETWORKS_PAGE 9 +#define CHOOSE_OBJECTS_PAGE 10 +#define ADJUST_OBJECT_TYPES_PAGE 11 +#define TARGET_LIB_PAGE 12 +#define CREATE_OBJECTS_PAGE 13 +#define NETWORK_ZONES_PAGE 14 + const int WIZARD_PAGES = 15; const bool WIZARD_FILE_PAGES[] = {1,1,0,0,0,0,0,0,1,0,1,0,1,1,0}; const bool WIZARD_DNS_PAGES[] = {1,0,0,1,1,0,0,0,1,0,1,0,1,1,0};