def __init__(self, parent, rack_name):
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.deleteRack_info.clear()
     self.installEventFilter(RadioKeyEventFilter(self))
     self.initial_rack_name = rack_name
     self.flagged_for_deletion = False
     self.rackName_edit.setText(self.initial_rack_name)
     self.privateRack_tickBox.setChecked(
         self.initial_rack_name in settings.private_racks)
     self.pickColour_button.setChoice(
         settings.rack_colours.get(rack_name, None))
     if rack_name == default_rack_name:
         self.rackName_edit.setEnabled(False)
         self.collectedStrips_box.setVisible(False)
         self.deleteRack_button.setEnabled(False)
         self.deleteRack_info.setText('Default rack cannot be deleted')
     else:
         self.collectsFrom_edit.setPlainText('\n'.join(
             atc for atc, rack in settings.ATC_collecting_racks.items()
             if rack == rack_name))
         self.collectAutoPrintedStrips_tickBox.setChecked(
             settings.auto_print_collecting_rack == self.initial_rack_name)
         self.rackName_edit.selectAll()
         self.deleteRack_button.toggled.connect(self.flagRackForDeletion)
     self.buttonBox.rejected.connect(self.reject)
     self.buttonBox.accepted.connect(self.doOK)
 def __init__(self, route, speedHint=None, acftHint=None, parent=None):
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.installEventFilter(RadioKeyEventFilter(self))
     self.depICAO_info.setText(route.dep.code)
     self.depAD_info.setText(route.dep.long_name)
     self.arrICAO_info.setText(route.arr.code)
     self.arrAD_info.setText(route.arr.long_name)
     self.route_length = route.totalDistance()
     self.totalRouteDistance_info.setText(dist_str(self.route_length))
     self.route_scene = RouteScene(route, parent=self)
     self.route_view.setScene(self.route_scene)
     self.route_table.setModel(RouteTableModel(route, self))
     for col in [0, 1, 3, 4, 6]:
         self.route_table.resizeColumnToContents(col)
     speedHint_OK = speedHint != None and self.speed_edit.minimum(
     ) <= speedHint.kt <= self.speed_edit.maximum()
     if speedHint_OK:
         self.speed_edit.setValue(speedHint.kt)
     if acftHint != None:
         self.acftType_select.setEditText(acftHint)
         if not speedHint_OK:
             self.EETfromACFT_radioButton.setChecked(True)
     self.updateEET()
     self.route_table.selectionModel().selectionChanged.connect(
         self.legSelectionChanged)
     self.OK_button.clicked.connect(self.accept)
     self.EETfromSpeed_radioButton.toggled.connect(self.updateEET)
     self.EETfromACFT_radioButton.toggled.connect(self.updateEET)
     self.speed_edit.valueChanged.connect(self.updateEET)
     self.acftType_select.editTextChanged.connect(self.updateEET)
Пример #3
0
 def __init__(self, parent=None):
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.setWindowTitle('%s location settings - %s' %
                         (('CTR' if env.airport_data == None else 'AD'),
                          settings.location_code))
     self.range_group_boxes = [
         self.range1_groupBox, self.range2_groupBox, self.range3_groupBox,
         self.range4_groupBox
     ]
     self.range_name_edits = [
         self.range1_name_edit, self.range2_name_edit,
         self.range3_name_edit, self.range4_name_edit
     ]
     self.range_lo_edits = [
         self.range1_lo_edit, self.range2_lo_edit, self.range3_lo_edit,
         self.range4_lo_edit
     ]
     self.range_hi_edits = [
         self.range1_hi_edit, self.range2_hi_edit, self.range3_hi_edit,
         self.range4_hi_edit
     ]
     self.range_col_edits = [
         self.range1_colourPicker, self.range2_colourPicker,
         self.range3_colourPicker, self.range4_colourPicker
     ]
     if env.airport_data == None:  # CTR session
         self.stripPrinter_groupBox.setEnabled(False)
         self.settings_tabs.removeTab(
             self.settings_tabs.indexOf(self.AD_tab))
         self.spawnCTR_minFL_edit.valueChanged.connect(
             self.spawnCTR_minFL_valueChanged)
         self.spawnCTR_maxFL_edit.valueChanged.connect(
             self.spawnCTR_maxFL_valueChanged)
     else:  # AD session
         self.runway_tabs = QTabWidget(self)
         self.runway_tabs.setTabShape(QTabWidget.Triangular)
         self.runway_tabs.setTabPosition(QTabWidget.South)
         for rwy in env.airport_data.allRunways(sortByName=True):
             self.runway_tabs.addTab(RunwayParametersWidget(self, rwy),
                                     rwy.name)
         if env.airport_data.transition_altitude != None:
             self.transitionAltitude_edit.setEnabled(False)
             self.transitionAltitude_edit.setToolTip(
                 'Fixed by airport data')
         self.settings_tabs.insertTab(0, self.runway_tabs, 'Runways')
         self.settings_tabs.removeTab(
             self.settings_tabs.indexOf(self.CTR_tab))
         self.spawnAPP_minFL_edit.valueChanged.connect(
             self.spawnAPP_minFL_valueChanged)
         self.spawnAPP_maxFL_edit.valueChanged.connect(
             self.spawnAPP_maxFL_valueChanged)
         self.TWRrangeCeiling_edit.valueChanged.connect(
             self.TWRrangeCeiling_valueChanged)
     self.installEventFilter(RadioKeyEventFilter(self))
     self.fillFromSettings()
     self.settings_tabs.setCurrentIndex(GeneralSettingsDialog.last_tab_used)
     self.buttonBox.accepted.connect(self.storeSettings)
 def __init__(self, parent, view_model, dialog_title):
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.clear_button.setIcon(QIcon(IconFile.button_clear))
     self.installEventFilter(RadioKeyEventFilter(self))
     self.setWindowTitle(dialog_title)
     self.model = view_model
     self.strip_view.setModel(view_model)
     self.clear_button.clicked.connect(self.model.forgetStrips)
     self.recall_button.clicked.connect(self.recallSelectedStrips)
     self.close_button.clicked.connect(self.accept)
