From 09555f9c78286b1e5a952a3f5d80531892b48111 Mon Sep 17 00:00:00 2001 From: Vadim Kurland Date: Wed, 6 Aug 2008 15:50:49 +0000 Subject: [PATCH] scrolling help panel to the appropriate location --- src/gui/Help.cpp | 4 + src/gui/Help.h | 1 + src/gui/freebsdadvanceddialog_q.ui | 4 +- src/gui/iosacladvanceddialog_q.ui | 4 +- src/gui/ipfAdvancedDialog.cpp | 2 +- src/gui/ipfadvanceddialog_q.ui | 6 +- src/gui/ipfwAdvancedDialog.cpp | 2 +- src/gui/ipfwadvanceddialog_q.ui | 4 +- src/gui/iptAdvancedDialog.cpp | 3 + src/gui/iptadvanceddialog_q.ui | 6 +- src/gui/linksysAdvancedDialog.cpp | 2 +- src/gui/linksysadvanceddialog_q.ui | 4 +- src/gui/linux24AdvancedDialog.cpp | 3 + src/gui/linux24advanceddialog_q.ui | 4 +- src/gui/macosxadvanceddialog_q.ui | 4 +- src/gui/openbsdadvanceddialog_q.ui | 4 +- src/gui/pfAdvancedDialog.cpp | 3 + src/gui/pfadvanceddialog_q.ui | 4 +- src/gui/pixAdvancedDialog.cpp | 2 +- src/gui/pixadvanceddialog_q.ui | 4 +- src/gui/pixosadvanceddialog_q.ui | 4 +- src/gui/solarisadvanceddialog_q.ui | 4 +- src/res/help/iptAdvancedDialog_en_US.html | 7 +- src/res/help/pfAdvancedDialog_en_US.html | 103 +++++++++++++++++++--- 24 files changed, 141 insertions(+), 47 deletions(-) diff --git a/src/gui/Help.cpp b/src/gui/Help.cpp index 5e23d6f34..d96ba55f4 100644 --- a/src/gui/Help.cpp +++ b/src/gui/Help.cpp @@ -66,6 +66,10 @@ Help::Help(QWidget *parent, const QString &help_file, const QString &title) : }; +void Help::scrollToAnchor(const QString &anchor) +{ + m_dialog->textview->scrollToAnchor(anchor); +} diff --git a/src/gui/Help.h b/src/gui/Help.h index 8bf5052ee..b2d5fae52 100644 --- a/src/gui/Help.h +++ b/src/gui/Help.h @@ -41,6 +41,7 @@ public: virtual ~Help() {}; + void scrollToAnchor(const QString &anchor); }; #endif diff --git a/src/gui/freebsdadvanceddialog_q.ui b/src/gui/freebsdadvanceddialog_q.ui index cfcf380e0..be81974c3 100644 --- a/src/gui/freebsdadvanceddialog_q.ui +++ b/src/gui/freebsdadvanceddialog_q.ui @@ -96,7 +96,7 @@ - + QTabWidget::Rounded @@ -504,7 +504,7 @@ - tabWidget5 + tabWidget freebsd_ip_forward freebsd_ip_sourceroute freebsd_ip_redirect diff --git a/src/gui/iosacladvanceddialog_q.ui b/src/gui/iosacladvanceddialog_q.ui index 9fb12607c..3a028d4f7 100644 --- a/src/gui/iosacladvanceddialog_q.ui +++ b/src/gui/iosacladvanceddialog_q.ui @@ -116,7 +116,7 @@ - + 0 @@ -1270,7 +1270,7 @@ First, create temporary access list to permit connections from the management su - notebook304 + tabWidget outputFileName iosacl_ignore_empty_groups iosacl_check_shadowing diff --git a/src/gui/ipfAdvancedDialog.cpp b/src/gui/ipfAdvancedDialog.cpp index 5b692d043..94f20a625 100644 --- a/src/gui/ipfAdvancedDialog.cpp +++ b/src/gui/ipfAdvancedDialog.cpp @@ -79,7 +79,7 @@ ipfAdvancedDialog::ipfAdvancedDialog(QWidget *parent,FWObject *o) fwopt->setStr("firewall_dir",""); } - m_dialog->tabWidget3->setTabEnabled(6,false); //Disable tab + m_dialog->tabWidget->setTabEnabled(6,false); //Disable tab data.registerOption(m_dialog->ipv4before_2, fwopt, "ipv4_6_order", QStringList() << "IPv4 before IPv6" <<"ipv4_first" << "IPv6 before IPv4" << "ipv6_first" ); data.registerOption( m_dialog->ipf_log_or_block ,fwopt, "ipf_log_or_block" ); data.registerOption( m_dialog->ipf_log_body ,fwopt, "ipf_log_body" ); diff --git a/src/gui/ipfadvanceddialog_q.ui b/src/gui/ipfadvanceddialog_q.ui index 6581edb33..39ee84bfa 100644 --- a/src/gui/ipfadvanceddialog_q.ui +++ b/src/gui/ipfadvanceddialog_q.ui @@ -99,9 +99,9 @@ - + - 6 + 0 @@ -1413,7 +1413,7 @@ with this address: - tabWidget3 + tabWidget ipf_nat_ftp_proxy ipf_nat_rcmd_proxy ipf_nat_raudio_proxy diff --git a/src/gui/ipfwAdvancedDialog.cpp b/src/gui/ipfwAdvancedDialog.cpp index 326693e28..36a9d424c 100644 --- a/src/gui/ipfwAdvancedDialog.cpp +++ b/src/gui/ipfwAdvancedDialog.cpp @@ -80,7 +80,7 @@ ipfwAdvancedDialog::ipfwAdvancedDialog(QWidget *parent,FWObject *o) if (fwopt->getStr("add_check_state_rule").empty()) fwopt->setBool("add_check_state_rule",true); - m_dialog->tabWidget3->setTabEnabled(4,false); //Disable tab + m_dialog->tabWidget->setTabEnabled(4,false); //Disable tab data.registerOption(m_dialog->ipv4before_2, fwopt, "ipv4_6_order", QStringList() << "IPv4 before IPv6" <<"ipv4_first" << "IPv6 before IPv4" << "ipv6_first" ); data.registerOption( m_dialog->ipfw_add_check_state_rule ,fwopt, "add_check_state_rule"); diff --git a/src/gui/ipfwadvanceddialog_q.ui b/src/gui/ipfwadvanceddialog_q.ui index 455a43690..40920a32d 100644 --- a/src/gui/ipfwadvanceddialog_q.ui +++ b/src/gui/ipfwadvanceddialog_q.ui @@ -99,7 +99,7 @@ - + 0 @@ -936,7 +936,7 @@ with this address: - tabWidget3 + tabWidget compiler compilerArgs outputFileName diff --git a/src/gui/iptAdvancedDialog.cpp b/src/gui/iptAdvancedDialog.cpp index d969da422..c782bc4a6 100644 --- a/src/gui/iptAdvancedDialog.cpp +++ b/src/gui/iptAdvancedDialog.cpp @@ -233,6 +233,9 @@ void iptAdvancedDialog::help() { Help *h = new Help(this, "iptAdvancedDialog", "Firewall platform: iptables"); h->show(); + QString tab_title = m_dialog->tabWidget->tabText( + m_dialog->tabWidget->currentIndex()); + h->scrollToAnchor(tab_title.replace('/', '-').replace(' ', '-').toLower()); } diff --git a/src/gui/iptadvanceddialog_q.ui b/src/gui/iptadvanceddialog_q.ui index 8402ab2bc..c50fb1e3b 100644 --- a/src/gui/iptadvanceddialog_q.ui +++ b/src/gui/iptadvanceddialog_q.ui @@ -26,7 +26,7 @@ - + 0 @@ -34,7 +34,7 @@ - 3 + 0 @@ -1456,7 +1456,7 @@ with this address: - tabWidget2 + tabWidget compiler compilerArgs outputFileName diff --git a/src/gui/linksysAdvancedDialog.cpp b/src/gui/linksysAdvancedDialog.cpp index d001ace4b..16b2747cc 100644 --- a/src/gui/linksysAdvancedDialog.cpp +++ b/src/gui/linksysAdvancedDialog.cpp @@ -67,7 +67,7 @@ linksysAdvancedDialog::linksysAdvancedDialog(QWidget *parent,FWObject *o) * since v2.0.3 we do not need to know shell prompt on linksys. Will * remove the page completely when code becomes stable. */ - m_dialog->tabWidget3->removeTab( 1 ); + m_dialog->tabWidget->removeTab( 1 ); QStringList threeStateMapping; diff --git a/src/gui/linksysadvanceddialog_q.ui b/src/gui/linksysadvanceddialog_q.ui index 981dc44ee..93cfda984 100644 --- a/src/gui/linksysadvanceddialog_q.ui +++ b/src/gui/linksysadvanceddialog_q.ui @@ -96,7 +96,7 @@ - + QTabWidget::Rounded @@ -447,7 +447,7 @@ The default strings work for Sveasoft Alchemy pre-5.1 and pre-5.2 - tabWidget3 + tabWidget linksys_path_iptables linksys_path_ip linksys_path_logger diff --git a/src/gui/linux24AdvancedDialog.cpp b/src/gui/linux24AdvancedDialog.cpp index 2394502f7..6f3e85f2c 100644 --- a/src/gui/linux24AdvancedDialog.cpp +++ b/src/gui/linux24AdvancedDialog.cpp @@ -186,6 +186,9 @@ void linux24AdvancedDialog::help() { Help *h = new Help(this, "linux24AdvancedDialog", "Host type Linux 2.4/2.6"); h->show(); + QString tab_title = m_dialog->tabWidget->tabText( + m_dialog->tabWidget->currentIndex()); + h->scrollToAnchor(tab_title.replace('/', '-').replace(' ', '-').toLower()); } diff --git a/src/gui/linux24advanceddialog_q.ui b/src/gui/linux24advanceddialog_q.ui index ec2b61ae2..374672bf9 100644 --- a/src/gui/linux24advanceddialog_q.ui +++ b/src/gui/linux24advanceddialog_q.ui @@ -14,7 +14,7 @@ - + QTabWidget::Rounded @@ -1041,7 +1041,7 @@ linux24_path_lsmod linux24_path_iptables_restore linux24_path_ip6tables_restore - tabWidget3 + tabWidget diff --git a/src/gui/macosxadvanceddialog_q.ui b/src/gui/macosxadvanceddialog_q.ui index ccc3f57a3..2cf920e42 100644 --- a/src/gui/macosxadvanceddialog_q.ui +++ b/src/gui/macosxadvanceddialog_q.ui @@ -78,7 +78,7 @@ - + QTabWidget::Rounded @@ -408,7 +408,7 @@ - tabWidget7 + tabWidget macosx_ip_forward macosx_ip_sourceroute macosx_ip_redirect diff --git a/src/gui/openbsdadvanceddialog_q.ui b/src/gui/openbsdadvanceddialog_q.ui index 359d35b28..f6143d138 100644 --- a/src/gui/openbsdadvanceddialog_q.ui +++ b/src/gui/openbsdadvanceddialog_q.ui @@ -96,7 +96,7 @@ - + 0 @@ -475,7 +475,7 @@ - tabWidget9 + tabWidget openbsd_ip_forward openbsd_ipv6_forward openbsd_ip_directed_broadcast diff --git a/src/gui/pfAdvancedDialog.cpp b/src/gui/pfAdvancedDialog.cpp index 311e3ae22..dc1569097 100644 --- a/src/gui/pfAdvancedDialog.cpp +++ b/src/gui/pfAdvancedDialog.cpp @@ -301,6 +301,9 @@ void pfAdvancedDialog::help() { Help *h = new Help(this, "pfAdvancedDialog", "Firewall platform: pf"); h->show(); + QString tab_title = m_dialog->tabWidget->tabText( + m_dialog->tabWidget->currentIndex()); + h->scrollToAnchor(tab_title.replace('/', '-').replace(' ', '-').toLower()); } diff --git a/src/gui/pfadvanceddialog_q.ui b/src/gui/pfadvanceddialog_q.ui index 4d45b4740..29e6a190f 100644 --- a/src/gui/pfadvanceddialog_q.ui +++ b/src/gui/pfadvanceddialog_q.ui @@ -17,7 +17,7 @@ - + 0 @@ -2428,7 +2428,7 @@ with this address: - tabWidget3 + tabWidget compiler compilerArgs outputFileName diff --git a/src/gui/pixAdvancedDialog.cpp b/src/gui/pixAdvancedDialog.cpp index 556536360..ff3d03a47 100644 --- a/src/gui/pixAdvancedDialog.cpp +++ b/src/gui/pixAdvancedDialog.cpp @@ -242,7 +242,7 @@ pixAdvancedDialog::pixAdvancedDialog(QWidget*, FWObject *o)//(parent) else m_dialog->pix_generate_out_acl->hide(); - m_dialog->notebook304->setTabEnabled(8,false); //Disable tab + m_dialog->tabWidget->setTabEnabled(8,false); //Disable tab data.registerOption(m_dialog->ipv4before_2, fwoptions, "ipv4_6_order", QStringList() << "IPv4 before IPv6" <<"ipv4_first" << "IPv6 before IPv4" << "ipv6_first" ); diff --git a/src/gui/pixadvanceddialog_q.ui b/src/gui/pixadvanceddialog_q.ui index 097f9130a..3c8bb018e 100644 --- a/src/gui/pixadvanceddialog_q.ui +++ b/src/gui/pixadvanceddialog_q.ui @@ -80,7 +80,7 @@ - + 0 @@ -4563,7 +4563,7 @@ the packet should go to, and which is the next hop - notebook304 + tabWidget outputFileName pix_assume_fw_part_of_any pix_replace_natted_objects diff --git a/src/gui/pixosadvanceddialog_q.ui b/src/gui/pixosadvanceddialog_q.ui index c85ccf017..466b6b1e7 100644 --- a/src/gui/pixosadvanceddialog_q.ui +++ b/src/gui/pixosadvanceddialog_q.ui @@ -35,7 +35,7 @@ 6 - + 0 @@ -606,7 +606,7 @@ - notebook305 + tabWidget pix_set_host_name pix_ip_address ntp1 diff --git a/src/gui/solarisadvanceddialog_q.ui b/src/gui/solarisadvanceddialog_q.ui index b279c2ab3..5bd8ce401 100644 --- a/src/gui/solarisadvanceddialog_q.ui +++ b/src/gui/solarisadvanceddialog_q.ui @@ -96,7 +96,7 @@ - + 0 @@ -487,7 +487,7 @@ - tabWidget11 + tabWidget solaris_ip_forward solaris_ip_forward_src_routed solaris_ip_forward_directed_broadcasts diff --git a/src/res/help/iptAdvancedDialog_en_US.html b/src/res/help/iptAdvancedDialog_en_US.html index 6bd21f789..89b26e5c3 100644 --- a/src/res/help/iptAdvancedDialog_en_US.html +++ b/src/res/help/iptAdvancedDialog_en_US.html @@ -4,7 +4,7 @@ Most of the iptables options can be found in the man page iptables(1) or online on the project web site at http://www.netfilter.org - +

