[PC-BSD Commits] r1994 - pcbsd-projects/warden/src

svn at pcbsd.org svn at pcbsd.org
Thu May 29 15:29:18 PDT 2008


Author: kris
Date: 2008-05-29 15:29:18 -0700 (Thu, 29 May 2008)
New Revision: 1994

Modified:
   pcbsd-projects/warden/src/dialogwarden.ui
   pcbsd-projects/warden/src/dialogwarden.ui.h
   pcbsd-projects/warden/src/main.cpp
Log:

Added feature to "toggle" autostart status in warden GUI, and fixed
bug in main.cpp starting application. Commited the wrong file previously



Modified: pcbsd-projects/warden/src/dialogwarden.ui
===================================================================
--- pcbsd-projects/warden/src/dialogwarden.ui	2008-05-29 21:04:09 UTC (rev 1993)
+++ pcbsd-projects/warden/src/dialogwarden.ui	2008-05-29 22:29:18 UTC (rev 1994)
@@ -263,6 +263,7 @@
     <variable access="private">QString importFile;</variable>
     <variable access="private">QProcess *importJailProc;</variable>
     <variable access="private">QProcess *loadInmateProc;</variable>
+    <variable access="private">QProcess *toggleAutoProc;</variable>
 </variables>
 <slots>
     <slot>helpAbout()</slot>
@@ -297,6 +298,7 @@
     <slot access="private">slotInmateInstallClicked()</slot>
     <slot access="private">slotReadInmateOutput()</slot>
     <slot access="private">slotFinishedInmateInstall()</slot>
+    <slot access="private">slotToggleAutostartClicked()</slot>
 </slots>
 <functions>
     <function>programInit()</function>

Modified: pcbsd-projects/warden/src/dialogwarden.ui.h
===================================================================
--- pcbsd-projects/warden/src/dialogwarden.ui.h	2008-05-29 21:04:09 UTC (rev 1993)
+++ pcbsd-projects/warden/src/dialogwarden.ui.h	2008-05-29 22:29:18 UTC (rev 1994)
@@ -244,6 +244,7 @@
 	      popup = new KPopupMenu();
 	      popup->insertItem( tr("Stop this Jail") , this, SLOT(slotStopJail() )  );
 	      popup->insertSeparator();
+	      popup->insertItem( tr("Toggle Autostart") , this, SLOT(slotToggleAutostartClicked() )  );
 	      popup->insertItem( tr("Install Inmate into jail") , this, SLOT(slotInmateInstallClicked() )  );
 	      popup->insertItem( tr("View installed packages") , this, SLOT(slotListJailPkgs() )  );
 	      popup->insertItem( tr("Export jail to .wdn file") , this, SLOT(slotExportJail() )  );
@@ -254,6 +255,7 @@
 	      popup = new KPopupMenu();
 	      popup->insertItem( tr("Start this Jail") , this, SLOT(slotStartJail() )  );
 	      popup->insertSeparator();
+	      popup->insertItem( tr("Toggle Autostart") , this, SLOT(slotToggleAutostartClicked() )  );
 	      popup->insertItem( tr("Install Inmate into jail") , this, SLOT(slotInmateInstallClicked() )  );
 	      popup->insertItem( tr("View installed packages") , this, SLOT(slotListJailPkgs() )  );
 	      popup->insertItem( tr("Export jail to .wdn file") , this, SLOT(slotExportJail() )  );
@@ -741,3 +743,23 @@
        // Refresh our jail list
     refreshJails();
 }
+
+
+void dialogWarden::slotToggleAutostartClicked()
+{
+    // Change auto-start status of the jail
+    runCommand("warden auto " + popupip);
+    
+      toggleAutoProc = new QProcess( this );
+      toggleAutoProc->addArgument( "warden");
+      toggleAutoProc->addArgument( "auto");
+      toggleAutoProc->addArgument( popupip);
+
+      
+            // Connect the exited signal and start the process 
+      connect( toggleAutoProc, SIGNAL(processExited()), this, SLOT(refreshJails() ) );
+      if ( ! toggleAutoProc->start() ) {
+	  QMessageBox::information( this, tr("Error!"), tr("Error running warden auto! ") );
+      }
+    
+}

Modified: pcbsd-projects/warden/src/main.cpp
===================================================================
--- pcbsd-projects/warden/src/main.cpp	2008-05-29 21:04:09 UTC (rev 1993)
+++ pcbsd-projects/warden/src/main.cpp	2008-05-29 22:29:18 UTC (rev 1994)
@@ -7,9 +7,13 @@
 
 int main( int argc, char ** argv )
 {
-KUniqueApplication::addCmdLineOptions();
 
+   KCmdLineArgs::init(argc, argv, "The Warden", "The Warden", "The Warden", "1.0");
 
+
+   KUniqueApplication::addCmdLineOptions();
+
+
     KApplication  a(argc, argv);
 
     dialogWarden *w = new dialogWarden();



More information about the Commits mailing list