Introducing a new way to review your PRs.

Read the announcement

transmission-remote-gui / transgui

🧲 A feature rich cross platform Transmission BitTorrent client. Faster and has more functionality than the built-in web GUI.

View on GitHub

19 documents · Updated Sep 25, 2026

docs / main-window-workflows

Main window workflows

The main window is the desktop control surface for Transmission Remote GUI. It presents the torrent state from a connected Transmission daemon and turns user selections into remote actions. It also keeps the list, detail views, connection state, and desktop presentation in step.

Main window purpose

main.pas defines TMainForm, the primary application form. The form owns the user-facing torrent list and coordinates the actions that operate on the selected torrent or on the daemon as a whole. The form resource in main.lfm defines the visible layout and connects menus, tool buttons, grids, timers, and tray behavior to that coordination.

The main window is useful only when its connection state is clear. A connected window enables torrent commands and shows remote data. A disconnected window clears remote views and leaves connection and preference commands available so the user can recover.

Main window views

Torrent list view

The torrent list is the main work area. It supports multiple selection and shows the state that users need to choose their next action, such as progress, status, peer counts, transfer rates, and queue position. The list can be sorted and its columns can be changed without changing the remote torrent data.

The list is paired with a filter pane and a search box. The filter pane selects broad status groups such as downloading, completed, active, stopped, error, and waiting. The search box narrows the torrent view by keywords. Both choices cause the list to refresh so that the visible rows represent the current view rather than a second local copy of torrent state.

References: main.pas• L3223-3245 main.pas• L4503-4516 main.pas• L4874-4886 main.lfm• L47-247

Detail views

The detail area follows the current torrent selected in the list. It provides separate views for general transfer and torrent information, trackers, peers, files, and statistics. Selecting another torrent clears stale detail data first, then requests the detail data needed by the active page.

The Files view is also an action surface. It lets the user inspect the torrent tree and change file selection or priority. The Trackers and Peers views provide their own context actions, while the Statistics view presents current and cumulative values without changing the selected torrent.

References: main.pas• L4645-4681 main.pas• L5205-5213 main.pas• L5498-5546 main.pas• L6855-6870 main.lfm• L282-1074

Window presentation

The main window can show or hide the filter pane, detail pane, menu, toolbar, and status bar. Splitter positions and list presentation choices are kept as user preferences, so the next session can restore the same working view. The status bar also exposes connection state and transfer summaries, with speed controls available from its context surface when connected.

The tray icon provides a second window surface for users who keep the application in the background. Depending on preference and platform, minimizing or closing the window hides it while the tray remains available. A tray notification can report a completed download.

References: main.pas• L2083-2142 main.pas• L2998-3053 main.pas• L3124-3167 main.pas• L3987-4016 main.pas• L4484-4501 main.lfm• L249-281 main.lfm• L1088-1325

Command surfaces

Shared commands

The main window defines commands once and exposes them through the main menu, toolbar, torrent context menu, file context menu, status bar, and tray menu. This keeps a command such as start, stop, remove, or add consistent when the user reaches it through a button, a shortcut, or a right-click menu.

The command state follows the current context. Commands are disabled when the needed connection, selection, detail data, or daemon feature is not available. Some commands also depend on the Transmission RPC version, which prevents the window from offering a remote operation that the connected daemon cannot support.

References: main.pas• L212-281 main.pas• L5629-5688 main.lfm• L1401-2058 main.lfm• L2589-3090

Keyboard commands

Keyboard commands provide direct access to the same view and action model. Fixed shortcuts switch status filters, focus search, and select the General, Trackers, Peers, or Files detail page. Configurable action shortcuts are loaded from the saved interface settings.

Focus matters for commands that can apply to either the torrent list or the Files view. For example, priority and selection commands act on the focused list. The form delays some file focus changes until the selected torrent’s file data is ready, which avoids applying a file command to stale detail rows.

References: main.pas• L1889-1907 main.pas• L4503-4516 main.pas• L4534-4563 main.pas• L5690-5734 README.md• L121-135

Command flow

The command flow turns a user gesture into a remote change and then refreshes the views that depend on it.

