Skip to content

fix(amulegui): hide preferences not propagated to amuled via EC - #122

Merged
got3nks merged 2 commits into
amule-org:masterfrom
got3nks:fix/amulegui-hide-dead-prefs
Jun 12, 2026
Merged

fix(amulegui): hide preferences not propagated to amuled via EC#122
got3nks merged 2 commits into
amule-org:masterfrom
got3nks:fix/amulegui-hide-dead-prefs

Conversation

@got3nks

@got3nks got3nks commented Jun 12, 2026

Copy link
Copy Markdown

Summary

Addresses item #3 of #54 — the broader "which preferences should be editable in amulegui" question. Eighteen widgets in PrefsUnifiedDlg are NewCfgItem-registered and therefore persisted to amulegui's local remote.conf on Save, but never packed into CEC_Prefs_Packet, so they're not sent to amuled via EC_OP_SET_PREFERENCES. The control shows amulegui's stale local default rather than amuled's actual value, and editing has no observable effect on the daemon. Same gap on both loopback and remote connections — amuled never reads remote.conf — so the widget is dead in both cases. Hide unconditionally in CLIENT_GUI builds.

Audit — the three categories

Crossed every NewCfgItem registration in Preferences.cpp:1050-1324 against every preference packed in CEC_Prefs_Packet::SetValues. The classification:

A — GUI-only (lives in remote.conf, doesn't touch amuled)

Safe to keep editable on both localhost and remote. Affects only amulegui's own behaviour.

IDC_LANGUAGE, IDC_BROWSERTABS, IDC_BROWSERSELF, IDC_VIDEOPLAYER, IDC_MACHIDEONCLOSE, IDC_ENABLETRAYICON, IDC_MINTRAY, IDC_NOTIF, IDC_EXIT, IDC_STARTMIN, IDC_3DDEPTH, IDC_TOOLTIPDELAY, IDC_SHOWOVERHEAD, IDC_EXTCATINFO, IDC_FED2KLH, IDC_PROGBAR, IDC_PERCENT, IDC_SKIN, IDC_VERTTOOLBAR, IDC_SHOWVERSIONONTITLE, IDC_SHOW_COUNTRY_FLAGS, IDC_GEOIP_MAXMIND_LIC, IDC_GEOIP_CUSTOM_URL, IDC_GEOIP_AUTOUPDATE, IDC_SLIDER, IDC_SLIDER2, IDC_SLIDER3, IDC_SLIDER4, IDC_CLIENTVERSIONS, IDC_MSGLOG, IDC_AUTOSORT, IDC_FILTERCOMMENTS, IDC_COMMENTWORD, IDC_PREVENT_SLEEP (already disabled in CLIENT_GUI at line 367-369), ID_VERBOSEDEBUG, ID_VERBOSEDEBUGLOGFILE, and the proxy block ID_PROXY_* — proxy is GUI-side because amulegui's own HTTP client (in ApplyProxyToDefaultSession) consumes those settings for the GeoIP DB fetch.

B — EC-sync'd (round-trips via GET_PREFERENCES / SET_PREFERENCES)

Value shown comes from amuled. Editable on both connection types; the audit task here is just confirming each one actually round-trips, which is left for a separate pass.

Connection: IDC_PORT, IDC_UDPPORT, IDC_UDPENABLE, IDC_MAXSOURCEPERFILE, IDC_MAXCON, IDC_AUTOCONNECT, IDC_RECONN, IDC_NETWORKED2K, IDC_NETWORKKAD, IDC_MAXUP, IDC_MAXDOWN, IDC_DOWNLOAD_CAP, IDC_UPLOAD_CAP, IDC_SLOTALLOC.

Servers: IDC_REMOVEDEAD, IDC_SERVERRETRIES, IDC_AUTOSERVER, IDC_UPDATESERVERCONNECT, IDC_UPDATESERVERCLIENT, IDC_SCORE, IDC_SAFESERVERCONNECT, IDC_AUTOCONNECTSTATICONLY, IDC_SMARTIDCHECK, IDC_MANUALSERVERHIGHPRIO. Plus Ed2kServersUrl / KadNodesUrl (text fields in ServerWnd, not NewCfgItem).

Files: IDC_ICH, IDC_AICHTRUST, IDC_CHECKDISKSPACE, IDC_MINDISKSPACE, IDC_ADDNEWFILESPAUSED, IDC_PREVIEWPRIO, IDC_STARTNEXTFILE, IDC_STARTNEXTFILE_SAME, IDC_SRCSEEDS, IDC_DAP, IDC_UAP, IDC_ALLOCFULLFILE.

Directories: IDC_INCFILES, IDC_TEMPFILES, IDC_SHAREHIDDENFILES, IDC_AUTO_RESCAN_SHARED, IDC_FOLLOW_SYMLINKS_SHARED (promoted to EC in this PR — new tag EC_TAG_DIRECTORIES_FOLLOW_SYMLINKS = 0x1A06). (Shared-folders tree carries through EC_TAG_DIRECTORIES_SHARED.)

Security: IDC_SEESHARES, IDC_IPFCLIENTS, IDC_IPFSERVERS, IDC_AUTOIPFILTER, IDC_IPFILTERURL, ID_IPFILTERLEVEL, IDC_FILTERLAN, IDC_SECIDENT, IDC_SUPPORT_PO, IDC_ENABLE_PO_OUTGOING, IDC_ENFORCE_PO_INCOMING.

Webserver: IDC_ENABLE_WEB, IDC_WEB_PASSWD, IDC_WEB_PASSWD_LOW, IDC_WEB_PORT, IDC_WEB_GZIP, IDC_ENABLE_WEB_LOW, IDC_WEB_REFRESH_TIMEOUT, IDC_WEBTEMPLATE.

Message filter: IDC_MSGFILTER, IDC_MSGFILTER_ALL, IDC_MSGFILTER_NONFRIENDS, IDC_MSGFILTER_NONSECURE, IDC_MSGFILTER_WORD, IDC_MSGWORD.

Online signature enable: IDC_ONLINESIG.

Core tweaks: IDC_MAXCON5SEC, IDC_FILEBUFFERSIZE, IDC_QUEUESIZE, IDC_SERVERKEEPALIVE.

General: IDC_NICK, IDC_NEWVERSION.

C — NewCfgItem-bound but not in CEC_Prefs_Packet — the dead widgets this PR hides

ID Key Why it's dead in amulegui
IDC_ADDRESS /eMule/Address amuled's TCP bind address
IDC_UPNP_ENABLED /eMule/UPnPEnabled amuled's UPnP toggle
IDC_UPNPTCPPORT + IDC_UPNPTCPPORTTEXT /eMule/UPnPTCPPort amuled's UPnP TCP port
IDC_UPNP_WEBSERVER_ENABLED (own key) amuled's web-server UPnP
IDC_WEBUPNPTCPPORT + IDC_WEBUPNPTCPPORTTEXT /WebServer/WebUPnPTCPPort amuled's web-server UPnP port
IDC_UPNP_EC_ENABLED /ExternalConnect/UPnPECEnabled amuled's EC UPnP
IDC_OSDIR /eMule/OSDirectory amuled writes the online-sig file here
IDC_OSUPDATE /eMule/OnlineSignatureUpdate amuled's online-sig update interval
IDC_EXT_CONN_ACCEPT /ExternalConnect/AcceptExternalConnections amuled's EC config — chicken-and-egg via EC
IDC_EXT_CONN_IP /ExternalConnect/ECAddress same
IDC_EXT_CONN_TCP_PORT /ExternalConnect/ECPort same
IDC_EXT_CONN_PASSWD /ExternalConnect/ECPassword same
IDC_PARANOID /eMule/ParanoidFiltering amuled-side IP filter behaviour
IDC_IPFILTERSYS /eMule/IPFilterSystem amuled uses system IP filter
IDC_STARTNEXTFILE_ALPHA /eMule/StartNextFileAlpha amuled's download orchestration

The empty EC_PREFS_STATISTICS branch at ECSpecialMuleTags.cpp:286-288 is a related TODO that's been there since at least 2009 — out of scope for this PR.

What this PR changes

A single #ifdef CLIENT_GUI block in PrefsUnifiedDlg::TransferToWindow iterates the Category-C ID list and calls Hide() on each. No IsConnectedToLocalHost() check needed because the gap is identical on loopback and remote (+38/-0 LOC).

Test plan

  • Built clean on macOS Release (cmake --build build-macos --target amulegui).
  • Connection tab: Address field hidden, UPnP block hidden (Enabled + TCP port + label).
  • Remote Controls tab: Web-server UPnP block hidden (Enabled + port + label), External Connect block hidden (Accept / IP / TCP port / password / UPnP-EC toggle).
  • Files tab: Follow symlinks in shared folders checkbox is still present (this PR promotes it from hidden-only to EC-sync'd via the new EC_TAG_DIRECTORIES_FOLLOW_SYMLINKS tag) and toggling it round-trips against amuled.
  • Files tab: the indented sub-checkbox "In alphabetic order" (under "Start next paused file when a file completes") hidden.
  • Online Signature tab: OS directory and OS update interval hidden.
  • Security tab: Paranoid filter and IPFilterSystem checkboxes hidden.
  • Layout doesn't collapse weirdly anywhere (a small visual gap is acceptable — widgets are Hide()d, not removed from the sizer).
  • Above tests pass with amulegui connected to a remote amuled (non-loopback).
  • Above tests pass with amulegui connected to a localhost amuled (loopback).
  • CI green on Ubuntu / macOS / mingw-w64.

Cross-platform manual verification is what's waiting on @ngosang via the fork's packaging run.

Fifteen widgets in PrefsUnifiedDlg are NewCfgItem-bound and therefore
persisted to amulegui's local remote.conf on save, but never packed
into CEC_Prefs_Packet, so the values are never sent to amuled via
EC_OP_SET_PREFERENCES. The control shows amulegui's stale local
default rather than amuled's actual value, and editing it has no
observable effect on the daemon. Same gap on both loopback and
remote connections -- amuled never reads remote.conf, so the widget
is dead in both cases.

Hide unconditionally in CLIENT_GUI builds:

- IDC_ADDRESS                  (amuled's TCP bind address)
- IDC_UPNP_ENABLED             (amuled's UPnP)
- IDC_UPNPTCPPORT              + IDC_UPNPTCPPORTTEXT label
- IDC_UPNP_WEBSERVER_ENABLED   (amuled's webserver UPnP)
- IDC_WEBUPNPTCPPORT           + IDC_WEBUPNPTCPPORTTEXT label
- IDC_UPNP_EC_ENABLED          (amuled's EC UPnP)
- IDC_OSDIR                    (amuled's online-signature file dir)
- IDC_OSUPDATE                 (amuled's online-signature interval)
- IDC_EXT_CONN_ACCEPT          (amuled's EC config -- chicken-and-egg
- IDC_EXT_CONN_IP               if amulegui could change it via EC)
- IDC_EXT_CONN_TCP_PORT
- IDC_EXT_CONN_PASSWD
- IDC_PARANOID                 (amuled IP filter behaviour)
- IDC_IPFILTERSYS              (amuled system IP filter)
- IDC_STARTNEXTFILE_ALPHA      (amuled's download orchestration)

IDC_FOLLOW_SYMLINKS_SHARED is promoted to EC-sync instead of hidden:
add EC_TAG_DIRECTORIES_FOLLOW_SYMLINKS (0x1A06) alongside the existing
EC_TAG_DIRECTORIES_SHARE_HIDDEN / EC_TAG_DIRECTORIES_AUTO_RESCAN, with
matching pack and ApplyBoolean entries. The setting is consulted at
directory-walk time in SharedFileList / SharedDirWatcher / SharedDirs
ApplyTask, so the next rescan picks it up without needing an explicit
immediate-apply hook on the daemon side. Mirrored across the abstract
and Java bindings. The debug-name switch was missing 0x1A05 (auto-
rescan) entirely; added that drive-by so EC trace logs render both
new and adjacent tags by name.

Proxy settings (ID_PROXY_*) are intentionally not hidden: amulegui's
ApplyProxyToDefaultSession() consumes thePrefs::GetProxyData() to
configure wxWebSession for its own GeoIP database fetch, so the
widgets are meaningful in CLIENT_GUI builds even though amuled has
its own separate copy in amule.conf.

Refs amule-project#54.
@got3nks
got3nks force-pushed the fix/amulegui-hide-dead-prefs branch from 3ee2382 to 3dc971a Compare June 12, 2026 10:20
The previous commit hid the amuled-only input widgets but left their
companion wxStaticText labels and the wrapping wxStaticBox visible,
because the wxFormBuilder-generated layout in muuli_wdr.cpp creates
those orphans with `-1` as the wxWindowID. FindWindow() can't reach
them, so the section ended up looking like:

    External Connection Parameters
       IP of the listening interface:
       TCP port:
       Password

with the input fields gone but the labels and group title still
showing.

Give the orphans IDs (10355..10361, taken from the free range between
IDC_FOLLOW_SYMLINKS_SHARED=10343 and IDC_GEOIP_SOURCE=10400, with
10344..10354 already used by the ID_BUTTON* toolbar slot) and plumb
them into the existing constructors:

- IDC_ADDRESSTEXT             "Bind local address to IP..."
- IDC_EXT_CONN_PARAMS_BOX     "External Connection Parameters"
- IDC_EXT_CONN_IPTEXT         "IP of the listening interface:"
- IDC_EXT_CONN_TCPPORTTEXT    "TCP port:" (EC block; not the connection-tab TCP port)
- IDC_EXT_CONN_PASSWDTEXT     "Password"
- IDC_OSDIRTEXT               "Save online signature file in:"
- IDC_OSUPDATETEXT            "Update Frequency (Secs):"

Extend amuledOnlyPrefs[] with these seven plus the existing
IDC_SELOSDIR (online-signature dir Browse button), which is already
named but was missing from the hide list.

Refs amule-project#54.
@got3nks
got3nks marked this pull request as ready for review June 12, 2026 16:01
@got3nks
got3nks merged commit ff1e50f into amule-org:master Jun 12, 2026
9 checks passed
@got3nks
got3nks deleted the fix/amulegui-hide-dead-prefs branch June 12, 2026 16:02
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