Tab Compiler

@@ -185,6 +185,7 @@ online on the project web site at http://www. +


Tab Installer

@@ -238,6 +239,7 @@ online on the project web site at http://www. +


Tab Prolog/Epilog

@@ -279,6 +281,7 @@ online on the project web site at http://www. +


Tab Logging

@@ -386,6 +389,7 @@ online on the project web site at http://www. +


Tab Script Options

@@ -450,6 +454,7 @@ online on the project web site at http://www. +


Tab IPv6

diff --git a/src/res/help/pfAdvancedDialog_en_US.html b/src/res/help/pfAdvancedDialog_en_US.html index a687858d4..7fd17c9df 100644 --- a/src/res/help/pfAdvancedDialog_en_US.html +++ b/src/res/help/pfAdvancedDialog_en_US.html @@ -2,9 +2,9 @@

pf settings

Most of the pf options can be found in the man page pf.conf(5) or -online
http://www.openbsd.org/cgi-bin/man.cgi?query=pf.conf&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html - +online http://www.openbsd.org/cgi-bin/man.cgi?query=pf.conf +

Tab Compiler

@@ -157,6 +157,7 @@ online


Tab Scrub rule options

@@ -167,7 +168,7 @@ online + Translates into "scrub out all no-df"

From man pf.conf(5):

