Skip to content
Snippets Groups Projects
main_window.py 37.8 KiB
Newer Older
  • Learn to ignore specific revisions
  •         if self.isFullScreen():
                self.showNormal()
                self.actionToggle_full_screen.setIcon(get_icon('full-screen'))
            else:
                self.showFullScreen()
                self.actionToggle_full_screen.setIcon(get_icon('full-screen-exit'))
    
    
    Andreas Bolin's avatar
    Andreas Bolin committed
    
    
    def start_scheduler(schedule: Optional[Schedule] = None) -> Schedule:
    
        """
        Start scheduler GUI.
    
        Parameters
        ----------
        schedule : Schedule, optional
            The schedule to start the editor with.
    
        Returns
        -------
        Schedule
            The edited schedule.
        """
        if not QApplication.instance():
    
    Oscar Gustafsson's avatar
    Oscar Gustafsson committed
            QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
    
            app = QApplication(sys.argv)
        else:
            app = QApplication.instance()
    
        window = ScheduleMainWindow()
    
        if schedule:
            window.open(schedule)
    
    Andreas Bolin's avatar
    Andreas Bolin committed
        window.show()
    
        app.exec_()
        return window.schedule
    
    Andreas Bolin's avatar
    Andreas Bolin committed
    
    
    Andreas Bolin's avatar
    Andreas Bolin committed
    if __name__ == "__main__":