[PC-BSD Commits] r2181 - pcbsd/trunk/kcmPFManager

svn at pcbsd.org svn at pcbsd.org
Thu Jun 26 15:00:35 PDT 2008


Author: kris
Date: 2008-06-26 15:00:35 -0700 (Thu, 26 Jun 2008)
New Revision: 2181

Modified:
   pcbsd/trunk/kcmPFManager/kcm.cpp
   pcbsd/trunk/kcmPFManager/kcm.hpp
   pcbsd/trunk/kcmPFManager/notroot.cpp
   pcbsd/trunk/kcmPFManager/pfmanager.pro
   pcbsd/trunk/kcmPFManager/pfmanagerdlg.cpp
   pcbsd/trunk/kcmPFManager/pfmanagerdlg.hpp
Log:
Fixed some bugs in the pfmanager which prevented it from loading




Modified: pcbsd/trunk/kcmPFManager/kcm.cpp
===================================================================
--- pcbsd/trunk/kcmPFManager/kcm.cpp	2008-06-26 21:14:16 UTC (rev 2180)
+++ pcbsd/trunk/kcmPFManager/kcm.cpp	2008-06-26 22:00:35 UTC (rev 2181)
@@ -13,21 +13,22 @@
 K_PLUGIN_FACTORY(PFManagerFactory,
                  registerPlugin<PFManager>();
                 )
-K_EXPORT_PLUGIN(PFManagerFactory("kcm_pfmanager"))
+K_EXPORT_PLUGIN(PFManagerFactory("kcmpfmanager"))
 
 
 PFManager::PFManager(QWidget *parent, const QVariantList &lst)
    :    KCModule(PFManagerFactory::componentData(), parent, lst)
 
 {
-    _layout = new QGridLayout(this);
-    _layout->setAutoAdd(true);
+    layout = new QGridLayout(this);
+    layout->setAutoAdd(true);
 
-    setButtons(0);
+  buttons();
   QString LANG="PFManager";
   //KGlobal::locale()->insertCatalogue(LANG);
 
 
+
     if ( isRoot() )
     { // Show our dialog
         _dlg = new PFManagerDlg();
@@ -39,11 +40,13 @@
     { // Show some fancy error message
         NotRoot *noroot = new NotRoot();
         // Not in as root
+        noroot->programInit();
         noroot->reparent(this, QPoint());
+        QMessageBox::information(this, tr("Restored."), tr("Here we are!"));
     }
 }
 
-PFManager::~PFManager ( void )
+PFManager::~PFManager ()
 {
 }
 
@@ -54,10 +57,10 @@
 
 void PFManager::load ( void )
 {
-    _dlg->load();
+    //_dlg->load();
 }
 
-bool PFManager::isRoot ( void ) const
+bool PFManager::isRoot ()
 {
     return ( getuid() == 0 );
 }

Modified: pcbsd/trunk/kcmPFManager/kcm.hpp
===================================================================
--- pcbsd/trunk/kcmPFManager/kcm.hpp	2008-06-26 21:14:16 UTC (rev 2180)
+++ pcbsd/trunk/kcmPFManager/kcm.hpp	2008-06-26 22:00:35 UTC (rev 2181)
@@ -1,26 +1,29 @@
 
 #ifndef __KCM_MODULE
-
 #define __KCM_MODULE
 
 #include <kcmodule.h>
 #include "pfmanagerdlg.hpp"
+#include "notroot.h"
+class KConfigDialogManager;
 
 class PFManager : public KCModule
 {
     Q_OBJECT
-    PFManagerDlg *_dlg;
-    QLayout *_layout;
 
 public:
+    PFManager ( QWidget *parent=0, const QVariantList& = QVariantList() );
+    ~PFManager ();
 
-    PFManager ( QWidget *widget, const QVariantList& = QVariantList() );
-    ~PFManager ( void );
+    PFManagerDlg *_dlg;
+    QLayout *layout;
+    bool isRoot();
 
+
+public slots:
+
     void load ( void );
     void save ( void );
-
-    bool isRoot ( void ) const;
 };
 
 #endif

Modified: pcbsd/trunk/kcmPFManager/notroot.cpp
===================================================================
--- pcbsd/trunk/kcmPFManager/notroot.cpp	2008-06-26 21:14:16 UTC (rev 2180)
+++ pcbsd/trunk/kcmPFManager/notroot.cpp	2008-06-26 22:00:35 UTC (rev 2181)
@@ -32,8 +32,7 @@
 
 void NotRoot::programInit()
 { 
-    qDebug("Application starting as non-root...");
-    
+    QMessageBox::information(this, tr("Restored."), tr("Here we are2!"));
     connect(pushAdmin, SIGNAL( clicked() ), this, SLOT(slotLaunchAdmin() ) );
     
 }
@@ -44,7 +43,7 @@
     launchAdminProc = new Q3Process( this );
     launchAdminProc->addArgument( "kdesu" );
     launchAdminProc->addArgument( "kcmshell4" );
-    launchAdminProc->addArgument( "pcbsdpbm" );
+    launchAdminProc->addArgument( "pfmanager" );
  
     if ( !launchAdminProc->start() ) {
  

Modified: pcbsd/trunk/kcmPFManager/pfmanager.pro
===================================================================
--- pcbsd/trunk/kcmPFManager/pfmanager.pro	2008-06-26 21:14:16 UTC (rev 2180)
+++ pcbsd/trunk/kcmPFManager/pfmanager.pro	2008-06-26 22:00:35 UTC (rev 2181)
@@ -5,6 +5,11 @@
 
 INCLUDEPATH	+= . config
 
+INCLUDEPATH += /usr/local/kde4/include
+
+LIBS += -L/usr/local/kde4/lib -lkdecore -lkio -lkdeui -Ikdelibs
+
+
 HEADERS	+= kcm.hpp \
         config/packetfilter.hpp \
 	config/rcconfig.hpp \

Modified: pcbsd/trunk/kcmPFManager/pfmanagerdlg.cpp
===================================================================
--- pcbsd/trunk/kcmPFManager/pfmanagerdlg.cpp	2008-06-26 21:14:16 UTC (rev 2180)
+++ pcbsd/trunk/kcmPFManager/pfmanagerdlg.cpp	2008-06-26 22:00:35 UTC (rev 2181)
@@ -11,6 +11,11 @@
 #include <Q3ListView>
 #include <Q3ListViewItem>
 
+PFManagerDlg::~PFManagerDlg(void)
+{
+
+}
+
 void PFManagerDlg::enableClicked ( void )
 {
     bool checked = cbEnable->isChecked();

Modified: pcbsd/trunk/kcmPFManager/pfmanagerdlg.hpp
===================================================================
--- pcbsd/trunk/kcmPFManager/pfmanagerdlg.hpp	2008-06-26 21:14:16 UTC (rev 2180)
+++ pcbsd/trunk/kcmPFManager/pfmanagerdlg.hpp	2008-06-26 22:00:35 UTC (rev 2181)
@@ -47,6 +47,7 @@
     refreshStatus();
 
     }
+
     ~PFManagerDlg ( void );
 
 public slots:



More information about the Commits mailing list