added versioning, requirements and setup

This commit is contained in:
robert 2026-01-06 16:15:18 +01:00
parent b0c968622e
commit 835ac2e9a6
6 changed files with 97 additions and 12 deletions

View file

@ -1,4 +1,3 @@
import tkinter as tk
from tkinter import ttk, filedialog, messagebox
from pathlib import Path
@ -6,10 +5,14 @@ import json
from PIL import Image
from PIL.PngImagePlugin import PngInfo
# Application metadata
APP_VERSION = "1.0.0"
APP_NAME = "PNG Metadata Editor"
class PNGMetadataEditor:
def __init__(self, root):
self.root = root
self.root.title("PNG Metadata Editor")
self.root.title(f"{APP_NAME} - No file loaded")
self.root.geometry("900x700")
self.current_file = None
@ -32,6 +35,7 @@ class PNGMetadataEditor:
ttk.Button(top_frame, text="Open PNG File", command=self.open_file).pack(side=tk.LEFT, padx=5)
ttk.Button(top_frame, text="Save Changes", command=self.save_changes).pack(side=tk.LEFT, padx=5)
ttk.Button(top_frame, text="About", command=self.show_about).pack(side=tk.RIGHT, padx=5) # New About button
self.file_label = ttk.Label(top_frame, text="No file loaded", foreground="gray")
self.file_label.pack(side=tk.LEFT, padx=20)
@ -52,7 +56,7 @@ class PNGMetadataEditor:
tree_scroll = ttk.Scrollbar(tree_frame)
tree_scroll.pack(side=tk.RIGHT, fill=tk.Y)
self.tree = ttk.Treeview(tree_frame, columns=("Key", "Value"), show="headings",
self.tree = ttk.Treeview(tree_frame, columns=("Key", "Value"), show="headings",
yscrollcommand=tree_scroll.set)
self.tree.heading("Key", text="Key")
self.tree.heading("Value", text="Value Preview")
@ -98,6 +102,19 @@ class PNGMetadataEditor:
self.status_label = ttk.Label(status_frame, text="Ready", padding=(10, 5))
self.status_label.pack(side=tk.LEFT, fill=tk.X, expand=True)
def show_about(self):
"""Show application about dialog"""
about_text = f"{APP_NAME} v{APP_VERSION}\n\n" \
"A graphical tool for viewing and editing metadata in PNG files.\n\n" \
"Author: Robert Tusa\n" \
"License: MIT"
messagebox.showinfo(
f"About {APP_NAME}",
about_text,
parent=self.root
)
def set_status(self, message, duration=3000, color=""):
"""Set status bar message that auto-clears after duration (ms)"""
# Cancel any existing timer
@ -126,7 +143,7 @@ class PNGMetadataEditor:
def update_title(self):
"""Update window title with unsaved indicator"""
base_title = "PNG Metadata Editor"
base_title = f"{APP_NAME} v{APP_VERSION}"
if self.current_file:
filename = Path(self.current_file).name
if self.has_unsaved_changes:
@ -243,7 +260,7 @@ class PNGMetadataEditor:
value_scroll = ttk.Scrollbar(text_frame)
value_scroll.pack(side=tk.RIGHT, fill=tk.Y)
value_text = tk.Text(text_frame, wrap=tk.WORD, yscrollcommand=value_scroll.set,
value_text = tk.Text(text_frame, wrap=tk.WORD, yscrollcommand=value_scroll.set,
font=("Menlo", 11))
value_text.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)
value_scroll.config(command=value_text.yview)
@ -387,4 +404,4 @@ class PNGMetadataEditor:
if __name__ == "__main__":
root = tk.Tk()
app = PNGMetadataEditor(root)
root.mainloop()
root.mainloop()