Officeview - #46
Open
pplupo wants to merge 225 commits into
Open
Conversation
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
…, and kate-case-conversion into kate base
…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.
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>
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 OfficeCore library from what was previously a Qt-only officeview.cpp/mupdfwidget.cpp: - PdfCore: MuPDF page rendering + fz_stext-based click-drag text selection - X2TConverter: x2t (Euro-Office/OnlyOffice) subprocess conversion backend, including the per-sheet-paginated xlsx conversion + qpdf merge path and the AllFonts.js/font_selection.bin packaging workaround - LokCore: LibreOfficeKit tile rendering + select-all/copy, via the existing header-only dlopen-based lok_init_2 - INI config load/save (officeview.conf) and rclone/Google-Drive stub detection+export, replacing QSettings/QProcess/QRegularExpression Adds a GTK3 UI (src/gtk3/plugin_gtk3.cpp): GtkDrawingArea+Cairo continuous page-scroll rendering for both the x2t/MuPDF and LibreOfficeKit paths, click-drag text selection, sheet-tab buttons for multi-sheet spreadsheets, Ctrl+wheel/Ctrl+-+/0 zoom and Ctrl+C copy via wlxbase_gtk's GtkFocusManager, and a right-click copy context menu. Also pulls wlxbase_gtk (GtkFocusManager et al.) onto this branch from the wlxbase_gtk branch, since officeview now depends on it. Fixed along the way: - macro-comma bug: std::pair<T,int> inside g_signal_connect() misparses; introduced a StateIntPair alias (same class of bug hit in wlxbase_gtk and logview earlier). - -fPIC: officeview_core (static lib) needs POSITION_INDEPENDENT_CODE since it's linked into a shared library. - -Bsymbolic: mupdf-third statically bundles lcms2; without -Bsymbolic its cms* symbols get exported from the .wlx and are interposed by the system liblcms2.so.2 that GTK/cairo/gdk-pixbuf already loaded, causing a segfault inside fz_new_context on the very first ICC colorspace setup. -Bsymbolic makes the library prefer its own internal symbols. Verified with a real dlopen+ListLoad ABI test against a real .docx and a real multi-sheet .xlsx (both go through LibreOffice/x2t on this machine) -- both open, render, and lc_focus/lc_copy return LISTPLUGIN_OK with no crash. nm -D confirms all 5 WLX entry points exported; ldd confirms zero Qt linkage. Qt6 build unchanged (still works standalone, not yet using OfficeCore -- left as-is since it already functions correctly; only the GTK3 side needed the new core). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A Double Commander WLX lister plugin that previews Microsoft Office and OpenDocument files (Word/Excel/PowerPoint and their legacy/macro-enabled variants, plus ODT/ODS/ODP) directly in Double Commander's Quick View panel and file lister, without opening a separate editor.
It depends on LibreOffice, Euro-Office, or OnlyOffice. It looks for them in the first execution and uses what it found. If it can't be found, the path can be provided in a config file. If multiple are found, it tries to open ODF with LibreOffice and OOXML+MS Legacy with Euro-Office or OnlyOffice (Euro-Office takes precedence). All that can be changed in the config file (users can have multiple, but use only one to visualize all formats).