Skip to content
Browse files

Merge branch 'master' of github.com:pcbsd/pcbsd

  • Loading branch information...
2 parents 50676f3 + 426313b commit 4ba9054ecb11c462e2152358b12dc7a1ff687848 @beanpole135 beanpole135 committed Aug 27, 2013
Showing with 26 additions and 0 deletions.
  1. +22 −0 src-qt4/pc-pkgmanager/mainWin.cpp
  2. +4 −0 src-qt4/pc-pkgmanager/mainWin.h
View
22 src-qt4/pc-pkgmanager/mainWin.cpp
@@ -1427,3 +1427,25 @@ void mainWin::slotCloseAdvClicked()
{
groupInfo->setVisible(false);
}
+
+void mainWin::closeEvent(QCloseEvent *event) {
+
+ if ( pkgCmdList.isEmpty() ) {
+ this->close();
+ return;
+ }
+ if ( pkgCmdList.at(0).at(0).isEmpty() ) {
+ this->close();
+ return;
+ }
+
+ //Verify that they want to continue
+ QMessageBox::StandardButton button = QMessageBox::warning(this, tr("Processes Running"), tr("Packages are currently being changed. Are you sure you want to quit?"), QMessageBox::Yes | QMessageBox::Cancel,QMessageBox::Cancel);
+ if(button == QMessageBox::Yes) {
+ this->close();
+ } else {
+ event->ignore();
+ return;
+ }
+}
+
View
4 src-qt4/pc-pkgmanager/mainWin.h
@@ -1,6 +1,7 @@
#ifndef MAINWIN_H
#define MAINWIN_H
+#include <QCloseEvent>
#include <QDialog>
#include <QFile>
#include <QMenu>
@@ -38,6 +39,9 @@ public slots:
void ProgramInit(QString);
void slotSingleInstance();
+protected:
+ void closeEvent(QCloseEvent *event);
+
private slots:
// Generic pkgng handlers

0 comments on commit 4ba9054

Please sign in to comment.
Something went wrong with that request. Please try again.