MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / __init__

Method __init__

gui/errorDialog.py:68–125  ·  view source on GitHub ↗
(self, parent=None, error_title=_t('Error!'))

Source from the content-addressed store, hash-verified

66class ErrorFrame(AuxiliaryFrame):
67
68 def __init__(self, parent=None, error_title=_t('Error!')):
69 super().__init__(parent, id=wx.ID_ANY, title=_t("pyfa error"), pos=wx.DefaultPosition, size=wx.Size(500, 600))
70
71 from eos.config import gamedata_version, gamedata_date
72
73 if gamedata_date:
74 try:
75 time = datetime.datetime.fromtimestamp(int(gamedata_date)).strftime('%Y-%m-%d %H:%M:%S')
76 except TypeError:
77 time = None
78 else:
79 time = None
80 version = "pyfa " + config.getVersion() + '\nEVE Data Version: {} ({})\n\n'.format(gamedata_version, time) # gui.aboutData.versionString
81
82 desc = _t("pyfa has experienced an unexpected issue. Below is a message that contains crucial \n"
83 "information about how this was triggered. Please contact the developers with the \n"
84 "information provided through the EVE Online forums or file a GitHub issue.")
85
86 self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
87
88 mainSizer = wx.BoxSizer(wx.VERTICAL)
89 headSizer = wx.BoxSizer(wx.HORIZONTAL)
90
91 headingText = wx.StaticText(self, wx.ID_ANY, error_title, wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE)
92 headingText.SetFont(wx.Font(14, 74, 90, 92, False))
93
94 headSizer.Add(headingText, 1, wx.ALL, 5)
95 mainSizer.Add(headSizer, 0, wx.EXPAND, 5)
96
97 mainSizer.Add(wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL), 0, wx.EXPAND | wx.ALL, 5)
98
99 box = wx.BoxSizer(wx.VERTICAL)
100 mainSizer.Add(box, 0, wx.EXPAND | wx.ALIGN_TOP)
101
102 descText = wx.StaticText(self, wx.ID_ANY, desc)
103 box.Add(descText, 1, wx.ALL, 5)
104
105 # github = wx.lib.agw.hyperlink.HyperLinkCtrl(self, wx.ID_ANY, label="Github", URL="https://github.com/pyfa-org/Pyfa/issues")
106 # box.Add(github, 0, wx.ALL, 5)
107 #
108 # eveForums = wx.lib.agw.hyperlink.HyperLinkCtrl(self, wx.ID_ANY, label="EVE Forums", URL="https://forums.eveonline.com/t/27156")
109 # box.Add(eveForums, 0, wx.ALL, 5)
110
111 # mainSizer.AddSpacer((0, 5), 0, wx.EXPAND, 5)
112
113 self.errorTextCtrl = wx.TextCtrl(self, wx.ID_ANY, version + version_block.strip(), wx.DefaultPosition,
114 (-1, 400), wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2 | wx.TE_DONTWRAP)
115 self.errorTextCtrl.SetFont(wx.Font(8, wx.FONTFAMILY_TELETYPE, wx.NORMAL, wx.NORMAL))
116 mainSizer.Add(self.errorTextCtrl, 0, wx.EXPAND | wx.ALL, 5)
117 self.errorTextCtrl.AppendText("\n")
118 self.errorTextCtrl.Layout()
119
120 self.SetSizer(mainSizer)
121 mainSizer.Layout()
122 self.Layout()
123 self.SetMinSize(self.GetSize())
124
125 self.Centre(wx.BOTH)

Callers

nothing calls this directly

Calls 2

_tFunction · 0.50
GetSizeMethod · 0.45

Tested by

no test coverage detected