flowchart LR
    Gesture[Menu toolbar shortcut or context action] --> Context[Current selection and focused view]
    Context --> Guard[Connection selection and feature checks]
    Guard --> Request[Remote torrent or session request]
    Request --> Result[Daemon result or error]
    Result --> Refresh[Refresh list details or session state]
    Refresh --> Views[Updated main window views]

Most torrent commands use the selected torrent IDs. Commands that apply to the whole daemon, such as start all or stop all, omit that selection. A failed request is reported through the connection and status surfaces instead of silently changing the local list.

References: main.pas• L3977-4026 main.pas• L7399-7490 main.pas• L8178-8237

Torrent list workflows

Torrent intake

The main window starts torrent intake from a local file, a URL, a magnet link, a dropped file, a watched local folder, or an eligible link copied to the clipboard. Intake first ensures that a daemon connection is available. It then opens the add workflow, where the user can choose the destination and file set before the new torrent is placed in the list.

The add workflow normally creates the torrent paused while the user confirms its options. It can then set wanted files, peer limits, and the torrent name before starting it when requested. A watched-folder or unattended path can accept the defaults. After a successful add, the window selects the new torrent and refreshes the list and detail views.

Clipboard intake is optional. When enabled, the window checks the clipboard when it becomes active and accepts a single HTTP, HTTPS, magnet, or torrent-hash link. It remembers the last handled link so that activation does not add the same link more than once.

References: main.pas• L1203-1234 main.pas• L2357-2362 main.pas• L2422-2425 main.pas• L2438-2443 main.pas• L2607-2610 main.pas• L2717-2828 main.pas• L2866-2983 main.pas• L4063-4070 main.pas• L4526-4532 main.pas• L4687-4701 main.pas• L5267-5310

The torrent list can copy magnet links for the selected torrents to the system clipboard. The window gets the links from the daemon and records the copied value as already handled, which keeps optional clipboard intake from immediately reprocessing its own output.

References: main.pas• L5156-5220

Torrent control

The selected rows are the unit of control for normal torrent actions. The user can start or stop selected torrents, force a start, reannounce trackers, verify data, change queue position, and set torrent priority. The same surfaces also provide start-all and stop-all commands when the operation should cover the daemon’s full torrent set.

These actions change remote state first. The list is then refreshed so status, progress, queue position, and related detail data reflect the daemon’s result. The command guard hides or disables operations that the connection or RPC version does not support.

References: main.pas• L2100-2103 main.pas• L3740-3763 main.pas• L3977-4026 main.pas• L7450-7490 main.pas• L7625-7633

Torrent inspection

Double-clicking a torrent is a shortcut to its most useful next view. A finished torrent opens its local file or folder when the client can resolve that remote path. Other cases open the torrent properties workflow. The explicit Open File and Open Containing Folder commands apply the same choice to the selected torrent or to the focused file row.

The properties workflow exposes per-torrent settings and detail editing. The main window remains responsible for choosing the torrent and refreshing the list after the dialog applies a change. Detailed property and tracker editing behavior belongs with the torrent workflow pages.

References: main.pas• L2236-2279 main.pas• L4097-4102 main.pas• L4102-4134 main.pas• L4683-4720 main.pas• L4852-4889 main.pas• L8538-8581

File selection and priority

The Files detail view presents the contents of the selected torrent as a tree. Users can choose which files the daemon should download, set file priority, rename a file or folder when supported, copy a remote path, and open a selected file. The command surface uses the focused row to distinguish file changes from torrent-wide priority changes.

The view is guarded while file details are pending or while another edit is active. This prevents a delayed response for one torrent from being used as the target for a command on another torrent.

References: main.pas• L2240-2278 main.pas• L3775-3860 main.pas• L4817-4843 main.pas• L6855-6870 main.pas• L7492-7623 main.pas• L7725-7815 main.lfm• L979-1029

Torrent relocation and removal

The list can move torrent data to a new location and can remove a torrent with or without its local data. Relocation asks for a destination and can request that the daemon move the data. Removal asks for confirmation and marks the affected rows so the list can converge with the daemon’s next refresh.

Remote paths require a usable local path mapping when the user must browse or open data on the client machine. If the mapping is missing, the window reports that it cannot safely find the local path rather than guessing.

