[PC-BSD Commits] r15900 - pcbsd/current/src-qt4/libpcbsd

svn at pcbsd.org svn at pcbsd.org
Wed Mar 21 16:39:31 PDT 2012


Author: kris
Date: 2012-03-21 23:39:30 +0000 (Wed, 21 Mar 2012)
New Revision: 15900

Added:
   pcbsd/current/src-qt4/libpcbsd/dialogInfoBox.cpp
   pcbsd/current/src-qt4/libpcbsd/dialogInfoBox.h
   pcbsd/current/src-qt4/libpcbsd/dialogInfoBox.ui
   pcbsd/current/src-qt4/libpcbsd/dialogMetaProgress.cpp
   pcbsd/current/src-qt4/libpcbsd/dialogMetaProgress.h
   pcbsd/current/src-qt4/libpcbsd/dialogMetaProgress.ui
Modified:
   pcbsd/current/src-qt4/libpcbsd/libpcbsd.pro
   pcbsd/current/src-qt4/libpcbsd/metaWidget.cpp
   pcbsd/current/src-qt4/libpcbsd/pcbsd-utils.h
   pcbsd/current/src-qt4/libpcbsd/utils.cpp
Log:

Add dialogMetaProgress / dialogInfoBox to libpcbsd, used by metaWidget
at the moment. 



Index: pcbsd/current/src-qt4/libpcbsd/dialogInfoBox.ui
===================================================================
--- pcbsd/current/src-qt4/libpcbsd/dialogInfoBox.ui	2012-03-21 21:45:59 UTC (rev 15899)
+++ pcbsd/current/src-qt4/libpcbsd/dialogInfoBox.ui	2012-03-21 23:39:30 UTC (rev 15900)

Property changes on: pcbsd/current/src-qt4/libpcbsd/dialogInfoBox.ui
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/xml
Index: pcbsd/current/src-qt4/libpcbsd/dialogMetaProgress.ui
===================================================================
--- pcbsd/current/src-qt4/libpcbsd/dialogMetaProgress.ui	2012-03-21 21:45:59 UTC (rev 15899)
+++ pcbsd/current/src-qt4/libpcbsd/dialogMetaProgress.ui	2012-03-21 23:39:30 UTC (rev 15900)

Property changes on: pcbsd/current/src-qt4/libpcbsd/dialogMetaProgress.ui
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/xml
Modified: pcbsd/current/src-qt4/libpcbsd/libpcbsd.pro
===================================================================
--- pcbsd/current/src-qt4/libpcbsd/libpcbsd.pro	2012-03-21 21:45:59 UTC (rev 15899)
+++ pcbsd/current/src-qt4/libpcbsd/libpcbsd.pro	2012-03-21 23:39:30 UTC (rev 15900)
@@ -6,13 +6,19 @@
 
 HEADERS	+= pcbsd-netif.h \
 	pcbsd-utils.h \
-        pcbsd-hardware.h
+        pcbsd-hardware.h \
+	dialogMetaProgress.h \
+	dialogInfoBox.h
 
 SOURCES	+= netif.cpp \
 	utils.cpp \
         hardware.cpp \
+	dialogInfoBox.cpp \
+	dialogMetaProgress.cpp \
 	metaWidget.cpp
 
+FORMS += dialogInfoBox.ui dialogMetaProgress.ui
+
 TARGET=/usr/local/lib/pcbsd
 
 include.path=/usr/local/include/

Modified: pcbsd/current/src-qt4/libpcbsd/metaWidget.cpp
===================================================================
--- pcbsd/current/src-qt4/libpcbsd/metaWidget.cpp	2012-03-21 21:45:59 UTC (rev 15899)
+++ pcbsd/current/src-qt4/libpcbsd/metaWidget.cpp	2012-03-21 23:39:30 UTC (rev 15900)
@@ -48,6 +48,13 @@
   Arch = getLineFromCommandOutput("uname -m");
 
   populateMetaPkgs();
+
+  // Connect our slots
+  treeMetaPkgs->setContextMenuPolicy(Qt::CustomContextMenu);
+  connect(treeMetaPkgs, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(slotMetaRightClick()) );
+  connect(pushApplyMeta, SIGNAL( clicked() ), this, SLOT( slotApplyMetaChanges() ) );
+
+
 }
 
 
