Changeset 45:0938977d6603 for src/mlx
- Timestamp:
- 03/18/12 16:50:52 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/config.py
r43 r45 23 23 self._pilotID = "" 24 24 self._password = "" 25 self._rememberPassword = False 25 26 26 27 self._autoUpdate = True … … 51 52 if password!=self._password: 52 53 self._password = password 54 self._modified = True 55 56 @property 57 def rememberPassword(self): 58 """Get if we should remember the password.""" 59 return self._rememberPassword 60 61 @rememberPassword.setter 62 def rememberPassword(self, rememberPassword): 63 """Set if we should remember the password.""" 64 if rememberPassword!=self._rememberPassword: 65 self._rememberPassword = rememberPassword 53 66 self._modified = True 54 67 … … 84 97 self._pilotID = self._get(config, "login", "id", "") 85 98 self._password = self._get(config, "login", "password", "") 99 self._rememberPassword = self._getBoolean(config, "login", 100 "rememberPassword", False) 86 101 87 102 self._autoUpdate = self._getBoolean(config, "update", "auto", True) … … 100 115 config.set("login", "id", self._pilotID) 101 116 config.set("login", "password", self._password) 117 config.set("login", "rememberPassword", 118 "yes" if self._rememberPassword else "no") 102 119 103 120 config.add_section("update") 104 config.set("update", "auto", self._autoUpdate) 121 config.set("update", "auto", 122 "yes" if self._autoUpdate else "no") 105 123 config.set("update", "url", self._updateURL) 106 124 -
src/mlx/gui/flight.py
r44 r45 85 85 super(LoginPage, self).__init__(wizard, "Login", help) 86 86 87 table = gtk.Table(2, 2)87 table = gtk.Table(2, 3) 88 88 table.set_row_spacings(4) 89 89 table.set_col_spacings(32) … … 91 91 92 92 labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0) 93 labelAlignment.add(gtk.Label("Pilot ID:")) 93 label = gtk.Label("Pilot _ID:") 94 label.set_use_underline(True) 95 labelAlignment.add(label) 94 96 table.attach(labelAlignment, 0, 1, 0, 1) 95 97 96 98 self._pilotID = gtk.Entry() 97 99 self._pilotID.connect("changed", self._setLoginButton) 100 self._pilotID.set_tooltip_text("Enter your MAVA pilot's ID. This " 101 "usually starts with a " 102 "'P' followed by 3 digits.") 98 103 table.attach(self._pilotID, 1, 2, 0, 1) 104 label.set_mnemonic_widget(self._pilotID) 99 105 100 106 labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0) 101 labelAlignment.add(gtk.Label("Password:")) 107 label = gtk.Label("_Password:") 108 label.set_use_underline(True) 109 labelAlignment.add(label) 102 110 table.attach(labelAlignment, 0, 1, 1, 2) 103 111 … … 105 113 self._password.set_visibility(False) 106 114 self._password.connect("changed", self._setLoginButton) 115 self._password.set_tooltip_text("Enter the password for your pilot's ID") 107 116 table.attach(self._password, 1, 2, 1, 2) 108 109 self._loginButton = self.addButton("Login") 117 label.set_mnemonic_widget(self._password) 118 119 self._rememberButton = gtk.CheckButton("_Remember password") 120 self._rememberButton.set_use_underline(True) 121 self._rememberButton.set_tooltip_text("If checked, your password will " 122 "be stored, so that you should " 123 "not have to enter it every time. " 124 "Note, however, that the password " 125 "is stored as text, and anybody " 126 "who can access your files will " 127 "be able to read it.") 128 table.attach(self._rememberButton, 1, 2, 2, 3, ypadding = 8) 129 130 self._loginButton = self.addButton("_Login") 110 131 self._loginButton.set_sensitive(False) 132 self._loginButton.set_use_underline(True) 111 133 self._loginButton.connect("clicked", self._loginClicked) 134 self._loginButton.set_tooltip_text("Click to log in.") 112 135 113 136 config = self._wizard.gui.config 114 137 self._pilotID.set_text(config.pilotID) 115 138 self._password.set_text(config.password) 139 self._rememberButton.set_active(config.rememberPassword) 116 140 117 141 def _setLoginButton(self, entry): … … 138 162 if result.loggedIn: 139 163 config = self._wizard.gui.config 164 140 165 config.pilotID = self._pilotID.get_text() 141 config.password = self._password.get_text() 166 167 rememberPassword = self._rememberButton.get_active() 168 config.password = self._password.get_text() if rememberPassword \ 169 else "" 170 171 config.rememberPassword = rememberPassword 172 142 173 config.save() 143 174 self._wizard.nextPage()
Note:
See TracChangeset
for help on using the changeset viewer.