From 80fb0e26b61f1a5d846b920878be014ccbbc8a00 Mon Sep 17 00:00:00 2001 From: Huy Pham <42948410+hpham@users.noreply.github.com> Date: Wed, 11 Dec 2019 16:16:59 -0800 Subject: [PATCH] attempt to work on check engine light dialog --- coretk/coretk/dialogs/cel.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/coretk/coretk/dialogs/cel.py b/coretk/coretk/dialogs/cel.py index 847d245b..a5fbea63 100644 --- a/coretk/coretk/dialogs/cel.py +++ b/coretk/coretk/dialogs/cel.py @@ -1,6 +1,7 @@ """ check engine light """ +import tkinter as tk from tkinter import ttk from coretk.dialogs.dialog import Dialog @@ -17,9 +18,14 @@ class CheckLight(Dialog): def draw(self): row = 0 frame = ttk.Frame(self) + label = ttk.Label(frame, text="Check Emulation Light") + label.grid(row=0, column=0) + frame.grid(row=row, column=0) + row = row + 1 + frame = ttk.Frame(self) button = ttk.Button(frame, text="Reset CEL") button.grid(row=0, column=0) - button = ttk.Button(frame, text="View core-daemon log") + button = ttk.Button(frame, text="View core-daemon log", command=self.daemon_log) button.grid(row=0, column=1) button = ttk.Button(frame, text="View node log") button.grid(row=0, column=2) @@ -27,3 +33,23 @@ class CheckLight(Dialog): button.grid(row=0, column=3) frame.grid(row=row, column=0, sticky="nsew") ++row + + def daemon_log(self): + dialog = DaemonLog(self, self.app) + dialog.show() + + +class DaemonLog(Dialog): + def __init__(self, master, app): + super().__init__(master, app, "core-daemon log", modal=True) + self.columnconfigure(0, weight=1) + self.path = tk.StringVar(value="/var/log/core-daemon.log") + self.draw() + + def draw(self): + frame = ttk.Frame(self) + label = ttk.Label(frame, text="File: ") + label.grid(row=0, column=0) + entry = ttk.Entry(frame, textvariable=self.path, state="readonly") + entry.grid(row=0, column=1) + frame.grid(row=0, column=0)