@@ -196,7 +197,7 @@ online + Translates into "scrub out all random-id"

From man pf.conf(5):

@@ -217,7 +218,7 @@ online + Translates into "scrub out all min-ttl"

From man pf.conf(5):

@@ -234,7 +235,7 @@ online + Translates into "scrub out all max-mss"

From man pf.conf(5):

@@ -258,7 +259,7 @@ online + Translates into "scrub in all fragment reassemble"

From man pf.conf(5):

@@ -281,7 +282,7 @@ online + Translates into "scrub in all fragment crop"

From man pf.conf(5):

@@ -304,7 +305,7 @@ online + Translates into "scrub in all fragment drop-ovl"

From man pf.conf(5):

@@ -319,6 +320,7 @@ online


Tab Limits

@@ -330,7 +332,7 @@ online + Translates into "set limit frags NNN"

From man pf.conf(5):

@@ -344,11 +346,14 @@ online + Translates into "set limit states"

From man pf.conf(5):

+ Sets the maximum number of entries in the memory pool used by + state table entries (generated by pass rules which do not specify + no state).

@@ -356,7 +361,7 @@ online
+ Translates into "set limit src-nodes"

From man pf.conf(5):

@@ -371,7 +376,7 @@ online + Translates into "set limit tables"

From man pf.conf(5):