@@ -249,12 +256,9 @@
 	// We've gotten this far, now time to do the actual meta pkg changes
 	if ( ! delPkgs.isEmpty() ) {
 
-		/*
-		metaProgressDel = new dialogMetaProgress();
+		metaProgressDel = new metaProgressDialog();
                 metaProgressDel->programInit(tr("Performing system-package changes."));
- 	       	metaProgressDel->setWindowModality(Qt::ApplicationModal);
 		metaProgressDel->show();
-		*/
 
 		delMetaProc = new QProcess();
 		delMetaProc->setProcessChannelMode(QProcess::MergedChannels);
@@ -277,15 +281,15 @@
 			line = line.replace("Pending Meta-Package changes: ", "");
 			line.toInt(&ok);
 			if ( ok ) {
-				//metaProgressDel->setTotalRange(0, line.toInt(&ok) + 1);
-				//metaProgressDel->setTotalVal(0);
+				metaProgressDel->setTotalRange(0, line.toInt(&ok) + 1);
+				metaProgressDel->setTotalVal(0);
 			}
 			continue;
 		}
 
 		if ( line.indexOf("Removing Meta-Package: ") != -1 ) { 
-			//metaProgressDel->setTotalVal(metaProgressDel->getTotalVal() + 1);
-			//metaProgressDel->setTotalDesc(line);
+			metaProgressDel->setTotalVal(metaProgressDel->getTotalVal() + 1);
+			metaProgressDel->setTotalDesc(line);
 			continue;
 		}
 
@@ -293,14 +297,14 @@
 			line = line.replace("Pending package changes: ", "");
 			line.toInt(&ok);
 			if ( ok ) {
-				//metaProgressDel->setSubRange(0, line.toInt(&ok) + 1);
-			//	metaProgressDel->setSubVal(0);
+				metaProgressDel->setSubRange(0, line.toInt(&ok) + 1);
+				metaProgressDel->setSubVal(0);
 			}
 			continue;
 			
 		} else {
-			//metaProgressDel->setSubVal(metaProgressDel->getSubVal() + 1);
-			//metaProgressDel->setSubDesc(line);
+			metaProgressDel->setSubVal(metaProgressDel->getSubVal() + 1);
+			metaProgressDel->setSubDesc(line);
 		}
 	}
 }
@@ -308,17 +312,14 @@
 void metaWidget::slotMetaDelDone()
 {
 	//if ( ! delPkgs.isEmpty() )
-		//metaProgressDel->close();
+		metaProgressDel->close();
 
 	// We've gotten this far, now time to do the actual meta pkg changes
 	if ( ! addPkgs.isEmpty() ) {
 	
-		/*
-		metaProgressAdd = new dialogMetaProgress();
+		metaProgressAdd = new metaProgressDialog();
                 metaProgressAdd->programInit(tr("Performing system-package changes."));
- 	       	metaProgressAdd->setWindowModality(Qt::ApplicationModal);
 		metaProgressAdd->show();
-		*/
 
 		addMetaProc = new QProcess();
 		addMetaProc->setProcessChannelMode(QProcess::MergedChannels);
@@ -344,16 +345,16 @@
 			line = line.replace("Pending Meta-Package changes: ", "");
 			line.toInt(&ok);
 			if ( ok ) {
-				//metaProgressAdd->setTotalRange(0, line.toInt(&ok) + 1);
-				//metaProgressAdd->setTotalVal(0);
+				metaProgressAdd->setTotalRange(0, line.toInt(&ok) + 1);
+				metaProgressAdd->setTotalVal(0);
 			}
 			continue;
 		}
 
 		// Check if on a new meta-pkg now
 		if ( line.indexOf("Installing Meta-Package: ") != -1 ) { 
-			//metaProgressAdd->setTotalVal(metaProgressAdd->getTotalVal() + 1);
-			//metaProgressAdd->setTotalDesc(line);
+			metaProgressAdd->setTotalVal(metaProgressAdd->getTotalVal() + 1);
+			metaProgressAdd->setTotalDesc(line);
 			continue;
 		}
 
@@ -361,13 +362,13 @@
 			line = line.replace("Pending package changes: ", "");
 			line.toInt(&ok);
 			if ( ok ) {
-				//metaProgressAdd->setSubRange(0, line.toInt(&ok) + 1 );
-				//metaProgressAdd->setSubVal(0);
+				metaProgressAdd->setSubRange(0, line.toInt(&ok) + 1 );
+				metaProgressAdd->setSubVal(0);
 			}
 			
 		} else {
-			//metaProgressAdd->setSubVal(metaProgressAdd->getSubVal() + 1);
-			//metaProgressAdd->setSubDesc(line);
+			metaProgressAdd->setSubVal(metaProgressAdd->getSubVal() + 1);
+			metaProgressAdd->setSubDesc(line);
 		}
 	}
 
@@ -376,7 +377,7 @@
 void metaWidget::slotMetaAddDone()
 {
 	//if ( ! addPkgs.isEmpty() )
-		//metaProgressAdd->close();
+		metaProgressAdd->close();
  
 	populateMetaPkgs();
 
@@ -657,11 +658,10 @@
 		pList.close();
 	        packageList.sort();
 			
-                //KPM
-		//dIB = new dialogInfoBox();
-    		//dIB->programInit(tr("Package Listing for:") + " " + (*it)->text(0));
-		//dIB->setInfoText(packageList.join("\n"));
-                //dIB->show();
+		dIB = new dialogInfo();
+    		dIB->programInit(tr("Package Listing for:") + " " + (*it)->text(0));
+		dIB->setInfoText(packageList.join("\n"));
+                dIB->show();
 	    }
 	  }
          ++it;

