Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@

### 2.1 (In Development)

* [general] Improve usability and accessibility across the Scan Wizard, Advanced Mode, Region Editor, Scan Window, and About dialog:
* Add keyboard navigation to the Scan Wizard drop zone (`Tab`, `Enter`, `Space`) and video list (`Up`, `Down`, `Shift+Up`, `Shift+Down`, `Home`, `End`)
* Add `Alt+Left` and `Alt+Right` step shortcuts, `F1` help shortcut, `Escape` dialog dismissal, and keyboard-focusable tooltips
* Increase text and border contrast, use native `ttk` controls and DVR-Scan brand colors, align form labels, add output-mode descriptions, and show guidance when zero motion events are found
* Add Region Editor toolbar controls to add and delete shapes, show the current frame number, show checkmarks in the `View` menu, and add high-contrast handle borders
* [bugfix] Switch open top-level menus on hover and support `Alt`/`F10` shortcuts in the Windows menu bar [#289](https://github.com/Breakthrough/DVR-Scan/issues/289)
* [bugfix] Show a message dialog in Advanced Mode when starting a scan with no input videos or an invalid start/end time range
* [bugfix] Fix a `Ctrl+N` crash in the Region Editor when the pointer is outside the canvas, and show an error dialog when a region file fails to load
* [bugfix] Fix the scan progress bar stopping below 100% when `frame-skip` is set, and clamp remaining time at `00:00` on variable framerate inputs
* [bugfix] Keep sort menu checkmarks in sync between the Scan Wizard toolbar and `File -> Sort`, clear the clipboard before copying text, use `https://` for help links, and parent child dialogs to their window

### 2.0 (2026-11-08)

Expand Down
1 change: 0 additions & 1 deletion dvr_scan/app/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def get_cli_parser():
"--debug",
action="store_true",
help=argparse.SUPPRESS,
default=False,
)

parser.add_argument(
Expand Down
120 changes: 86 additions & 34 deletions dvr_scan/app/about_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,27 @@
f"DVR-Scan {dvr_scan.__version__}\n\n"
"Copyright \N{COPYRIGHT SIGN} Brandon Castellano.\nAll rights reserved."
)
WEBSITE_URL = "https://www.dvr-scan.com/"
ISSUES_URL = "https://github.com/Breakthrough/DVR-Scan/issues"


def _allow_tab_traversal(text_widget: tk.Text):
"""Let Tab / Shift+Tab move focus out of a read-only Text widget instead of trapping focus."""

def focus_next(event):
target = event.widget.tk_focusNext()
if target is not None:
target.focus_set()
return "break"

def focus_prev(event):
target = event.widget.tk_focusPrev()
if target is not None:
target.focus_set()
return "break"

text_widget.bind("<Tab>", focus_next)
text_widget.bind("<Shift-Tab>", focus_prev)


def show_about(root: tk.Misc):
Expand All @@ -42,81 +63,112 @@ def show_about(root: tk.Misc):
# Tk keeps no reference of its own, so this local must outlive the window (it does: the
# function blocks in `wait_window` below).
about_image_tk = PIL.ImageTk.PhotoImage(about_image)
canvas = tk.Canvas(window, width=about_image.width, height=about_image.height)
canvas.grid()
bg = ttk.Style().lookup("TFrame", "background") or "SystemButtonFace"
canvas = tk.Canvas(
window,
width=about_image.width,
height=about_image.height,
background=bg,
highlightthickness=0,
)
canvas.grid(row=0, column=0, padx=8, pady=(8, 0))
canvas.create_image(0, 0, anchor=tk.NW, image=about_image_tk)

ttk.Separator(window, orient=tk.HORIZONTAL).grid(row=1, sticky="ew", padx=16.0)
ttk.Label(window, text=COPYRIGHT).grid(row=2, sticky="nw", padx=24.0, pady=24.0)

