Skip to content

Microsoft Access data recovery support. - #32

Open
pplupo wants to merge 10 commits into
Euro-Office:mainfrom
pplupo:db-support
Open

Microsoft Access data recovery support.#32
pplupo wants to merge 10 commits into
Euro-Office:mainfrom
pplupo:db-support

Conversation

@pplupo

@pplupo pplupo commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Description

This PR complements the core database support by exposing the new formats to the desktop user interface.

Changes

  • Updated the system file picker filters to natively recognize and allow the selection of .mdb, .sqlite, .db, .duckdb, and .parquet files.
  • Added UI warning dialogs to gracefully handle edge cases (e.g., when a user opens a database containing an exceptionally large number of tables, ensuring they are aware that parsing might take time).
  • Integrates seamlessly with the new x2t converter capabilities added in Euro-Office_core.

pplupo added 2 commits July 7, 2026 17:49
Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
pplupo added 8 commits July 8, 2026 00:08
mdbtools is now built as a separate shared library (core side) instead
of being statically compiled into BinDocument; add it to the install
target list so it ships alongside the app. Also add DuckDB's MIT notice
and mdbtools' full LGPLv2 text to the bundled third-party license file
-- previously missing since both were vendored ad hoc rather than
through the normal packaging process.

Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
Two related bugs in the database-format support:

- Database-origin documents (sqlite/duckdb/mdb/parquet/etc) were opened
  fully editable even though the engines are read-only and can't write
  back to these formats. Force view/read-only mode (the existing
  mode=view mechanism) whenever a recognized database extension is
  opened, alongside the existing warning message. Extracted the
  extension check into a shared isDatabaseFile() helper instead of
  duplicating it.

- CFileDialogWrapper::setFormats() built its Save As filter string by
  blindly looking up each supported-format id in m_mapFilters, which
  has no entry for the new database format ids. QMap::value() returns
  an empty string for a missing key, so an id with no entry produced a
  filter with both an empty name and empty pattern -- rejected outright
  by the XDG desktop portal ('invalid filter: name is empty'), crashing
  the Save As flow (e.g. via Ctrl+S) with an error dialog. Skip ids with
  no filter entry instead of appending an empty one.

Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
modalSaveAs left _sel_filter empty whenever the document's current
extension didn't match any of the offered Save As filters -- exactly
the case for a database-origin document, since database formats are
deliberately excluded as save targets. That empty _sel_filter got
passed straight to the native/XDG portal file dialog as the 'currently
selected filter', which rejects a filter with an empty name the same
way an empty entry in the filter list does. Default it to the first
available filter instead of leaving it blank.

Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
…rag-drop

Two paths bypassed the database-file handling added in 89fbf4f:
- Drag-and-drop: dragEnterEvent's extension whitelist didn't include
  any database extensions, so the drop was rejected outright (leading
  to a degraded fallback open with no warning and no read-only mode).
- Recent files: onLocalFileRecent goes straight to
  CAscTabWidget::openLocalDocument, which for etRecentFile calls
  CTabPanel::openRecentFile -> CCefViewEditor::OpenRecentFile,
  entirely bypassing CTabPanel::openLocalFile (where the original fix
  lives). Add the same warning here, where the recent file's path is
  already available via opts.url.

Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
Recent Files actually opens through the "open:recent" EXECUTE_COMMAND
handler in cascapplicationmanagerwrapper_private.h, not through
CMainWindow::onLocalFileRecent -- that dispatch was deliberately
decoupled from ASC_MENU_EVENT_TYPE_CEF_LOCALFILE_RECENTOPEN back in
2020 (f89f856), so the warning added there never fired. Move the
check to the real entry point (read-only was already applied
correctly via CCefViewEditor::OpenRecentFile's own check, so only the
warning was missing here).

Also consolidates the isDatabaseFile check (previously duplicated in
ctabpanel.cpp and cmainwindow.cpp) into Utils::isDatabaseFile, and
adds Utils::warnIfDatabaseFile with a "don't ask again" checkbox that
persists via QSettings, mirroring the existing
ignoreMsgAboutOpenTabs/CMainWindow::close pattern. Clarifies the
warning text: files must be saved as a spreadsheet, not just "Save
As" (which doesn't otherwise say what format).

Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
Only database files exhibited this (confirmed against xlsx/csv/docx/
odt/txt/md/pdf via drag-drop, all fine); those are the only ones that
pop a synchronous modal warning (Utils::warnIfDatabaseFile) from
inside dropEvent()'s call chain. Showing a modal surface while
Wayland's drag-and-drop grab for the drop is still active corrupts
the resulting tab's surface state -- resizing the window makes it
vanish entirely, and only a detach/reattach recreates it cleanly.

Defer the whole open to a queued call so it runs after dropEvent()
returns and the compositor releases the DnD grab.

Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
…n open

Confirmed (by disabling the warning via "don't ask again" and
retesting) that the modal warning dialog itself was the trigger for
dropped database files rendering at a tiny size and never recovering:
popping a modal surface while Wayland's drag-and-drop grab for the
drop was still active corrupted the new tab's rendering. An earlier
attempt to just defer the doOpenLocalFile() call by one event-loop
tick wasn't enough delay to avoid this.

Move the warning to CAscTabWidget::applyPageLoadingStatus's
DOCUMENT_CHANGED_LOADING_FINISH handler, which fires uniformly once a
tab actually finishes loading regardless of how it was opened (File >
Open, Recent Files, drag-and-drop). This sidesteps the timing issue
entirely rather than guessing at how long a delay is enough, and also
means every open path is now consistent -- previously each path had
its own duplicated warning call.

Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
mdbtools was installed to the app root alongside DesktopEditors, but
DesktopEditors itself never links it -- only x2t does (via
BinDocument). x2t's INSTALL_RPATH only searches $ORIGIN and
$ORIGIN/system (i.e. converter/ and converter/system/), so it could
never find the library at the root, causing every document open to
fail with a libmdbtools.so load error.

Signed-off-by: Peter P. Lupo <pplupo@gmail.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.

1 participant