Mainwindow: Fix #11 pdf file open, use QDesktopServices instead of open cmd.
parent
769fd8581e
commit
9c5b76e451
|
|
@ -290,17 +290,29 @@ class Ui_MainWindow(object):
|
||||||
aw = AboutWindow()
|
aw = AboutWindow()
|
||||||
aw.exec()
|
aw.exec()
|
||||||
|
|
||||||
|
def current_file_path(self, filename):
|
||||||
|
return os.path.abspath(
|
||||||
|
os.path.join(
|
||||||
|
os.path.dirname(__file__),
|
||||||
|
"..", filename
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
def open_doc_file(self, filename):
|
||||||
|
QtGui.QDesktopServices.openUrl(
|
||||||
|
QtCore.QUrl(
|
||||||
|
f"file://{self.current_file_path(filename)}"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
def user_manual(self):
|
def user_manual(self):
|
||||||
open('AcouSed_UserManual.pdf')
|
self.open_doc_file('AcouSed_UserManual.pdf')
|
||||||
run(["open", 'AcouSed_UserManual.pdf'])
|
|
||||||
|
|
||||||
def inversion_acoustic_theory(self):
|
def inversion_acoustic_theory(self):
|
||||||
open('Acoustic_Inversion_theory.pdf')
|
self.open_doc_file('Acoustic_Inversion_theory.pdf')
|
||||||
run(["open", 'Acoustic_Inversion_theory.pdf'])
|
|
||||||
|
|
||||||
def tutorial_AQUAscat_software(self):
|
def tutorial_AQUAscat_software(self):
|
||||||
open('Tutorial_AQUAscat_software.pdf')
|
self.open_doc_file('Tutorial_AQUAscat_software.pdf')
|
||||||
run(["open", 'Tutorial_AQUAscat_software.pdf'])
|
|
||||||
|
|
||||||
def export_table_of_acoustic_BS_values_to_excel_or_libreOfficeCalc_file(self):
|
def export_table_of_acoustic_BS_values_to_excel_or_libreOfficeCalc_file(self):
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue