Changeset 764:8fd245311db5 for src
- Timestamp:
- 02/21/16 10:18:43 (9 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r762 r764 21 21 import threading 22 22 import re 23 import webbrowser 23 24 24 25 #----------------------------------------------------------------------------- … … 1378 1379 xscale = 0.5, yscale = 0.0) 1379 1380 1380 table = gtk.Table( 1, 1)1381 table = gtk.Table(2, 2) 1381 1382 table.set_row_spacings(4) 1382 1383 table.set_col_spacings(32) 1384 table.set_homogeneous(False) 1383 1385 alignment.add(table) 1384 1386 self.setMainWidget(alignment) 1385 1387 1386 1388 row = 0 1389 1390 labelAlignment = gtk.Alignment(xalign=0.0, yalign = 0.5, 1391 xscale=0.0, yscale = 0.0) 1392 label = gtk.Label(xstr("student_entry_exam_status")) 1393 labelAlignment.add(label) 1394 table.attach(labelAlignment, 0, 1, row, row + 1, xoptions = 0) 1395 1396 alignment = gtk.Alignment(xalign=0.0, yalign = 0.5, 1397 xscale=1.0, yscale = 0.0) 1398 self._entryExamStatus = gtk.Label() 1399 self._entryExamStatus.set_use_markup(True) 1400 self._entryExamStatus.set_alignment(0.0, 0.5) 1401 alignment.add(self._entryExamStatus) 1402 table.attach(alignment, 1, 2, row, row + 1) 1403 1404 row += 1 1387 1405 1388 1406 buttonAlignment = gtk.Alignment(xalign=0.0, xscale=1.0) … … 1393 1411 1394 1412 buttonAlignment.add(button) 1395 table.attach(buttonAlignment, 0, 1, 0, 1) 1413 table.attach(buttonAlignment, 0, 2, row, row + 1, 1414 ypadding = 4) 1396 1415 1397 1416 def activate(self): 1398 1417 """Activate the student page.""" 1399 1418 loginResult = self._wizard.loginResult 1400 self._entryExamButton.set_sensitive(not loginResult.entryExamPassed) 1419 self._entryExamLink = loginResult.entryExamLink 1420 1421 self._updateEntryExamStatus(loginResult.entryExamPassed) 1422 1401 1423 self._getEntryExamStatus() 1402 1424 1403 1425 def _entryExamClicked(self, button): 1404 1426 """Called when the entry exam button is clicked.""" 1427 webbrowser.open(self._entryExamLink) 1405 1428 1406 1429 def _getEntryExamStatus(self): … … 1418 1441 print "_handleEntryExamStatus", returned, result 1419 1442 if returned: 1420 self._entryExamButton.set_sensitive(not result.entryExamPassed) 1443 self._entryExamLink = result.entryExamLink 1444 self._updateEntryExamStatus(result.entryExamPassed) 1421 1445 self._getEntryExamStatus() 1446 1447 def _updateEntryExamStatus(self, passed): 1448 """Update the entry exam status display and button.""" 1449 self._entryExamStatus.set_text(xstr("student_entry_exam_passed") 1450 if passed else 1451 xstr("student_entry_exam_not_passed")) 1452 self._entryExamStatus.set_use_markup(True) 1453 self._entryExamButton.set_sensitive(not passed) 1422 1454 1423 1455 #----------------------------------------------------------------------------- -
src/mlx/rpc.py
r761 r764 261 261 value = self._performCall(lambda sessionID: 262 262 self._server.getEntryExamStatus(sessionID)) 263 return (value["entryExamPassed"], value["checkFlightStatus"]) 263 return (value["entryExamPassed"], value["entryExamLink"], 264 value["checkFlightStatus"]) 264 265 265 266 def getFleet(self): -
src/mlx/web.py
r761 r764 739 739 reply = self._client.getEntryExamStatus() 740 740 result.entryExamPassed = reply[0] 741 result.checkFlightStatus = reply[1] 741 result.entryExamLink = reply[1] 742 result.checkFlightStatus = reply[2] 742 743 743 744 return result … … 758 759 759 760 result.entryExamPassed = reply[0] 760 result.checkFlightStatus = reply[1] 761 result.entryExamLink = reply[1] 762 result.checkFlightStatus = reply[2] 761 763 762 764 return result
Note:
See TracChangeset
for help on using the changeset viewer.