Changeset 45:0938977d6603 for src/mlx/gui
- Timestamp:
- 03/18/12 16:50:52 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.