def __init__(self, parent=None, default_url=""):
wx.Panel.__init__(self, parent)
self._sizer = wx.BoxSizer(wx.HORIZONTAL)
self._url = wx.TextCtrl(self)
self._url.Bind(wx.EVT_KILL_FOCUS, self._field_changed)
self._url.SetValue(default_url)
self._status_label = ProcessingPlaceholderText(self)
label = wx.StaticText(self, label="Server URL")
label.SetToolTipString("URL for the IRIDA server API.")
self._sizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, border=5, proportion=0)
self._sizer.Add(self._url, flag=wx.EXPAND, proportion=1)
self._sizer.Add(self._status_label, flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, border=5, proportion=0)
self.SetSizerAndFit(self._sizer)
self.Layout()
self.Bind(wx.EVT_CLOSE, self._on_close)
pub.subscribe(self._status_label.SetError, APIConnectorTopics.connection_error_url_topic)
pub.subscribe(self._status_label.SetSuccess, APIConnectorTopics.connection_success_topic)
pub.subscribe(self._status_label.SetSuccess, APIConnectorTopics.connection_success_valid_url)
评论列表
文章目录