- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r512 r513 880 880 completedHelp = xstr("connect_chelp")) 881 881 882 self._selectSimulator = os.name=="nt" or "FORCE_SELECT_SIM" in os.environ 883 882 884 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5, 883 885 xscale = 0.0, yscale = 0.0) 884 886 885 table = gtk.Table( 5, 2)887 table = gtk.Table(7 if self._selectSimulator else 5, 2) 886 888 table.set_row_spacings(4) 887 889 table.set_col_spacings(16) … … 949 951 labelAlignment.add(self._departureGate) 950 952 table.attach(labelAlignment, 1, 2, 4, 5) 953 954 if self._selectSimulator: 955 labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0, yalign=0.5) 956 label = gtk.Label(xstr("connect_sim")) 957 labelAlignment.add(label) 958 table.attach(labelAlignment, 0, 1, 5, 7) 959 960 selectAlignment = gtk.Alignment(xalign=0.0, xscale=0.0, yalign=0.5) 961 962 selectBox = gtk.HBox() 963 if pygobject: 964 self._selectMSFS = \ 965 gtk.RadioButton.new_with_mnemonic_from_widget(None, 966 xstr("connect_sim_msfs")) 967 else: 968 self._selectMSFS = gtk.RadioButton(None, 969 xstr("connect_sim_msfs")) 970 971 selectBox.pack_start(self._selectMSFS, False, False, 0); 972 973 if pygobject: 974 self._selectXPlane = \ 975 gtk.RadioButton.new_with_mnemonic_from_widget(self._selectMSFS, 976 xstr("connect_sim_xplane")) 977 else: 978 self._selectXPlane = gtk.RadioButton(self._selectMSFS, 979 xstr("connect_sim_xplane")) 980 981 selectBox.pack_start(self._selectXPlane, False, False, 8); 982 983 selectAlignment.add(selectBox) 984 table.attach(selectAlignment, 1, 2, 5, 7) 985 951 986 952 987 self.addCancelFlightButton() … … 982 1017 self._departureGate.set_markup(gate) 983 1018 1019 if self._selectSimulator: 1020 config = self._wizard.gui.config 1021 self._selectMSFS.set_active(config.defaultMSFS) 1022 self._selectXPlane.set_active(not config.defaultMSFS) 1023 984 1024 def finalize(self): 985 1025 """Finalize the page.""" … … 996 1036 def _connectClicked(self, button): 997 1037 """Called when the Connect button is pressed.""" 998 self._wizard._connectSimulator() 1038 if self._selectSimulator: 1039 simulatorType = const.SIM_MSFS9 if self._selectMSFS.get_active() \ 1040 else const.SIM_XPLANE10 1041 else: 1042 simulatorType = const.SIM_MSFS9 if os.name=="nt" \ 1043 else const.SIM_XPLANE10 1044 1045 config = self._wizard.gui.config 1046 config.defaultMSFS = simulatorType == const.SIM_MSFS9 1047 config.save() 1048 1049 self._wizard._connectSimulator(simulatorType) 999 1050 1000 1051 def _forwardClicked(self, button): … … 3573 3624 self.gui.rtoToggled(indicated) 3574 3625 3575 def _connectSimulator(self ):3626 def _connectSimulator(self, simulatorType): 3576 3627 """Connect to the simulator.""" 3577 self.gui.connectSimulator(self._bookedFlight.aircraftType) 3628 self.gui.connectSimulator(self._bookedFlight.aircraftType, 3629 simulatorType) 3578 3630 3579 3631 def _arrivalMETARCallback(self, returned, result):
Note:
See TracChangeset
for help on using the changeset viewer.