@@ -385,7 +390,7 @@ online + Translates into "set limit table-entries"

From man pf.conf(5):

@@ -399,6 +404,7 @@ online


Tab Timeouts

@@ -408,6 +414,7 @@ online


Tab Installer

@@ -461,6 +468,7 @@ online


Tab Prolog/Epilog

@@ -518,3 +526,70 @@ online +


+

Tab Logging

+

+ +

Log Prefix:

+

+ this translates into "label " option in pf rules that request + logging. + + + +

Fallback "deny all" rule should log blocked packets

+

+ Compiler adds policy rule at the bottom of the pf rule set that just + denies all packets in and out. This is just a fallback rule that + follows best practices in firewall policy design. Normally this rule + blocks but does not log packets. This option makes it log. + + + + +


+

Tab Script Options

+

+ +

Turn debugging on in generated script

+

+ This option makes the generated firewall script print all commands + when it is executed. To do this, compiler adds "-x" to the shell + command line at the top of the script. Command pfctlc/ used to + load PF rules into the kernel will also be given command line flag + "-v". + + + +

Configure interfaces of the firewall machine

+

+ This option makes compiler add commands to configure ip addresses of + the interfaces of the firewall according to the "Address" objects + added to interfaces in the Firewall Builder GUI. + + + +

Add virtual addresses for NAT

+

+ The compiler can generate commands to add a virtual address to one + of the interfaces of the firewall machine if this option is turned + on. This is needed if a NAT rule uses an IP address that does not + belong to any interface of the firewall. The firewall either needs + the static ’published’ ARP entry for this address, or it should be + added to one of the interfaces as an ’alias’ or virtual address. + The policy compiler adds code to add an ’alias’ address to the + interface on top of the firewall activation script. + + + +


+

Tab IPv6

+

+ +

Order in which IPv4 and IPv6 rules should be generated

+

+ Compiler can place ipv6 policies before or after ipv4 rules. This + option controls the order. + +