Пример #5
0
 def openDataLinkWindow(self, data_link_model):
     try:
         window = next(w for w in self.child_windows
                       if w.model() is data_link_model and not w.closed())
     except StopIteration:
         window = CpdlcConnectionWidget(self, data_link_model)
         window.setWindowIcon(QIcon(IconFile.panel_CPDLC))
         window.setWindowFlags(Qt.Window)
         window.installEventFilter(RadioKeyEventFilter(self))
         self.child_windows.append(window)
     window.show()
     window.raise_()
Пример #6
0
 def __init__(self, visible_racks, parent=None):
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.installEventFilter(RadioKeyEventFilter(self))
     self.table_model = RackVisibilityTableModel(self, visible_racks)
     self.tableView.setModel(self.table_model)
     self.selectAll_button.clicked.connect(
         lambda: self.table_model.globalSelect(True))
     self.selectNone_button.clicked.connect(
         lambda: self.table_model.globalSelect(False))
     self.buttonBox.accepted.connect(self.accept)
     self.buttonBox.rejected.connect(self.reject)
Пример #7
0
 def __init__(self, parent=None):
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.CPDLC_tab.setEnabled(settings.controller_pilot_data_link)
     self.positionHistoryTraceTime_edit.setMaximum(
         snapshot_history_size)  # limit is one snapshot per second
     self.autoLinkStrip_off_radioButton.setChecked(
         True)  # sets a defult; auto-excludes if different selection below
     self.installEventFilter(RadioKeyEventFilter(self))
     self.fillFromSettings()
     self.settings_tabs.setCurrentIndex(GeneralSettingsDialog.last_tab_used)
     self.addMsgPreset_button.clicked.connect(self.addPresetMessage)
     self.rmMsgPreset_button.clicked.connect(self.removePresetMessage)
     self.buttonBox.accepted.connect(self.storeSettings)
	def __init__(self, parent=None):
		QWidget.__init__(self, parent)
		self.setupUi(self)
		self.whoHas_window = WhoHasWidget(self)
		self.whoHas_window.setWindowFlags(Qt.Window)
		self.whoHas_window.installEventFilter(RadioKeyEventFilter(self))
		self.callsign_suggestion = ''
		self.ATC_view.setModel(env.ATCs)
		self.publicFrequency_edit.addFrequencies([(f, d) for f, d, t in env.frequencies if t != 'recorded'])
		self.whoHas_button.clicked.connect(self.whoHasRequest)
		self.publiciseFrequency_tickBox.toggled.connect(self.publiciseFrequency)
		self.publicFrequency_edit.frequencyChanged.connect(self.setPublicisedFrequency)
		signals.incomingContactClaim.connect(self.whoHas_window.processClaim)
		signals.selectionChanged.connect(self.updateSuggestionFromSelection)
		signals.sessionEnded.connect(env.ATCs.clear)
Пример #9
0
 def __init__(self, parent=None):
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.installEventFilter(RadioKeyEventFilter(self))
     self.setWindowIcon(QIcon(IconFile.action_runwayUse))
     self.table_model = RunwayUseTableModel(
         self, (env.airport_data.allRunways(
             sortByName=True) if env.airport_data != None else []))
     self.tableView.setModel(self.table_model)
     for i in range(self.table_model.columnCount()):
         self.tableView.resizeColumnToContents(i)
     self.avoidOppositeRunways_tickBox.toggled.connect(
         self.table_model.setAvoidOppositeRunwayUse)
     self.buttonBox.accepted.connect(self.ok)
     self.buttonBox.rejected.connect(self.reject)
Пример #10
0
 def __init__(self, parent=None):
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.cpdlcConnections_label.setEnabled(
         settings.controller_pilot_data_link)
     self.cpdlcConnections_widget.setEnabled(
         settings.controller_pilot_data_link)
     self.airportMode_groupBox.setEnabled(env.airport_data != None)
     self.voiceInstr_off_radioButton.setChecked(
         True)  # sets a defult; auto-excludes if voice instr selected below
     self.readBack_off_radioButton.setChecked(
         True)  # sets a defult; auto-excludes if other selection below
     self.voiceInstr_on_radioButton.setEnabled(speech_recognition_available)
     self.readBack_voice_radioButton.setEnabled(speech_synthesis_available)
     self.installEventFilter(RadioKeyEventFilter(self))
     self.fillFromSettings()
     self.buttonBox.accepted.connect(self.storeSettings)
 def __init__(self, parent=None):
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.installEventFilter(RadioKeyEventFilter(self))
     self.magneticDeclination_infoLabel.setText(
         some(env.readDeclination(), 'N/A'))
     self.radarPosition_infoLabel.setText(str(env.radarPos()))
     if env.airport_data == None:
         self.airport_tab.setEnabled(False)
     else:
         self.airportName_infoLabel.setText(env.locationName())
         self.airportElevation_infoLabel.setText(
             '%.1f ft' % env.airport_data.field_elevation)
         table_model = RwyInfoTableModel(self)
         self.runway_tableView.setModel(table_model)
         for i in range(table_model.columnCount()):
             self.runway_tableView.resizeColumnToContents(i)
Пример #12
0
 def __init__(self, gui, strip):
     QDialog.__init__(self, gui)
     self.setupUi(self)
     self.installEventFilter(RadioKeyEventFilter(self))
     self.setWindowIcon(QIcon(IconFile.pixmap_strip))
     self.linkFPL_reset_button.setIcon(QIcon(IconFile.button_clear))
     self.strip = strip
     self.FPL_link_on_save = None  # None to link a new FPL
     self.FPL_matches = []  # Flight plans matching the last callsign edit
     if self.strip.lookup(rack_detail) == None:  # unracked strip
         self.rack_select.addItem(unracked_strip_str)
         self.rack_select.setEnabled(False)
     else:
         self.rack_select.addItems(env.strips.rackNames())
     ro_tod = strip.lookup(FPL.TIME_OF_DEP)
     ro_eet = strip.lookup(FPL.EET)
     ro_altAD = strip.lookup(FPL.ICAO_ALT)
     ro_souls = strip.lookup(FPL.SOULS)
     self.depAirportPicker_widget.recognised.connect(
         lambda ad: self.depAirportName_info.setText(ad.long_name))
     self.arrAirportPicker_widget.recognised.connect(
         lambda ad: self.arrAirportName_info.setText(ad.long_name))
     self.depAirportPicker_widget.unrecognised.connect(
         self.depAirportName_info.clear)
     self.arrAirportPicker_widget.unrecognised.connect(
         self.arrAirportName_info.clear)
     self.cruiseAlt_edit.textChanged.connect(self.updateCruiseButton)
     self.assignCruiseAlt_button.clicked.connect(self.assignCruiseLevel)
     linkedFPL = self.strip.linkedFPL()
     if linkedFPL == None:
         self.fplLink_stackedWidget.setCurrentWidget(self.noFplLink_page)
         self.updateFplToLinkInfo()
         self.matchingFPLs_button.clicked.connect(
             self.matchingFPLsButtonClicked)
         self.callsign_edit.textChanged.connect(self.updateMatchingFPLs)
         self.linkFPL_tickBox.toggled.connect(self.updateFplToLinkInfo)
         self.linkFPL_reset_button.clicked.connect(self.fplToLinkReset)
     else:  # a flight plan is already linked
         self.matchingFPLs_button.setVisible(False)
         self.fplLink_stackedWidget.setCurrentWidget(self.gotFplLink_page)
         self.linkedFPL_info.setText(linkedFPL.shortDescr())
     SharedDetailSheet.__init__(self)
     if self.strip.linkedFPL() == None:
         self.updateMatchingFPLs(self.callsign_edit.text())
Пример #13
0
 def __init__(self, gui, fpl):
     QDialog.__init__(self, gui)
     self.setupUi(self)
     self.installEventFilter(RadioKeyEventFilter(self))
     self.setWindowIcon(QIcon(IconFile.panel_FPLs))
     self.fpl = fpl
     self.updateOnlineStatusBox()
     self.stripLinked_info.setText(
         'yes' if env.linkedStrip(self.fpl) != None else 'no')
     SharedDetailSheet.__init__(self)
     self.viewOnlineComments_button.clicked.connect(self.viewOnlineComments)
     self.openFPL_button.clicked.connect(
         lambda: self.changeFplOnlineStatus(FPL.OPEN))
     self.closeFPL_button.clicked.connect(
         lambda: self.changeFplOnlineStatus(FPL.CLOSED))
     # FUTURE[tabOrder]: remove tab order corrections below? current Qt focus behaviour is currently bad wthout them
     self.setTabOrder(self.cruiseAlt_edit, self.altAirportPicker_widget)
     self.setTabOrder(self.altAirportPicker_widget.focusProxy(),
                      self.flightRules_select)
Пример #14
0
	def __init__(self, spawn_coords, spawn_hdg, parent=None):
		QDialog.__init__(self, parent)
		self.setupUi(self)
		self.createCallsign_edit.setClearButtonEnabled(True)
		self.installEventFilter(RadioKeyEventFilter(self))
		self.createAircraftType_edit.setAircraftFilter(lambda t: cruise_speed(t) != None)
		self.airline_codes = known_airline_codes()
		self.createAircraftType_edit.setEditText(CreateTrafficDialog.last_known_acft_type_used)
		self.startFrozen_tickBox.setChecked(CreateTrafficDialog.last_start_frozen)
		self.createStripLink_tickBox.setChecked(CreateTrafficDialog.last_strip_link)
		self.suggestCallsign()
		if env.airport_data == None:
			self.allow_taxi = False
			self.closest_PKG = None
			self.nearby_THRs = []
		else:
			self.allow_taxi = env.airport_data.ground_net.closestNode(spawn_coords, maxdist=max_spawn_GND_dist) != None
			self.closest_PKG = env.airport_data.ground_net.closestParkingPosition(spawn_coords, maxdist=max_spawn_PKG_dist)
			self.nearby_THRs = [r.name for r in env.airport_data.allRunways() if r.threshold().distanceTo(spawn_coords) <= max_spawn_THR_dist]
		self.closestParkingPosition_info.setText(some(self.closest_PKG, ''))
		self.depRWY_select.addItems(sorted(self.nearby_THRs))
		self.spawn_coords = spawn_coords
		self.spawn_hdg = spawn_hdg
		self.updateButtons()
		if self.allow_taxi:
			self.ground_status_radioButton.toggled.connect(self.toggleGroundStatus)
			self.ground_status_radioButton.setChecked(True)
			if self.closest_PKG != None:
				self.parked_tickBox.setChecked(True)
		else:
			self.ground_status_radioButton.setEnabled(False)
			self.toggleGroundStatus(False)
		self.depRWY_select.setEnabled(False)
		if self.nearby_THRs == []:
			self.ready_status_radioButton.setEnabled(False)
		elif self.closest_PKG == None:
			self.ready_status_radioButton.setChecked(True)
		self.accepted.connect(self.rememberOptions)
		self.createAircraftType_edit.editTextChanged.connect(self.updateButtons)
		self.createAircraftType_edit.editTextChanged.connect(self.suggestCallsign)
		self.createCallsign_edit.textChanged.connect(self.updateButtons)
Пример #15
0
 def openWidgetPopOut(self, widget):
     widget.installEventFilter(RadioKeyEventFilter(widget))
     widget.setWindowFlags(Qt.Window)
     self.popped_out_widgets[widget._workspace_widget_index] = widget
     widget.show()
