[PC-BSD Commits] r12115 - pcbsd/current/src-qt4/pc-updategui
svn at pcbsd.org
svn at pcbsd.org
Fri Aug 12 09:39:10 PDT 2011
Author: kenmoore
Date: 2011-08-12 09:39:10 -0700 (Fri, 12 Aug 2011)
New Revision: 12115
Modified:
pcbsd/current/src-qt4/pc-updategui/mainWin.cpp
pcbsd/current/src-qt4/pc-updategui/mainWin.h
Log:
Set the "install updates" button disabled unless an update is selected in the update GUI
Modified: pcbsd/current/src-qt4/pc-updategui/mainWin.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-updategui/mainWin.cpp 2011-08-12 16:36:54 UTC (rev 12114)
+++ pcbsd/current/src-qt4/pc-updategui/mainWin.cpp 2011-08-12 16:39:10 UTC (rev 12115)
@@ -25,12 +25,22 @@
connect(buttonRescan, SIGNAL(clicked()), this, SLOT(slotRescanUpdates()));
connect(pushInstallUpdates, SIGNAL(clicked()), this, SLOT(slotInstallClicked()));
connect(checkAll, SIGNAL(clicked()), this, SLOT(slotSelectAllClicked()));
-
+ connect(listViewUpdates, SIGNAL(clicked()),this,SLOT(slotListClicked()));
progressUpdate->setHidden(true);
QTimer::singleShot(200, this, SLOT(slotRescanUpdates() ) );
}
+//Check whether an update was selected to enable the button
+void mainWin::slotListClicked(){
+ if(listViewUpdates.currentRow()==-1){
+ pushInstallUpdates->setEnabled(false);
+ }else{
+ pushInstallUpdates->setEnabled(true);
+ }
+ return;
+}
+
bool mainWin::sanityCheck()
{
bool haveUP, haveMU;
@@ -293,6 +303,7 @@
slotReadUpdateData();
slotDisplayUpdates();
qDebug() << listUpdates;
+ pushInstallUpdates->setEnabled(false); //disable the button until an update is selected
}
void mainWin::slotDisplayUpdates()
Modified: pcbsd/current/src-qt4/pc-updategui/mainWin.h
===================================================================
--- pcbsd/current/src-qt4/pc-updategui/mainWin.h 2011-08-12 16:36:54 UTC (rev 12114)
+++ pcbsd/current/src-qt4/pc-updategui/mainWin.h 2011-08-12 16:39:10 UTC (rev 12115)
@@ -44,6 +44,7 @@
void slotUpdateLoop();
void slotReadUpdateOutput();
void slotUpdateFinished();
+ void slotListClicked();
private:
void doUpdates();
More information about the Commits
mailing list