Changeset 760:733c148959e9 for src/mlx/gui
- Timestamp:
- 02/14/16 09:17:27 (9 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r759 r760 301 301 xscale = 0.0, yscale = 0.0) 302 302 303 table = gtk.Table( 4, 2)303 table = gtk.Table(3, 2) 304 304 table.set_row_spacings(4) 305 305 table.set_col_spacings(32) … … 339 339 table.attach(self._rememberButton, 1, 2, 2, 3, ypadding = 8) 340 340 341 self._entranceExam = gtk.CheckButton(xstr("login_entranceExam"))342 self._entranceExam.set_use_underline(True)343 self._entranceExam.set_tooltip_text(xstr("login_entranceExam_tooltip"))344 self._entranceExam.connect("toggled", self._setControls)345 table.attach(self._entranceExam, 1, 2, 3, 4, ypadding = 12)346 347 341 self.addButton(xstr("button_login_register"), 348 342 clicked = self._registerClicked, … … 357 351 self._loginButton.set_tooltip_text(xstr("login_button_tooltip")) 358 352 359 360 @property361 def entranceExam(self):362 """Get whether an entrance exam is being performed."""363 return self._entranceExam.get_active() and \364 self._pilotID.get_text()!=""365 353 366 354 @property … … 401 389 pilotID = self._pilotID.get_text() 402 390 password = self._password.get_text() 403 entranceExam = self._entranceExam.get_active() 404 self._password.set_sensitive(not entranceExam) 405 self._rememberButton.set_sensitive(password!="" and not entranceExam) 406 self._entranceExam.set_sensitive(pilotID!="") 407 self._loginButton.set_sensitive(pilotID!="" and 408 (password!="" or entranceExam)) 391 self._rememberButton.set_sensitive(password!="") 392 self._loginButton.set_sensitive(pilotID!="" and password!="") 409 393 410 394 def _registerClicked(self, button): … … 422 406 self._wizard.login(self._handleLoginResult, 423 407 self._pilotID.get_text(), 424 self._password.get_text(), 425 self.entranceExam) 408 self._password.get_text()) 426 409 427 410 def _handleLoginResult(self, returned, result): … … 439 422 440 423 config.save() 441 self._wizard.nextPage() 424 if result.rank=="STU": 425 self._wizard.jumpPage("student") 426 else: 427 self._wizard.nextPage() 442 428 443 429 #----------------------------------------------------------------------------- … … 4839 4825 def entranceExam(self): 4840 4826 """Get whether an entrance exam is about to be taken.""" 4841 return self._login Page.entranceExam4827 return self._loginResult is not None and self._loginResult.rank=="STU" 4842 4828 4843 4829 @property … … 5132 5118 #self.setCurrentPage(10) 5133 5119 5134 def login(self, callback, pilotID, password , entranceExam):5120 def login(self, callback, pilotID, password): 5135 5121 """Called when the login button was clicked.""" 5136 5122 self._loginCallback = callback … … 5140 5126 pilotID = loginResult.pilotID 5141 5127 password = loginResult.password 5142 entranceExam = loginResult.entranceExam5143 5128 busyMessage = xstr("reload_busy") 5144 5129 else: … … 5149 5134 5150 5135 self.gui.webHandler.login(self._loginResultCallback, 5151 pilotID, password, 5152 entranceExam = entranceExam) 5136 pilotID, password) 5153 5137 5154 5138 def reloadFlights(self, callback):
Note:
See TracChangeset
for help on using the changeset viewer.