Metadata-Version: 2.4
Name: blackPanther-pydialog
Version: 1.2.1
Summary: PySide6 dialogs for shell scripts, with kdialog-style options
Author: Charles Barcza, Miklos Horvath
License-Expression: GPL-3.0-or-later
Project-URL: Repository, https://github.com/blackPantherOS/pydialog
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Desktop Environment
Classifier: Environment :: X11 Applications :: Qt
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PySide6<7,>=6.8
Provides-Extra: packages
Requires-Dist: ptyprocess>=0.7; extra == "packages"
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Dynamic: license-file

# PyDialog

PySide6 / Qt 6 dialogs for shell scripts, with kdialog-style options and blackPanther OS extensions. Python 3.10 or newer is required.

## Install and run

```sh
python -m venv .venv
. .venv/bin/activate
python -m pip install .
pydialog --help
pydialog --title "My script" --msgbox "The operation has finished."
```

For pkcon installation/removal dialogs, install the optional PTY dependency with `python -m pip install '.[packages]'`. Package operations additionally require PackageKit/pkcon and the desktop authentication agent. Passive popups retain the `bubblemsg` dependency.

When developing with distribution-provided PySide6, the source launcher also works directly:

```sh
./bin/pydialog --calendar "Choose a date" --default 2026-10-20
./bin/pydialog --theme dark --longtitle "Connection failed" --detailederror "Please try again." "The server could not be reached."
./bin/pydialog --inputbox "Your name" "Initial value"
./bin/pydialog --checklist "Components" base "Base system" on docs "Documentation" off --separate-output
./bin/pydialog --compat kdialog --yesnocancel "Save the changes?"
```

## Features

- PySide6 widgets with system fonts, distinct content and action areas, larger buttons and auto/light/dark themes.
- Full-width radio/check rows with clear selection, wrapping labels and keyboard-following scrolling; configuration dialogs show their own headings without a redundant information banner.
- Image headers and captions are centered, including HTML separated with `<br>`. HTML `width` and `height` are honored together; images shrink proportionally from the requested size in narrow windows. Tabs span the content width and show a distinct active indicator in light and dark themes.
- Content and footer use compact 16-pixel side margins. The settings button has a visible outline, background and a contrasting 24-pixel icon in a 40-pixel button.
- List dialogs start at a compact width of 500 logical pixels, with a short scrollable viewport. Enlarging the window gives more space to the list; explicit geometry remains available.
- Reversible details panel, resizable content and corrected list/file/color handling.
- Calendar with ISO date output, including `--default YYYY-MM-DD`.
- Date/time and time-only selectors with separate hour/minute/second fields and Today/Now shortcuts. Defaults and results are validated, machine-readable values.
- Explicit legacy/kdialog result modes; the default retains PyDialog-specific codes.
- Independent D-Bus progress service with verified startup and typed properties.
- Package workers with interactive prompts, cancellation and real success/failure status.
- XDG settings with atomic writes, preserved INI entries and remembered radio-list tags.
- Bundled Hungarian translations, a console entry point and wheel/sdist packaging.

See [the compatibility notes](docs/COMPATIBILITY.md) before migrating scripts. Full kdialog feature parity is not claimed. JSON results, stdin progress, list search and timeouts are planned for a later round.

![Actual PySide6 dialog, Hungarian, light theme](docs/screenshots/question-light.png)

![Actual PySide6 details dialog, Hungarian, dark theme](docs/screenshots/details-dark.png)

![PyDialog choice rows, dark theme](docs/screenshots/list-dark.png)

These are actual Qt captures using Fusion and the explicit light/dark palettes. Auto mode takes its colors and fonts from the desktop; the dialog shell and choice rows retain their consistent layout. Window decorations remain desktop-managed. See [the visual refresh notes](docs/VISUAL-REFRESH.hu.md) for the shared components and validation.

## Date and time parameters

```sh
pydialog --calendar "Choose a date" --default 2026-10-21
pydialog --datetime "Start at" --default 2026-10-21T18:30:00
pydialog --timebox "Countdown duration" --default 00:05:00
```

On acceptance these return `2026-10-21`, `2026-10-21T18:30:00` and `00:05:00`, respectively, followed by a newline. A script can capture the value with `value=$(pydialog ...)` and check the exit status. Time fields are independent, use a 24-hour clock and do not advance while editing. Today/Now updates the selection without closing the dialog. The accepted appearance and existing calendar output remain intact.

[Hungarian examples, including countdown parameters](docs/TIME-INPUT.hu.md)

## Progress example

```sh
reference=$(pydialog --progressbar "Preparing" 100) || exit "$?"
qdbus $reference Set org.kde.kdialog.ProgressDialog value 50
qdbus $reference setLabelText "Halfway done"
qdbus $reference Set org.kde.kdialog.ProgressDialog autoClose true
qdbus $reference Set org.kde.kdialog.ProgressDialog value 100
```

The D-Bus utility may be named `qdbus6` or `qdbus-qt6` by your distribution.

## Development and verification

```sh
python -m pip install '.[packages,test]' build
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 QT_QPA_PLATFORM=offscreen python -m pytest -q
QT_QPA_PLATFORM=offscreen dbus-run-session -- python tests/dbus_probe.py
python tools/regenerate_ui.py
python tools/compile_translations.py
LANGUAGE=hu QT_QPA_PLATFORM=offscreen python tools/preview_dialogs.py
python -m build
```

Keep behavior in the application modules; do not edit the generated `window1.py`. The UI regeneration tool uses `pyside6-uic`, with a distribution Qt6 compiler fallback. `msgfmt` is required only to regenerate the bundled translation catalogue. The wheel and source distribution include the compiled catalogue.

The former Python 3.7/PyQt5 Pipenv lock is preserved in `docs/archive/Pipfile.qt5.lock` for reference. It does not resolve the PySide6 dependencies; regenerate a local lock if using Pipenv.

[Original audit and design](docs/MODERNIZATION.hu.md) · [Implementation plan](docs/superpowers/plans/2026-10-20-pyside6-first-round.md)

Authors: Charles Barcza and Miklos Horvath. GPL-3.0-or-later; see [LICENSE](LICENSE).
