[PC-BSD Commits] r7932 - pcbsd/current/src-qt4/pc-sysmanager

svn at pcbsd.org svn at pcbsd.org
Thu Oct 28 07:25:47 PDT 2010


Author: kris
Date: 2010-10-28 07:25:47 -0700 (Thu, 28 Oct 2010)
New Revision: 7932

Modified:
   pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp
   pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h
   pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.ui
Log:

Updated pc-sysmanager, make it use smaller size, to fit on 800x600 screens,
query for meta-pkgs in the background now to speed up the initial display
of the UI. 



Modified: pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp	2010-10-28 12:50:49 UTC (rev 7931)
+++ pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.cpp	2010-10-28 14:25:47 UTC (rev 7932)
@@ -609,8 +609,27 @@
 // Display found meta-pkg data
 void PBSystemTab::populateMetaPkgs()
 {
-  metaPkgList = getPackageData();
+  pushApplyMeta->setEnabled(false);
+  treeMetaPkgs->clear();
+  new QTreeWidgetItem(treeMetaPkgs, QStringList() << tr("Loading... Please wait...") );
 
+  if ( ! metaPkgList.isEmpty() )
+  	disconnect(treeMetaPkgs, SIGNAL(itemChanged(QTreeWidgetItem *, int)), 0, 0);
+  metaPkgList.clear();
+
+  // Start the process to get meta-pkg info
+  getMetaProc = new QProcess();
+  qDebug() << "Searching for meta-pkgs...";
+  connect( getMetaProc, SIGNAL(readyReadStandardOutput()), this, SLOT(slotGetPackageDataOutput()) );
+  connect( getMetaProc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotFinishLoadingMetaPkgs()) );
+  getMetaProc->setProcessChannelMode(QProcess::MergedChannels);
+  getMetaProc->start(QString("pc-metapkgmanager"), QStringList() << "list");
+
+}
+
+// Display found meta-pkg data
+void PBSystemTab::slotFinishLoadingMetaPkgs()
+{
   treeMetaPkgs->clear();
 
   // First look for "parent" apps
@@ -675,21 +694,13 @@
 }
 
 // Function which checks for our GUI package schema data
