Changeset 101:35e361b4c306 for src/mlx/gui
- Timestamp:
- 04/21/12 17:08:58 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r97 r101 1300 1300 completedHelp = completedHelp) 1301 1301 1302 self._forwardAllowed = False 1303 1302 1304 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5, 1303 1305 xscale = 0.0, yscale = 0.0) … … 1318 1320 self._runway.set_width_chars(10) 1319 1321 self._runway.set_tooltip_text("The runway the takeoff is performed from.") 1322 self._runway.connect("changed", self._valueChanged) 1320 1323 table.attach(self._runway, 1, 3, 0, 1) 1321 1324 label.set_mnemonic_widget(self._runway) … … 1329 1332 self._sid.set_width_chars(10) 1330 1333 self._sid.set_tooltip_text("The name of the Standard Instrument Deparature procedure followed.") 1334 self._sid.connect("changed", self._valueChanged) 1331 1335 table.attach(self._sid, 1, 3, 1, 2) 1332 1336 label.set_mnemonic_widget(self._sid) … … 1341 1345 self._v1.set_width_chars(4) 1342 1346 self._v1.set_tooltip_markup("The takeoff decision speed in knots.") 1347 self._v1.connect("integer-changed", self._valueChanged) 1343 1348 table.attach(self._v1, 2, 3, 2, 3) 1344 1349 label.set_mnemonic_widget(self._v1) … … 1355 1360 self._vr.set_width_chars(4) 1356 1361 self._vr.set_tooltip_markup("The takeoff rotation speed in knots.") 1362 self._vr.connect("integer-changed", self._valueChanged) 1357 1363 table.attach(self._vr, 2, 3, 3, 4) 1358 1364 label.set_mnemonic_widget(self._vr) … … 1369 1375 self._v2.set_width_chars(4) 1370 1376 self._v2.set_tooltip_markup("The takeoff safety speed in knots.") 1377 self._v2.connect("integer-changed", self._valueChanged) 1371 1378 table.attach(self._v2, 2, 3, 4, 5) 1372 1379 label.set_mnemonic_widget(self._v2) … … 1421 1428 self._button.set_sensitive(False) 1422 1429 1423 def f reezeValues(self):1424 """F reeze the values on the page, and enable the forward button."""1430 def finalize(self): 1431 """Finalize the page.""" 1425 1432 self._runway.set_sensitive(False) 1426 1433 self._sid.set_sensitive(False) … … 1428 1435 self._vr.set_sensitive(False) 1429 1436 self._v2.set_sensitive(False) 1430 self._button.set_sensitive(True) 1437 self._wizard.gui.flight.aircraft.updateV1R2() 1438 1439 def allowForward(self): 1440 """Allow going to the next page.""" 1441 self._forwardAllowed = True 1442 self._updateForwardButton() 1443 1444 def _updateForwardButton(self): 1445 """Update the sensitivity of the forward button based on some conditions.""" 1446 sensitive = self._forwardAllowed and \ 1447 self._runway.get_text()!="" and \ 1448 self._sid.get_text()!="" and \ 1449 self.v1 is not None and \ 1450 self.vr is not None and \ 1451 self.v2 is not None and \ 1452 self.v1 <= self.vr and \ 1453 self.vr <= self.v2 1454 self._button.set_sensitive(sensitive) 1455 1456 def _valueChanged(self, widget, arg = None): 1457 """Called when the value of some widget has changed.""" 1458 self._updateForwardButton() 1431 1459 1432 1460 def _backClicked(self, button): … … 2086 2114 """Set the flight stage to the given one.""" 2087 2115 if stage==const.STAGE_TAKEOFF: 2088 self._takeoffPage. freezeValues()2116 self._takeoffPage.allowForward() 2089 2117 elif stage==const.STAGE_END: 2090 2118 self._landingPage.flightEnded()
Note:
See TracChangeset
for help on using the changeset viewer.