[PC-BSD Commits] r19504 - pcbsd/current/src-qt4/pc-softwaremanager

svn at pcbsd.org svn at pcbsd.org
Tue Sep 25 07:34:55 PDT 2012


Author: kris
Date: 2012-09-25 14:34:55 +0000 (Tue, 25 Sep 2012)
New Revision: 19504

Modified:
   pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp
   pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.h
   pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.ui
   pcbsd/current/src-qt4/pc-softwaremanager/softmanager-pbiupdate.cpp
Log:

Added "Update All" button to AppCafe



Modified: pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp	2012-09-25 14:32:28 UTC (rev 19503)
+++ pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp	2012-09-25 14:34:55 UTC (rev 19504)
@@ -80,6 +80,7 @@
    connect( SoftwareListBox, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int) ), this, SLOT(slotViewPBIClicked() ) );
 
    // Connect our main UI Buttons
+   connect(pushUpdateAll, SIGNAL( clicked() ), this, SLOT(slotUpdateAllClicked() ) );
    connect(RemoveButton, SIGNAL( clicked() ), this, SLOT(RemoveButtonSlot() ) );
    connect(ProgressCancelButton, SIGNAL( clicked() ), this, SLOT(RemoveButtonSlot() ) );
    //Setup status bar
@@ -812,3 +813,16 @@
 
   return QString("warden chroot " + wardenIP + " \"" + cmd + "\""); 
 }
+
+void PBM::slotUpdateAllClicked()
+{
+   QTreeWidgetItemIterator it(SoftwareListBox);
+   while (*it) {
+     PBI *item = dynamic_cast<PBI*>(*it);
+     bool isUpdate= item->getUpdateAvail() && ! item->isNewDownload();
+     if (isUpdate)
+        markPBIForUpdate(item);
+     ++it;
+   }
+
+}

Modified: pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.h
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.h	2012-09-25 14:32:28 UTC (rev 19503)
+++ pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.h	2012-09-25 14:34:55 UTC (rev 19504)
@@ -90,6 +90,7 @@
     void slotStartPBIUpdateCheck();
     void slotTabChanged(int);
     void slotViewPBIClicked();
+    void slotUpdateAllClicked();
 
     // Slots for the scrollArea
     void slotHomeButtonClicked();

Modified: pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.ui
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.ui	2012-09-25 14:32:28 UTC (rev 19503)
+++ pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.ui	2012-09-25 14:34:55 UTC (rev 19504)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>663</width>
-    <height>497</height>
+    <width>654</width>
+    <height>543</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -152,8 +152,8 @@
        <attribute name="title">
         <string>&Installed</string>
        </attribute>
-       <layout class="QVBoxLayout" name="verticalLayout_2">
-        <item>
+       <layout class="QGridLayout" name="gridLayout_3">
+        <item row="0" column="0">
          <layout class="QHBoxLayout" name="horizontalLayout_4">
           <item>
            <widget class="QTreeWidget" name="SoftwareListBox">
@@ -204,7 +204,31 @@
           </item>
          </layout>
         </item>
-        <item>
+        <item row="1" column="0">
+         <layout class="QHBoxLayout" name="horizontalLayout_10">
+          <item>
+           <widget class="QPushButton" name="pushUpdateAll">
+            <property name="text">
+             <string>Update &All</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <spacer name="horizontalSpacer_7">
+            <property name="orientation">
+             <enum>Qt::Horizontal</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>40</width>
+              <height>20</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+         </layout>
+        </item>
+        <item row="2" column="0">
          <widget class="QStackedWidget" name="AppInfoStack">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -560,8 +584,8 @@
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>663</width>
-     <height>20</height>
+     <width>654</width>
+     <height>22</height>
     </rect>
    </property>
    <widget class="QMenu" name="menu_File">

Modified: pcbsd/current/src-qt4/pc-softwaremanager/softmanager-pbiupdate.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/softmanager-pbiupdate.cpp	2012-09-25 14:32:28 UTC (rev 19503)
+++ pcbsd/current/src-qt4/pc-softwaremanager/softmanager-pbiupdate.cpp	2012-09-25 14:34:55 UTC (rev 19504)
@@ -30,6 +30,9 @@
 // Start checking our list of PBIs which may be updatable
 void PBM::slotPBICheckUpdate()
 {
+  // No updates yet, disable the button
+  pushUpdateAll->setEnabled(false);
+
   // Need to loop through iterator here, and test each PBI for updates 
   // and if it is, check for update, then continue on to next currentCheckingPBI++ until we
   // are at the end of the list
@@ -85,6 +88,9 @@
           // Great, we have a PBI with an available update! Notify the widget now          
           item->setUpdateAvail(true);
           refreshAppInfo(item);
+
+	  // Enable the update all button
+  	  pushUpdateAll->setEnabled(true);
     } else {
       // Update is invalid for some reason, no update for you!      
       item->setUpdateAvail(false);



More information about the Commits mailing list