Changeset 744:39e770edda2e for src/mlx/gui
- Timestamp:
- 01/02/16 12:29:48 (9 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/gui.py
r733 r744 89 89 self._sendPIREPCallback = None 90 90 self._sendBugReportCallback = None 91 92 self._credentialsCondition = threading.Condition() 93 self._credentialsAvailable = False 94 self._credentialsUserName = None 95 self._credentialsPassword = None 91 96 92 97 self.webHandler = web.Handler() … … 1635 1640 """Set the anti-ice on indicator.""" 1636 1641 self._wizard.landingAntiIceOn = value 1642 1643 def _getCredentialsCallback(self): 1644 """Called when the web handler asks for the credentials.""" 1645 # FIXME: this is almost the same as 1646 # SimBriefSetupPage._getCredentialsCallback 1647 with self._credentialsCondition: 1648 self._credentialsAvailable = False 1649 1650 gobject.idle_add(self._getCredentials) 1651 1652 while not self._credentialsAvailable: 1653 self._credentialsCondition.wait() 1654 1655 return (self._credentialsUserName, self._credentialsPassword) 1656 1657 def _getCredentials(self): 1658 """Get the credentials.""" 1659 # FIXME: this is almost the same as 1660 # SimBriefSetupPage._getCredentials 1661 with self._credentialsCondition: 1662 config = self.config 1663 1664 dialog = CredentialsDialog(self, config.pilotID, config.password, 1665 xstr("login_title"), 1666 xstr("button_cancel"), 1667 xstr("button_ok"), 1668 xstr("label_pilotID"), 1669 xstr("login_pilotID_tooltip"), 1670 xstr("label_password"), 1671 xstr("login_password_tooltip"), 1672 xstr("login_info"), 1673 config.rememberPassword, 1674 xstr("remember_password"), 1675 xstr("login_remember_tooltip")) 1676 response = dialog.run() 1677 1678 if response==RESPONSETYPE_OK: 1679 self._credentialsUserName = dialog.userName 1680 self._credentialsPassword = dialog.password 1681 rememberPassword = dialog.rememberPassword 1682 1683 config.pilotID = self._credentialsUserName 1684 1685 config.password = \ 1686 self._credentialsPassword if rememberPassword else "" 1687 config.rememberPassword = rememberPassword 1688 1689 config.save() 1690 else: 1691 self._credentialsUserName = None 1692 self._credentialsPassword = None 1693 1694 self._credentialsAvailable = True 1695 self._credentialsCondition.notify()
Note:
See TracChangeset
for help on using the changeset viewer.