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

svn at pcbsd.org svn at pcbsd.org
Wed Aug 1 17:24:54 PDT 2012


Author: kris
Date: 2012-08-02 00:24:54 +0000 (Thu, 02 Aug 2012)
New Revision: 18082

Modified:
   pcbsd/current/src-qt4/warden-gui/dialogwarden.cpp
   pcbsd/current/src-qt4/warden-gui/dialogwarden.h
Log:

When starting the Warden, check to make sure we have a valid NIC
specified, and prompt user to select one if not



Modified: pcbsd/current/src-qt4/warden-gui/dialogwarden.cpp
===================================================================
--- pcbsd/current/src-qt4/warden-gui/dialogwarden.cpp	2012-08-01 23:42:40 UTC (rev 18081)
+++ pcbsd/current/src-qt4/warden-gui/dialogwarden.cpp	2012-08-02 00:24:54 UTC (rev 18082)
@@ -98,9 +98,27 @@
    connect( pushRemoveSnap, SIGNAL(clicked()), this, SLOT(slotRemoveSnap() ) );
    //connect( sliderSnaps, SIGNAL(sliderMoved(int)), this, SLOT(slotSnapSliderChanged(int) ) );
    connect( sliderSnaps, SIGNAL(valueChanged(int)), this, SLOT(slotSnapSliderChanged(int) ) );
+   QTimer::singleShot(100, this, SLOT(slotCheckNic()) );
 }
 
 
+void dialogWarden::slotCheckNic() 
+{
+   QString NIC = Utils::getValFromPCConf("/usr/local/etc/warden.conf", "NIC");
+   if ( system("ifconfig " + NIC.toLatin1() + " >/dev/null 2>/dev/null") != 0 )
+   {
+      // Confirm with user
+      int ret = QMessageBox::warning(this, tr("Warden"),
+                                tr("No valid network interface specified! Select one now?"),
+                                QMessageBox::Yes | QMessageBox::No,
+                                QMessageBox::No);
+      if ( ret == QMessageBox::No)
+         return;
+
+      slotOpenConfig();
+   }
+}
+
 void dialogWarden::refreshJails()
 {
    QString jType, jIPs, jZFS;

Modified: pcbsd/current/src-qt4/warden-gui/dialogwarden.h
===================================================================
--- pcbsd/current/src-qt4/warden-gui/dialogwarden.h	2012-08-01 23:42:40 UTC (rev 18081)
+++ pcbsd/current/src-qt4/warden-gui/dialogwarden.h	2012-08-02 00:24:54 UTC (rev 18082)
@@ -72,6 +72,7 @@
 
     void slotCheckForUpdates();
     void slotCheckUpdateReturn();
+    void slotCheckNic();
 
     // Snapshot support
     void slotSnapSliderChanged(int newVal);



More information about the Commits mailing list