Example #1
0
    def __init__(self):
        self.settings = EsiSettings.getInstance()
        self.server_base: ApiBase = supported_servers[self.settings.get("server")]

        # session request stuff
        self._session = Session()
        self._basicHeaders = {
            'Accept': 'application/json',
            'User-Agent': (
                'pyfa v{}'.format(config.version)
            )
        }
        self._session.headers.update(self._basicHeaders)
        self._session.proxies = NetworkSettings.getInstance().getProxySettingsInRequestsFormat()

        # Set up cached session. This is only used for SSO meta data for now, but can be expanded to actually handle
        # various ESI caching (using ETag, for example) in the future
        cached_session = CachedSession(
            os.path.join(config.savePath, config.ESI_CACHE),
            backend="sqlite",
            cache_control=True,                # Use Cache-Control headers for expiration, if available
            expire_after=timedelta(days=1),    # Otherwise expire responses after one day
            stale_if_error=True,               # In case of request errors, use stale cache data if possible
        )
        cached_session.headers.update(self._basicHeaders)
        cached_session.proxies = NetworkSettings.getInstance().getProxySettingsInRequestsFormat()

        meta_call = cached_session.get("https://%s/.well-known/oauth-authorization-server" % self.server_base.sso)
        meta_call.raise_for_status()
        self.server_meta = meta_call.json()

        jwks_call = cached_session.get(self.server_meta["jwks_uri"])
        jwks_call.raise_for_status()
        self.jwks = jwks_call.json()
Example #2
0
    def __init__(self):
        try:
            Esi.initEsiApp()
        except Exception as e:
            # todo: this is a stop-gap for #1546. figure out a better way of handling esi service failing.
            pyfalog.error(e)
            wx.MessageBox(
                "The ESI module failed to initialize. This can sometimes happen on first load on a slower connection. Please try again."
            )
            return

        self.settings = EsiSettings.getInstance()

        AFTER_TOKEN_REFRESH.add_receiver(self.tokenUpdate)

        # these will be set when needed
        self.httpd = None
        self.state = None
        self.ssoTimer = None

        self.implicitCharacter = None

        # The database cache does not seem to be working for some reason. Use
        # this as a temporary measure
        self.charCache = {}

        # need these here to post events
        import gui.mainFrame  # put this here to avoid loop
        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
Example #3
0
    def __init__(self):
        self.settings = EsiSettings.getInstance()

        # session request stuff
        self._session = Session()
        self._session.headers.update({
            'Accept':
            'application/json',
            'User-Agent': ('pyfa v{}'.format(config.version))
        })
Example #4
0
    def __init__(self):
        self.settings = EsiSettings.getInstance()

        # session request stuff
        self._session = Session()
        self._session.headers.update({
            'Accept': 'application/json',
            'User-Agent': (
                'pyfa v{}'.format(config.version)
            )
        })
        self._session.proxies = NetworkSettings.getInstance().getProxySettingsInRequestsFormat()
Example #5
0
    def __init__(self):
        self.settings = EsiSettings.getInstance()

        # session request stuff
        self._session = Session()
        self._basicHeaders = {
            'Accept': 'application/json',
            'User-Agent': ('pyfa v{}'.format(config.version))
        }
        self._session.headers.update(self._basicHeaders)
        self._session.proxies = NetworkSettings.getInstance(
        ).getProxySettingsInRequestsFormat()
