From d4ed39b7d20dc815dd3a8d56e487046965552598 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Fri, 26 Aug 2022 08:10:53 +0200 Subject: [PATCH] replace the 'Open PDF' button text with 'Open PDF, JPG, PNG, TIF' if we have img2pdf --- plakativ.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plakativ.py b/plakativ.py index 8faa866..7007a58 100755 --- a/plakativ.py +++ b/plakativ.py @@ -1034,7 +1034,10 @@ class Application(tkinter.Frame): top_frame = tkinter.Frame(frame_right) top_frame.pack(fill=tkinter.X) - tkinter.Button(top_frame, text="Open PDF", command=self.on_open_button).pack( + button_text = "Open PDF" + if have_img2pdf: + button_text = "Open PDF, JPG, PNG, TIF" + tkinter.Button(top_frame, text=button_text, command=self.on_open_button).pack( side=tkinter.LEFT, expand=tkinter.TRUE, fill=tkinter.X ) tkinter.Button(top_frame, text="Help", state=tkinter.DISABLED).pack( @@ -1188,10 +1191,13 @@ class Application(tkinter.Frame): self.canvas.delete(tkinter.ALL) if not hasattr(self, "plakativ"): + button_text = "Open PDF" + if have_img2pdf: + button_text = "Open PDF, JPG, PNG, TIF" self.canvas.create_text( self.canvas_size[0] / 2, self.canvas_size[1] / 2, - text='Click on the "Open PDF" button in the upper right.', + text='Click on the "%s" button in the upper right.' % button_text, fill="white", ) return