dialogs: migrate to wxSizerFlags, retire wxDesigner, eliminate GCC 15 enum-enum conversion warnings - #473
Merged
mrjimenez merged 4 commits intoApr 24, 2026
Conversation
The .wdr source was maintained in a proprietary wxDesigner binary format from Roebling Systems, which is effectively abandonware — no modern contributor has a working copy and the .cpp/.h are already being edited by hand despite the "Do not modify" header. Make that official: - Delete src/muuli.wdr (no longer round-trippable). - Replace the "generated by wxDesigner / Do not modify" headers in both src/muuli_wdr.cpp and src/muuli_wdr.h with the standard aMule GPL copyright block plus a short historical note explaining the origin. No code change, no functional change — pure ownership-transfer commit.
612 sites. Mechanical transform:
sizer->Add(item, proportion, wxALIGN_CENTER|wxALL, 5);
becomes
sizer->Add(item, wxSizerFlags(proportion).Center().Border(wxALL, 5));
Flag-to-method mapping:
- wxGROW / wxEXPAND -> .Expand()
- wxSHAPED -> .Shaped()
- wxFIXED_MINSIZE -> .FixedMinSize()
- wxRESERVE_SPACE_EVEN_IF_HIDDEN -> .ReserveSpaceEvenIfHidden()
- wxALIGN_CENTER -> .Center()
- wxALIGN_CENTER_HORIZONTAL -> .CenterHorizontal()
- wxALIGN_CENTER_VERTICAL -> .CenterVertical()
- wxALIGN_RIGHT -> .Right()
- wxALIGN_BOTTOM -> .Bottom()
- wxALIGN_LEFT, wxALIGN_TOP -> default (no method)
- direction flags + border px -> .Border(dir, px)
This eliminates the C++20 -Wdeprecated-enum-enum-conversion that fires on
the legacy OR between wxStretch, wxAlignment, and wxDirection enum types;
wxSizerFlags' method chaining doesn't OR enums. Proportion 0 collapses to
the default wxSizerFlags() constructor. Same-enum direction ORs inside
.Border() (e.g. wxLEFT|wxRIGHT) stay — they're not deprecated.
Same mechanical transform as the muuli_wdr.cpp commit applied to the 7 hand-written dialog files that use the legacy wxALIGN_*/wxALL/wxGROW-OR idiom as the 3rd arg to sizer->Add: - src/PrefsUnifiedDlg.cpp - src/amuleDlg.cpp - src/CaptchaDialog.cpp - src/EditServerListDlg.cpp - src/utils/wxCas/src/wxcasprefs.cpp - src/utils/wxCas/src/wxcasframe.cpp - src/utils/aLinkCreator/src/alcframe.cpp Total 97 sites. Remaining wx-OR-wx expressions in these files are widget-style flags (wxOK|wxCANCEL, wxTE_MULTILINE|wxTE_READONLY, wxLB_SINGLE|wxLB_NEEDED_SB, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER, etc.) that are plain int macros — not wx enum types, not deprecated.
Four residual -Wdeprecated-enum-enum-conversion hits that the wxSizerFlags sweep didn't cover because they use different call shapes: - PrefsUnifiedDlg.cpp:1251,1268 — wxSizer::Add(w, h, prop, flags, border) spacer-overload (5-arg form). Migrated to the equivalent Add(w, h, wxSizerFlags().Center()) shape; the old border=0 drop-through is preserved by defaulting wxSizerFlags with no .Border() call. - amuleDlg.cpp:1346 — CreateToolBar() style mask OR'd wxToolBarStyleFlags with wxBorder enum (wxNO_BORDER). Cast wxNO_BORDER to int so the compound expression has a single enum type on each operator. - muuli_wdr.cpp:2839 — wxRadioBox ctor style mask OR'd wxBorder (wxNO_BORDER) with wxRA_SPECIFY_ROWS. Same int() cast treatment. After this commit, -Wdeprecated-enum-enum-conversion is at 0 on GCC 15 for the entire aMule tree.
got3nks
added a commit
to got3nks/amule
that referenced
this pull request
Jul 13, 2026
…mule-project#466) (amule-project#473) The Shared Files view could only show static counters (transferred, requests, accepts, complete sources) — unlike Downloads, there was no way to tell an actively-seeded file from an idle one. Surface per-file upload activity over EC so clients (the REST API now, the desktop GUI later) can add the corresponding columns. Core (CKnownFile): * GetUploadDatarate() / GetTransferringClientCount() — live, summed from m_ClientUploadList: current upload speed and peers uploading now. * m_lastUploadDatetime — stamped in CFileStatistic::AddTransferred (the single point where sent bytes are attributed to a file), the upload-side analogue of the download's m_lastDateChanged. * m_dateShared — stamped once when a file completes (CompleteFileEnded) or is first hashed into the share (CKnownFileList::Append, afterHashing). Both persist in known.met as new FT_ tags (FT_LASTUPLOADED / FT_SHAREDSINCE); absent on a pre-feature known.met => 0 (unknown). Uploading never rewrites the shared file, so the timestamp can't ride the .met date the way downloads do — it needs its own tag. The unknown-tag preserve-and-rewrite path keeps this forward/backward compatible. EC / dirty-marking: * New tags EC_TAG_KNOWNFILE_UPLOAD_SPEED / _UPLOADING_COUNT / _LAST_UPLOAD (live, emitted before the UPDATE early-return) and _SHARED_SINCE (full detail). * SetUploadState marks the file EC-dirty on US_UPLOADING transitions so a file that stops uploading but stays queued drops its speed to 0 — completed/shared files have no per-tick Process() sweep like downloads. REST + SSE (amuleapi): * /shared list + detail gain upload_speed_bps, uploading, last_upload, shared_since; the SSE shared_added/shared_updated payload and EqualShared comparator carry them so live changes emit events. Tests: RefresherTest decodes the new tags; curl 04 asserts the fields. Docs: docs/api/REFERENCE.md.
mrjimenez
pushed a commit
to mrjimenez/amule
that referenced
this pull request
Aug 1, 2026
…ct#675) (amule-project#744) This is a deliberate UI change, not a behaviour-preserving refactor -- worth being explicit about per review discussion on amule-project#675. None of the 74 sites touched here have ever rendered their border: the legacy `Add(window, proportion, flag, border)` form only applies `border` when `flag` carries a direction bit (wxALL/wxLEFT/wxRIGHT/wxTOP/ wxBOTTOM), and all 74 omitted it. Converting to wxSizerFlags() and supplying a real direction bit means these borders render for the first time, which will reflow the affected dialogs to some degree. Per amule-project#663 (the case that originally surfaced this pattern): the recorded border values were never validated by anything, since they never rendered. Each site was judged against its structural siblings rather than ported verbatim -- where siblings already carried a working border, matched to it; where a site was the outlier in an otherwise-consistent row/grid, adjusted to match rather than introducing a new, never-tested value. A few sites lost their border entirely where every sibling in the same row already had none (the stray value read as leftover noise, not an intended margin). Three additional non-legacy-syntax inconsistencies folded into the same pass (found while scoping amule-project#675, confirmed still present): - PreferencesRemoteControlsTab: "Low rights password" carried Border(wxLEFT|wxRIGHT, 20) while every other same-column label in the grid ("Web template", "Full rights password") uses Border(wxRIGHT, 5) -- the 20px left indent looked like it was copy-pasted from the unrelated UPnP-port row's indent, not a deliberate choice for this row. - PreferencesOnlineSigTab: the "Save online signature file in" path field had no Expand()/proportion despite sitting in a column its parent FlexGridSizer marks growable -- it couldn't actually grow to fill the space reserved for it. - PreferencesGeneralTab: the "Browser Selection" row (text field + Browse button) still used the legacy 3-arg Add() form while the structurally identical "Video Player" row already used wxSizerFlags() -- modernized for consistency, no behaviour change (both used border 0). Scope: src/muuli_wdr.cpp only, matching where amule-project#663/amule-project#473 originally established (and didn't fully carry through) the wxSizerFlags() convention. Testing: full build verified (macOS). Visually walked every dialog these 20 functions produce that's reachable without live server/ download/client data in a fresh test config: main status bar, search, transfer panes, shared-files header, servers/Kad tabs, Friends/Messages panels, and all 15 Preferences tabs -- no clipped or overlapping controls, and the two directly-testable fixes (the OnlineSig path field now expanding, the RemoteControls password grid column now aligned) confirmed visually. NOT independently verified: fileDetails, clientDetails, commentLstDlg, and CategoriesEditWindow all require live downloads/shared files/ clients/categories to reach via the UI, which a from-scratch test config doesn't have -- these got the same siblings-based border review as everything else, but I have not seen them rendered. Sizer-border rendering is exactly where wxGTK/wxMSW/wxOSX diverge, so this needs eyes on Linux and Windows too, per the amule-project#675 review discussion.
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.
Summary
Four atomic commits that clear the last deprecation warning class emitted by
-Wdeprecated-declarations -Wdeprecated-copy -Wdeprecatedin hand-written aMule code: GCC 15's-Wdeprecated-enum-enum-conversion(a C++20 deprecation of bitwise OR between distinct enumeration types, e.g.wxALIGN_CENTER|wxALL). Approach: migrate legacysizer->Add(item, prop, flags, border)calls to the modernsizer->Add(item, wxSizerFlags(prop).chain())idiom. The wxSizerFlags builder method-chains alignment / border / stretch options instead of OR-ing distinct wx enum types, sidesteps the warning entirely, and is wx's documented recommendation since 2.9.While we're at it, retire the long-abandoned wxDesigner pipeline:
src/muuli.wdr(a proprietary Roebling Systems binary format) hasn't been round-trippable for years —src/muuli_wdr.cpphas been maintained by hand despite the "Do not modify" comment. Delete the .wdr, replace the generated-file banner with the standard aMule GPL header.Net:
-Wdeprecated-enum-enum-conversionon GCC 15 drops from 706 hits to 0 on Ubuntu ARM64. Mac / Ubuntu x86_64 / Windows are unaffected (their compilers don't emit this warning class).Commits in review order
dialogs: retire wxDesigner, take ownership of muuli_wdr.{cpp,h}src/muuli.wdr(no longer round-trippable), replace "generated by wxDesigner / Do not modify" headers insrc/muuli_wdr.{cpp,h}with the standard aMule GPL block plus a short historical note. Pure ownership-transfer commit, no code change.dialogs: migrate muuli_wdr sizer->Add to wxSizerFlagssrc/muuli_wdr.cpp. Mechanical transform:sizer->Add(item, proportion, wxALIGN_CENTER|wxALL, 5)→sizer->Add(item, wxSizerFlags(proportion).Center().Border(wxALL, 5)). Flag mapping:wxGROW/wxEXPAND→.Expand();wxSHAPED→.Shaped();wxFIXED_MINSIZE→.FixedMinSize();wxRESERVE_SPACE_EVEN_IF_HIDDEN→.ReserveSpaceEvenIfHidden();wxALIGN_CENTER→.Center();wxALIGN_CENTER_HORIZONTAL→.CenterHorizontal();wxALIGN_CENTER_VERTICAL→.CenterVertical();wxALIGN_RIGHT→.Right();wxALIGN_BOTTOM→.Bottom(); direction flags + border →.Border(dir, px). Same-enum direction ORs inside.Border()(e.g.wxLEFT|wxRIGHT) stay — not deprecated. Net -612 lines because wxSizerFlags chains are more compact than the 4-arg form.dialogs: migrate hand-written sizer->Add to wxSizerFlagssrc/PrefsUnifiedDlg.cpp,src/amuleDlg.cpp,src/CaptchaDialog.cpp,src/EditServerListDlg.cpp,src/utils/wxCas/src/wxcasprefs.cpp,src/utils/wxCas/src/wxcasframe.cpp,src/utils/aLinkCreator/src/alcframe.cpp). Same transform as commit 2. Remaining OR sites in these files are widget-style flags (wxOK|wxCANCEL,wxTE_MULTILINE|wxTE_READONLY,wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER, …) — plain int macros, not wx enum types, not deprecated.dialogs: silence the last 4 enum-enum conversion siteswxSizer::Add(w, h, prop, flags, border)5-arg spacer calls inPrefsUnifiedDlg.cpp(migrated toAdd(w, h, wxSizerFlags().Center())), oneCreateToolBar()style mask inamuleDlg.cppthat OR'dwxToolBarStyleFlagswithwxBorder(fixed by castingwxNO_BORDERtoint), and onewxRadioBoxctor style mask inmuuli_wdr.cppwith the samewxBorder-vs-wxRA_SPECIFY_ROWSmix (sameint()cast). After this commit the warning is at 0 for the entire tree.Warning audit
Audit flags:
-Wdeprecated-declarations -Wdeprecated-copy -Wdeprecated. Fresh clean build. "Before" is upstreammasterat the branch base; "After" is this PR's tip.Risk
No runtime behaviour change. wxSizerFlags is wx's documented sizer-flags builder (introduced in wx 2.9, recommended since wx 3.0); the method chain produces the same sizer flag bits the OR-form assembled by hand. Verified for each translated pattern:
wxEXPAND/wxGROW→.Expand()— both setwxEXPAND.wxALIGN_CENTER→.Center()— both setwxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL.wxALIGN_X/wxALIGN_Y/.Right()/.Bottom()/.CenterHorizontal()/.CenterVertical()— one-to-one.wxFIXED_MINSIZE→.FixedMinSize()— one-to-one.wxALL/wxLEFT/… + border size →.Border(dir, px)— one-to-one; same-enum direction ORs inside.Border()are not deprecated.0collapses to default-constructedwxSizerFlags(); non-zero keeps the explicitwxSizerFlags(n)form.The four manual fixes in commit 4 are type casts only — they change the narrow type of one operand from a
wxBorderenum value toint, which is what the wxSizer / toolbar / radiobox constructors already accept via implicit conversion. No semantic change.Verified
-Wdeprecated-enum-enum-conversion, UI spot-check on main window tabs + dialogs — no layout regressions.ubuntu-latestGCC + wx 3.2,macos-latestApple clang + wx 3.3.2,windows-latestMINGW64 + wx 3.2): pending.Not in this PR
wxOK|wxCANCEL,wxTE_MULTILINE|wxTE_READONLY,wxLC_REPORT|wxSUNKEN_BORDERare plain int macros (not wx enum types) and don't fire-Wdeprecated-enum-enum-conversion. Left untouched.