Now possible to create/delete flights.

This commit is contained in:
Khopa
2020-05-25 14:54:02 +02:00
parent 7a3ee6b1a9
commit 3f2aafcd28
6 changed files with 173 additions and 7 deletions

View File

@@ -2,7 +2,7 @@ from PySide2.QtWidgets import QFrame, QGridLayout, QLabel, QPushButton, QVBoxLay
from gen.flights.flight import Flight
from qt_ui.windows.mission.flight.waypoints.QFlightWaypointList import QFlightWaypointList
from qt_ui.windows.mission.flight.waypoints.QWaypointSelectionWindow import QWaypointSelectionWindow
from qt_ui.windows.mission.flight.waypoints.QPredefinedWaypointSelectionWindow import QPredefinedWaypointSelectionWindow
from game import Game
class QFlightWaypointTab(QFrame):
@@ -22,7 +22,6 @@ class QFlightWaypointTab(QFrame):
self.delete_selected = QPushButton("Delete Selected")
self.delete_selected.clicked.connect(self.on_delete_waypoint)
layout.addWidget(self.flight_waypoint_list,0,0)
rlayout.addWidget(self.open_fast_waypoint_button)
rlayout.addWidget(self.delete_selected)
@@ -37,5 +36,5 @@ class QFlightWaypointTab(QFrame):
self.flight_waypoint_list.update_list()
def on_fast_waypoint(self):
self.subwindow = QWaypointSelectionWindow(self.game, self.flight, self.flight_waypoint_list)
self.subwindow = QPredefinedWaypointSelectionWindow(self.game, self.flight, self.flight_waypoint_list)
self.subwindow.show()

View File

@@ -15,11 +15,11 @@ PREDEFINED_WAYPOINT_CATEGORIES = [
]
class QWaypointSelectionWindow(QDialog):
class QPredefinedWaypointSelectionWindow(QDialog):
def __init__(self, game: Game, flight: Flight, flight_waypoint_list):
super(QWaypointSelectionWindow, self).__init__()
super(QPredefinedWaypointSelectionWindow, self).__init__()
self.game = game
self.flight = flight
self.setWindowFlags(Qt.WindowStaysOnTopHint)