2012-03-14 11:47:21 -05:00
|
|
|
# Created On: 2012/03/13
|
2015-01-03 15:30:57 -06:00
|
|
|
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
2016-05-29 13:13:19 -05:00
|
|
|
#
|
|
|
|
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
|
|
|
# which should be included with this package. The terms are also available at
|
2015-01-03 15:33:16 -06:00
|
|
|
# http://www.gnu.org/licenses/gpl-3.0.html
|
2012-03-14 11:47:21 -05:00
|
|
|
|
|
|
|
from hscommon.trans import tr
|
2022-05-09 01:40:08 -05:00
|
|
|
from core.gui.ignore_list_table import IgnoreListTable
|
2012-03-14 11:47:21 -05:00
|
|
|
|
2019-12-31 20:16:27 -06:00
|
|
|
|
2012-03-14 11:47:21 -05:00
|
|
|
class IgnoreListDialog:
|
2019-12-31 20:16:27 -06:00
|
|
|
# --- View interface
|
2012-03-14 11:47:21 -05:00
|
|
|
# show()
|
|
|
|
#
|
2016-05-29 13:13:19 -05:00
|
|
|
|
2012-03-14 11:47:21 -05:00
|
|
|
def __init__(self, app):
|
|
|
|
self.app = app
|
2016-05-29 13:13:19 -05:00
|
|
|
self.ignore_list = self.app.ignore_list
|
2020-07-28 09:33:28 -05:00
|
|
|
self.ignore_list_table = IgnoreListTable(self) # GUITable
|
2016-05-29 13:13:19 -05:00
|
|
|
|
2012-03-14 11:47:21 -05:00
|
|
|
def clear(self):
|
|
|
|
if not self.ignore_list:
|
|
|
|
return
|
2021-08-15 04:10:18 -05:00
|
|
|
msg = tr("Do you really want to remove all %d items from the ignore list?") % len(self.ignore_list)
|
2012-03-14 11:47:21 -05:00
|
|
|
if self.app.view.ask_yes_no(msg):
|
2021-08-25 01:11:24 -05:00
|
|
|
self.ignore_list.clear()
|
2012-03-14 11:47:21 -05:00
|
|
|
self.refresh()
|
2016-05-29 13:13:19 -05:00
|
|
|
|
2012-03-14 11:47:21 -05:00
|
|
|
def refresh(self):
|
|
|
|
self.ignore_list_table.refresh()
|
2016-05-29 13:13:19 -05:00
|
|
|
|
2012-03-14 11:47:21 -05:00
|
|
|
def remove_selected(self):
|
|
|
|
for row in self.ignore_list_table.selected_rows:
|
|
|
|
self.ignore_list.remove(row.path1_original, row.path2_original)
|
|
|
|
self.refresh()
|
2016-05-29 13:13:19 -05:00
|
|
|
|
2012-03-14 11:47:21 -05:00
|
|
|
def show(self):
|
|
|
|
self.view.show()
|