mirror of
https://forgemia.inra.fr/theophile.terraz/acoused.git
synced 2026-10-30 03:10:40 +01:00
Mainwindow: Fix #11 pdf file open, use QDesktopServices instead of open cmd.
This commit is contained in:
1 parent
769fd8581e
commit
9c5b76e451
1 file changed
+19
-7
+19
-7
@@ -280,7 +280,7 @@ class Ui_MainWindow(object):
|
||||
proc.waitForFinished()
|
||||
|
||||
if proc.exitCode() != 0:
|
||||
print(f"'sqlitebrowser' return with error code : {proc.exitCode()}")
|
||||
print(f"'sqlitebrowser' return with error code: {proc.exitCode()}")
|
||||
print("-error------")
|
||||
print(f"{proc.readAllStandardError()}")
|
||||
print("------------")
|
||||
@@ -290,17 +290,29 @@ class Ui_MainWindow(object):
|
||||
aw = AboutWindow()
|
||||
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):
|
||||
open('AcouSed_UserManual.pdf')
|
||||
run(["open", 'AcouSed_UserManual.pdf'])
|
||||
self.open_doc_file('AcouSed_UserManual.pdf')
|
||||
|
||||
def inversion_acoustic_theory(self):
|
||||
open('Acoustic_Inversion_theory.pdf')
|
||||
run(["open", 'Acoustic_Inversion_theory.pdf'])
|
||||
self.open_doc_file('Acoustic_Inversion_theory.pdf')
|
||||
|
||||
def tutorial_AQUAscat_software(self):
|
||||
open('Tutorial_AQUAscat_software.pdf')
|
||||
run(["open", 'Tutorial_AQUAscat_software.pdf'])
|
||||
self.open_doc_file('Tutorial_AQUAscat_software.pdf')
|
||||
|
||||
def export_table_of_acoustic_BS_values_to_excel_or_libreOfficeCalc_file(self):
|
||||
|
||||
|
||||
Reference in new issue
Block a user