Skip to content

Structured files wlx (JSON, XML, CBOR, INI, TOML, YML) - #41

Open
pplupo wants to merge 227 commits into
doublecmd:masterfrom
pplupo:structview
Open

Structured files wlx (JSON, XML, CBOR, INI, TOML, YML)#41
pplupo wants to merge 227 commits into
doublecmd:masterfrom
pplupo:structview

Conversation

@pplupo

@pplupo pplupo commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

This viewer superseeds the JSON viewer I had previously implemented. It has support for multiple formats using a standardized interface. More information in the README.md file.

pplupo and others added 30 commits May 12, 2026 10:08
This commit introduces the mpv_wayland WLX (Lister) plugin for Double
Commander. It enables native video playback in the Quick View panel
using the libmpv Render API and QOpenGLWidget. It is specifically
designed for seamless integration on Wayland and HiDPI displays.

Committed files:
- Source code (src/) implementing Qt6/mpv integration
- SDK headers (sdk/) for plugin interface
- CMakeLists.txt for build configuration
- README.md with installation instructions and embedded screenshot
- mpv_wayland.png screenshot asset
- Integration into root build.sh for automated release packaging
This commit introduces the MDK WLX plugin, a high-performance media
viewer powered by the MDK SDK and pure Qt6. It allows instant preview
of video and audio files. A key feature is its out-of-process isolation
via dlopen, ensuring that MDK's dependencies do not conflict with
Double Commander.

Committed files:
- C++ source (plugin.cpp) and Pascal wrappers (mdk.pas, etc.)
- Lazarus project files (.lpi, .lpr)
- Makefile for building the C++ shared object
- SDK headers (sdk/)
- README.md and proposal.md documentation
- Integration into root build.sh for automated release packaging
This commit introduces a specialized log viewer WLX plugin built with
Qt6 and C++20. It is designed to handle massive log files without
freezing Double Commander, utilizing zero-copy file loading (mmap),
fast regex searching (RE2), and a robust focus-isolation architecture
for Wayland.

Committed files:
- Source code (src/) for the log model and viewer widget
- CMakeLists.txt for build configuration
- README.md and detailed design doc (double commander wlx log viewer.md)
- logviewer.png screenshot asset
- Integration into root build.sh for automated release packaging
This commit introduces the kpart WLX plugin. It acts as a host for
KDE KParts, effectively allowing Double Commander to leverage any
installed KDE viewer (like Okular for PDFs or LibreOffice for docs)
directly within the Quick View panel natively on Wayland/Qt6.

Committed files:
- Source code (src/) for KPart hosting logic
- SDK headers (sdk/)
- CMakeLists.txt for build configuration
- README.md with screenshots
- test.svg and screenshot assets (kpart_md.png, kpart_svg.png)
- Integration into root build.sh for automated release packaging
…ete row editing, TSV support, and context menu

- Display CSV/TSV files in an interactive QTableWidget grid
- Auto-detect separator (comma, semicolon, tab); fall back to file extension
- Header Row toggle button: interprets first line as header or data row,
  reloads file on toggle; controls whether copies include the header line
- Ctrl+C: copy selection as TSV (includes header when Header Row is on)
- Right-click context menu: Copy as TSV, Copy as CSV, Delete Selected Rows,
  Insert from Clipboard
- Ctrl+V: insert clipboard rows at selected position; validates column count;
  skips clipboard header line when it matches the current header (Header Row on)
- Delete: remove selected rows
- Ctrl+S: save file; correctly handles editing vs non-editing state without
  disturbing Double Commander focus
- Inline cell editing with Save / Save As / Reload toolbar actions
- Enca encoding auto-detection with Glib conversion fallback
- Double-quoted field parsing per CSV RFC
- F7 search support
- Full README with screenshots, feature docs, and configuration reference
- Attribution to original author j2969719
…nd highlighting

- Export ListSetDefaultParams to retrieve and bind the host's INI file path.
- Add HighlightRule structure and fast RE2-based line matching directly on memory-mapped offsets.
- Create Highlighting Rules SettingsDialog modal with an inline-colored rules list.
- Enable ExtendedSelection on the rules list to support deleting or moving multiple rules up/down, maintaining selection state using QItemSelectionModel.
- Connect double-click on any rule row to open the editing window.
- Write Foreground/Background labels above color picker buttons in RuleDialog.
- Implement session persistence under [HighlightRules] in the INI file.
- Prevent default rules from overriding empty rule configurations on restart.
- Add context-aware "Add Default Rules" button to prepend default log levels relative to the current selection.
- Create sample.log matching each level for diagnostics.
This commit introduces a premium editor WLX plugin based on Native Qt6
and KDE's KTextEditor framework. It brings full syntax highlighting,
code folding, and advanced editing capabilities to Double Commander's
viewer panel without LCL compatibility crashes on Wayland.

