[PC-BSD Commits] r15657 - pcbsd/current/src-qt4/warden/src

svn at pcbsd.org svn at pcbsd.org
Wed Feb 29 10:34:06 PST 2012


Author: kris
Date: 2012-02-29 18:34:06 +0000 (Wed, 29 Feb 2012)
New Revision: 15657

Modified:
   pcbsd/current/src-qt4/warden/src/dialogconfig.cpp
   pcbsd/current/src-qt4/warden/src/dialogwarden.cpp
   pcbsd/current/src-qt4/warden/src/src.pro
Log:

Update warden gui to use new /usr/local/etc/warden.conf file



Modified: pcbsd/current/src-qt4/warden/src/dialogconfig.cpp
===================================================================
--- pcbsd/current/src-qt4/warden/src/dialogconfig.cpp	2012-02-29 18:17:32 UTC (rev 15656)
+++ pcbsd/current/src-qt4/warden/src/dialogconfig.cpp	2012-02-29 18:34:06 UTC (rev 15657)
@@ -12,6 +12,7 @@
 #include "dialogconfig.h"
 #include <qsettings.h>
 #include <qfiledialog.h>
+#include "pcbsd-utils.h"
 
 
 void dialogConfig::programInit()
@@ -25,9 +26,9 @@
 {
     QSettings settings("PCBSD");
     
-    NIC = settings.value( "/PC-BSD/TheWarden/NIC", "UNSET" ).toString();
-    TMPDIR = settings.value( "/PC-BSD/TheWarden/TMPDIR", "UNSET" ).toString();
-    JailDir = settings.value( "/PC-BSD/TheWarden/JailDir", "UNSET" ).toString();
+    NIC = Utils::getValFromPCConf("/usr/local/etc/warden.conf", "NIC");
+    TMPDIR = Utils::getValFromPCConf("/usr/local/etc/warden.conf", "WTMP");
+    JailDir = Utils::getValFromPCConf("/usr/local/etc/warden.conf", "JDIR");
     
     lineNIC->setText(NIC);
     lineJailDir->setText(JailDir);
@@ -64,11 +65,10 @@
 
 void dialogConfig::slotSave()
 {
-    QSettings settings("PCBSD");
     
-    settings.setValue( "/PC-BSD/TheWarden/NIC", lineNIC->text());
-    settings.setValue( "/PC-BSD/TheWarden/TMPDIR", lineTMPDIR->text() );
-    settings.setValue( "/PC-BSD/TheWarden/JailDir", lineJailDir->text() );
+    Utils::setValPCConf("/usr/local/etc/warden.conf", "NIC", lineNIC->text());
+    Utils::setValPCConf("/usr/local/etc/warden.conf", "WTMP", lineTMPDIR->text());
+    Utils::setValPCConf("/usr/local/etc/warden.conf", "JDIR", lineJailDir->text());
     
     emit saved();
     close();

Modified: pcbsd/current/src-qt4/warden/src/dialogwarden.cpp
===================================================================
--- pcbsd/current/src-qt4/warden/src/dialogwarden.cpp	2012-02-29 18:17:32 UTC (rev 15656)
+++ pcbsd/current/src-qt4/warden/src/dialogwarden.cpp	2012-02-29 18:34:06 UTC (rev 15657)
@@ -23,6 +23,7 @@
 #include "dialogdisplayoutput.h"
 #include "dialogimport.h"
 #include "dialogsetupuser.h"
+#include "pcbsd-utils.h"
 
 /* Update interval in ms  - Every 2 seconds */
 #define  UPDATE_MSEC 1000 * 2
@@ -110,14 +111,9 @@
 void dialogWarden::readConfig()
 {  
     
-    QSettings settings("PCBSD");
-
-    ProgDir = settings.value( "/PC-BSD/TheWarden/ProgDir", WARDENDIR ).toString();
-    WorldSrc = settings.value( "/PC-BSD/TheWarden/WorldSrc", QString("/usr/src") ).toString();
-    WorldDir = settings.value( "/PC-BSD/TheWarden/WorldDir", WARDENDIR + QString("/worlds/buildworld") ).toString();
-    NIC = settings.value( "/PC-BSD/TheWarden/NIC", "UNSET" ).toString();
-    TMPDIR = settings.value( "/PC-BSD/TheWarden/TMPDIR", WARDENDIR + QString("/tmp")).toString();
-    JailDir = settings.value( "/PC-BSD/TheWarden/JailDir", WARDENDIR + QString("/jails") ).toString();
+    ProgDir = "/usr/local/share/warden";
+    TMPDIR = Utils::getValFromPCConf("/usr/local/etc/warden.conf", "WTMP");
+    JailDir = Utils::getValFromPCConf("/usr/local/etc/warden.conf", "JDIR");
     
 }
 

Modified: pcbsd/current/src-qt4/warden/src/src.pro
===================================================================
--- pcbsd/current/src-qt4/warden/src/src.pro	2012-02-29 18:17:32 UTC (rev 15656)
+++ pcbsd/current/src-qt4/warden/src/src.pro	2012-02-29 18:34:06 UTC (rev 15657)
@@ -3,10 +3,9 @@
 
 CONFIG	+= qt warn_on release
 
-LIBS	+= -L/usr/local/lib 
+LIBS    += -lpcbsd
+INCLUDEPATH+= ../../../pcbsd/current/src-qt4/libpcbsd/
 
-INCLUDEPATH += /usr/local/include
-
 HEADERS += dialogwarden.h dialogconfig.h dialogimport.h dialogworking.h dialogdisplayoutput.h dialogcreatejail.h dialogsetupuser.h
 
 SOURCES	+= main.cpp dialogwarden.cpp dialogconfig.cpp dialogimport.cpp dialogworking.cpp dialogdisplayoutput.cpp dialogcreatejail.cpp dialogsetupuser.cpp



More information about the Commits mailing list