Changeset 384:97052bda0e22 for src/mlx/gui
- Timestamp:
- 12/21/12 16:50:01 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r383 r384 1999 1999 xscale = 0.0, yscale = 0.0) 2000 2000 2001 table = gtk.Table( 6, 4)2001 table = gtk.Table(7, 4) 2002 2002 table.set_row_spacings(4) 2003 2003 table.set_col_spacings(16) … … 2044 2044 2045 2045 self._v1Unit = gtk.Label(xstr("label_knots")) 2046 self._v1Unit.set_alignment(0.0, 0.5) 2046 2047 table.attach(self._v1Unit, 3, 4, 2, 3) 2047 2048 … … 2060 2061 2061 2062 self._vrUnit = gtk.Label(xstr("label_knots")) 2063 self._vrUnit.set_alignment(0.0, 0.5) 2062 2064 table.attach(self._vrUnit, 3, 4, 3, 4) 2063 2065 … … 2076 2078 2077 2079 self._v2Unit = gtk.Label(xstr("label_knots")) 2080 self._v2Unit.set_alignment(0.0, 0.5) 2078 2081 table.attach(self._v2Unit, 3, 4, 4, 5) 2082 2083 self._hasDerate = False 2084 2085 self._derateLabel = gtk.Label() 2086 self._derateLabel.set_use_underline(True) 2087 self._derateLabel.set_markup(xstr("takeoff_derate_tupolev")) 2088 self._derateLabel.set_alignment(0.0, 0.5) 2089 table.attach(self._derateLabel, 0, 1, 5, 6) 2090 2091 self._derate = gtk.Entry() 2092 self._derate.set_width_chars(10) 2093 self._derate.set_tooltip_text(xstr("takeoff_derate_tooltip")) 2094 self._derate.set_alignment(1.0) 2095 self._derate.connect("changed", self._derateChanged) 2096 table.attach(self._derate, 1, 3, 5, 6) 2097 self._derateLabel.set_mnemonic_widget(self._derate) 2098 2099 self._derateUnit = gtk.Label("") 2100 self._derateUnit.set_use_markup(True) 2101 self._derateUnit.set_alignment(0.0, 0.5) 2102 table.attach(self._derateUnit, 3, 4, 5, 6) 2079 2103 2080 2104 self._rto = gtk.CheckButton(xstr("takeoff_rto")) … … 2082 2106 self._rto.set_tooltip_text(xstr("takeoff_rto_tooltip")) 2083 2107 self._rto.connect("toggled", self._rtoToggled) 2084 table.attach(self._rto, 2, 4, 5, 6, ypadding = 8)2108 table.attach(self._rto, 2, 4, 6, 7, ypadding = 8) 2085 2109 2086 2110 self.addCancelFlightButton() … … 2114 2138 """Get the v2 speed.""" 2115 2139 return self._v2.get_int() 2140 2141 @property 2142 def derate(self): 2143 """Get the derate value, if any.""" 2144 if self._hasDerate: 2145 derate = self._derate.get_text() 2146 return derate if derate else None 2147 else: 2148 return None 2116 2149 2117 2150 @property … … 2143 2176 self._v2.set_tooltip_markup(xstr("takeoff_v2_tooltip" + i18nSpeedUnit)) 2144 2177 2178 (derateLabel, derateUnit) = \ 2179 self._wizard.gui.flight.aircraft.derateLabels 2180 2181 self._hasDerate = derateLabel is not None 2182 2183 if self._hasDerate: 2184 self._derateLabel.set_markup(derateLabel) 2185 self._derateLabel.set_use_underline(True) 2186 self._derateUnit.set_markup("" if derateUnit is None 2187 else derateUnit) 2188 else: 2189 self._derateLabel.set_markup(xstr("takeoff_derate")) 2190 self._derateUnit.set_text("") 2191 2192 self._derate.set_text("") 2193 2194 self._derateLabel.set_sensitive(self._hasDerate) 2195 self._derate.set_sensitive(self._hasDerate) 2196 self._derateUnit.set_sensitive(self._hasDerate) 2197 2145 2198 self._rto.set_active(False) 2146 2199 self._rto.set_sensitive(False) … … 2160 2213 self._vr.reset() 2161 2214 self._v2.reset() 2215 2216 self._hasDerate = False 2162 2217 2163 2218 def setRTOEnabled(self, enabled): … … 2176 2231 self.v2 is not None and \ 2177 2232 self.v1 <= self.vr and \ 2178 self.vr <= self.v2 2233 self.vr <= self.v2 and \ 2234 (not self._hasDerate or self._derate.get_text()!="") 2179 2235 self._button.set_sensitive(sensitive) 2180 2236 … … 2189 2245 self._valueChanged(entry, arg) 2190 2246 2247 def _derateChanged(self, entry): 2248 """Called when the value of the derate is changed.""" 2249 self._updateForwardButton() 2250 2191 2251 def _rtoToggled(self, button): 2192 2252 """Called when the RTO check button is toggled.""" … … 2200 2260 """Called when the forward button is clicked.""" 2201 2261 self._wizard.gui.flight.aircraft.updateV1R2() 2262 if self._hasDerate: 2263 self._wizard.gui.flight.aircraft.updateDerate() 2202 2264 self._wizard.nextPage() 2203 2265 … … 3118 3180 """Get the V2 speed.""" 3119 3181 return self._takeoffPage.v2 3182 3183 @property 3184 def derate(self): 3185 """Get the derate value.""" 3186 return self._takeoffPage.derate 3120 3187 3121 3188 @property -
src/mlx/gui/gui.py
r383 r384 306 306 """Get the V2 speed calculated for the flight.""" 307 307 return self._wizard.v2 308 309 @property 310 def derate(self): 311 """Get the derate value calculated for the flight.""" 312 return self._wizard.derate 308 313 309 314 @property
Note:
See TracChangeset
for help on using the changeset viewer.