2009-06-01 04:55:11 -05:00
|
|
|
# Created By: Virgil Dupras
|
|
|
|
# Created On: 2009-05-23
|
2012-03-15 13:28:40 -05:00
|
|
|
# Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
2009-08-05 03:59:46 -05:00
|
|
|
#
|
2010-09-30 05:17:41 -05:00
|
|
|
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
2009-08-05 03:59:46 -05:00
|
|
|
# which should be included with this package. The terms are also available at
|
2010-09-30 05:17:41 -05:00
|
|
|
# http://www.hardcoded.net/licenses/bsd_license
|
2009-06-01 04:55:11 -05:00
|
|
|
|
|
|
|
from PyQt4.QtGui import QMessageBox, QAction
|
|
|
|
|
2011-11-01 14:44:18 -05:00
|
|
|
from hscommon.trans import trget
|
2011-01-15 09:29:35 -06:00
|
|
|
from ..base.result_window import ResultWindow as ResultWindowBase
|
2009-06-01 04:55:11 -05:00
|
|
|
|
2011-11-01 14:44:18 -05:00
|
|
|
tr = trget('ui')
|
|
|
|
|
2011-01-15 09:29:35 -06:00
|
|
|
class ResultWindow(ResultWindowBase):
|
2012-03-31 09:56:14 -05:00
|
|
|
def _setupMenu(self):
|
|
|
|
ResultWindowBase._setupMenu(self)
|
2011-01-21 06:57:54 -06:00
|
|
|
self.actionClearPictureCache = QAction(tr("Clear Picture Cache"), self)
|
2012-03-31 09:56:14 -05:00
|
|
|
self.menuFile.insertAction(self.actionSaveResults, self.actionClearPictureCache)
|
|
|
|
self.actionClearPictureCache.triggered.connect(self.clearPictureCacheTriggered)
|
2009-06-01 04:55:11 -05:00
|
|
|
|
|
|
|
def clearPictureCacheTriggered(self):
|
2011-01-21 06:57:54 -06:00
|
|
|
title = tr("Clear Picture Cache")
|
2011-11-04 12:10:11 -05:00
|
|
|
msg = tr("Do you really want to remove all your cached picture analysis?")
|
2011-01-15 09:29:35 -06:00
|
|
|
if self.app.confirm(title, msg, QMessageBox.No):
|
2011-12-12 12:37:45 -06:00
|
|
|
self.app.model.scanner.clear_picture_cache()
|
2011-11-04 13:37:07 -05:00
|
|
|
QMessageBox.information(self, title, tr("Picture cache cleared."))
|
2009-06-01 04:55:11 -05:00
|
|
|
|