Skip to content

Commit

Permalink
added new file option
Browse files Browse the repository at this point in the history
  • Loading branch information
shankinsMechEng committed Jan 3, 2025
1 parent 86fefea commit 670516a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
10 changes: 9 additions & 1 deletion python/FIERRO-GUI/fierro_gui/FIERRO_GUI.ui
Original file line number Diff line number Diff line change
Expand Up @@ -12157,8 +12157,11 @@ li.checked::marker { content: "\2612"; }
<property name="title">
<string>File</string>
</property>
<addaction name="actionNew"/>
<addaction name="actionOpen"/>
<addaction name="separator"/>
<addaction name="actionSaveAs"/>
<addaction name="separator"/>
<addaction name="actionChange_Working_Directory"/>
</widget>
<addaction name="menuFile"/>
Expand All @@ -12176,7 +12179,7 @@ li.checked::marker { content: &quot;\2612&quot;; }
</action>
<action name="actionSaveAs">
<property name="text">
<string>Save as..</string>
<string>Save as...</string>
</property>
</action>
<action name="actionHelp">
Expand All @@ -12189,6 +12192,11 @@ li.checked::marker { content: &quot;\2612&quot;; }
<string>Open</string>
</property>
</action>
<action name="actionNew">
<property name="text">
<string>New...</string>
</property>
</action>
</widget>
<tabstops>
<tabstop>INSphereri</tabstop>
Expand Down
23 changes: 17 additions & 6 deletions python/FIERRO-GUI/fierro_gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import time
from PySide6.QtWidgets import QApplication
from PySide6.QtGui import QPalette, QColor
from PySide6.QtCore import Qt
from PySide6.QtCore import Qt, QTimer
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

def main():
t1 = time.perf_counter()
# t1 = time.perf_counter()
sys.path.append(os.path.dirname(__file__))
from fierro_gui.FIERRO_GUI import FIERRO_GUI
from PySide6.QtWidgets import QMainWindow, QApplication, QSplashScreen
Expand All @@ -16,19 +17,30 @@ def main():

# MAIN WINDOW CLASS
class MainWindow(QMainWindow):
def restart(self):
QApplication.quit()
python = sys.executable
os.execl(python, python, *sys.argv)

def setup_restart(self):
self.ui.actionNew.triggered.connect(self.restart)

def __init__(self):
super(MainWindow, self).__init__()
self.setWindowTitle("Fierro")
self.ui = FIERRO_GUI()
self.ui.setupUi(self)
self.setEnabled(False)

# add restart
self.setup_restart()

# SHOW MAIN WINDOW
self.show()

# SHOW FIERRO SETUP WINDOW
t2 = time.perf_counter()
print(f"Started up in {t2 - t1:0.4f} seconds")
# t2 = time.perf_counter()
# print(f"Started up in {t2 - t1:0.4f} seconds")
self.ui.open_fierro_setup_dialog(self)

# self.dialog = WorkingDirectoryDialog(self)
Expand All @@ -39,7 +51,7 @@ def __init__(self):
app.setStyle('Fusion')
app.setWindowIcon(QIcon(':/Logos/Logos/FierroAppIcon.png'))
app.setApplicationDisplayName("Fierro")
start = time.perf_counter()
# start = time.perf_counter()
# print ("Splash Screen")
# pixmap = QPixmap(":/Logos/Logos/FIERRO.png")
# pixmap = pixmap.scaledToWidth(500)
Expand All @@ -55,7 +67,6 @@ def __init__(self):
window.show()
# splash.finish(window)


sys.exit(app.exec())

def force_light_mode(app):
Expand Down
10 changes: 8 additions & 2 deletions python/FIERRO-GUI/fierro_gui/ui_FIERRO_GUI.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

################################################################################
## Form generated from reading UI file 'FIERRO_GUIfiuqEK.ui'
## Form generated from reading UI file 'FIERRO_GUIYaKUPn.ui'
##
## Created by: Qt User Interface Compiler version 6.6.0
##
Expand Down Expand Up @@ -58,6 +58,8 @@ def setupUi(self, MainWindow):
self.actionHelp.setObjectName(u"actionHelp")
self.actionOpen = QAction(MainWindow)
self.actionOpen.setObjectName(u"actionOpen")
self.actionNew = QAction(MainWindow)
self.actionNew.setObjectName(u"actionNew")
self.centralwidget = QWidget(MainWindow)
self.centralwidget.setObjectName(u"centralwidget")
self.centralwidget.setEnabled(True)
Expand Down Expand Up @@ -6384,8 +6386,11 @@ def setupUi(self, MainWindow):
self.menubar.addAction(self.menuFile.menuAction())
self.menubar.addAction(self.menuHelp.menuAction())
self.menuHelp.addAction(self.actionManual)
self.menuFile.addAction(self.actionNew)
self.menuFile.addAction(self.actionOpen)
self.menuFile.addSeparator()
self.menuFile.addAction(self.actionSaveAs)
self.menuFile.addSeparator()
self.menuFile.addAction(self.actionChange_Working_Directory)

self.retranslateUi(MainWindow)
Expand Down Expand Up @@ -6440,9 +6445,10 @@ def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"Fierro", None))
self.actionManual.setText(QCoreApplication.translate("MainWindow", u"Manual", None))
self.actionChange_Working_Directory.setText(QCoreApplication.translate("MainWindow", u"Change Working Directory", None))
self.actionSaveAs.setText(QCoreApplication.translate("MainWindow", u"Save as..", None))
self.actionSaveAs.setText(QCoreApplication.translate("MainWindow", u"Save as...", None))
self.actionHelp.setText(QCoreApplication.translate("MainWindow", u"Help", None))
self.actionOpen.setText(QCoreApplication.translate("MainWindow", u"Open", None))
self.actionNew.setText(QCoreApplication.translate("MainWindow", u"New...", None))
self.NavigationMenu.setTabText(self.NavigationMenu.indexOf(self.Title), "")
self.NavigationMenu.setTabText(self.NavigationMenu.indexOf(self.Pipeline), QCoreApplication.translate("MainWindow", u"Pipeline", None))
self.NavigationMenu.setTabText(self.NavigationMenu.indexOf(self.Geometry), QCoreApplication.translate("MainWindow", u"Geometry", None))
Expand Down

0 comments on commit 670516a

Please sign in to comment.