def __init__(self, parent, sheets_directory):
"""Initalize InvalidSampleSheetsPanel.
Args:
parent: the owning Window
sheets_directory: the parent directory for searching sample sheets. This
argument is used in the error message that's displayed to the user to
tell them where to look to fix any issues.
"""
wx.Panel.__init__(self, parent)
self._sizer = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(self._sizer)
header = wx.StaticText(self, label=u"? Looks like some sample sheets are not valid.")
header.SetFont(wx.Font(18, wx.DEFAULT, wx.NORMAL, wx.BOLD))
header.SetForegroundColour(wx.Colour(255, 0, 0))
header.Wrap(350)
self._sizer.Add(header,flag=wx.TOP | wx.BOTTOM | wx.ALIGN_CENTER, border=5)
self._sizer.Add(wx.StaticText(self,
label=wordwrap((
"I found the following sample sheets in {}, but I couldn't understand "
"their contents. Check these sample sheets in an editor outside "
"of the uploader, then click the 'Scan Again' button below.").format(sheets_directory),
350, wx.ClientDC(self))), flag=wx.ALIGN_CENTER | wx.TOP | wx.BOTTOM, border=5)
self._errors_tree = wx.TreeCtrl(self, style=wx.TR_DEFAULT_STYLE | wx.TR_FULL_ROW_HIGHLIGHT | wx.TR_LINES_AT_ROOT | wx.TR_HIDE_ROOT)
self._errors_tree_root = self._errors_tree.AddRoot("")
self._sizer.Add(self._errors_tree, flag=wx.EXPAND, proportion=1)
scan_again_button = wx.Button(self, label="Scan Again")
self.Bind(wx.EVT_BUTTON, lambda evt: send_message(SettingsDialog.settings_closed_topic), id=scan_again_button.GetId())
self._sizer.Add(scan_again_button, flag=wx.ALIGN_CENTER | wx.TOP | wx.BOTTOM, border=5)
pub.subscribe(self._sample_sheet_error, DirectoryScannerTopics.garbled_sample_sheet)
pub.subscribe(self._sample_sheet_error, DirectoryScannerTopics.missing_files)
InvalidSampleSheetsPanel.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录