Mainwindow: Fix #7 sqlitebrowser call with QProcess.
parent
dc9264cd65
commit
769fd8581e
|
|
@ -39,7 +39,7 @@ from View.about_window import AboutWindow
|
|||
import settings as stg
|
||||
|
||||
import numpy as np
|
||||
from subprocess import check_call, run
|
||||
from subprocess import run
|
||||
|
||||
import time
|
||||
|
||||
|
|
@ -269,7 +269,21 @@ class Ui_MainWindow(object):
|
|||
cc_kt.exec()
|
||||
|
||||
def db_browser_for_sqlite(self):
|
||||
check_call("/usr/bin/sqlitebrowser")
|
||||
proc = QtCore.QProcess()
|
||||
if stg.filename_save_as != "":
|
||||
print(f"Set working directory to: '{stg.filename_save_as}'")
|
||||
proc.setWorkingDirectory(
|
||||
os.path.dirname(stg.filename_save_as)
|
||||
)
|
||||
|
||||
proc.start("sqlitebrowser", [])
|
||||
proc.waitForFinished()
|
||||
|
||||
if proc.exitCode() != 0:
|
||||
print(f"'sqlitebrowser' return with error code : {proc.exitCode()}")
|
||||
print("-error------")
|
||||
print(f"{proc.readAllStandardError()}")
|
||||
print("------------")
|
||||
|
||||
def about_window(self):
|
||||
print("about")
|
||||
|
|
|
|||
Loading…
Reference in New Issue