Commit 224b4872 authored by Domanski, Marian M.'s avatar Domanski, Marian M.
Browse files

Merge branch '56-v4-1-0-code-review' into 'master'

Resolve "v4.1.0 Code Review"

Closes #56

See merge request !56
parents dee5a12e 2bc9dd65
......@@ -2,10 +2,11 @@
# Form implementation generated from reading ui file 'fluegggui/batch_gui_layout.ui'
#
# Created by: PyQt5 UI code generator 5.12.2
# Created by: PyQt5 UI code generator 5.12.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
......@@ -510,7 +511,7 @@ class Ui_BatchWindow(object):
self.verticalLayout.setStretch(3, 1)
BatchWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(BatchWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 689, 26))
self.menubar.setGeometry(QtCore.QRect(0, 0, 689, 21))
self.menubar.setObjectName("menubar")
self.menuVersion = QtWidgets.QMenu(self.menubar)
self.menuVersion.setObjectName("menuVersion")
......@@ -522,8 +523,13 @@ class Ui_BatchWindow(object):
self.actionHelp.setObjectName("actionHelp")
self.actionVersion = QtWidgets.QAction(BatchWindow)
self.actionVersion.setObjectName("actionVersion")
self.actionUser_Manual = QtWidgets.QAction(BatchWindow)
self.actionUser_Manual.setObjectName("actionUser_Manual")
self.actionProject_Page = QtWidgets.QAction(BatchWindow)
self.actionProject_Page.setObjectName("actionProject_Page")
self.menuVersion.addAction(self.actionVersion)
self.menuVersion.addAction(self.actionHelp)
self.menuVersion.addAction(self.actionUser_Manual)
self.menuVersion.addAction(self.actionProject_Page)
self.menubar.addAction(self.menuVersion.menuAction())
self.retranslateUi(BatchWindow)
......@@ -696,15 +702,5 @@ class Ui_BatchWindow(object):
self.menuVersion.setTitle(_translate("BatchWindow", "About"))
self.actionHelp.setText(_translate("BatchWindow", "Help"))
self.actionVersion.setText(_translate("BatchWindow", "Version"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
BatchWindow = QtWidgets.QMainWindow()
ui = Ui_BatchWindow()
ui.setupUi(BatchWindow)
BatchWindow.show()
sys.exit(app.exec_())
self.actionUser_Manual.setText(_translate("BatchWindow", "User Manual"))
self.actionProject_Page.setText(_translate("BatchWindow", "Project Page"))
......@@ -1129,7 +1129,7 @@
<x>0</x>
<y>0</y>
<width>689</width>
<height>26</height>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuVersion">
......@@ -1137,7 +1137,8 @@
<string>About</string>
</property>
<addaction name="actionVersion"/>
<addaction name="actionHelp"/>
<addaction name="actionUser_Manual"/>
<addaction name="actionProject_Page"/>
</widget>
<addaction name="menuVersion"/>
</widget>
......@@ -1152,6 +1153,16 @@
<string>Version</string>
</property>
</action>
<action name="actionUser_Manual">
<property name="text">
<string>User Manual</string>
</property>
</action>
<action name="actionProject_Page">
<property name="text">
<string>Project Page</string>
</property>
</action>
</widget>
<tabstops>
<tabstop>radioButton_csv</tabstop>
......@@ -1666,10 +1677,10 @@
</connection>
</connections>
<buttongroups>
<buttongroup name="direction"/>
<buttongroup name="results_size"/>
<buttongroup name="hydraulic_inputs"/>
<buttongroup name="species"/>
<buttongroup name="direction"/>
<buttongroup name="diffusivities"/>
<buttongroup name="varying_dd"/>
</buttongroups>
......
......@@ -116,9 +116,9 @@ class HecrasDialog(QDialog):
dlg = QFileDialog()
file_path = dlg.getOpenFileName(
self,
"QFileDialog.getOpenFileName()",
"Open HEC-RAS Project File",
"",
"HECRAS Project File (*.prj)")[0]
"HEC-RAS Project File (*.prj)")[0]
if file_path == '':
return
......@@ -243,6 +243,7 @@ class AppWindow(QMainWindow):
# Input validators
self.int_val = QIntValidator()
self.double_val = QDoubleValidator()
self.double_val.setNotation(QDoubleValidator.StandardNotation)
# Set line edit validators
self.ui.lineEdit_duration.setValidator(self.double_val)
......@@ -441,7 +442,7 @@ class AppWindow(QMainWindow):
# File exploring dialog
dlg = QFileDialog()
file_path = dlg.getOpenFileName(
self, "QFileDialog.getOpenFileName()", "",
self, "Open CSV File", "",
"CSV File (*.csv)")[0]
if file_path == '':
return
......@@ -453,17 +454,9 @@ class AppWindow(QMainWindow):
self.ui.groupBox_sim.setEnabled(True)
elif self.ui.radioButton_hecras.isChecked():
# File exploring dialog
dlg = QFileDialog()
file_path = dlg.getOpenFileName(
self, "QFileDialog.getOpenFileName()", "",
"HECRAS Project File (*.prj)")[0]
self.ui.lineEdit_hecras.setText(file_path)
# Hecras dialog
self.ras_window = HecrasDialog(self)
self.ras_window.show()
self.ras_window.ui.lineEdit_project.setText(file_path)
self.ras_window.setup()
self.ui.label_sim_running.setStyleSheet('color: green;')
......@@ -828,7 +821,7 @@ class AppWindow(QMainWindow):
self.handle_validate()
class BatchWindow(AppWindow, QMainWindow):
class BatchWindow(AppWindow):
"""Class that defines the main window of the ui.
It links the pre-generated ui created by the .ui to .py GUI files
with the functionality of the main_functions methods. This window
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment