Skip to content

Commit

Permalink
Make the "Help" and "Print" buttons *nix (Linux and OSX) compatible (#76
Browse files Browse the repository at this point in the history
)

* Add Linux compatibility to help and print buttons
  • Loading branch information
gutow committed Sep 19, 2022
1 parent 3c82755 commit 33a9fba
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/user_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,19 +610,28 @@ def __confirm(self):

def __show_help(self):
helpfile = str(Path(__file__).parent / "assets" / "manual.pdf")
subprocess.Popen([helpfile], shell=True)
if platform.system() in ('Darwin','Linux'):
subprocess.Popen(['open',helpfile])
else:
subprocess.Popen([helpfile], shell=True)

def __show_sheet(self):
if (self.form_variant == FormVariantSelection.VARIANT_75_Q):
helpfile = str(
Path(__file__).parent / "assets" /
"multiple_choice_sheet_75q.pdf")
subprocess.Popen([helpfile], shell=True)
if platform.system() in ('Darwin','Linux'):
subprocess.Popen(['open', helpfile])
else:
subprocess.Popen([helpfile], shell=True)
elif (self.form_variant == FormVariantSelection.VARIANT_150_Q):
helpfile = str(
Path(__file__).parent / "assets" /
"multiple_choice_sheet_150q.pdf")
subprocess.Popen([helpfile], shell=True)
if platform.system() in ('Darwin','Linux'):
subprocess.Popen(['open', helpfile])
else:
subprocess.Popen([helpfile], shell=True)

def __on_close(self):
self.__app.destroy()
Expand Down

0 comments on commit 33a9fba

Please sign in to comment.