Skip to content

Commit

Permalink
Fix help menu. Add files and pdf call
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcurbelo committed Sep 25, 2024
1 parent 0fd50b0 commit aa4928a
Show file tree
Hide file tree
Showing 5 changed files with 261 additions and 135 deletions.
27 changes: 16 additions & 11 deletions GUI_GO.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@
from scipy.fft import fft, fftfreq, fftshift, ifft, ifftshift
from UTILS.Ti34_XAS_Python import GetTiFormFactor

import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)


# This global variable is used to stop the data fitting
global stop
stop = False
Expand Down Expand Up @@ -8441,18 +8445,18 @@ def __init__(self):

# Help menu
helpMenu = menuBar.addMenu("&Help")
# software license
self.license = QAction('License', self)
self.license.triggered.connect(self._license)
helpMenu.addAction(self.license)
# user manual
self.about = QAction('About', self)
self.about.triggered.connect(self._help)
self.about = QAction('User Guide', self)
self.about.triggered.connect(self._userguide)
helpMenu.addAction(self.about)
# data analysis tips
self.tips = QAction('Tips', self)
self.tips.triggered.connect(self._tips)
helpMenu.addAction(self.tips)
# software license
self.license = QAction('License', self)
self.license.triggered.connect(self._license)
helpMenu.addAction(self.license)


def _loadOrbitals(self):
Expand Down Expand Up @@ -9259,22 +9263,20 @@ def _license(self):
license.close()
# no current implementation


def _tips(self):
license = tipsWidget()
license.show()
license.exec_()
license.close()
# no current implementation

def _help(self):
def _userguide(self):
"""
Purpose: provide user document of how to use application
"""
from PyQt5.QtGui import QDesktopServices
from PyQt5.QtCore import QUrl

file_path = 'GO-RXR_UserGuide_v0.3.1.pdf'
file_path = os.path.abspath('DOCS/GO-RXR_UserGuide_v0.3.1.pdf')

QDesktopServices.openUrl(QUrl.fromLocalFile(file_path))

Expand Down Expand Up @@ -11484,7 +11486,7 @@ def __init__(self):
self.scrollable_text_area = QTextEdit() # allowing scrollable capabilities
self.scrollable_text_area.setReadOnly(True)

with open('license.txt', 'r',encoding='ISO-8859-1') as f:
with open('LICENSE', 'r',encoding='ISO-8859-1') as f:
file_contents = f.read()
self.scrollable_text_area.setText(file_contents)

Expand Down Expand Up @@ -11526,6 +11528,9 @@ def __init__(self):

self.setLayout(pagelayout)




def is_float(string):
try:
float(string)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2024, lucaskorol21
Copyright (c) 2024, Lucas Korol, Robert J. Green, Raymond Spiteri, and Jesus Perez Curbelo

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
Loading

0 comments on commit aa4928a

Please sign in to comment.