Skip to content

Commit

Permalink
Made log auto-minimize on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nimaid committed Nov 28, 2019
1 parent 6b9aa75 commit e6b6aeb
Show file tree
Hide file tree
Showing 13 changed files with 1,905 additions and 1,911 deletions.
9 changes: 8 additions & 1 deletion LPHK.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#! /usr/bin/python3
from datetime import datetime

def datetime_str():
now = datetime.now()
return now.strftime("%d/%m/%Y %H:%M:%S")

print("LPHK - LaunchPad HotKey - A Novation Launchpad Macro Scripting System")
print("-------- BEGIN LOG", datetime_str(), "--------\n")

import sys, os

Expand Down
1,903 changes: 0 additions & 1,903 deletions README_FILES/LPHK.ai

This file was deleted.

Binary file removed README_FILES/LPHK.png
Binary file not shown.
Binary file removed README_FILES/LPHK_icon.png
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
1,884 changes: 1,884 additions & 0 deletions README_FILES/Source/LPHK.ai

Large diffs are not rendered by default.

File renamed without changes.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.6
0.1.7
Binary file added resources/LPHK.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions run.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@echo off
set STARTPATH="%CD%"
cd "%~dp0"
conda activate LPHK & python LPHK.py & conda deactivate & cd %STARTPATH%

start "LPHK Log (Do Not Close)" /min /D "%~dp0" cmd /c "conda activate LPHK & python -u LPHK.py & conda deactivate & exit"
13 changes: 10 additions & 3 deletions window.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def __init__(self, master=None):
tk.Frame.__init__(self, master)
self.master = master
self.init_window()


self.about_image = ImageTk.PhotoImage(Image.open(PATH + "/resources/LPHK.png"))
self.info_image = ImageTk.PhotoImage(Image.open(PATH + "/resources/info.png"))
self.warning_image = ImageTk.PhotoImage(Image.open(PATH + "/resources/warning.png"))
self.error_image = ImageTk.PhotoImage(Image.open(PATH + "/resources/error.png"))
Expand Down Expand Up @@ -102,7 +103,7 @@ def init_window(self):
self.m_Help.add_command(label="Scripting help...", command=open_scripting)
open_main_folder = lambda: files.open_file_folder(PATH)
self.m_Help.add_command(label="Program folder...", command=open_main_folder)
display_info = lambda: self.popup(self, "About LPHK", self.info_image, "A Novation Launchpad Macro Scripting System\nMade by Ella Jameson (nimaid)\n\nVersion: " + files.PROG_VERSION + "\nFile format version: " + files.FILE_VERSION, "Done")
display_info = lambda: self.popup(self, "About LPHK", self.about_image, "A Novation Launchpad Macro Scripting System\nMade by Ella Jameson (nimaid)\n\nVersion: " + files.PROG_VERSION + "\nFile format version: " + files.FILE_VERSION, "Done")
self.m_Help.add_command(label="About LPHK", command=display_info)
self.m.add_cascade(label="Help", menu=self.m_Help)

Expand All @@ -116,7 +117,11 @@ def init_window(self):
self.stat = tk.Label(self, text="No Launchpad Connected", bg=STAT_INACTIVE_COLOR, fg="#fff")
self.stat.grid(row=1, column=0, sticky=tk.EW)
self.stat.config(font=("Courier", BUTTON_SIZE // 3, "bold"))


def raise_above_all(self):
self.master.attributes('-topmost', 1)
self.master.attributes('-topmost', 0)

def enable_menu(self, name):
self.m.entryconfig(name, state="normal")

Expand Down Expand Up @@ -656,7 +661,9 @@ def make():
root_destroyed = False
root.protocol("WM_DELETE_WINDOW", close)
root.resizable(False, False)
root.iconbitmap(os.path.join(PATH, "resources", "LPHK.ico"))
app = Main_Window(root)
app.raise_above_all()
app.mainloop()

def close():
Expand Down

0 comments on commit e6b6aeb

Please sign in to comment.