play a file from the shared file tab - #278
Conversation
|
Thanks @tbo47 — this addresses most of the #272 points: the preview logic is now a single shared A few things before it can go in: 1. Gate Play/Open to the monolithic app — on both tabs. The new Shared-tab item ( 2. Guard the downcast. 3. Replace the 4. Label it "Open" on the Shared tab and route by file type — aMule already has the helper. The Shared list is arbitrary files, not just media, so a completed file should say "Open". Right now the configured video player is forced on every type, so "Play" on a non-media file (a 5. The po diff. The large catalog churn is because your branch predates recent string additions on master — the |
got3nks's review of amule-org#650 asked for this to reach amulegui and amuleapi, not just the monolithic app, ahead of the push to keep every feature available across all three clients. Adds two optional EC_TAG_CONNSTATE sub-tags, hand-synced into ECCodes.abstract/.h per the project's existing convention (never regenerate the committed header -- it reflows the whole license block): - EC_TAG_ED2K_CONNECTED_SINCE / EC_TAG_KAD_CONNECTED_SINCE (uint32 unix timestamps), populated in CEC_ConnState_Tag's constructor from CamuleApp's existing m_ed2kConnectedSince/m_kadConnectedSince, present only while actually connected. Consumption side: - CamuleRemoteGuiApp (amulegui) gets matching m_ed2kConnectedSince/ m_kadConnectedSince members and GetED2KConnectedSince()/ GetKadConnectedSince() accessors -- same names as CamuleApp's, so ServerWnd.cpp's "Connected since" rows no longer need a #ifndef CLIENT_GUI gate; each build's theApp resolves to whichever class actually has the data. - amuleapi's Refresher.cpp reads the same sub-tags directly into StatusSnapshot.{ed2k,kad}_connected_since, surfaced in GET /status as ed2k.connected_since / kad.connected_since (0 while disconnected). Documented in docs/api/REFERENCE.md. po/ catalogs regenerated as the final step (scripts/update-po.sh) so the diff is just the "Connected since:" string in sync with the tree, per got3nks's note on amule-org#278 about avoiding line-number-shift churn. Verified by building and running all three targets (amule, amulegui, amuleapi) plus the full unit test suite (26/26 passing, including RefresherTest which exercises the new StatusSnapshot fields directly).
…ts (#831) Supersedes #278 by tbo47, whose Shared-tab "play" item this grew out of; its review points (guard the CPartFile downcast, drop the reinterpret_cast, label it Open and route by file type) are carried over. Adds Open and "Show in file manager" to the Downloads and Shared Files lists. Availability is now whether the resolved path exists on this host, tested when the menu is built, rather than which binary is running -- the old check was build variant plus loopback locality, which refused every shared-filesystem setup and allowed a local file that had since been deleted. One filesystem check answers both entries. Media goes to the configured video player, including the in-progress preview; everything else goes to the platform opener regardless of that setting, so opening an archive no longer launches the video player. An unfinished download is NNNN.part on disk and no desktop handles that extension, so with no player configured that case says so instead of failing twice. Revealing is suppressed for unfinished downloads. The player template is split into arguments once -- UNIX rules on Unix, DOS on Windows -- and the placeholders substituted inside the resulting arguments in a single pass, so the path crosses as one argv entry. Building a command string instead would let a remote-supplied eD2k filename inject arguments into the player, and escaping quotes (what the old code did) is bypassable. macOS reveals via NSWorkspace, Windows via explorer /select,, Linux opens the containing folder. Launches keep the AppImage-safe environment from #334 and are guarded against an escaping exception, which would otherwise terminate aMule with no signal, no backtrace and no crash report. Both lists pin the context menu to the item rather than the row, so a list mutated while the menu is open cannot redirect the click to a neighbour. Also fixes a Downloads label that fell through to an empty string, and an enable test that used the media-only PreviewAvailable() -- so a finished .zip or .pdf could not be opened at all.
Summary
Play a file from the shared file tab.
I tried to use the feedback from
#272