def new_cabin_configuration(self): self.ui.stackedWidget.setCurrentWidget(self.New_ship_cabin) self.emp_title_back_to_first_page.clicked.connect(self.back_to_first_page) LoadDataToComboBox.load_port_ids(self.ship_id_comboBox) self.load_ship_capacity_on_change() self.ship_id_comboBox.currentIndexChanged.connect(self.load_ship_capacity_on_change) self.add_new_cabin_button.clicked.connect(self.check_all_ship_cabin_details)
def open_new_ship_configuration(self): """Interface with new ship form""" self.ui.stackedWidget.setCurrentWidget(self.ui.New_ship_configuration) self.emp_title_back_to_first_page.clicked.connect(self.back_to_first_page) LoadDataToComboBox.load_ports(self.port_identification_comboBox) self.add_new_ship_button.clicked.connect(self.check_all_ship_details)
def update_port_configuration(self): """Load interface with port update""" self.ui.stackedWidget.setCurrentWidget(self.ui.Port_configuration) self.emp_title_back_to_first_page.clicked.connect(self.back_to_first_page) LoadDataToComboBox.load_ports(self.port_comboBox) self.change_port_details_button.clicked.connect(self.enter_updated_port_details_to_db)
def open_new_port_configuration(self): """Opens widget with form for new port. After button is clicked, starts to check all ports details""" self.ui.stackedWidget.setCurrentWidget(self.ui.New_port_configuration) self.emp_title_back_to_first_page.clicked.connect(self.back_to_first_page) LoadDataToComboBox.load_countries_list(self.country_comboBox) self.port_add_button.clicked.connect(self.check_all_port_details)
def __init__(self): super(NewClient, self).__init__() self.ui = loadUi("Resources/interfaces/client_register_form.ui", self) self.show() LoadDataToComboBox.load_countries_list(self.country_comboBox) self.create_account_button.clicked.connect( self.check_all_client_details)
def organize_new_trip(self, port_number): self.ui.stackedWidget.setCurrentWidget(self.New_trip) # Need this solution for a moment, because if user switch widgets from organize trip to another and then # again to organize trip he can add multiple trips with the same details, which means user violates constraints self.port_info_button.setEnabled(False) self.emp_title_back_to_first_page.setEnabled(False) self.emp_title_back_to_first_page.clicked.connect(self.back_to_first_page) LoadDataToComboBox.load_ships_available_for_trip(self.onboard_combobox, port_number) self.add_trip_button.clicked.connect(lambda: self.check_trip_details(port_number))
def trip_booking(self, email): self.ui.stackedWidget.setCurrentWidget(self.Choose_trip_page) LoadDataToComboBox.load_trips(self.trip_combobox) get_number_of_available_trips = 'SELECT COUNT(*) FROM trips' DatabaseConnection.cursor.execute(get_number_of_available_trips) number_of_available_trips, = DatabaseConnection.cursor.fetchone() if number_of_available_trips == 0: self.ui.stackedWidget.setCurrentWidget(self.Choose_trip_page) self.trip_name_error_label.setText('No trips available') else: self.load_trips_on_change() self.trip_combobox.currentTextChanged.connect(self.load_trips_on_change) self.book_button.clicked.connect(lambda: self.check_details_of_trip_to_book(email))