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