References: main.pas• L2144-2228 main.pas• L2321-2405 main.pas• L3765-3773 main.pas• L5554-5575 main.pas• L5740-5801 main.pas• L6788-6835

Torrent labels and grouping

Labels and grouping change how the list is organized without changing the torrent’s transfer state. Users can assign labels to selected torrents and can group the list by folder, label, or tracker. The list refreshes or rebuilds its requested fields when a grouping choice changes, so the visible grouping remains tied to current remote data.

References: main.pas• L2093-2133 main.pas• L3223-3245 main.pas• L3862-3923 main.pas• L4536-4541 main.lfm• L2020-2028

Connection and refresh behavior

Refresh coordination

The main window does not treat a user gesture as proof that the view is current. A list refresh updates torrent rows and may also update the active detail data. A detail refresh follows a torrent selection or a detail-tab change. Timers serialize these refresh requests with the form’s idle work and show a wait indicator when a response takes long enough to affect the user.

This coordination is important for the user experience: the list can remain visible while remote work is pending, but actions that need a current selection or file tree are held back until the matching data arrives.

References: main.pas• L3375-3381 main.pas• L3544-3550 main.pas• L4660-4681 main.pas• L4829-4850 main.pas• L5075-5167 main.pas• L5170-5175 main.pas• L5412-5418 main.pas• L5821-5926

Connection recovery

Connection loss clears remote rows and detail data, disables remote commands, and preserves the connection status in the status bar and tray hint. When recovery is allowed, the window shows a reconnect panel with a retry countdown. A later timer attempt can reconnect and repopulate the list.

This boundary connects the main-window behavior to the broader startup and shutdown flow. See Application lifecycle for process-level ownership and Startup and component wiring for how the primary form and its supporting components become available.

References: main.pas• L5426-5477 main.pas• L5502-5616 main.pas• L5618-5669 main.pas• L7399-7448 main.pas• L7591-7639 main.pas• L8158-8237

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the action enabled-state rules aligned with every menu, toolbar, context menu, and shortcut entry that exposes the action.
  • Keep selection and detail refresh behavior aligned when changing gTorrents, PageInfo, or the Files view. A delayed detail response must not become the target of a later command.
  • Keep RPC-version guards aligned with the daemon fields and commands used by the corresponding action.
  • Keep saved view keys aligned with the controls that read them during form creation and write them during close.
  • Keep remote path mapping checks aligned with open, move, and browse workflows. A remote path cannot be treated as a local path without that contract.
  • Keep clipboard intake and magnet-link copy behavior aligned. Copied links must remain marked as handled, and clipboard parsing must continue to reject multi-line or unsupported text.

Important failure modes

TriggerConsequenceGuard
A torrent action runs without a connected daemonNo remote change occurs and the user sees an error or disconnected stateUpdateUI disables remote actions and TorrentAction reports failed requests
The selected torrent changes while detail data is pendingA file or detail command could target stale rowsSelection clears detail state and keeps file actions pending until the matching torrent data arrives
A daemon does not support an RPC featureA command could fail or send fields the daemon does not understandAction availability checks the connected RPC version
A remote download path has no usable local mappingOpen or browse actions cannot locate the client-side filePath-based workflows stop with the path-mapping message
The user removes a torrent and expects local data to remainRemoving with the wrong command can delete associated dataSeparate confirmation paths distinguish torrent removal from removal with data
Clipboard intake sees unsupported, multi-line, or already handled textThe window could add unintended content or repeatedly add the same torrentClipboard normalization accepts one supported link and tracks the last handled value

Key files

FileWhy to read it
main.pasDefines TMainForm, its view coordination, action rules, refresh behavior, clipboard handling, and torrent-list workflows.
main.lfmShows the primary form layout and the command surfaces connected to each view.
README.mdSummarizes the user-facing interface, fixed shortcuts, and command-line torrent intake.
rpc.pasExplains the remote state and command boundary used by the main window.
baseform.pasExplains shared behavior for the modal forms opened by main-window commands.
docs/application-lifecycle.mdProvides the parent view of startup, main-form ownership, and shutdown.
docs/startup-and-component-wiring.mdExplains how the application creates and wires the main form and its reusable components.