Committed files:
- Source code (src/) wrapping KTextEditor
- CMakeLists.txt for build configuration
- README.md with screenshots
- defects.md tracking known issues and resolutions
- Screenshot assets (kate_java.png, kate_md.png, kate_py.png)
- Integration into root build.sh for automated release packaging
…yles, preserve selection, and fix Proper/Title Case logic
…nd highlighting

- Export ListSetDefaultParams to retrieve and bind the host's INI file path.
- Add HighlightRule structure and fast RE2-based line matching directly on memory-mapped offsets.
- Create Highlighting Rules SettingsDialog modal with an inline-colored rules list.
- Enable ExtendedSelection on the rules list to support deleting or moving multiple rules up/down, maintaining selection state using QItemSelectionModel.
- Connect double-click on any rule row to open the editing window.
- Write Foreground/Background labels above color picker buttons in RuleDialog.
- Implement session persistence under [HighlightRules] in the INI file.
- Prevent default rules from overriding empty rule configurations on restart.
- Add context-aware "Add Default Rules" button to prepend default log levels relative to the current selection.
- Create sample.log matching each level for diagnostics.
Manually merged unique changes from all editor-related branches:

- editor-features: focus management (NoFocus on menuBar, focus restoration,
  focus-stealing prevention), Save/Save As/Save Copy As actions with toolbar
  button, Print action with toolbar button, font zoom controls (Ctrl++/Ctrl+-/
  Ctrl+0) with native KTE action fallback, Force RTL Direction toggle, Ctrl+Shift+S
  Save As shortcut precedence fix, QTimer-based focus restoration

- kate-case-conversion: Capitalization submenu replacing flat menu items,
  improved Title Case with minor-word handling, fixed Proper Case (toLower
  instead of preserve), renamed snail_case to snake_case, added PascalCase,
  SCREAMING_SNAKE_CASE, kebab-case, Sentence case, SCREAMING-KEBAB-CASE,
  dot.case, path/case, replaceSelectionPreservingRange helper to restore
  selection after text replacement

- fix-redo-and-write-lock: Ctrl+Shift+Z redo shortcut (in addition to Ctrl+Y),
  extracted toggleReadOnly() helper, Alt+Shift+R shortcut for read-only toggle,
  fixed double-trigger bug by switching QAction::toggled to QAction::triggered,
  added shortcut labels to read-only menu action
…agation

- Remove non-standard `lc_focus` definition from `sdk/wlxplugin.h` and its handler in `wlx_plugin.cpp`.

- Remove custom `hostSetFocus` method from `EditorWidget`.

- Set the editor view as the focus proxy for the main widget.

- Use native Qt event filtering and focus change listeners to handle active state transitions.
This makes the plugin standalone by compiling and linking libenca statically, removing the need for users to manually install libenca.so.0.
Adds ability to insert empty rows or clipboard rows above/below current selection or clicked row.
pplupo and others added 30 commits July 13, 2026 09:20
Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
Focus/input:
- Add lc_focus (5) to the shared wlxplugin.h SDK header, previously missing
  entirely on this branch, so ListSendCommand could handle DC's focus
  hand-off signal at all.
- Port QtWlPlugin::FocusManager (from wayland_qt_base) into officeview for
  both the x2t/PdfViewerWidget and LibreOfficeKit/LOKContainerWidget paths,
  replacing ad-hoc focus handling that left keyboard shortcuts and panel
  switching unreliable.
- Fix a click-activation bug where the ancestry check used the wrong
  QObject in the propagation chain (QWidgetWindow isn't a QWidget), causing
  some documents to require two clicks before Ctrl+C worked.
- Add a grace-period guard (setActiveFromHost) so DC's own lc_focus(0)
  can't immediately undo a legitimate click-based activation.
- Retry LOK's getTextSelection after SelectAll instead of a single fixed
  wait, fixing intermittent empty-clipboard copies.
- Scope LOK copy/context-menu actions to the specific sheet/slide clicked
  or currently visible, instead of whatever part LOK's internal cursor
  last happened to be on.

Rendering:
- Give ODF documents their own LibreOfficeKit-side zoom, copy, and context
  menu instead of silently borrowing x2t's, since ODF stays on LibreOffice
  deliberately (better fidelity than x2t for this format family).
- Fix spreadsheet sheet-tab extraction to exclude hidden sheets, which
  otherwise mismatched x2t's actual visible-sheet PDF output and silently
  hid the tab bar.
- Add per-sheet pagination for xlsx/xlsm: convert each sheet separately
  (patching its own temp copy's activeTab so x2t paginates it fully,
  instead of squeezing every sheet onto a single page via printPages:all)
  and merge with qpdf, tracking real per-sheet start pages instead of
  assuming one page per sheet.
- Switch the PDF view to always use MultiPage mode; SinglePage mode hid a
  sheet's later pages behind the tab bar with no obvious way to reach them.
- Apply 2x supersampled LOK tile rendering to reduce font aliasing.

Config:
- Add a per-extension file size limit (officeview.conf), skipping
  conversion entirely for files over the limit; 0 disables an extension.
- Restructure officeview.conf into [Paths]/[Engines]/[FileSizeLimits]
  sections (previously a flat list that only grew entries lazily, so it
  never had all supported extensions) with paths first and a comment
  explaining the size-limit semantics.

Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
QPdfView's page-layout/coordinate-mapping internals are private API with
no public hook to map a click to a page + point-within-page, which meant
copy was limited to whole-page/whole-selection text with no way to
highlight or select an arbitrary run of text. MuPDF's structured-text API
(fz_highlight_selection / fz_copy_selection) exposes that directly.

- Add MuPdfWidget/MuPdfContainerWidget, mirroring LOKWidget/
  LOKContainerWidget's structure (continuous page stacking, only visible
  pages rendered, same FocusManager/zoom/wheel-event wiring) so all three
  rendering paths share one interface for ListSendCommand.