# TODO: These should be buttons not labels.
website_link = ttk.Label(
window, text="www.dvr-scan.com", cursor="hand2", foreground="medium blue"
ttk.Separator(window, orient=tk.HORIZONTAL).grid(row=1, column=0, sticky="ew", padx=16.0)
ttk.Label(window, text=COPYRIGHT).grid(
row=2, column=0, sticky="nw", padx=24.0, pady=(16.0, 8.0)
)
website_link.grid(row=2, sticky="ne", padx=24.0, pady=24.0)
website_link.bind("<Button-1>", lambda _: webbrowser.open_new_tab("www.dvr-scan.com"))

links_frame = ttk.Frame(window)
links_frame.grid(row=3, column=0, sticky="new", padx=24.0, pady=(0.0, 16.0))
ttk.Button(
links_frame,
text="Website",
command=lambda: webbrowser.open_new_tab(WEBSITE_URL),
).grid(row=0, column=0, padx=(0, 8))
ttk.Button(
links_frame,
text="Report Issue",
command=lambda: webbrowser.open_new_tab(ISSUES_URL),
).grid(row=0, column=1)

version_info = get_system_version_info()
about_tabs = ttk.Notebook(window)
version_tab = ttk.Frame(about_tabs)
version_tab = ttk.Frame(about_tabs, padding=8)
version_area = tkinter.scrolledtext.ScrolledText(version_tab, wrap=tk.NONE, width=40, height=1)
# TODO: See if we can add another button that will copy debug logs.
version_area.insert(tk.INSERT, version_info)
version_area.grid(sticky="nsew")
version_area.grid(row=0, column=0, sticky="nsew")
version_area.config(state="disabled")
_allow_tab_traversal(version_area)
version_tab.columnconfigure(0, weight=1)
version_tab.rowconfigure(0, weight=1)
tk.Button(

copy_reset_id = None

def copy_version_info():
nonlocal copy_reset_id
root.clipboard_clear()
root.clipboard_append(version_info)
root.update_idletasks()
copy_button.configure(text="Copied!")
copy_reset_id = window.after(1500, lambda: copy_button.configure(text="Copy to Clipboard"))

copy_button = ttk.Button(
version_tab,
text="Copy to Clipboard",
command=lambda: root.clipboard_append(version_info),
).grid(row=1, column=0)
command=copy_version_info,
)
copy_button.grid(row=1, column=0, sticky="e", pady=(8, 0))

license_tab = ttk.Frame(about_tabs)
scrollbar = tk.Scrollbar(license_tab, orient=tk.HORIZONTAL)
license_tab = ttk.Frame(about_tabs, padding=8)
scrollbar = ttk.Scrollbar(license_tab, orient=tk.HORIZONTAL)
license_area = tkinter.scrolledtext.ScrolledText(
license_tab, wrap=tk.NONE, width=40, xscrollcommand=scrollbar.set, height=1
)
license_area.insert(tk.INSERT, dvr_scan.get_license_info())
license_area.grid(sticky="nsew")
license_area.grid(row=0, column=0, sticky="nsew")
scrollbar.config(command=license_area.xview)
scrollbar.grid(row=1, sticky="swe")
scrollbar.grid(row=1, column=0, sticky="swe")
license_area.config(state="disabled")
_allow_tab_traversal(license_area)
license_tab.columnconfigure(0, weight=1)
license_tab.rowconfigure(0, weight=1)

# TODO: Add tab that has some useful links like submitting bug report, etc
about_tabs.add(version_tab, text="Version Info")
about_tabs.add(license_tab, text="License Info")
about_tabs.grid(row=0, column=1, rowspan=4, padx=(0.0, 16.0), pady=(16.0, 16.0), sticky="nsew")
window.update()
window.columnconfigure(0, minsize=about_image.width)
window.rowconfigure(0, minsize=about_image.height)
# minsize includes padding
window.columnconfigure(1, weight=1, minsize=100)
window.rowconfigure(3, weight=1)
window.minsize(width=window.winfo_reqwidth(), height=window.winfo_reqheight())
about_tabs.grid(row=0, column=1, rowspan=4, padx=(8.0, 16.0), pady=(16.0, 8.0), sticky="nsew")

# The region editor holds a grab on its root while launched from the Advanced Mode window;
# hand the grab to this dialog and give it back on close. (Tkinter maps Tk's "none"
# grab status to None.)
restore_grab = root.grab_status() is not None
root.grab_release()
window.transient(root)
window.focus()
window.grab_set()

def dismiss():
if copy_reset_id is not None:
window.after_cancel(copy_reset_id)
window.grab_release()
window.destroy()
if restore_grab:
root.grab_set()
root.focus()

close_button = ttk.Button(window, text="Close", command=dismiss)
close_button.grid(row=4, column=0, columnspan=2, sticky="e", padx=16.0, pady=(0.0, 16.0))

window.update_idletasks()
window.columnconfigure(0, minsize=about_image.width)
window.rowconfigure(0, minsize=about_image.height)
# minsize includes padding
window.columnconfigure(1, weight=1, minsize=100)
window.rowconfigure(3, weight=1)
window.minsize(width=window.winfo_reqwidth(), height=window.winfo_reqheight())

window.protocol("WM_DELETE_WINDOW", dismiss)
window.attributes("-topmost", True)
window.bind("<Escape>", lambda _: window.destroy())
window.bind("<Destroy>", lambda _: dismiss())
window.bind("<Escape>", lambda _: dismiss())

window.deiconify()
close_button.focus_set()
window.grab_set()
window.wait_window()
Loading
Loading