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

svn at pcbsd.org svn at pcbsd.org
Wed Mar 21 01:20:40 PDT 2012


Author: kris
Date: 2012-03-21 08:20:39 +0000 (Wed, 21 Mar 2012)
New Revision: 15869

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

Let us remove jails via GUI, warn user ahead of time though. Also re-enable fixed
right-click functionality



Modified: pcbsd/current/src-qt4/warden/src/dialogwarden.cpp
===================================================================
--- pcbsd/current/src-qt4/warden/src/dialogwarden.cpp	2012-03-21 07:42:52 UTC (rev 15868)
+++ pcbsd/current/src-qt4/warden/src/dialogwarden.cpp	2012-03-21 08:20:39 UTC (rev 15869)
@@ -44,6 +44,7 @@
    // Hide the identifier column / host column
    listJails->setColumnHidden(0, true);
    listJails->setColumnHidden(2, true);
+   listJails->setColumnHidden(3, true);
 
    groupJailTab->setTitle(tr("<- Please select a jail"));
    groupJailTab->setEnabled(false);
@@ -64,12 +65,12 @@
     
    // Connect the rightclick slot 
    listJails->setContextMenuPolicy( Qt::CustomContextMenu);
-   //connect( listJails, SIGNAL(customContextMenuRequested (const QPoint & ) ), this, SLOT(slotJailRightClicked() ) );
+   connect( listJails, SIGNAL(customContextMenuRequested (const QPoint & ) ), this, SLOT(slotJailRightClicked() ) );
    connect( listJails, SIGNAL(itemSelectionChanged() ), this, SLOT(slotCurrentJailChanged() ) );
    connect( radioIPSort, SIGNAL(clicked()), this, SLOT(slotJailViewChanged() ) );
    connect( radioHostSort, SIGNAL(clicked()), this, SLOT(slotJailViewChanged() ) );
    connect( pushAdd, SIGNAL(clicked()), this, SLOT(slotClickedNewJail() ) );
-   connect( pushRemove, SIGNAL(clicked()), this, SLOT(slotClickedNewJail() ) );
+   connect( pushRemove, SIGNAL(clicked()), this, SLOT(slotDeleteJail() ) );
 }
 
 
@@ -230,9 +231,11 @@
 	    if ( exitStatus == 0) {
 		(*it)->setIcon(1, QIcon(":running.png"));
 		(*it)->setIcon(2, QIcon(":running.png"));
+	        (*it)->setText(3, "Running");
 	    } else {
 		(*it)->setIcon(1, QIcon(":stopped.png"));
 		(*it)->setIcon(2, QIcon(":stopped.png"));
+	        (*it)->setText(3, "Not Running");
 	    }
 	    break;
 	}
@@ -253,29 +256,17 @@
     if ( listJails->currentItem()) {
           popupip = listJails->currentItem()->text(0);
           Status = listJails->currentItem()->text(3);
-	  if ( Status == tr("Running") ) {
-	      popup = new QMenu();
+	  popup = new QMenu();
+	  if ( Status == "Running" )
 	      popup->addAction( tr("Stop this Jail") , this, SLOT(slotStopJail() )  );
-	      popup->addSeparator();
-	      popup->addAction( tr("Toggle Autostart") , this, SLOT(slotToggleAutostartClicked() )  );
-	      popup->addAction( tr("Install Inmate into jail") , this, SLOT(slotInmateInstallClicked() )  );
-	      popup->addAction( tr("View installed packages") , this, SLOT(slotListJailPkgs() )  );
-	      popup->addAction( tr("Export jail to .wdn file") , this, SLOT(slotExportJail() )  );
-	      popup->addSeparator();
-	      popup->addAction( tr("Delete Jail") , this, SLOT(slotDeleteJail() )  );
-	      popup->exec( QCursor::pos() );
-	  } else {
-	      popup = new QMenu();
+	  else
 	      popup->addAction( tr("Start this Jail") , this, SLOT(slotStartJail() )  );
-	      popup->addSeparator();
-	      popup->addAction( tr("Toggle Autostart") , this, SLOT(slotToggleAutostartClicked() )  );
-	      popup->addAction( tr("Install Inmate into jail") , this, SLOT(slotInmateInstallClicked() )  );
-	      popup->addAction( tr("View installed packages") , this, SLOT(slotListJailPkgs() )  );
-	      popup->addAction( tr("Export jail to .wdn file") , this, SLOT(slotExportJail() )  );
-	      popup->addSeparator();
-	      popup->addAction( tr("Delete Jail") , this, SLOT(slotDeleteJail() )  );
-	      popup->exec( QCursor::pos() );
-	  }
+	  popup->addSeparator();
+	  popup->addAction( tr("Toggle Autostart") , this, SLOT(slotToggleAutostartClicked() )  );
+	  popup->addAction( tr("Export jail to .wdn file") , this, SLOT(slotExportJail() )  );
+	  popup->addSeparator();
+	  popup->addAction( tr("Delete Jail") , this, SLOT(slotDeleteJail() )  );
+	  popup->exec( QCursor::pos() );
 
 
     }
@@ -423,6 +414,14 @@
       return;
 
     popupip = listJails->currentItem()->text(0);
+
+    // Confirm with user
+    int ret = QMessageBox::warning(this, tr("Warden"),
+                                tr("Are you sure you want to delete the jail") + ": " + popupip,
+                                QMessageBox::Yes | QMessageBox::No,
+                                QMessageBox::No);
+    if ( ret == QMessageBox::No)
+      return;
     
     // Launch our working dialog to prevent further action until we are finished
     workingDialog = new dialogWorking();

Modified: pcbsd/current/src-qt4/warden/src/dialogwarden.ui
===================================================================
--- pcbsd/current/src-qt4/warden/src/dialogwarden.ui	2012-03-21 07:42:52 UTC (rev 15868)
+++ pcbsd/current/src-qt4/warden/src/dialogwarden.ui	2012-03-21 08:20:39 UTC (rev 15869)
@@ -73,14 +73,19 @@
          </column>
          <column>
           <property name="text">
-           <string>Jail</string>
+           <string notr="true">Jail</string>
           </property>
          </column>
          <column>
           <property name="text">
-           <string>Hostname</string>
+           <string notr="true">Hostname</string>
           </property>
          </column>
+         <column>
+          <property name="text">
+           <string notr="true">Status</string>
+          </property>
+         </column>
         </widget>
        </item>
        <item row="2" column="0">
@@ -218,7 +223,7 @@
      <x>0</x>
      <y>0</y>
      <width>804</width>
-     <height>21</height>
+     <height>22</height>
     </rect>
    </property>
    <widget class="QMenu" name="fileMenu">



More information about the Commits mailing list