-QList<QStringList> PBSystemTab::getPackageData()
+void PBSystemTab::slotGetPackageDataOutput()
 {
-  QList<QStringList> metaPkgs;
   QString tmp, mName, mDesc, mIcon, mParent, mDesktop, mInstalled;
   QStringList package;
 
-  if ( ! metaPkgList.isEmpty() )
-  	disconnect(treeMetaPkgs, SIGNAL(itemChanged(QTreeWidgetItem *, int)), 0, 0);
-
-  QProcess pcmp;
-  qDebug() << "Searching for meta-pkgs...";
-  pcmp.start(QString("pc-metapkgmanager"), QStringList() << "list");
-  if (pcmp.waitForFinished()) {
-    while (pcmp.canReadLine()) {
-        tmp = pcmp.readLine().simplified();
+  while (getMetaProc->canReadLine()) {
+        tmp = getMetaProc->readLine().simplified();
 	if ( tmp.indexOf("Meta Package: ") == 0) {
 		mName = tmp.replace("Meta Package: ", "");
 		continue;
@@ -721,13 +732,12 @@
 			mInstalled = "NO";
 
 		package << mName << mDesc << mIcon << mParent << mDesktop << mInstalled;
-		metaPkgs.append(package);
+		metaPkgList.append(package);
 		mName=""; mDesc=""; mIcon=""; mParent=""; mDesktop=""; mInstalled="";
 	}
+
     }
-  }
 
-  return metaPkgs;
 }
 
 void PBSystemTab::saveMetaPkgs()
@@ -897,7 +907,7 @@
 	if ( source == "LOCAL" )
 		dir = findLocalInstallMedia() + "/packages";
 	else
-		dir = Utils::getMasterMirror() + "/" + Version + "/" + Arch + "/netinstall/";
+		dir = Utils::getMasterMirror() + "/" + Version + "/" + Arch + "/netinstall/packages/";
 
 	if ( dir == "NOT FOUND" || dir.isEmpty() ) {
         	QMessageBox::warning(this, tr("No media detected."),

Modified: pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h	2010-10-28 12:50:49 UTC (rev 7931)
+++ pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.h	2010-10-28 14:25:47 UTC (rev 7932)
@@ -103,6 +103,8 @@
     // Meta Package Slots
     void slotApplyMetaChanges();
     void slotDeskPkgsChanged(QTreeWidgetItem *aItem, int aCol);
+    void slotFinishLoadingMetaPkgs();
+    void slotGetPackageDataOutput();
     void slotMetaAddDone();
     void slotMetaAddRead();
     void slotMetaDelDone();
@@ -151,10 +153,10 @@
     bool haveAMetaDesktop();
     bool haveMetaPkgChanges();
     bool getMediaLocation(QString &pkgsource, QString &rDir);
-    QList<QStringList> getPackageData();
     QList<QStringList> metaPkgList;
     QProcess *addMetaProc;
     QProcess *delMetaProc;
+    QProcess *getMetaProc;
     QProgressDialog *delprogress;
     QProgressDialog *addprogress;
     QString addPkgs;

Modified: pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.ui
===================================================================
--- pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.ui	2010-10-28 12:50:49 UTC (rev 7931)
+++ pcbsd/current/src-qt4/pc-sysmanager/pbsystemtab.ui	2010-10-28 14:25:47 UTC (rev 7932)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>489</width>
-    <height>505</height>
+    <width>537</width>
+    <height>425</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -768,6 +768,105 @@
        </item>
       </layout>
      </widget>
+     <widget class="QWidget" name="tab_4">
+      <attribute name="title">
+       <string>Tasks</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_13">
+       <item row="0" column="0">
+        <widget class="QGroupBox" name="groupBox_3">
+         <property name="title">
+          <string>Ports Console</string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout">
+          <item row="0" column="0">
+           <layout class="QHBoxLayout" name="horizontalLayout_8">
+            <item>
+             <widget class="QPushButton" name="fetchPortsConsoleBut">
+              <property name="text">
+               <string>Fetch &amp;Ports Tree</string>
+              </property>
+              <property name="shortcut">
+               <string>Alt+P</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <spacer name="horizontalSpacer_5">
+              <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>
+         </layout>
+        </widget>
+       </item>
+       <item row="1" column="0">
+        <widget class="QGroupBox" name="groupBox_2">
+         <property name="title">
+          <string>System Tasks - Advanced Users</string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_4">
+          <item row="0" column="0">
+           <layout class="QHBoxLayout" name="horizontalLayout_9">
+            <item>
+             <widget class="QPushButton" name="fetchSourceBut">
+              <property name="text">
+               <string>Fetch &amp;System Source</string>
+              </property>
+              <property name="shortcut">
+               <string>Alt+S</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QPushButton" name="fetchPortsBut">
+              <property name="text">
+               <string>Fetch System P&amp;orts Tree</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>
+         </layout>
+        </widget>
+       </item>
+       <item row="2" column="0">
+        <spacer name="verticalSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>189</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
      <widget class="QWidget" name="TabPage">
       <attribute name="title">
        <string>Misc</string>
@@ -940,86 +1039,7 @@
          </layout>
         </widget>
        </item>
-       <item row="2" column="0" colspan="2">
-        <widget class="QGroupBox" name="groupBox_3">
-         <property name="title">
-          <string>Ports Console</string>
-         </property>
-         <layout class="QGridLayout" name="gridLayout">
-          <item row="0" column="0">
-           <layout class="QHBoxLayout" name="horizontalLayout_8">
-            <item>
-             <widget class="QPushButton" name="fetchPortsConsoleBut">
-              <property name="text">
-               <string>Fetch &amp;Ports Tree</string>
-              </property>
-              <property name="shortcut">
-               <string>Alt+P</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <spacer name="horizontalSpacer_5">
-              <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>
-         </layout>
-        </widget>
-       </item>
-       <item row="3" column="0" colspan="2">
-        <widget class="QGroupBox" name="groupBox_2">
-         <property name="title">
-          <string>System Tasks - Advanced Users</string>
-         </property>
-         <layout class="QGridLayout" name="gridLayout_4">
-          <item row="0" column="0">
-           <layout class="QHBoxLayout" name="horizontalLayout_9">
-            <item>
-             <widget class="QPushButton" name="fetchSourceBut">
-              <property name="text">
-               <string>Fetch &amp;System Source</string>
-              </property>
-              <property name="shortcut">
-               <string>Alt+S</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QPushButton" name="fetchPortsBut">
-              <property name="text">
-               <string>Fetch System P&amp;orts Tree</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>
-         </layout>
-        </widget>
-       </item>
-       <item row="5" column="1">
+       <item row="3" column="1">
         <spacer name="spacer37">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
@@ -1035,7 +1055,7 @@
          </property>
         </spacer>
        </item>
-       <item row="4" column="0" colspan="2">
+       <item row="2" column="0" colspan="2">
         <widget class="QGroupBox" name="groupBox_6">
          <property name="title">
           <string>Other Options</string>



More information about the Commits mailing list