Пример #16
0
	def __init__(self, launcher, parent=None):
		QMainWindow.__init__(self, parent)
		self.setupUi(self)
		self.central_workspace = WorkspaceWidget(self)
		self.setCentralWidget(self.central_workspace)
		self.installEventFilter(RadioKeyEventFilter(self))
		self.setAttribute(Qt.WA_DeleteOnClose)
		self.launcher = launcher
		settings.controlled_tower_viewer = FlightGearTowerViewer(self)
		settings.session_manager = SessionManager(self)
		self.setWindowTitle('%s - %s (%s)' % (self.windowTitle(), env.locationName(), settings.location_code))
		self.session_start_sound_lock_timer = QTimer(self)
		self.session_start_sound_lock_timer.setSingleShot(True)
		self.session_start_sound_lock_timer.timeout.connect(self.unlockSounds)
		
		## Restore saved dock layout
		try:
			with open(dock_layout_file, 'rb') as f: # Restore saved dock arrangement
				self.restoreState(f.read())
		except FileNotFoundError: # Fallback on default dock arrangement
			# left docks, top zone
			self.tabifyDockWidget(self.selection_info_dock, self.weather_dock)
			self.tabifyDockWidget(self.selection_info_dock, self.towerView_dock)
			self.tabifyDockWidget(self.selection_info_dock, self.navigator_dock)
			self.selection_info_dock.hide()
			# left docks, bottom zone
			self.tabifyDockWidget(self.instructions_dock, self.notepads_dock)
			self.tabifyDockWidget(self.instructions_dock, self.radio_dock)
			self.tabifyDockWidget(self.instructions_dock, self.FPLlist_dock)
			self.tabifyDockWidget(self.instructions_dock, self.CPDLC_dock)
			self.instructions_dock.hide()
			self.notepads_dock.hide()
			self.radio_dock.hide()
			self.CPDLC_dock.hide()
			# right docks
			self.rwyBoxes_dock.hide() # hiding this because bad position (user will drag 1st thing after raise)
			# bottom docks
			self.atcTextChat_dock.hide()
		
		## Permanent tool/status bar widgets
		self.selectionInfo_toolbar.addWidget(SelectionInfoToolbarWidget(self))
		self.METAR_statusBarLabel = QLabel()
		self.PTT_statusBarLabel = QLabel()
		self.RDF_statusBarLabel = QLabel()
		self.RDF_statusBarLabel.setToolTip('Current signal / last QDM')
		self.wind_statusBarLabel = QLabel()
		self.QNH_statusBarLabel = QLabel()
		self.QNH_statusBarLabel.setToolTip('hPa / inHg')
		self.clock_statusBarLabel = QLabel()
		self.alarmClock_statusBarButtons = [AlarmClockButton('1', self), AlarmClockButton('2', self)]
		self.statusbar.addWidget(self.METAR_statusBarLabel)
		self.statusbar.addPermanentWidget(self.PTT_statusBarLabel)
		self.statusbar.addPermanentWidget(self.RDF_statusBarLabel)
		self.statusbar.addPermanentWidget(self.wind_statusBarLabel)
		self.statusbar.addPermanentWidget(self.QNH_statusBarLabel)
		for b in self.alarmClock_statusBarButtons:
			self.statusbar.addPermanentWidget(b)
			b.alarm.connect(self.notification_pane.notifyAlarmClockTimedOut)
		self.statusbar.addPermanentWidget(self.clock_statusBarLabel)
		
		# Populate menus (toolbar visibility and airport viewpoints)
		toolbar_menu = QMenu()
		self.general_viewToolbar_action = self.general_toolbar.toggleViewAction()
		self.stripActions_viewToolbar_action = self.stripActions_toolbar.toggleViewAction()
		self.docks_viewToolbar_action = self.docks_toolbar.toggleViewAction()
		self.selectionInfo_viewToolbar_action = self.selectionInfo_toolbar.toggleViewAction()
		self.radarAssistance_viewToolbar_action = self.radarAssistance_toolbar.toggleViewAction()
		self.workspace_viewToolbar_action = self.workspace_toolbar.toggleViewAction()
		toolbar_menu.addAction(self.general_viewToolbar_action)
		toolbar_menu.addAction(self.stripActions_viewToolbar_action)
		toolbar_menu.addAction(self.docks_viewToolbar_action)
		toolbar_menu.addAction(self.selectionInfo_viewToolbar_action)
		toolbar_menu.addAction(self.radarAssistance_viewToolbar_action)
		toolbar_menu.addAction(self.workspace_viewToolbar_action)
		self.toolbars_view_menuAction.setMenu(toolbar_menu)
		
		if env.airport_data == None or len(env.airport_data.viewpoints) == 0:
			self.viewpointSelection_view_menuAction.setEnabled(False)
		else:
			viewPointSelection_menu = QMenu()
			viewPointSelection_actionGroup = QActionGroup(self)
			for vp_i, (vp_pos, vp_h, vp_name) in enumerate(env.airport_data.viewpoints):
				action = QAction('%s - %d ft ASFC' % (vp_name, vp_h + .5), self)
				action.setCheckable(True)
				action.triggered.connect(lambda ignore_checked, i=vp_i: self.selectIndicateViewpoint(i))
				viewPointSelection_actionGroup.addAction(action)
			actions = viewPointSelection_actionGroup.actions()
			viewPointSelection_menu.addActions(actions)
			self.viewpointSelection_view_menuAction.setMenu(viewPointSelection_menu)
			try:
				actions[settings.selected_viewpoint].setChecked(True)
			except IndexError:
				actions[0].setChecked(True)
		
		## Memory-persistent windows and dialogs
		self.solo_connect_dialog_AD = StartSoloDialog_AD(self)
		self.MP_connect_dialog = StartFlightGearMPdialog(self)
		self.start_student_session_dialog = StartStudentSessionDialog(self)
		self.recall_cheat_dialog = DiscardedStripsDialog(self, ShelfFilterModel(self, env.discarded_strips, False), 'Sent and deleted strips')
		self.shelf_dialog = DiscardedStripsDialog(self, ShelfFilterModel(self, env.discarded_strips, True), 'Strip shelf')
		self.environment_info_dialog = EnvironmentInfoDialog(self)
		self.about_dialog = AboutDialog(self)
		self.teaching_console = TeachingConsole(parent=self)
		self.unit_converter = UnitConversionWindow(parent=self)
		self.world_airport_navigator = WorldAirportNavigator(parent=self)
		self.quick_reference = QuickReference(parent=self)
		for w in self.teaching_console, self.unit_converter, self.world_airport_navigator, self.quick_reference:
			w.setWindowFlags(Qt.Window)
			w.installEventFilter(RadioKeyEventFilter(w))
		
		# Make a few actions always visible
		self.addAction(self.newStrip_action)
		self.addAction(self.newLinkedStrip_action)
		self.addAction(self.newFPL_action)
		self.addAction(self.newLinkedFPL_action)
		self.addAction(self.startTimer1_action)
		self.addAction(self.forceStartTimer1_action)
		self.addAction(self.startTimer2_action)
		self.addAction(self.forceStartTimer2_action)
		self.addAction(self.notificationSounds_options_action)
		self.addAction(self.quickReference_help_action)
		self.addAction(self.saveDockLayout_view_action)
		self.addAction(self.recallWindowState_view_action)
		
		# Populate icons
		self.newStrip_action.setIcon(QIcon(IconFile.action_newStrip))
		self.newLinkedStrip_action.setIcon(QIcon(IconFile.action_newLinkedStrip))
		self.newFPL_action.setIcon(QIcon(IconFile.action_newFPL))
		self.newLinkedFPL_action.setIcon(QIcon(IconFile.action_newLinkedFPL))
		self.teachingConsole_view_action.setIcon(QIcon(IconFile.panel_teaching))
		self.unitConversionTool_view_action.setIcon(QIcon(IconFile.panel_unitConv))
		self.worldAirportNavigator_view_action.setIcon(QIcon(IconFile.panel_airportList))
		self.environmentInfo_view_action.setIcon(QIcon(IconFile.panel_envInfo))
		self.generalSettings_options_action.setIcon(QIcon(IconFile.action_generalSettings))
		self.soloSessionSettings_system_action.setIcon(QIcon(IconFile.action_sessionSettings))
		self.runwaysInUse_options_action.setIcon(QIcon(IconFile.action_runwayUse))
		self.newLooseStripBay_view_action.setIcon(QIcon(IconFile.action_newLooseStripBay))
		self.newRadarScreen_view_action.setIcon(QIcon(IconFile.action_newRadarScreen))
		self.newStripRackPanel_view_action.setIcon(QIcon(IconFile.action_newRackPanel))
		self.popOutCurrentWindow_view_action.setIcon(QIcon(IconFile.action_popOutWindow))
		self.reclaimPoppedOutWindows_view_action.setIcon(QIcon(IconFile.action_reclaimWindows))
		self.primaryRadar_options_action.setIcon(QIcon(IconFile.option_primaryRadar))
		self.approachSpacingHints_options_action.setIcon(QIcon(IconFile.option_approachSpacingHints))
		self.runwayOccupationWarnings_options_action.setIcon(QIcon(IconFile.option_runwayOccupationMonitor))
		self.routeConflictWarnings_options_action.setIcon(QIcon(IconFile.option_routeConflictWarnings))
		self.trafficIdentification_options_action.setIcon(QIcon(IconFile.option_identificationAssistant))
		
		setDockAndActionIcon(IconFile.panel_ATCs, self.handovers_dockView_action, self.handover_dock)
		setDockAndActionIcon(IconFile.panel_atcChat, self.atcTextChat_dockView_action, self.atcTextChat_dock)
		setDockAndActionIcon(IconFile.panel_CPDLC, self.cpdlc_dockView_action, self.CPDLC_dock)
		setDockAndActionIcon(IconFile.panel_FPLs, self.FPLs_dockView_action, self.FPLlist_dock)
		setDockAndActionIcon(IconFile.panel_instructions, self.instructions_dockView_action, self.instructions_dock)
		setDockAndActionIcon(IconFile.panel_navigator, self.navpoints_dockView_action, self.navigator_dock)
		setDockAndActionIcon(IconFile.panel_notepads, self.notepads_dockView_action, self.notepads_dock)
		setDockAndActionIcon(IconFile.panel_notifications, self.notificationArea_dockView_action, self.notification_dock)
		setDockAndActionIcon(IconFile.panel_radios, self.fgcom_dockView_action, self.radio_dock)
		setDockAndActionIcon(IconFile.panel_runwayBox, self.runwayBoxes_dockView_action, self.rwyBoxes_dock)
		setDockAndActionIcon(IconFile.panel_selInfo, self.radarContactDetails_dockView_action, self.selection_info_dock)
		setDockAndActionIcon(IconFile.panel_racks, self.strips_dockView_action, self.strip_dock)
		setDockAndActionIcon(IconFile.panel_txtChat, self.radioTextChat_dockView_action, self.radioTextChat_dock)
		setDockAndActionIcon(IconFile.panel_twrView, self.towerView_dockView_action, self.towerView_dock)
		setDockAndActionIcon(IconFile.panel_weather, self.weather_dockView_action, self.weather_dock)
		
		# action TICKED STATES (set here before connections)
		self.windowedWorkspace_view_action.setChecked(settings.saved_workspace_windowed_view)
		self.verticalRwyBoxLayout_view_action.setChecked(settings.vertical_runway_box_layout)
		self.notificationSounds_options_action.setChecked(settings.notification_sounds_enabled)
		self.primaryRadar_options_action.setChecked(settings.primary_radar_active)
		self.routeConflictWarnings_options_action.setChecked(settings.route_conflict_warnings)
		self.trafficIdentification_options_action.setChecked(settings.traffic_identification_assistant)
		self.runwayOccupationWarnings_options_action.setChecked(settings.monitor_runway_occupation)
		self.approachSpacingHints_options_action.setChecked(settings.APP_spacing_hints)
		
		# action CONNECTIONS
		# non-menu actions
		self.newStrip_action.triggered.connect(lambda: new_strip_dialog(self, default_rack_name, linkToSelection=False))
		self.newLinkedStrip_action.triggered.connect(lambda: new_strip_dialog(self, default_rack_name, linkToSelection=True))
		self.newFPL_action.triggered.connect(lambda: self.FPLlist_pane.createLocalFPL(link=None))
		self.newLinkedFPL_action.triggered.connect(lambda: self.FPLlist_pane.createLocalFPL(link=selection.strip))
		self.startTimer1_action.triggered.connect(lambda: self.startTimer(0, False))
		self.forceStartTimer1_action.triggered.connect(lambda: self.startTimer(0, True))
		self.startTimer2_action.triggered.connect(lambda: self.startTimer(1, False))
		self.forceStartTimer2_action.triggered.connect(lambda: self.startTimer(1, True))
		# system menu
		self.soloSession_system_action.triggered.connect(lambda: self.startStopSession(self.start_solo))
		self.connectFlightGearMP_system_action.triggered.connect(lambda: self.startStopSession(self.start_FlightGearMP))
		self.teacherSession_system_action.triggered.connect(lambda: self.startStopSession(self.start_teaching))
		self.studentSession_system_action.triggered.connect(lambda: self.startStopSession(self.start_learning))
		self.reloadAdditionalViewers_system_action.triggered.connect(self.reloadAdditionalViewers)
		self.reloadBgImages_system_action.triggered.connect(self.reloadBackgroundImages)
		self.reloadColourConfig_system_action.triggered.connect(self.reloadColourConfig)
		self.reloadRoutePresets_system_action.triggered.connect(self.reloadRoutePresets)
		self.reloadEntryExitPoints_system_action.triggered.connect(self.reloadEntryExitPoints)
		self.announceFgSession_system_action.triggered.connect(self.announceFgSession)
		self.fgcomEchoTest_system_action.triggered.connect(self.radio_pane.performEchoTest)
		self.extractSectorFile_system_action.triggered.connect(self.extractSectorFile)
		self.repositionBgImages_system_action.triggered.connect(self.repositionRadarBgImages)
		self.measuringLogsCoordinates_system_action.toggled.connect(self.switchMeasuringCoordsLog)
		self.airportGateway_system_action.triggered.connect(lambda: self.goToURL(airport_gateway_URL))
		self.openStreetMap_system_action.triggered.connect(lambda: self.goToURL(mk_OSM_URL(env.radarPos())))
		self.soloSessionSettings_system_action.triggered.connect(self.openSoloSessionSettings)
		self.locationSettings_system_action.triggered.connect(self.openLocalSettings)
		self.systemSettings_system_action.triggered.connect(self.openSystemSettings)
		self.changeLocation_system_action.triggered.connect(self.changeLocation)
		self.quit_system_action.triggered.connect(self.close)
		# view menu
		self.saveDockLayout_view_action.triggered.connect(self.saveDockLayout)
		self.recallWindowState_view_action.triggered.connect(self.recallWindowState)
		self.handovers_dockView_action.triggered.connect(lambda: self.raiseDock(self.handover_dock))
		self.atcTextChat_dockView_action.triggered.connect(lambda: self.raiseDock(self.atcTextChat_dock))
		self.cpdlc_dockView_action.triggered.connect(lambda: self.raiseDock(self.CPDLC_dock))
		self.FPLs_dockView_action.triggered.connect(lambda: self.raiseDock(self.FPLlist_dock))
		self.instructions_dockView_action.triggered.connect(lambda: self.raiseDock(self.instructions_dock))
		self.navpoints_dockView_action.triggered.connect(lambda: self.raiseDock(self.navigator_dock))
		self.notepads_dockView_action.triggered.connect(lambda: self.raiseDock(self.notepads_dock))
		self.notificationArea_dockView_action.triggered.connect(lambda: self.raiseDock(self.notification_dock))
		self.fgcom_dockView_action.triggered.connect(lambda: self.raiseDock(self.radio_dock))
		self.runwayBoxes_dockView_action.triggered.connect(lambda: self.raiseDock(self.rwyBoxes_dock))
		self.radarContactDetails_dockView_action.triggered.connect(lambda: self.raiseDock(self.selection_info_dock))
		self.strips_dockView_action.triggered.connect(lambda: self.raiseDock(self.strip_dock))
		self.radioTextChat_dockView_action.triggered.connect(lambda: self.raiseDock(self.radioTextChat_dock))
		self.towerView_dockView_action.triggered.connect(lambda: self.raiseDock(self.towerView_dock))
		self.weather_dockView_action.triggered.connect(lambda: self.raiseDock(self.weather_dock))
		self.windowedWorkspace_view_action.toggled.connect(self.central_workspace.switchWindowedView)
		self.popOutCurrentWindow_view_action.triggered.connect(self.central_workspace.popOutCurrentWindow)
		self.reclaimPoppedOutWindows_view_action.triggered.connect(self.central_workspace.reclaimPoppedOutWidgets)
		self.newLooseStripBay_view_action.triggered.connect(lambda: self.central_workspace.addWorkspaceWidget(WorkspaceWidget.LOOSE_BAY))
		self.newRadarScreen_view_action.triggered.connect(lambda: self.central_workspace.addWorkspaceWidget(WorkspaceWidget.RADAR_SCREEN))
		self.newStripRackPanel_view_action.triggered.connect(lambda: self.central_workspace.addWorkspaceWidget(WorkspaceWidget.STRIP_PANEL))
		self.verticalRwyBoxLayout_view_action.toggled.connect(self.switchVerticalRwyBoxLayout)
		self.towerView_view_action.triggered.connect(self.toggleTowerWindow)
		self.addViewer_view_action.triggered.connect(self.addView)
		self.listViewers_view_action.triggered.connect(self.listAdditionalViews)
		self.activateAdditionalViewers_view_action.toggled.connect(self.activateAdditionalViews)
		self.removeViewer_view_action.triggered.connect(self.removeView)
		self.teachingConsole_view_action.triggered.connect(self.teaching_console.show)
		self.unitConversionTool_view_action.triggered.connect(self.unit_converter.show)
		self.worldAirportNavigator_view_action.triggered.connect(self.world_airport_navigator.show)
		self.environmentInfo_view_action.triggered.connect(self.environment_info_dialog.exec)
		# options menu
		self.runwaysInUse_options_action.triggered.connect(self.configureRunwayUse)
		self.notificationSounds_options_action.toggled.connect(self.switchNotificationSounds)
		self.primaryRadar_options_action.toggled.connect(self.switchPrimaryRadar)
		self.routeConflictWarnings_options_action.toggled.connect(self.switchConflictWarnings)
		self.trafficIdentification_options_action.toggled.connect(self.switchTrafficIdentification)
		self.runwayOccupationWarnings_options_action.toggled.connect(self.switchRwyOccupationIndications)
		self.approachSpacingHints_options_action.toggled.connect(self.switchApproachSpacingHints)
		self.generalSettings_options_action.triggered.connect(self.openGeneralSettings)
		# cheat menu
		self.pauseSimulation_cheat_action.toggled.connect(self.pauseSession)
		self.spawnAircraft_cheat_action.triggered.connect(self.spawnAircraft)
		self.killSelectedAircraft_cheat_action.triggered.connect(self.killSelectedAircraft)
		self.popUpMsgOnRejectedInstr_cheat_action.toggled.connect(self.setRejectedInstrPopUp)
		self.showRecognisedVoiceStrings_cheat_action.toggled.connect(self.setShowRecognisedVoiceStrings)
		self.ensureClearWeather_cheat_action.toggled.connect(self.ensureClearWeather)
		self.ensureDayLight_cheat_action.triggered.connect(self.towerView_pane.ensureDayLight)
		self.changeTowerHeight_cheat_action.triggered.connect(self.changeTowerHeight)
		self.recallDiscardedStrip_cheat_action.triggered.connect(self.recall_cheat_dialog.exec)
		self.radarCheatMode_cheat_action.toggled.connect(self.setRadarCheatMode)
		# help menu
		self.quickReference_help_action.triggered.connect(self.quick_reference.show)
		self.videoTutorial_help_action.triggered.connect(lambda: self.goToURL(video_tutorial_URL))
		self.FAQ_help_action.triggered.connect(lambda: self.goToURL(FAQ_URL))
		self.about_help_action.triggered.connect(self.about_dialog.exec)
		
		## More signal connections
		signals.openShelfRequest.connect(self.shelf_dialog.exec)
		signals.privateAtcChatRequest.connect(lambda: self.raiseDock(self.atcTextChat_dock))
		signals.stripRecall.connect(recover_strip)
		env.radar.blip.connect(env.strips.refreshViews)
		env.radar.lostContact.connect(self.aircraftHasDisappeared)
		signals.aircraftKilled.connect(self.aircraftHasDisappeared)
		env.strips.rwyBoxFreed.connect(lambda box, strip: env.airport_data.physicalRunway_restartWtcTimer(box, strip.lookup(FPL.WTC)))
		env.rdf.signalChanged.connect(self.updateRDF)
		signals.statusBarMsg.connect(lambda msg: self.statusbar.showMessage(msg, status_bar_message_timeout))
		signals.newWeather.connect(self.updateWeatherIfPrimary)
		signals.kbdPTT.connect(self.updatePTT)
		signals.sessionStarted.connect(self.sessionHasStarted)
		signals.sessionEnded.connect(self.sessionHasEnded)
		signals.towerViewProcessToggled.connect(self.towerView_view_action.setChecked)
		signals.towerViewProcessToggled.connect(self.towerView_cheat_menu.setEnabled)
		signals.stripInfoChanged.connect(env.strips.refreshViews)
		signals.fastClockTick.connect(self.updateClock)
		signals.fastClockTick.connect(env.cpdlc.updateAckStatuses)
		signals.slowClockTick.connect(strip_auto_print_check)
		signals.stripEditRequest.connect(lambda strip: edit_strip(self, strip))
		signals.selectionChanged.connect(self.updateStripFplActions)
		signals.receiveStrip.connect(receive_strip)
		signals.handoverFailure.connect(self.recoverFailedHandover)
		signals.sessionPaused.connect(env.radar.stopSweeping)
		signals.sessionResumed.connect(env.radar.startSweeping)
		signals.aircraftKilled.connect(env.radar.silentlyForgetContact)
		signals.rackVisibilityLost.connect(self.collectClosedRacks)
		signals.localSettingsChanged.connect(env.rdf.clearAllSignals)
		signals.localSettingsChanged.connect(self.updateRDF)
		
		## MISC GUI setup
		self.strip_pane.setViewRacks([default_rack_name]) # will be moved out if a rack panel's saved "visible_racks" claims it [*1]
		self.strip_pane.restoreState(settings.saved_strip_dock_state) # [*1]
		self.central_workspace.restoreWorkspaceWindows(settings.saved_workspace_windows)
		self.central_workspace.switchWindowedView(settings.saved_workspace_windowed_view) # keep this after restoring windows!
		
		self.subsecond_ticker = Ticker(signals.fastClockTick.emit, parent=self)
		self.subminute_ticker = Ticker(signals.slowClockTick.emit, parent=self)
		self.subsecond_ticker.start_stopOnZero(subsecond_tick_interval)
		self.subminute_ticker.start_stopOnZero(subminute_tick_interval)
		self.towerView_cheat_menu.setEnabled(False)
		self.solo_cheat_menu.setEnabled(False)
		self.updateClock()
		self.updateWeatherIfPrimary(settings.primary_METAR_station, None)
		self.updateStripFplActions()
		self.last_RDF_qdm = None
		self.updateRDF()
		self.updatePTT(0, False)
		# Disable some base airport stuff if doing CTR
		if env.airport_data == None:
			self.towerView_view_action.setEnabled(False)
			self.runwaysInUse_options_action.setEnabled(False)
			self.runwayOccupationWarnings_options_action.setEnabled(False)
		# Finish
		self.atcTextChat_pane.switchAtcChatFilter(None) # Show GUI on general chat room at start
		if speech_recognition_available:
			prepare_SR_language_files()
 def __init__(self, parent, title, lost_specs_text):
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.installEventFilter(RadioKeyEventFilter(self))
     self.setWindowTitle(title)
     self.lostSpecs_box.setText(lost_specs_text)