[PC-BSD Commits] r20192 - pcbsd/branches/9.1/src-qt4/pc-pfmanager

svn at pcbsd.org svn at pcbsd.org
Mon Nov 12 10:52:36 PST 2012


Author: kris
Date: 2012-11-12 18:52:35 +0000 (Mon, 12 Nov 2012)
New Revision: 20192

Modified:
   pcbsd/branches/9.1/src-qt4/pc-pfmanager/pc-pfmanager.pro
   pcbsd/branches/9.1/src-qt4/pc-pfmanager/pfmanagerdlg.cpp
Log:

MFC fix for firewall GUI



Modified: pcbsd/branches/9.1/src-qt4/pc-pfmanager/pc-pfmanager.pro
===================================================================
--- pcbsd/branches/9.1/src-qt4/pc-pfmanager/pc-pfmanager.pro	2012-11-12 18:51:47 UTC (rev 20191)
+++ pcbsd/branches/9.1/src-qt4/pc-pfmanager/pc-pfmanager.pro	2012-11-12 18:52:35 UTC (rev 20192)
@@ -33,6 +33,9 @@
 TARGET = /usr/local/bin/pc-pfmanager
 DEPENDPATH += config
 
+LIBS    += -lpcbsd
+INCLUDEPATH+= ../../../libpcbsd/
+
 TRANSLATIONS =  i18n/PFManager_af.ts \
 		i18n/PFManager_ar.ts \
 		i18n/PFManager_az.ts \

Modified: pcbsd/branches/9.1/src-qt4/pc-pfmanager/pfmanagerdlg.cpp
===================================================================
--- pcbsd/branches/9.1/src-qt4/pc-pfmanager/pfmanagerdlg.cpp	2012-11-12 18:51:47 UTC (rev 20191)
+++ pcbsd/branches/9.1/src-qt4/pc-pfmanager/pfmanagerdlg.cpp	2012-11-12 18:52:35 UTC (rev 20192)
@@ -9,6 +9,7 @@
 #include <qmessagebox.h>
 #include <qpushbutton.h>
 #include <QTreeWidgetItem>
+#include <pcbsd-utils.h>
 
 PFManagerDlg::~PFManagerDlg(void)
 {
@@ -25,6 +26,8 @@
         if ( checked )
         {
             _firewall.enable();
+	    Utils::setConfFileValue( "/etc/rc.conf", "pf_enable", "pf_enable=\"YES\"", -1);
+   	    system("/etc/rc.d/pf start");
         }
         else
         { // disable firewall
@@ -35,7 +38,8 @@
             if ( QMessageBox::question(this, tr("Question"), question,
                                        QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
             {
-                _firewall.disable();
+		system("/etc/rc.d/pf stop");
+		Utils::setConfFileValue( "/etc/rc.conf", "pf_enable", "pf_enable=\"NO\"", -1);
             } else {
     		cbEnable->setChecked(true);
 	    }



More information about the Commits mailing list