2010-04-12 10:21:01 +00:00
|
|
|
# Created By: Virgil Dupras
|
|
|
|
# Created On: 2010-04-12
|
2015-01-03 21:30:57 +00:00
|
|
|
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
|
2020-01-01 02:16:27 +00: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 21:33:16 +00:00
|
|
|
# http://www.gnu.org/licenses/gpl-3.0.html
|
2010-04-12 10:21:01 +00:00
|
|
|
|
2010-11-24 15:12:10 +00:00
|
|
|
from hscommon.gui.table import GUITable, Row
|
2011-11-28 15:27:17 +00:00
|
|
|
from hscommon.gui.column import Column, Columns
|
|
|
|
from hscommon.trans import trget
|
|
|
|
|
2020-01-01 02:16:27 +00:00
|
|
|
coltr = trget("columns")
|
|
|
|
|
2010-04-12 10:21:01 +00:00
|
|
|
|
2012-03-13 15:58:07 +00:00
|
|
|
class ProblemTable(GUITable):
|
2011-11-28 15:27:17 +00:00
|
|
|
COLUMNS = [
|
2020-01-01 02:16:27 +00:00
|
|
|
Column("path", coltr("File Path")),
|
|
|
|
Column("msg", coltr("Error Message")),
|
2011-11-28 15:27:17 +00:00
|
|
|
]
|
2020-01-01 02:16:27 +00:00
|
|
|
|
2012-01-13 21:14:06 +00:00
|
|
|
def __init__(self, problem_dialog):
|
2010-04-12 10:21:01 +00:00
|
|
|
GUITable.__init__(self)
|
2021-08-25 05:46:33 +00:00
|
|
|
self._columns = Columns(self)
|
2010-04-12 10:21:01 +00:00
|
|
|
self.dialog = problem_dialog
|
2020-01-01 02:16:27 +00:00
|
|
|
|
|
|
|
# --- Override
|
2010-04-12 10:21:01 +00:00
|
|
|
def _update_selection(self):
|
|
|
|
row = self.selected_row
|
|
|
|
dupe = row.dupe if row is not None else None
|
|
|
|
self.dialog.select_dupe(dupe)
|
2020-01-01 02:16:27 +00:00
|
|
|
|
2010-04-12 10:21:01 +00:00
|
|
|
def _fill(self):
|
|
|
|
problems = self.dialog.app.results.problems
|
|
|
|
for dupe, msg in problems:
|
|
|
|
self.append(ProblemRow(self, dupe, msg))
|
2020-01-01 02:16:27 +00:00
|
|
|
|
2010-04-12 10:21:01 +00:00
|
|
|
|
|
|
|
class ProblemRow(Row):
|
|
|
|
def __init__(self, table, dupe, msg):
|
|
|
|
Row.__init__(self, table)
|
|
|
|
self.dupe = dupe
|
|
|
|
self.msg = msg
|
2010-08-11 14:39:06 +00:00
|
|
|
self.path = str(dupe.path)
|