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

svn at pcbsd.org svn at pcbsd.org
Wed Mar 7 12:16:22 PST 2012


Author: kris
Date: 2012-03-07 20:16:22 +0000 (Wed, 07 Mar 2012)
New Revision: 15744

Added:
   pcbsd/current/src-qt4/warden/src/edit_add.png
   pcbsd/current/src-qt4/warden/src/edit_remove.png
   pcbsd/current/src-qt4/warden/src/running.png
   pcbsd/current/src-qt4/warden/src/stopped.png
Modified:
   pcbsd/current/src-qt4/warden/src/dialogwarden.cpp
   pcbsd/current/src-qt4/warden/src/dialogwarden.ui
   pcbsd/current/src-qt4/warden/src/warden.qrc
Log:

Add intial GUI redesign for warden, more functionality to come



Modified: pcbsd/current/src-qt4/warden/src/dialogwarden.cpp
===================================================================
--- pcbsd/current/src-qt4/warden/src/dialogwarden.cpp	2012-03-07 18:59:23 UTC (rev 15743)
+++ pcbsd/current/src-qt4/warden/src/dialogwarden.cpp	2012-03-07 20:16:22 UTC (rev 15744)
@@ -56,22 +56,27 @@
     
     // 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( radioIPSort, SIGNAL(clicked()), this, SLOT(refreshJails() ) );
+    connect( radioHostSort, SIGNAL(clicked()), this, SLOT(refreshJails() ) );
+    connect( pushAdd, SIGNAL(clicked()), this, SLOT(slotClickedNewJail() ) );
+    connect( pushRemove, SIGNAL(clicked()), this, SLOT(slotClickedNewJail() ) );
 }
 
 
 void dialogWarden::refreshJails()
 {
-    QString AutoStart;
+   QString AutoStart;
     
    listJails->clear();
+   // Hide the identifier column
+   listJails->setColumnHidden(0, true);
    
    // Check our JailDir and see what we have
    QDir d(JailDir);
    d.setFilter( QDir::Dirs);
 
-   for ( int i = 0; i < d.count(); i++ ) {
+   for ( unsigned int i = 0; i < d.count(); i++ ) {
        
        // Traverse our directories, looking for jails
        if ( d[i] != "." && d[i] != ".." ) {
@@ -95,7 +100,10 @@
 		     AutoStart = "Enabled";  
 	          }
 	           QStringList cols;
-                   cols << d[i] << host << AutoStart << "<Unknown>"; 
+		   if ( radioIPSort->isChecked() )	
+                     cols << d[i] << d[i];
+		   else
+                     cols << d[i] << host;
 	           (void) new QTreeWidgetItem( listJails, cols );
                   }
 	}
@@ -103,7 +111,7 @@
    
    }
    
-
+   listJails->sortByColumn(1, Qt::AscendingOrder);
    
 }
 
@@ -212,9 +220,9 @@
 	if ( currentStatusWorkingJail == (*it)->text(0) )
 	{
 	    if ( exitStatus == 0) {
-		(*it)->setText(3, tr("Running"));
+		(*it)->setIcon(1, QIcon(":running.png"));
 	    } else {
-		(*it)->setText(3, tr("Stopped"));
+		(*it)->setIcon(1, QIcon(":stopped.png"));
 	    }
 	    
 	    break;
@@ -234,7 +242,6 @@
 void dialogWarden::slotJailRightClicked()
 {
     QString Status;
-    bool ok;
 
     if ( listJails->currentItem()) {
           popupip = listJails->currentItem()->text(0);
@@ -404,27 +411,32 @@
 void dialogWarden::slotDeleteJail()
 {
     QString tmp;
+
+    if ( ! listJails->currentItem() )
+      return;
+
+    popupip = listJails->currentItem()->text(0);
     
-       // Launch our working dialog to prevent further action until we are finished
-      workingDialog = new dialogWorking();
-      workingDialog->setModal(true);
-      workingDialog->programInit();
-      tmp = tr("Deleting Jail");
-      workingDialog->setDialogTitle(tmp);
-      tmp = tr("Deleting Jail:") + " " + popupip;
-      workingDialog->setDialogText(tmp);
-      workingDialog->show();
+    // Launch our working dialog to prevent further action until we are finished
+    workingDialog = new dialogWorking();
+    workingDialog->setModal(true);
+    workingDialog->programInit();
+    tmp = tr("Deleting Jail");
+    workingDialog->setDialogTitle(tmp);
+    tmp = tr("Deleting Jail:") + " " + popupip;
+    workingDialog->setDialogText(tmp);
+    workingDialog->show();
+  
+    // Now start the script to stop this jail
+    deleteJailProc = new QProcess( this );
+    QString program = ProgDir + "/scripts/backend/deletejail.sh";
+    QStringList args;
+    args << popupip;
     
-          // Now start the script to stop this jail
-      deleteJailProc = new QProcess( this );
-      QString program = ProgDir + "/scripts/backend/deletejail.sh";
-      QStringList args;
-      args << popupip;
-      
-      // Connect the exited signal and start the process 
-      connect( deleteJailProc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(refreshJails() ) );
-      connect( deleteJailProc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotFinishedWorking() ) );
-      deleteJailProc->start(program, args);
+    // Connect the exited signal and start the process 
+    connect( deleteJailProc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(refreshJails() ) );
+    connect( deleteJailProc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotFinishedWorking() ) );
+    deleteJailProc->start(program, args);
 }
 
 

Modified: pcbsd/current/src-qt4/warden/src/dialogwarden.ui
===================================================================
--- pcbsd/current/src-qt4/warden/src/dialogwarden.ui	2012-03-07 18:59:23 UTC (rev 15743)
+++ pcbsd/current/src-qt4/warden/src/dialogwarden.ui	2012-03-07 20:16:22 UTC (rev 15744)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>509</width>
-    <height>336</height>
+    <width>804</width>
+    <height>457</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -18,14 +18,20 @@
     <normaloff>:/warden.png</normaloff>:/warden.png</iconset>
   </property>
   <widget class="QWidget" name="widget">
-   <layout class="QGridLayout">
+   <layout class="QGridLayout" name="gridLayout_3">
     <item row="0" column="0">
      <widget class="QGroupBox" name="groupBox">
+      <property name="maximumSize">
+       <size>
+        <width>250</width>
+        <height>16777215</height>
+       </size>
+      </property>
       <property name="title">
-       <string>Available Jails</string>
+       <string>Installed Jails</string>
       </property>
       <layout class="QGridLayout" name="gridLayout">
-       <item row="0" column="0">
+       <item row="1" column="0" colspan="3">
         <widget class="QTreeWidget" name="listJails">
          <property name="indentation">
           <number>0</number>
@@ -40,23 +46,11 @@
           <bool>true</bool>
          </property>
          <property name="headerHidden">
-          <bool>false</bool>
+          <bool>true</bool>
          </property>
-         <attribute name="headerCascadingSectionResizes">
+         <attribute name="headerVisible">
           <bool>false</bool>
          </attribute>
-         <attribute name="headerDefaultSectionSize">
-          <number>70</number>
-         </attribute>
-         <attribute name="headerMinimumSectionSize">
-          <number>25</number>
-         </attribute>
-         <attribute name="headerShowSortIndicator" stdset="0">
-          <bool>false</bool>
-         </attribute>
-         <attribute name="headerStretchLastSection">
-          <bool>true</bool>
-         </attribute>
          <attribute name="headerCascadingSectionResizes">
           <bool>false</bool>
          </attribute>
@@ -74,29 +68,143 @@
          </attribute>
          <column>
           <property name="text">
-           <string>IP</string>
+           <string notr="true">JDIR</string>
           </property>
          </column>
          <column>
           <property name="text">
-           <string>Hostname</string>
+           <string>Jail</string>
           </property>
          </column>
-         <column>
-          <property name="text">
-           <string>Autostart</string>
-          </property>
-         </column>
-         <column>
-          <property name="text">
-           <string>Status</string>
-          </property>
-         </column>
         </widget>
        </item>
+       <item row="2" column="0">
+        <widget class="QPushButton" name="pushAdd">
+         <property name="minimumSize">
+          <size>
+           <width>32</width>
+           <height>32</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>32</width>
+           <height>32</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>Add a new Jail</string>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+         <property name="icon">
+          <iconset resource="warden.qrc">
+           <normaloff>:/edit_add.png</normaloff>:/edit_add.png</iconset>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1">
+        <widget class="QPushButton" name="pushRemove">
+         <property name="minimumSize">
+          <size>
+           <width>32</width>
+           <height>32</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>32</width>
+           <height>32</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>Remove the selected Jail</string>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+         <property name="icon">
+          <iconset resource="warden.qrc">
+           <normaloff>:/edit_remove.png</normaloff>:/edit_remove.png</iconset>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="2">
+        <spacer name="horizontalSpacer">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>155</width>
+           <height>29</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item row="0" column="0" colspan="2">
+        <widget class="QRadioButton" name="radioIPSort">
+         <property name="toolTip">
+          <string>Sort via IP</string>
+         </property>
+         <property name="text">
+          <string>IP</string>
+         </property>
+         <property name="checked">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="2">
+        <widget class="QRadioButton" name="radioHostSort">
+         <property name="toolTip">
+          <string>Sort via Hostname</string>
+         </property>
+         <property name="text">
+          <string>Host</string>
+         </property>
+        </widget>
+       </item>
       </layout>
      </widget>
     </item>
+    <item row="0" column="1">
+     <widget class="QGroupBox" name="groupBox_2">
+      <property name="title">
+       <string>Working on Jail</string>
+      </property>
+      <layout class="QGridLayout" name="gridLayout_2">
+       <item row="0" column="0">
+        <widget class="QTabWidget" name="tabJail">
+         <property name="currentIndex">
+          <number>0</number>
+         </property>
+         <widget class="QWidget" name="tab">
+          <attribute name="title">
+           <string>Info</string>
+          </attribute>
+         </widget>
+         <widget class="QWidget" name="tab_2">
+          <attribute name="title">
+           <string>Tools</string>
+          </attribute>
+         </widget>
+         <widget class="QWidget" name="tab_3">
+          <attribute name="title">
+           <string>Logs</string>
+          </attribute>
+         </widget>
+         <widget class="QWidget" name="tab_4">
+          <attribute name="title">
+           <string>Packages</string>
+          </attribute>
+         </widget>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </item>
    </layout>
   </widget>
   <widget class="QMenuBar" name="MenuBar">
@@ -104,8 +212,8 @@
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>509</width>
-     <height>22</height>
+     <width>804</width>
+     <height>21</height>
     </rect>
    </property>
    <widget class="QMenu" name="fileMenu">

Index: pcbsd/current/src-qt4/warden/src/edit_add.png
===================================================================
--- pcbsd/current/src-qt4/warden/src/edit_add.png	2012-03-07 18:59:23 UTC (rev 15743)
+++ pcbsd/current/src-qt4/warden/src/edit_add.png	2012-03-07 20:16:22 UTC (rev 15744)

Property changes on: pcbsd/current/src-qt4/warden/src/edit_add.png
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
Added: svn:mime-type
## -0,0 +1 ##
+image/png
Index: pcbsd/current/src-qt4/warden/src/edit_remove.png
===================================================================
--- pcbsd/current/src-qt4/warden/src/edit_remove.png	2012-03-07 18:59:23 UTC (rev 15743)
+++ pcbsd/current/src-qt4/warden/src/edit_remove.png	2012-03-07 20:16:22 UTC (rev 15744)

Property changes on: pcbsd/current/src-qt4/warden/src/edit_remove.png
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
Added: svn:mime-type
## -0,0 +1 ##
+image/png
Index: pcbsd/current/src-qt4/warden/src/running.png
===================================================================
--- pcbsd/current/src-qt4/warden/src/running.png	2012-03-07 18:59:23 UTC (rev 15743)
+++ pcbsd/current/src-qt4/warden/src/running.png	2012-03-07 20:16:22 UTC (rev 15744)

Property changes on: pcbsd/current/src-qt4/warden/src/running.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
Index: pcbsd/current/src-qt4/warden/src/stopped.png
===================================================================
--- pcbsd/current/src-qt4/warden/src/stopped.png	2012-03-07 18:59:23 UTC (rev 15743)
+++ pcbsd/current/src-qt4/warden/src/stopped.png	2012-03-07 20:16:22 UTC (rev 15744)

Property changes on: pcbsd/current/src-qt4/warden/src/stopped.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
Modified: pcbsd/current/src-qt4/warden/src/warden.qrc
===================================================================
--- pcbsd/current/src-qt4/warden/src/warden.qrc	2012-03-07 18:59:23 UTC (rev 15743)
+++ pcbsd/current/src-qt4/warden/src/warden.qrc	2012-03-07 20:16:22 UTC (rev 15744)
@@ -1,5 +1,9 @@
 <RCC>
   <qresource>
+    <file>running.png</file>
+    <file>stopped.png</file>
+    <file>edit_add.png</file>
+    <file>edit_remove.png</file>
     <file>folder.png</file>
     <file>warden.png</file>
     <file>cell.png</file>



More information about the Commits mailing list