Example #6
0
    def __init__(self, parent):
        super().__init__(parent,
                         id=wx.ID_ANY,
                         title="Export fit to EVE",
                         pos=wx.DefaultPosition,
                         size=wx.Size(400, 140)
                         if "wxGTK" in wx.PlatformInfo else wx.Size(350, 115),
                         resizeable=True)

        self.mainFrame = parent

        mainSizer = wx.BoxSizer(wx.VERTICAL)
        hSizer = wx.BoxSizer(wx.HORIZONTAL)

        self.charChoice = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition,
                                    wx.DefaultSize, [])
        hSizer.Add(self.charChoice, 1, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
        self.updateCharList()
        self.charChoice.SetSelection(0)

        self.exportBtn = wx.Button(self, wx.ID_ANY, "Export Fit",
                                   wx.DefaultPosition, wx.DefaultSize, 5)
        hSizer.Add(self.exportBtn, 0, wx.ALL, 5)

        mainSizer.Add(hSizer, 0, wx.EXPAND, 5)

        self.exportChargesCb = wx.CheckBox(self, wx.ID_ANY,
                                           'Export Loaded Charges',
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.exportChargesCb.SetValue(
            EsiSettings.getInstance().get('exportCharges'))
        self.exportChargesCb.Bind(wx.EVT_CHECKBOX, self.OnChargeExportChange)
        mainSizer.Add(self.exportChargesCb, 0, 0, 5)

        self.exportBtn.Bind(wx.EVT_BUTTON, self.exportFitting)

        self.statusbar = wx.StatusBar(self)
        self.statusbar.SetFieldsCount(2)
        self.statusbar.SetStatusWidths([100, -1])

        self.Bind(wx.EVT_CHAR_HOOK, self.kbEvent)

        self.SetSizer(mainSizer)
        self.SetStatusBar(self.statusbar)
        self.Layout()
        self.SetMinSize(self.GetSize())

        self.Center(wx.BOTH)
Example #7
0
    def __init__(self):
        self.settings = EsiSettings.getInstance()

        # session request stuff
        self._session = Session()
        self._session.headers.update({
            'Accept':
            'application/json',
            'Origin':
            'https://esi.evepc.163.com',
            'Content-Type':
            'application/x-www-form-urlencoded'
        })
        self._session.proxies = NetworkSettings.getInstance(
        ).getProxySettingsInRequestsFormat()
Example #8
0
    def __init__(self):
        self.settings = EsiSettings.getInstance()

        super().__init__()

        # these will be set when needed
        self.httpd = None
        self.state = None
        self.ssoTimer = None

        self.implicitCharacter = None

        # until I can get around to making proper caching and modifications to said cache, storee deleted fittings here
        # so that we can easily hide them in the fitting browser
        self.fittings_deleted = set()

        # need these here to post events
        import gui.mainFrame  # put this here to avoid loop
        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
Example #9
0
File: esi.py Project: wyl0706/Pyfa
    def __init__(self):
        self.settings = EsiSettings.getInstance()

        super().__init__()

        # these will be set when needed
        self.httpd = None
        self.state = None
        self.ssoTimer = None

        self.implicitCharacter = None

        # until I can get around to making proper caching and modifications to said cache, storee deleted fittings here
        # so that we can easily hide them in the fitting browser
        self.fittings_deleted = set()

        # need these here to post events
        import gui.mainFrame  # put this here to avoid loop
        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
Example #10
0
    def populatePanel(self, panel):
        self.title = _t("EVE SSO")
        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
        self.settings = EsiSettings.getInstance()
        self.dirtySettings = False
        dlgWidth = panel.GetParent().GetParent().ClientSize.width
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0)
        self.stTitle.Wrap(-1)
        self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
        mainSizer.Add(self.stTitle, 0, wx.EXPAND | wx.ALL, 5)

        self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
        mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        self.stInfo = wx.StaticText(panel, wx.ID_ANY,
                                    _t("Please see the pyfa wiki on GitHub for information regarding these options."),
                                    wx.DefaultPosition, wx.DefaultSize, 0)
        self.stInfo.Wrap(dlgWidth - 50)
        mainSizer.Add(self.stInfo, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        rbSizer = wx.BoxSizer(wx.HORIZONTAL)
        self.rbMode = wx.RadioBox(panel, -1, _t("Login Authentication Method"), wx.DefaultPosition, wx.DefaultSize,
                                  [_t('Local Server'), _t('Manual')], 1, wx.RA_SPECIFY_COLS)
        self.rbMode.SetItemToolTip(0, _t("This option starts a local webserver that EVE SSO Server will call back to"
                                         " with information about the character login."))
        self.rbMode.SetItemToolTip(1, _t("This option prompts users to copy and paste information to allow for"
                                         " character login. Use this if having issues with the local server."))

        self.rbMode.SetSelection(self.settings.get('loginMode'))

        rbSizer.Add(self.rbMode, 1, wx.TOP | wx.RIGHT, 5)

        self.rbMode.Bind(wx.EVT_RADIOBOX, self.OnModeChange)

        mainSizer.Add(rbSizer, 1, wx.ALL | wx.EXPAND, 0)

        panel.SetSizer(mainSizer)
        panel.Layout()
Example #11
0
    def populatePanel(self, panel):

        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
        self.settings = EsiSettings.getInstance()
        self.dirtySettings = False
        dlgWidth = panel.GetParent().GetParent().ClientSize.width
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title,
                                     wx.DefaultPosition, wx.DefaultSize, 0)
        self.stTitle.Wrap(-1)
        self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
        mainSizer.Add(self.stTitle, 0, wx.EXPAND | wx.ALL, 5)

        self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY,
                                           wx.DefaultPosition, wx.DefaultSize,
                                           wx.LI_HORIZONTAL)
        mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        self.stInfo = wx.StaticText(
            panel, wx.ID_ANY,
            "Please see the pyfa wiki on GitHub for information regarding these options.",
            wx.DefaultPosition, wx.DefaultSize, 0)
        self.stInfo.Wrap(dlgWidth - 50)
        mainSizer.Add(self.stInfo, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        rbSizer = wx.BoxSizer(wx.HORIZONTAL)
        self.rbMode = wx.RadioBox(panel, -1, "Login Authentication Method",
                                  wx.DefaultPosition, wx.DefaultSize,
                                  ['Local Server', 'Manual'], 1,
                                  wx.RA_SPECIFY_COLS)
        self.rbMode.SetItemToolTip(
            0,
            "This options starts a local webserver that the web application will call back to"
            " with information about the character login.")
        self.rbMode.SetItemToolTip(
            1,
            "This option prompts users to copy and paste information from the web application "
            "to allow for character login. Use this if having issues with the local server."
        )

        self.rbSsoMode = wx.RadioBox(panel, -1, "SSO Mode", wx.DefaultPosition,
                                     wx.DefaultSize,
                                     ['pyfa.io', 'Custom application'], 1,
                                     wx.RA_SPECIFY_COLS)
        self.rbSsoMode.SetItemToolTip(
            0,
            "This options routes SSO Logins through pyfa.io, allowing you to easily login "
            "without any configuration. When in doubt, use this option.")
        self.rbSsoMode.SetItemToolTip(
            1,
            "This option goes through EVE SSO directly, but requires more configuration. Use "
            "this is pyfa.io is blocked for some reason, or if you do not wish to route data throguh pyfa.io."
        )

        self.rbMode.SetSelection(self.settings.get('loginMode'))
        self.rbSsoMode.SetSelection(self.settings.get('ssoMode'))

        rbSizer.Add(self.rbSsoMode, 1, wx.ALL, 5)
        rbSizer.Add(self.rbMode, 1, wx.TOP | wx.RIGHT, 5)

        self.rbMode.Bind(wx.EVT_RADIOBOX, self.OnModeChange)
        self.rbSsoMode.Bind(wx.EVT_RADIOBOX, self.OnSSOChange)

        mainSizer.Add(rbSizer, 1, wx.ALL | wx.EXPAND, 0)

        detailsTitle = wx.StaticText(panel, wx.ID_ANY, "Custom Application",
                                     wx.DefaultPosition, wx.DefaultSize, 0)
        detailsTitle.Wrap(-1)
        detailsTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))

        mainSizer.Add(detailsTitle, 0, wx.ALL, 5)
        mainSizer.Add(
            wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize,
                          wx.LI_HORIZONTAL), 0, wx.EXPAND, 5)

        fgAddrSizer = wx.FlexGridSizer(2, 2, 0, 0)
        fgAddrSizer.AddGrowableCol(1)
        fgAddrSizer.SetFlexibleDirection(wx.BOTH)
        fgAddrSizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)

        self.stSetID = wx.StaticText(panel, wx.ID_ANY, "Client ID:",
                                     wx.DefaultPosition, wx.DefaultSize, 0)
        self.stSetID.Wrap(-1)
        fgAddrSizer.Add(self.stSetID, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.inputClientID = wx.TextCtrl(panel, wx.ID_ANY,
                                         self.settings.get('clientID'),
                                         wx.DefaultPosition, wx.DefaultSize, 0)

        fgAddrSizer.Add(self.inputClientID, 0,
                        wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)

        self.stSetSecret = wx.StaticText(panel, wx.ID_ANY, "Client Secret:",
                                         wx.DefaultPosition, wx.DefaultSize, 0)
        self.stSetSecret.Wrap(-1)

        fgAddrSizer.Add(self.stSetSecret, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                        5)

        self.inputClientSecret = wx.TextCtrl(panel, wx.ID_ANY,
                                             self.settings.get('clientSecret'),
                                             wx.DefaultPosition,
                                             wx.DefaultSize, 0)

        fgAddrSizer.Add(self.inputClientSecret, 0,
                        wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)

        self.inputClientID.Bind(wx.EVT_TEXT, self.OnClientDetailChange)
        self.inputClientSecret.Bind(wx.EVT_TEXT, self.OnClientDetailChange)

        mainSizer.Add(fgAddrSizer, 0, wx.EXPAND, 5)

        # self.stTimout = wx.StaticText(panel, wx.ID_ANY, "Timeout (seconds):", wx.DefaultPosition, wx.DefaultSize, 0)
        # self.stTimout.Wrap(-1)
        #
        # timeoutSizer.Add(self.stTimout, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        # self.intTimeout = IntCtrl(panel, max=300000, limited=True, value=self.settings.get('timeout'))
        # timeoutSizer.Add(self.intTimeout, 0, wx.ALL, 5)
        # self.intTimeout.Bind(wx.lib.intctrl.EVT_INT, self.OnTimeoutChange)
        #
        # mainSizer.Add(timeoutSizer, 0, wx.ALL | wx.EXPAND, 0)

        # detailsTitle = wx.StaticText(panel, wx.ID_ANY, "CREST client details", wx.DefaultPosition, wx.DefaultSize, 0)
        # detailsTitle.Wrap(-1)
        # detailsTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
        #
        # mainSizer.Add(detailsTitle, 0, wx.ALL, 5)
        # mainSizer.Add(wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL), 0,
        #               wx.EXPAND, 5)

        # fgAddrSizer = wx.FlexGridSizer(2, 2, 0, 0)
        # fgAddrSizer.AddGrowableCol(1)
        # fgAddrSizer.SetFlexibleDirection(wx.BOTH)
        # fgAddrSizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)
        #
        # self.stSetID = wx.StaticText(panel, wx.ID_ANY, "Client ID:", wx.DefaultPosition, wx.DefaultSize, 0)
        # self.stSetID.Wrap(-1)
        # fgAddrSizer.Add(self.stSetID, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
        #
        # self.inputClientID = wx.TextCtrl(panel, wx.ID_ANY, self.settings.get('clientID'), wx.DefaultPosition,
        #                                  wx.DefaultSize, 0)
        #
        # fgAddrSizer.Add(self.inputClientID, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
        #
        # self.stSetSecret = wx.StaticText(panel, wx.ID_ANY, "Client Secret:", wx.DefaultPosition, wx.DefaultSize, 0)
        # self.stSetSecret.Wrap(-1)
        #
        # fgAddrSizer.Add(self.stSetSecret, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
        #
        # self.inputClientSecret = wx.TextCtrl(panel, wx.ID_ANY, self.settings.get('clientSecret'), wx.DefaultPosition,
        #                                      wx.DefaultSize, 0)
        #
        # fgAddrSizer.Add(self.inputClientSecret, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
        #
        # self.btnApply = wx.Button(panel, wx.ID_ANY, "Save Client Settings", wx.DefaultPosition, wx.DefaultSize, 0)
        # self.btnApply.Bind(wx.EVT_BUTTON, self.OnBtnApply)
        #
        # mainSizer.Add(fgAddrSizer, 0, wx.EXPAND, 5)
        # mainSizer.Add(self.btnApply, 0, wx.ALIGN_RIGHT, 5)

        # self.ToggleProxySettings(self.settings.get('loginMode'))

        self.ToggleSSOMode(self.settings.get('ssoMode'))
        panel.SetSizer(mainSizer)
        panel.Layout()
Example #12
0
 def OnChargeExportChange(self, event):
     EsiSettings.getInstance().set('exportCharges', self.exportChargesCb.GetValue())
     event.Skip()
Example #13
0
    def populatePanel(self, panel):

        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
        self.settings = EsiSettings.getInstance()
        self.dirtySettings = False
        dlgWidth = panel.GetParent().GetParent().ClientSize.width
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0)
        self.stTitle.Wrap(-1)
        self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))

        mainSizer.Add(self.stTitle, 0, wx.ALL, 5)

        self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
        mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        self.stInfo = wx.StaticText(panel, wx.ID_ANY,
                                    "Please see the pyfa wiki on GitHub for information regarding these options.",
                                    wx.DefaultPosition, wx.DefaultSize, 0)
        self.stInfo.Wrap(dlgWidth - 50)
        mainSizer.Add(self.stInfo, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        rbSizer = wx.BoxSizer(wx.HORIZONTAL)
        self.rbMode = wx.RadioBox(panel, -1, "Login Authentication Method", wx.DefaultPosition, wx.DefaultSize,
                                  ['Local Server', 'Manual'], 1, wx.RA_SPECIFY_COLS)
        self.rbMode.SetItemToolTip(0, "This options starts a local webserver that the web application will call back to"
                                      " with information about the character login.")
        self.rbMode.SetItemToolTip(1, "This option prompts users to copy and paste information from the web application "
                                      "to allow for character login. Use this if having issues with the local server.")

        self.rbSsoMode = wx.RadioBox(panel, -1, "SSO Mode", wx.DefaultPosition, wx.DefaultSize,
                                     ['pyfa.io', 'Custom application'], 1, wx.RA_SPECIFY_COLS)
        self.rbSsoMode.SetItemToolTip(0, "This options routes SSO Logins through pyfa.io, allowing you to easily login "
                                         "without any configuration. When in doubt, use this option.")
        self.rbSsoMode.SetItemToolTip(1, "This option goes through EVE SSO directly, but requires more configuration. Use "
                                         "this is pyfa.io is blocked for some reason, or if you do not wish to route data throguh pyfa.io.")

        self.rbMode.SetSelection(self.settings.get('loginMode'))
        self.rbSsoMode.SetSelection(self.settings.get('ssoMode'))

        rbSizer.Add(self.rbSsoMode, 1, wx.ALL, 5)
        rbSizer.Add(self.rbMode, 1, wx.TOP | wx.RIGHT, 5)

        self.rbMode.Bind(wx.EVT_RADIOBOX, self.OnModeChange)
        self.rbSsoMode.Bind(wx.EVT_RADIOBOX, self.OnSSOChange)

        mainSizer.Add(rbSizer, 1, wx.ALL | wx.EXPAND, 0)

        detailsTitle = wx.StaticText(panel, wx.ID_ANY, "Custom Application", wx.DefaultPosition, wx.DefaultSize, 0)
        detailsTitle.Wrap(-1)
        detailsTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))

        mainSizer.Add(detailsTitle, 0, wx.ALL, 5)
        mainSizer.Add(wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL), 0,
                      wx.EXPAND, 5)

        fgAddrSizer = wx.FlexGridSizer(2, 2, 0, 0)
        fgAddrSizer.AddGrowableCol(1)
        fgAddrSizer.SetFlexibleDirection(wx.BOTH)
        fgAddrSizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)

        self.stSetID = wx.StaticText(panel, wx.ID_ANY, u"Client ID:", wx.DefaultPosition, wx.DefaultSize, 0)
        self.stSetID.Wrap(-1)
        fgAddrSizer.Add(self.stSetID, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.inputClientID = wx.TextCtrl(panel, wx.ID_ANY, self.settings.get('clientID'), wx.DefaultPosition,
                                         wx.DefaultSize, 0)

        fgAddrSizer.Add(self.inputClientID, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)

        self.stSetSecret = wx.StaticText(panel, wx.ID_ANY, u"Client Secret:", wx.DefaultPosition, wx.DefaultSize, 0)
        self.stSetSecret.Wrap(-1)

        fgAddrSizer.Add(self.stSetSecret, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.inputClientSecret = wx.TextCtrl(panel, wx.ID_ANY, self.settings.get('clientSecret'), wx.DefaultPosition,
                                             wx.DefaultSize, 0)

        fgAddrSizer.Add(self.inputClientSecret, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)

        self.inputClientID.Bind(wx.EVT_TEXT, self.OnClientDetailChange)
        self.inputClientSecret.Bind(wx.EVT_TEXT, self.OnClientDetailChange)

        mainSizer.Add(fgAddrSizer, 0, wx.EXPAND, 5)

        # self.stTimout = wx.StaticText(panel, wx.ID_ANY, "Timeout (seconds):", wx.DefaultPosition, wx.DefaultSize, 0)
        # self.stTimout.Wrap(-1)
        #
        # timeoutSizer.Add(self.stTimout, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        # self.intTimeout = IntCtrl(panel, max=300000, limited=True, value=self.settings.get('timeout'))
        # timeoutSizer.Add(self.intTimeout, 0, wx.ALL, 5)
        # self.intTimeout.Bind(wx.lib.intctrl.EVT_INT, self.OnTimeoutChange)
        #
        # mainSizer.Add(timeoutSizer, 0, wx.ALL | wx.EXPAND, 0)

        # detailsTitle = wx.StaticText(panel, wx.ID_ANY, "CREST client details", wx.DefaultPosition, wx.DefaultSize, 0)
        # detailsTitle.Wrap(-1)
        # detailsTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
        #
        # mainSizer.Add(detailsTitle, 0, wx.ALL, 5)
        # mainSizer.Add(wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL), 0,
        #               wx.EXPAND, 5)

        # fgAddrSizer = wx.FlexGridSizer(2, 2, 0, 0)
        # fgAddrSizer.AddGrowableCol(1)
        # fgAddrSizer.SetFlexibleDirection(wx.BOTH)
        # fgAddrSizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)
        #
        # self.stSetID = wx.StaticText(panel, wx.ID_ANY, "Client ID:", wx.DefaultPosition, wx.DefaultSize, 0)
        # self.stSetID.Wrap(-1)
        # fgAddrSizer.Add(self.stSetID, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
        #
        # self.inputClientID = wx.TextCtrl(panel, wx.ID_ANY, self.settings.get('clientID'), wx.DefaultPosition,
        #                                  wx.DefaultSize, 0)
        #
        # fgAddrSizer.Add(self.inputClientID, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
        #
        # self.stSetSecret = wx.StaticText(panel, wx.ID_ANY, "Client Secret:", wx.DefaultPosition, wx.DefaultSize, 0)
        # self.stSetSecret.Wrap(-1)
        #
        # fgAddrSizer.Add(self.stSetSecret, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
        #
        # self.inputClientSecret = wx.TextCtrl(panel, wx.ID_ANY, self.settings.get('clientSecret'), wx.DefaultPosition,
        #                                      wx.DefaultSize, 0)
        #
        # fgAddrSizer.Add(self.inputClientSecret, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
        #
        # self.btnApply = wx.Button(panel, wx.ID_ANY, "Save Client Settings", wx.DefaultPosition, wx.DefaultSize, 0)
        # self.btnApply.Bind(wx.EVT_BUTTON, self.OnBtnApply)
        #
        # mainSizer.Add(fgAddrSizer, 0, wx.EXPAND, 5)
        # mainSizer.Add(self.btnApply, 0, wx.ALIGN_RIGHT, 5)

        # self.ToggleProxySettings(self.settings.get('loginMode'))

        self.ToggleSSOMode(self.settings.get('ssoMode'))
        panel.SetSizer(mainSizer)
        panel.Layout()