From 7879c847b3b1aa2a9b6775e38dbad22de5b37e96 Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 25 Jul 2019 17:17:30 +0200 Subject: Menubar items for script run --- jfr_playoff/gui/__init__.py | 34 +++++++++++++++++++++++++++++++++- jfr_playoff/gui/icons/log.gif | Bin 0 -> 1014 bytes jfr_playoff/gui/icons/run-once.gif | Bin 0 -> 189 bytes jfr_playoff/gui/icons/run-timed.gif | Bin 0 -> 567 bytes 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 jfr_playoff/gui/icons/log.gif create mode 100644 jfr_playoff/gui/icons/run-once.gif create mode 100644 jfr_playoff/gui/icons/run-timed.gif diff --git a/jfr_playoff/gui/__init__.py b/jfr_playoff/gui/__init__.py index 09d9c98..a0dedc9 100644 --- a/jfr_playoff/gui/__init__.py +++ b/jfr_playoff/gui/__init__.py @@ -10,7 +10,8 @@ import tkMessageBox as tkmb from .tabs import * from .icons import GuiImage -from .frames import LabelButton +from .frames import LabelButton, NumericSpinbox +from .variables import NumericVar class PlayoffGUI(tk.Tk): def __init__(self): @@ -84,6 +85,28 @@ class PlayoffGUI(tk.Tk): menu, image=GuiImage.get_icon(icon), command=command, tooltip=tooltip, label=statusBar) self.menuButtons[icon].pack(side=tk.LEFT) + (ttk.Separator(menu, orient=tk.VERTICAL)).pack( + side=tk.LEFT, fill=tk.Y, padx=3, pady=1) + for icon, command, tooltip in [ + ('run-once', self.onRunOnce, 'Wygeneruj'), + ('run-timed', self.onRunTimed, 'Generuj co X sekund')]: + self.menuButtons[icon] = LabelButton( + menu, image=GuiImage.get_icon(icon), command=command, + tooltip=tooltip, label=statusBar) + self.menuButtons[icon].pack(side=tk.LEFT) + self.interval = NumericVar() + self.intervalField = NumericSpinbox( + menu, width=5, + textvariable=self.interval, from_=30, to=3600) + self.intervalField.pack(side=tk.LEFT) + (ttk.Label(menu, text='sekund')).pack(side=tk.LEFT) + for icon, command, tooltip in [ + ('log', self.onLogWindowOpen, 'Dziennik komunikatów')]: + self.menuButtons[icon] = LabelButton( + menu, image=GuiImage.get_icon(icon), command=command, + tooltip=tooltip, label=statusBar) + self.menuButtons[icon].pack(side=tk.LEFT) + def onNewFile(self): self._checkSave() @@ -114,6 +137,15 @@ class PlayoffGUI(tk.Tk): filename = filename + '.jtpo' self.saveFile(filename) + def onRunOnce(self): + pass + + def onRunTimed(self): + pass + + def onLogWindowOpen(self): + pass + def newFile(self): self._filepath = None self.newFileIndex += 1 diff --git a/jfr_playoff/gui/icons/log.gif b/jfr_playoff/gui/icons/log.gif new file mode 100644 index 0000000..7915311 Binary files /dev/null and b/jfr_playoff/gui/icons/log.gif differ diff --git a/jfr_playoff/gui/icons/run-once.gif b/jfr_playoff/gui/icons/run-once.gif new file mode 100644 index 0000000..842afd8 Binary files /dev/null and b/jfr_playoff/gui/icons/run-once.gif differ diff --git a/jfr_playoff/gui/icons/run-timed.gif b/jfr_playoff/gui/icons/run-timed.gif new file mode 100644 index 0000000..1b8340e Binary files /dev/null and b/jfr_playoff/gui/icons/run-timed.gif differ -- cgit v1.2.3