diff --git a/spinetoolbox/ui/startup_box.py b/spinetoolbox/ui/startup_box.py index 63fb322b8..5a8574a0c 100644 --- a/spinetoolbox/ui/startup_box.py +++ b/spinetoolbox/ui/startup_box.py @@ -51,15 +51,18 @@ def setupUi(self, Form): self.groupBox_7.setMinimumSize(QSize(0, 16)) self.pushButton_8 = QPushButton(self.groupBox_7) self.pushButton_8.setObjectName(u"pushButton_8") - self.pushButton_8.setGeometry(QRect(10, 40, 131, 24)) + self.pushButton_8.setGeometry(QRect(10, 80, 131, 24)) self.label_2 = QLabel(self.groupBox_7) self.label_2.setObjectName(u"label_2") - self.label_2.setGeometry(QRect(10, 80, 49, 16)) + self.label_2.setGeometry(QRect(10, 130, 49, 16)) self.listWidget = QListWidget(self.groupBox_7) self.listWidget.setObjectName(u"listWidget") - self.listWidget.setGeometry(QRect(10, 110, 131, 331)) + self.listWidget.setGeometry(QRect(10, 160, 131, 331)) self.listWidget.setStyleSheet(u"background-color: rgb(240, 240, 240);\n" "border-color: rgb(240, 240, 240);") + self.pushButton_9 = QPushButton(self.groupBox_7) + self.pushButton_9.setObjectName(u"pushButton_9") + self.pushButton_9.setGeometry(QRect(10, 40, 131, 24)) self.tabWidget = QTabWidget(Form) self.tabWidget.setObjectName(u"tabWidget") self.tabWidget.setGeometry(QRect(210, 40, 691, 611)) @@ -103,9 +106,6 @@ def setupUi(self, Form): self.groupBox_13 = QGroupBox(self.scrollAreaWidgetContents_3) self.groupBox_13.setObjectName(u"groupBox_13") self.groupBox_13.setGeometry(QRect(10, 460, 631, 101)) - self.groupBox_9 = QGroupBox(self.scrollAreaWidgetContents_3) - self.groupBox_9.setObjectName(u"groupBox_9") - self.groupBox_9.setGeometry(QRect(10, 580, 631, 101)) self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_3) self.tabWidget.addTab(self.tab_2, "") self.tab = QWidget() @@ -129,12 +129,12 @@ def setupUi(self, Form): self.label.setLayoutDirection(Qt.LeftToRight) self.label_13 = QLabel(self.scrollAreaWidgetContents_2) self.label_13.setObjectName(u"label_13") - self.label_13.setGeometry(QRect(10, 410, 670, 21)) + self.label_13.setGeometry(QRect(10, 240, 621, 21)) self.label_13.setFont(font) self.label_13.setLayoutDirection(Qt.LeftToRight) self.groupBox_8 = QGroupBox(self.scrollAreaWidgetContents_2) self.groupBox_8.setObjectName(u"groupBox_8") - self.groupBox_8.setGeometry(QRect(10, 50, 631, 111)) + self.groupBox_8.setGeometry(QRect(10, 60, 631, 131)) self.label_5 = QLabel(self.groupBox_8) self.label_5.setObjectName(u"label_5") self.label_5.setGeometry(QRect(90, 20, 351, 71)) @@ -143,55 +143,22 @@ def setupUi(self, Form): self.label_5.setWordWrap(True) self.pushButton_3 = QPushButton(self.groupBox_8) self.pushButton_3.setObjectName(u"pushButton_3") - self.pushButton_3.setGeometry(QRect(460, 40, 141, 24)) - self.groupBox = QGroupBox(self.scrollAreaWidgetContents_2) - self.groupBox.setObjectName(u"groupBox") - self.groupBox.setGeometry(QRect(10, 170, 631, 101)) - self.pushButton_4 = QPushButton(self.groupBox) - self.pushButton_4.setObjectName(u"pushButton_4") - self.pushButton_4.setGeometry(QRect(460, 30, 141, 24)) - self.label_6 = QLabel(self.groupBox) - self.label_6.setObjectName(u"label_6") - self.label_6.setGeometry(QRect(90, 20, 361, 50)) - self.label_6.setTextFormat(Qt.PlainText) - self.label_6.setScaledContents(False) - self.label_6.setWordWrap(True) - self.groupBox_2 = QGroupBox(self.scrollAreaWidgetContents_2) - self.groupBox_2.setObjectName(u"groupBox_2") - self.groupBox_2.setGeometry(QRect(10, 280, 631, 111)) - self.pushButton_5 = QPushButton(self.groupBox_2) - self.pushButton_5.setObjectName(u"pushButton_5") - self.pushButton_5.setGeometry(QRect(464, 40, 131, 24)) - self.label_8 = QLabel(self.groupBox_2) - self.label_8.setObjectName(u"label_8") - self.label_8.setGeometry(QRect(80, 20, 361, 81)) - self.label_8.setTextFormat(Qt.PlainText) - self.label_8.setScaledContents(False) - self.label_8.setWordWrap(True) + self.pushButton_3.setGeometry(QRect(460, 50, 141, 24)) self.groupBox_3 = QGroupBox(self.scrollAreaWidgetContents_2) self.groupBox_3.setObjectName(u"groupBox_3") - self.groupBox_3.setGeometry(QRect(10, 440, 631, 80)) + self.groupBox_3.setGeometry(QRect(10, 320, 631, 131)) self.pushButton_7 = QPushButton(self.groupBox_3) self.pushButton_7.setObjectName(u"pushButton_7") - self.pushButton_7.setGeometry(QRect(471, 30, 121, 24)) + self.pushButton_7.setGeometry(QRect(470, 50, 121, 24)) self.label_12 = QLabel(self.groupBox_3) self.label_12.setObjectName(u"label_12") - self.label_12.setGeometry(QRect(70, 20, 371, 50)) + self.label_12.setGeometry(QRect(70, 20, 371, 91)) self.label_12.setTextFormat(Qt.PlainText) self.label_12.setScaledContents(False) self.label_12.setWordWrap(True) - self.groupBox_5 = QGroupBox(self.scrollAreaWidgetContents_2) - self.groupBox_5.setObjectName(u"groupBox_5") - self.groupBox_5.setGeometry(QRect(10, 540, 631, 91)) - self.pushButton_6 = QPushButton(self.groupBox_5) - self.pushButton_6.setObjectName(u"pushButton_6") - self.pushButton_6.setGeometry(QRect(470, 30, 121, 24)) - self.label_9 = QLabel(self.groupBox_5) - self.label_9.setObjectName(u"label_9") - self.label_9.setGeometry(QRect(80, 20, 361, 64)) - self.label_9.setTextFormat(Qt.PlainText) - self.label_9.setScaledContents(False) - self.label_9.setWordWrap(True) + self.label_4 = QLabel(self.scrollAreaWidgetContents_2) + self.label_4.setObjectName(u"label_4") + self.label_4.setGeometry(QRect(10, 280, 631, 31)) self.scrollArea.setWidget(self.scrollAreaWidgetContents_2) self.verticalLayout_3.addWidget(self.scrollArea) @@ -212,31 +179,23 @@ def retranslateUi(self, Form): self.groupBox_7.setTitle(QCoreApplication.translate("Form", u"Main", None)) self.pushButton_8.setText(QCoreApplication.translate("Form", u"Open Project", None)) self.label_2.setText(QCoreApplication.translate("Form", u"Recent", None)) - self.label_3.setText(QCoreApplication.translate("Form", u"Introductory Learnign Material", None)) + self.pushButton_9.setText(QCoreApplication.translate("Form", u"New Project", None)) + self.label_3.setText(QCoreApplication.translate("Form", u"Introductory Learning Material", None)) self.label_14.setText(QCoreApplication.translate("Form", u"Advanced Learning Material", None)) self.groupBox_4.setTitle(QCoreApplication.translate("Form", u"Hello World", None)) self.groupBox_10.setTitle(QCoreApplication.translate("Form", u"Introduction to Spine Data Structure", None)) self.groupBox_11.setTitle(QCoreApplication.translate("Form", u"Setting up a Workflow", None)) - self.groupBox_13.setTitle(QCoreApplication.translate("Form", u"topic 4 tbd", None)) - self.groupBox_9.setTitle(QCoreApplication.translate("Form", u"Tutorial 6", None)) + self.groupBox_13.setTitle(QCoreApplication.translate("Form", u"Executing Projects", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), QCoreApplication.translate("Form", u"Learning materials", None)) - self.label.setText(QCoreApplication.translate("Form", u"Beginner Templates", None)) - self.label_13.setText(QCoreApplication.translate("Form", u"Advanced Templates", None)) - self.groupBox_8.setTitle(QCoreApplication.translate("Form", u"Simple Energy System", None)) - self.label_5.setText(QCoreApplication.translate("Form", u"This tutorial provides a step-by-step guide to setup a simple energy system with Spine Toolbox for SpineOpt. Spine Toolbox is used to create a workflow with databases and tools and SpineOpt is the tool that simulates/optimizes the energy system.", None)) + self.label.setText(QCoreApplication.translate("Form", u"Spine Toolbox", None)) + self.label_13.setText(QCoreApplication.translate("Form", u"Model specific workflows", None)) + self.groupBox_8.setTitle(QCoreApplication.translate("Form", u"Basic Modelling Workflow", None)) + self.label_5.setText(QCoreApplication.translate("Form", u"https://spine-toolbox.readthedocs.io/en/latest/data_import_export.html", None)) self.pushButton_3.setText(QCoreApplication.translate("Form", u"Open", None)) - self.groupBox.setTitle(QCoreApplication.translate("Form", u"Reserve Requirement", None)) - self.pushButton_4.setText(QCoreApplication.translate("Form", u"Open", None)) - self.label_6.setText(QCoreApplication.translate("Form", u"This tutorial provides a step-by-step guide to include reserve requirements in a simple energy system with Spine Toolbox for SpineOpt.", None)) - self.groupBox_2.setTitle(QCoreApplication.translate("Form", u"Hydropower Plant", None)) - self.pushButton_5.setText(QCoreApplication.translate("Form", u"Open", None)) - self.label_8.setText(QCoreApplication.translate("Form", u"Welcome to this Spine Toolbox Case Study tutorial. Case Study A5 is one of the Spine Project case studies designed to verify Toolbox and Model capabilities. To this end, it reproduces an already existing study about hydropower on the Skellefte river, which models one week of operation of the fifteen power stations along the river.", None)) - self.groupBox_3.setTitle(QCoreApplication.translate("Form", u"TBD?", None)) + self.groupBox_3.setTitle(QCoreApplication.translate("Form", u"SpineOpt - Simple Energy System", None)) self.pushButton_7.setText(QCoreApplication.translate("Form", u"Open", None)) - self.label_12.setText(QCoreApplication.translate("Form", u"TO BE Defined", None)) - self.groupBox_5.setTitle(QCoreApplication.translate("Form", u"Coal Plant", None)) - self.pushButton_6.setText(QCoreApplication.translate("Form", u"Open", None)) - self.label_9.setText(QCoreApplication.translate("Form", u"The system contains three demand nodes, connections between them, a coal plant and a wind plant to provide the energy to the time varying demand. The system is run over a 48 hour timeline.", None)) + self.label_12.setText(QCoreApplication.translate("Form", u"This tutorial provides a step-by-step guide to setup a simple energy system with Spine Toolbox for SpineOpt. Spine Toolbox is used to create a workflow with databases and tools and SpineOpt is the tool that simulates/optimizes the energy system.", None)) + self.label_4.setText(QCoreApplication.translate("Form", u"Prerequisite to run the and Julia, SpineOpt", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QCoreApplication.translate("Form", u"Templates", None)) # retranslateUi diff --git a/spinetoolbox/ui/startup_box.ui b/spinetoolbox/ui/startup_box.ui index cfbea1bbe..9b53ef6a8 100644 --- a/spinetoolbox/ui/startup_box.ui +++ b/spinetoolbox/ui/startup_box.ui @@ -84,7 +84,7 @@ border-color: rgb(240, 240, 240); 10 - 40 + 80 131 24 @@ -97,7 +97,7 @@ border-color: rgb(240, 240, 240); 10 - 80 + 130 49 16 @@ -110,7 +110,7 @@ border-color: rgb(240, 240, 240); 10 - 110 + 160 131 331 @@ -120,6 +120,19 @@ border-color: rgb(240, 240, 240); border-color: rgb(240, 240, 240); + + + + 10 + 40 + 131 + 24 + + + + New Project + + @@ -193,7 +206,7 @@ border-color: rgb(240, 240, 240); Qt::LeftToRight - Introductory Learnign Material + Introductory Learning Material @@ -268,23 +281,10 @@ border-color: rgb(240, 240, 240); - topic 4 tbd + Executing Projects - - - - 10 - 580 - 631 - 101 - - - - Tutorial 6 - - @@ -338,15 +338,15 @@ border-color: rgb(240, 240, 240); Qt::LeftToRight - Beginner Templates + Spine Toolbox 10 - 410 - 670 + 240 + 621 21 @@ -361,20 +361,20 @@ border-color: rgb(240, 240, 240); Qt::LeftToRight - Advanced Templates + Model specific workflows 10 - 50 + 60 631 - 111 + 131 - Simple Energy System + Basic Modelling Workflow @@ -386,7 +386,7 @@ border-color: rgb(240, 240, 240); - This tutorial provides a step-by-step guide to setup a simple energy system with Spine Toolbox for SpineOpt. Spine Toolbox is used to create a workflow with databases and tools and SpineOpt is the tool that simulates/optimizes the energy system. + https://spine-toolbox.readthedocs.io/en/latest/data_import_export.html Qt::PlainText @@ -402,33 +402,7 @@ border-color: rgb(240, 240, 240); 460 - 40 - 141 - 24 - - - - Open - - - - - - - 10 - 170 - 631 - 101 - - - - Reserve Requirement - - - - - 460 - 30 + 50 141 24 @@ -437,94 +411,24 @@ border-color: rgb(240, 240, 240); Open - - - - 90 - 20 - 361 - 50 - - - - This tutorial provides a step-by-step guide to include reserve requirements in a simple energy system with Spine Toolbox for SpineOpt. - - - Qt::PlainText - - - false - - - true - - - - - - - 10 - 280 - 631 - 111 - - - - Hydropower Plant - - - - - 464 - 40 - 131 - 24 - - - - Open - - - - - - 80 - 20 - 361 - 81 - - - - Welcome to this Spine Toolbox Case Study tutorial. Case Study A5 is one of the Spine Project case studies designed to verify Toolbox and Model capabilities. To this end, it reproduces an already existing study about hydropower on the Skellefte river, which models one week of operation of the fifteen power stations along the river. - - - Qt::PlainText - - - false - - - true - - 10 - 440 + 320 631 - 80 + 131 - TBD? + SpineOpt - Simple Energy System - 471 - 30 + 470 + 50 121 24 @@ -539,11 +443,11 @@ border-color: rgb(240, 240, 240); 70 20 371 - 50 + 91 - TO BE Defined + This tutorial provides a step-by-step guide to setup a simple energy system with Spine Toolbox for SpineOpt. Spine Toolbox is used to create a workflow with databases and tools and SpineOpt is the tool that simulates/optimizes the energy system. Qt::PlainText @@ -556,53 +460,18 @@ border-color: rgb(240, 240, 240); - + 10 - 540 + 280 631 - 91 + 31 - - Coal Plant + + Prerequisite to run the and Julia, SpineOpt - - - - 470 - 30 - 121 - 24 - - - - Open - - - - - - 80 - 20 - 361 - 64 - - - - The system contains three demand nodes, connections between them, a coal plant and a wind plant to provide the energy to the time varying demand. The system is run over a 48 hour timeline. - - - Qt::PlainText - - - false - - - true - - diff --git a/spinetoolbox/ui_main.py b/spinetoolbox/ui_main.py index ef7d77957..0f1b5de86 100644 --- a/spinetoolbox/ui_main.py +++ b/spinetoolbox/ui_main.py @@ -243,6 +243,10 @@ def __init__(self): self.startup_box_widget.project_load_requested.connect(self.restore_project) # Connect to open_project the function in the start_up_box.py self.startup_box_widget.project_opener.connect(self.open_project) + + # Connect to open_project the function in the start_up_box.py + self.startup_box_widget.new_project_opener.connect(self.new_project) + # Show the Start Up box self.startup_box_widget.show() diff --git a/spinetoolbox/widgets/startup_box_widget.py b/spinetoolbox/widgets/startup_box_widget.py index 09d2e4365..6dbb7c12a 100644 --- a/spinetoolbox/widgets/startup_box_widget.py +++ b/spinetoolbox/widgets/startup_box_widget.py @@ -21,6 +21,7 @@ class StartupBoxWidget(QWidget): project_load_requested = Signal(str) project_opener = Signal(str) recent_projects = Signal(str) + new_project_opener = Signal(str) def __init__(self, parent=None): super().__init__(parent=parent, f=Qt.WindowType.Window) @@ -33,14 +34,14 @@ def __init__(self, parent=None): # Connect the clicked signal of open project button self._ui.pushButton_8.clicked.connect(self.open_project_startbox) + # Connect the clicked signal of open project button + self._ui.pushButton_9.clicked.connect(self.open_new_project_startbox) + # Connect the signal of recent projects self.open_recent() # Connect the clicked signal of each button to a specific slot self._ui.pushButton_3.clicked.connect(self.open_tutorial1) - self._ui.pushButton_4.clicked.connect(self.open_tutorial2) - self._ui.pushButton_5.clicked.connect(self.open_tutorial3) - self._ui.pushButton_6.clicked.connect(self.open_tutorial4) self._ui.pushButton_7.clicked.connect(self.open_tutorial5) def set_changelog_diff(self, diff_list): @@ -55,6 +56,12 @@ def open_project_startbox(self): # Execute the open_project function in the ui_main.py self.project_opener.emit(self) + def open_new_project_startbox(self): + # Execute the open_project function in the ui_main.py + self.new_project_opener.emit(self) + + + def open_recent(self): # Access qsettings from the parent object recents = self.parent().qsettings().value("appSettings/recentProjects", defaultValue=None)