summaryrefslogtreecommitdiff
path: root/jfr_playoff/gui
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-07-25 17:17:30 +0200
committeremkael <emkael@tlen.pl>2019-07-25 17:17:30 +0200
commit7879c847b3b1aa2a9b6775e38dbad22de5b37e96 (patch)
treebca7896acf6e090f6a098422b9c1e56d2f62bad7 /jfr_playoff/gui
parente5620ec415e677603e0144e367dec938504c4c2d (diff)
Menubar items for script run
Diffstat (limited to 'jfr_playoff/gui')
-rw-r--r--jfr_playoff/gui/__init__.py34
-rw-r--r--jfr_playoff/gui/icons/log.gifbin0 -> 1014 bytes
-rw-r--r--jfr_playoff/gui/icons/run-once.gifbin0 -> 189 bytes
-rw-r--r--jfr_playoff/gui/icons/run-timed.gifbin0 -> 567 bytes
4 files changed, 33 insertions, 1 deletions
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
--- /dev/null
+++ b/jfr_playoff/gui/icons/log.gif
Binary files 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
--- /dev/null
+++ b/jfr_playoff/gui/icons/run-once.gif
Binary files 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
--- /dev/null
+++ b/jfr_playoff/gui/icons/run-timed.gif
Binary files differ