Skip to content

Fix #123: add drag-and-drop support to file name fields, plus related small fixes#2552

Open
dcwhite wants to merge 8 commits into
masterfrom
drag-file-widget
Open

Fix #123: add drag-and-drop support to file name fields, plus related small fixes#2552
dcwhite wants to merge 8 commits into
masterfrom
drag-file-widget

Conversation

@dcwhite

@dcwhite dcwhite commented Jul 4, 2026

Copy link
Copy Markdown
Member

Summary

Test plan

  • Drag a file onto a DataIO file name field and confirm path is populated
  • Drag a file onto a Matlab dialog file name field
  • Confirm module filter inline clear button works
  • Confirm log button color is stable across state changes
  • Confirm note color persists after font-size change and network reload

🤖 Generated with Claude Code

dcwhite and others added 8 commits July 3, 2026 23:11
… Matlab dialogs

Adds FileNameLineEdit, a QLineEdit subclass that accepts file URL drops
and emits editingFinished, then promotes all 14 fileNameLineEdit_ widgets
in the DataIO and Matlab module UI files to use it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduce LogColorPriority and an atomic currentLogPriority_ to ensure log button color only escalates to higher-priority states. setLogButtonColor now computes an incoming priority and uses compare_exchange_weak to update the atomic only if the incoming priority is strictly greater (prevents a remark from overriding an existing error color; fixes #103). Reset currentLogPriority_ to None in resetLogButtonColor and when starting executeWithSignals. Initialize member in the header.
Qt's uic tool cannot qualify custom widget names — it always generates
unqualified construction (new FileNameLineEdit(parent)). The <namespace>
element in .ui custom widget blocks is a Qt Designer runtime (QUiLoader)
feature only; uic rejects it even in Qt 6.10. Custom widgets used in
.ui files must live in the global namespace.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…odule filter

Qt's QLineEdit::setClearButtonEnabled(true) provides a dynamic × button
that appears inside the widget only when text is present — exactly the
Firefox-style behaviour requested. The separate clearFilterButton_ widget
and its .ui connection are removed; no C++ changes needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces shared_ptr<spire::VarBuffer>(new spire::VarBuffer(...)) with
make_shared<spire::VarBuffer>(...) in all six call sites, combining
the object and control-block allocations into one. The full unique_ptr
migration described in #560 requires a larger refactor; see issue comment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Root cause: every formatting operation called setPlainText(toPlainText()),
which discards all HTML (including color spans) and re-sets the document
with only the current single character format. Replace every occurrence
with QTextCursor::select(Document) + mergeCharFormat so font-size and
color changes are applied to all text without destroying each other.

Also sync currentColor_/previousColor_ from loaded HTML in setNoteHtml
so that Reset Color and Cancel operate on the actual loaded color rather
than always reverting to Qt::white.  Add colorBackup_ so Cancel fully
restores color tracking state alongside HTML and font-size index.
Fix changeTextAlignment to use mergeBlockFormat on all blocks instead
of the same broken setPlainText pattern (resolves the "one line at a
time" TODO as a side effect).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Effective Modern C++ Item 42: convert push_back(T(args)) to
emplace_back(args) and map.insert(make_pair(k,v)) to map.emplace(k,v)
where the element is always constructed in-place from forwarded arguments.

Targets: SpireVBO::AttributeData and SpireSubPass::Uniform vectors in
the visualization/rendering pipeline (GlyphConstructor, ShowField,
ShowColorMapModule, ShowString, TextBuilder), Variable push_back in
ElectrodeCoilSetupDialog, and std::map/std::set insert(make_pair)
calls in SRInterface, ReorderNormalCoherentlyAlgo, and
BuildPointCloudToLatVolMappingMatrix.

Note: reverted boost::bimap left-view — it predates std::map's emplace
and does not expose that API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dcwhite dcwhite requested review from basisunus and jessdtate July 4, 2026 05:33
@dcwhite dcwhite self-assigned this Jul 4, 2026
@dcwhite dcwhite added this to the 5.0.0 milestone Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant