forked from Mirrors/apostrophe
disable "export to pdf" if pdftex is not avaliable
parent
fb34842a56
commit
696f135e33
|
@ -1022,6 +1022,12 @@ class UberwriterWindow(Window):
|
|||
self.focusmode_button.set_name('focus_toggle')
|
||||
self.preview_button.set_name('preview_toggle')
|
||||
|
||||
self.export_pdf_button = builder.get_object('mnu_export_pdf')
|
||||
|
||||
# Gray export to pdf if pdftex not avaliable
|
||||
if not helpers.exist_executable('pdftex'):
|
||||
self.export_pdf_button.set_sensitive(False)
|
||||
|
||||
# Setup status bar hide after 3 seconds
|
||||
|
||||
self.status_bar = builder.get_object('status_bar_box')
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
import logging
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
|
||||
from . uberwriterconfig import get_data_file
|
||||
from . Builder import Builder
|
||||
|
@ -125,3 +126,6 @@ def alias(alternative_function_name):
|
|||
function.aliases.append(alternative_function_name)
|
||||
return function
|
||||
return decorator
|
||||
|
||||
def exist_executable(command):
|
||||
return shutil.which(command) is not None
|
Loading…
Reference in New Issue