- Remove PdfViewerWidget and the Qt6::Pdf/PdfWidgets dependency entirely;
  replace the one QPdfDocument use (page counting for the per-sheet merge
  pipeline) with a small MuPDF-based helper.
- Fix tab-bar desync: sheetStartPages holds page *indices*, but three
  places compared it directly against the scrollbar's pixel position, so
  a few pixels of scroll could exceed a page-index number like 14 or 15
  and snap the active tab to the last sheet. Convert through
  pageYOffset()/pageAtY() so both sides of every comparison share units.
- Fix font aliasing on fractional-scaling displays: page rendering had no
  devicePixelRatio handling, so Qt stretched the under-resolution image up
  to fill the widget's real physical pixels. Render at
  zoom*devicePixelRatioF() and mark the QImage's devicePixelRatio so Qt
  draws it 1:1 instead of scaling it.

Links dynamically against the system libmupdf for now; static linking is
a separate follow-up.

Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
Also update the compiled binary to match the current MuPDF-based build.

Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
rclone's Google Drive VFS mount leaves native Google Docs/Sheets/Slides
as 0-byte stub files on disk, since it can't materialize their content
transparently on read like a regular file. When ListLoad hits a 0-byte
file for a supported extension, it now checks /proc/mounts for a
covering fuse.rclone mount, and if found runs `rclone copyto` to export
the real content before handing it to the usual OOXML/ODF rendering
path. If the file isn't under an rclone mount, it fails gracefully
with a short message instead of trying to render nothing.

Google Drive exports get their own independently configurable engine
preference (EngineForGDrive), and any of the four Engines keys can now
be set to Disabled to skip that format family entirely.

The file-size-limit disable sentinel changes from 0 to -1, since 0 is
now a legitimate size for an unmaterialized rclone stub rather than
something to reject outright.

README updated to document all of the above.

Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
Extracts a Qt-free structview_core out of what was previously a Qt-only
DocumentNode/TextFormatEngine (QString/QVariant/QVector-typed throughout)
plus 6 format engines:

- DocumentNode/TextFormatEngine: rewritten onto std::string (every engine
  already stringified scalars before storing them, so cells are plain
  strings, not a generic variant) and raw-pointer-owns-children semantics
  matching the original's QList<DocumentNode*> + qDeleteAll ownership.
- JsonEngine + CborEngine: replaced QJsonDocument/QCborValue with
  nlohmann::json, which has native CBOR encode/decode (to_cbor/from_cbor),
  so CborEngine keeps the original's design of bridging to JSON and
  delegating tree-building to JsonEngine.
- XmlEngine: replaced QDomDocument with tinyxml2.
- IniEngine: replaced QSettings with a hand-rolled order-preserving INI
  parser (General section for keys before any [section], matching the
  original's QSettings-based behavior).
- YamlEngine/TomlEngine: mechanical port (both already used non-Qt
  yaml-cpp/toml++ under the hood, just QString/QVariant call sites).

Adds a GTK3 UI (src/gtk3/plugin_gtk3.cpp): GtkTreeStore document tree +
GtkNotebook (Grid/Text tabs) via wlxbase_gtk's GtkFocusManager and
GtkEditableGridWidget (recreated per tree-node selection, since its
column count is fixed at construction and different nodes have different
shapes), Ctrl+S save, and ListSearchText scanning the currently-visible
grid the same way the Qt side scanned its QTableView.

Also pulls wlxbase_gtk onto this branch (same dependency as officeview).

Verified: a standalone round-trip test (parse -> serialize -> re-parse)
against real JSON/XML/YAML/TOML/INI files and a real externally-generated
CBOR file (via nlohmann::json::to_cbor, independent of our own encoder)
all pass with correct tree structure. A real dlopen+ListLoad ABI test
against all 6 file types opens, searches, copies, and closes cleanly with
no crash. nm -D confirms all 5 WLX entry points exported; ldd confirms
zero Qt linkage.

Qt6 build unchanged (still works standalone; only the GTK3 side needed
the new core).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants