def showPackages(self, sauce): QtGui.QApplication.setOverrideCursor(QtCore.Qt.WaitCursor) button = QtGui.qApp.focusWidget() index = self.table.indexAt(button.pos()) if index.isValid(): available = AppView(self) text = "These packages are available from the selected ppa" if len(sauce) >= index.row(): available.showView(sauce[index.row()], "PPA Packages", text, False) available.show() QtGui.QApplication.restoreOverrideCursor()
def warningPrompt(self): choice = QMessageBox.warning \ (self, 'RESET EVERYTHING?', "Reset Everything? \n\n This will reset your " + self.os_info['DESCRIPTION'] + " installation to its " "factory defaults. Local user accounts and home directories will also be removed." "\n\nAre you sure you\'d like to continue?", QMessageBox.Yes | QMessageBox.No) if choice == QMessageBox.Yes: QApplication.setOverrideCursor(QtCore.Qt.WaitCursor) self.logger.warning("auto reset chosen") self.getInstalledList() self.getMissingPackages() if UsefulTools().lineCount('apps-to-remove') > 0: self.getLocalUserList() self.findNonDefaultUsers() view = AppView(self) tip = "These packages will be removed" view.showView("apps-to-remove", "Packages To Remove", tip, True) view.show() QApplication.restoreOverrideCursor() else: UsefulTools().showMessage("Nothing left to remove", "All removable packages have already been removed, there are no more packages left", QMessageBox.Information) QApplication.restoreOverrideCursor() else: self.logger.info("auto reset cancelled")
def showInstalled(self): QApplication.setOverrideCursor(QtCore.Qt.WaitCursor) self.getInstalledList() viewInstalled = AppView(self) text = "These packages are currently installed on your system" viewInstalled.showView("installed", "Installed List", text, False) viewInstalled.show() QApplication.restoreOverrideCursor()
def showPackages(self, sauce): button = QtGui.qApp.focusWidget() index = self.table.indexAt(button.pos()) if index.isValid(): available = AppView(self) text = "These packages are available from the selected ppa" if len(sauce) >= index.row(): available.showView(sauce[index.row()], "PPA Packages", text, False) available.show()
def depPackages(self, item): QtGui.QApplication.setOverrideCursor(QtCore.Qt.WaitCursor) package = self.cache[(str(item)).strip()] package.mark_delete(True, True) if len(self.cache.get_changes()) > 1: dep_view = AppView(self) text = "These packages depend on {} and they will also be REMOVED.".format(str(item)) dep_view.showView(self.cache.get_changes(), 'Dependent packages', text, False, width=370, height=200, check_state=1) dep_view.show() self.cache.clear() QtGui.QApplication.restoreOverrideCursor()
def showMissings(self): QApplication.setOverrideCursor(QtCore.Qt.WaitCursor) self.getMissingPackages() if UsefulTools().lineCount('apps-to-install') > 0: text = "These were pre-installed packages that are missing but due for install" view_missing = AppView(self) view_missing.showView("apps-to-install", "Missing pre-installed packages", text, False) view_missing.show() QApplication.restoreOverrideCursor() else: QApplication.restoreOverrideCursor() UsefulTools().showMessage('No missing pre-installed packages', "Nothing to Show :-)", QMessageBox.Information)
def showNonDefaultUsers(self): QApplication.setOverrideCursor(QtCore.Qt.WaitCursor) self.getLocalUserList() self.findNonDefaultUsers() if len(self.non_defaults) > 0: ndu = AppView(self) text = "These are non default users" ndu.showView(self.non_defaults, 'Non-default users and groups list', text, False) ndu.show() QApplication.restoreOverrideCursor() else: QApplication.restoreOverrideCursor() UsefulTools().showMessage("No non-default users or groups on your system found", "Nothing to show :-)", QMessageBox.Information)