[PC-BSD Commits] r21451 - pcbsd/current/src-qt4/pc-updategui

svn at pcbsd.org svn at pcbsd.org
Mon Feb 11 09:57:28 PST 2013


Author: kris
Date: 2013-02-11 17:57:28 +0000 (Mon, 11 Feb 2013)
New Revision: 21451

Modified:
   pcbsd/current/src-qt4/pc-updategui/mainWin.cpp
   pcbsd/current/src-qt4/pc-updategui/mainWin.h
Log:

When double-clicking an update, bring up the browser to the wiki page
of details. Also some cosmetic fixes while here



Modified: pcbsd/current/src-qt4/pc-updategui/mainWin.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-updategui/mainWin.cpp	2013-02-11 17:40:15 UTC (rev 21450)
+++ pcbsd/current/src-qt4/pc-updategui/mainWin.cpp	2013-02-11 17:57:28 UTC (rev 21451)
@@ -42,12 +42,23 @@
   connect(listViewUpdates, SIGNAL(itemActivated(QListWidgetItem *)),this,SLOT(slotListClicked()));
   connect(listViewUpdates, SIGNAL(itemChanged(QListWidgetItem *)),this,SLOT(slotListClicked()));
   connect(listViewUpdates, SIGNAL(itemPressed(QListWidgetItem *)),this,SLOT(slotListClicked()));
+  connect(listViewUpdates, SIGNAL(itemDoubleClicked(QListWidgetItem *)),this,SLOT(slotListDoubleClicked(QListWidgetItem *)));
   progressUpdate->setHidden(true);
 
   QTimer::singleShot(100, this, SLOT(slotRescanUpdates() ) );
   QTimer::singleShot(200, this, SLOT(slotRescanPkgsClicked() ) );
 }
 
+void mainWin::slotListDoubleClicked(QListWidgetItem *cItem)
+{
+  if ( listUpdates.at(listViewUpdates->row(cItem)).at(7).isEmpty() )
+     return;
+
+  QString url = listUpdates.at(listViewUpdates->row(cItem)).at(7);
+  qDebug() << url;
+  system("openwith '" + url.toLatin1() + "' &"); 
+}
+
 //Check whether an update was selected to enable the button
 void mainWin::slotListClicked(){
   bool found = false;
@@ -321,6 +332,7 @@
   if ( listUpdates.isEmpty() ) {
     if ( ! pushUpdatePkgs->isEnabled() ) {
       textLabel->setText(tr("Your system is fully updated!"));
+      tabUpdates->setTabText(0, tr("System Updates"));
     } else {
       textLabel->setText(tr("Package updates available!"));
     }
@@ -347,7 +359,7 @@
 						  .arg(listUpdates.at(z).at(0))
 					  	  .arg(listUpdates.at(z).at(2)));
       item->setCheckState(Qt::Unchecked);
-      item->setToolTip(tr("This is a patch for your version of PC-BSD") + "<hr>" + tr("Patch Size:") + " " + listUpdates.at(z).at(4) + "MB<br>" + tr("Stand Alone:") +" " + listUpdates.at(z).at(5) + "<br>" + tr("Requires Reboot:") + " " + listUpdates.at(z).at(6));
+      item->setToolTip(tr("This is a patch for your version of PC-BSD") + "<hr>" + tr("Patch Size:") + " " + listUpdates.at(z).at(4) + "MB<br>");
       listViewUpdates->addItem(item);
     }
 

Modified: pcbsd/current/src-qt4/pc-updategui/mainWin.h
===================================================================
--- pcbsd/current/src-qt4/pc-updategui/mainWin.h	2013-02-11 17:40:15 UTC (rev 21450)
+++ pcbsd/current/src-qt4/pc-updategui/mainWin.h	2013-02-11 17:57:28 UTC (rev 21451)
@@ -46,6 +46,7 @@
     void slotReadUpdateOutput();
     void slotUpdateFinished();
     void slotListClicked();
+    void slotListDoubleClicked(QListWidgetItem *);
     void slotCloseClicked();
 
     // Package updates



More information about the Commits mailing list