Modified: pcbsd/current/src-qt4/libpcbsd/pcbsd-utils.h
===================================================================
--- pcbsd/current/src-qt4/libpcbsd/pcbsd-utils.h	2012-03-21 21:45:59 UTC (rev 15899)
+++ pcbsd/current/src-qt4/libpcbsd/pcbsd-utils.h	2012-03-21 23:39:30 UTC (rev 15900)
@@ -35,6 +35,42 @@
 #ifndef _PCBSD_UTILS_H_
 #define _PCBSD_UTILS_H_
 
+class dialogInfoBox; 
+class dialogInfo {
+
+public:
+  dialogInfo();
+  void programInit(QString title);
+  void setInfoText(QString text);
+  void show();
+
+private:
+  dialogInfoBox *d_p;
+};
+
+class dialogMetaProgress;
+class metaProgressDialog {
+
+public:
+  metaProgressDialog();
+  void programInit(QString desc);
+  void setTotalDesc(QString desc);
+  void setSubDesc(QString desc);
+  void setTotalRange(int min, int max);
+  void setTotalVal(int val);
+  int  getTotalVal();
+  void setSubRange(int min, int max);
+  void setSubVal(int val);
+  int  getSubVal();
+  void show();
+  void close();
+
+private:
+  dialogMetaProgress *d_p;
+};
+
+
+
 class Utils
 {
 public:
@@ -115,9 +151,9 @@
    QString Arch;
 
    QMenu *popup;
-   //dialogMetaProgress *metaProgressDel;
-   //dialogMetaProgress *metaProgressAdd;
-   //dialogInfoBox *dIB;
+   metaProgressDialog *metaProgressDel;
+   metaProgressDialog *metaProgressAdd;
+   dialogInfo *dIB;
    
 
 

Modified: pcbsd/current/src-qt4/libpcbsd/utils.cpp
===================================================================
--- pcbsd/current/src-qt4/libpcbsd/utils.cpp	2012-03-21 21:45:59 UTC (rev 15899)
+++ pcbsd/current/src-qt4/libpcbsd/utils.cpp	2012-03-21 23:39:30 UTC (rev 15900)
@@ -42,6 +42,8 @@
 #include <QPushButton>
 
 #include "pcbsd-utils.h"
+#include "dialogInfoBox.h"
+#include "dialogMetaProgress.h"
 
 #include "../config.h"
 
@@ -482,3 +484,76 @@
   delete inputDialog; //delete the dialog - we are done with it
   return outputList; //Ouput will be empty if an error or if box cancelled
 }
+
+// PLMPL class for dialogInfoBox
+dialogInfo::dialogInfo() {
+  d_p = new dialogInfoBox;
+}
+
+void dialogInfo::programInit(QString title)
+{
+  d_p->programInit(title);
+}
+
+void dialogInfo::setInfoText(QString text)
+{
+  d_p->setInfoText(text);
+}
+
+void dialogInfo::show()
+{
+  d_p->show();
+}
+
+//
+// PLMPL class for metaProgressDialog
+//////////////////////////////////////////
+metaProgressDialog::metaProgressDialog() {
+  d_p = new dialogMetaProgress;
+  d_p->setWindowModality(Qt::ApplicationModal);
+}
+
+void metaProgressDialog::programInit(QString desc) {
+  d_p->programInit(desc);
+}
+
+void metaProgressDialog::setTotalDesc(QString desc) {
+  d_p->setTotalDesc(desc);
+}
+
+void metaProgressDialog::setSubDesc(QString desc) {
+  d_p->setSubDesc(desc);
+}
+
+void metaProgressDialog::setTotalRange(int min, int max) {
+  d_p->setTotalRange(min, max);
+}
+
+void metaProgressDialog::setTotalVal(int val) {
+  d_p->setTotalVal(val);
+}
+
+int metaProgressDialog::getTotalVal() {
+  return d_p->getTotalVal();
+}
+
+void metaProgressDialog::setSubRange(int min, int max) {
+  d_p->setSubRange(min, max);
+}
+
+void metaProgressDialog::setSubVal(int val) {
+  d_p->setSubVal(val);
+}
+
+int metaProgressDialog::getSubVal() {
+  return d_p->getSubVal();
+}
+
+void metaProgressDialog::show() {
+  d_p->show();
+}
+
+void metaProgressDialog::close() {
+  d_p->close();
+}
+



More information about the Commits mailing list