Desktop interface and preferences
The desktop client gives users a consistent way to view remote torrent state, change actions, and shape the client around their work. Shared form rules support different displays, while preferences and interaction history keep the same choices available across sessions and connection profiles.
Interaction model
The client joins three layers of user interaction: reusable forms provide a stable desktop surface, list views present changing torrent data, and saved preferences restore the user's working context. The main window coordinates these layers with the remote torrent session without making display choices part of torrent state.
The following diagram shows how a user choice moves through the desktop client and becomes a saved or remote effect.
flowchart LR
A[User action] --> B[Form or list interaction]
B --> C{Choice type}
C -->|View choice| D[Update desktop presentation]
C -->|Preference| E[Save client settings]
C -->|Torrent action| F[Send remote command]
C -->|Recent input| G[Update interaction history]
E --> H[Restore at next start]
G --> H
Form foundation
The shared form base gives dialogs and the main window common size and scale behavior. It reads the system font and the user interface scale so controls, spacing, grid columns, and status panels remain usable across display sizes. Forms can also calculate a suitable height from their visible controls.
This common behavior matters because the same client runs on several desktop platforms. A dialog that changes its visible pages or controls still needs to keep its buttons and content inside the usable window area.
References: baseform.pas• L44-56 baseform.pas• L75-113 baseform.pas• L117-173 baseform.pas• L217-271
Main window state
The main window is the user's working surface for torrent lists and detail views. It restores its size, position, window state, pane visibility, splitters, menu, toolbar, and status bar choices so a later session starts with the same work layout.
The window keeps view state separate from daemon state. Hiding a pane or changing a splitter affects only the desktop view. Commands that change torrents remain enabled or disabled from connection state, selection, and current data readiness.
References: main.pas• L1717-1788 main.pas• L3000-3017 main.pas• L3124-3168 main.lfm• L1-83
List presentation
The client uses shared list controls for the main torrent view and the file, peer, tracker, and filter views. These controls let a user scan changing data, select rows, search, sort, edit supported values, and adjust the visible layout without changing the meaning of the data behind the view.
Detailed data mapping and table behavior are covered in Torrent lists and columns.
Shared list behavior
The list presentation layer separates row data from visible column order. It supports multi-row selection, keyboard navigation, quick search, hints for clipped text, sorting, check boxes, tree controls, and in-place editing where a view allows it.
This separation lets the main window act on stable torrent or file data even when a user moves or hides a column. The list also groups updates so a refresh can replace many values without showing a partial redraw to the user.
References: varlist.pas• L47-95 varlist.pas• L227-258 varlist.pas• L366-429 vargrid.pas• L71-95 vargrid.pas• L847-937
Column configuration
Column setup lets a user choose which fields to see and in which order. The same interaction serves the focused torrent, file, peer, or tracker list, so users can tune each view for its purpose.
The client keeps a usable view when a layout changes. At least one column must remain visible, a newly shown column receives a practical width, and hiding the active sort column uses a protected fallback when one is available. The layout is saved by list type and restored by stable column identity.
References: colsetup.pas• L45-66 colsetup.pas• L72-121 colsetup.pas• L126-188 main.pas• L3925-3955 main.pas• L5775-5819
Preference model
Preferences control how the client looks, refreshes, connects, and responds to user input. The settings file acts as the shared store for global interface choices, main-window choices, peer display choices, translation choices, and named connection profiles.
The client uses portable settings when an INI file is beside the program. Otherwise it uses the platform application settings directory. A separate home option can select another settings location. This makes the preference scope part of the selected client profile rather than part of the remote daemon.
Global preferences
Global preferences describe behavior that applies across connection profiles. They include refresh timing, tray behavior, add-torrent behavior, clipboard link handling, language, text direction, interface scale, and update checks. The options dialog loads these values for editing and writes them only after the user accepts the dialog.
Some choices change the user interface structure or language. The client marks those changes as needing a restart so the next startup can build the interface with the new rules instead of leaving a mixed state in the current session.
References: main.pas• L1257-1278 main.pas• L1321-1340 main.pas• L2281-2351 options.pas• L110-179 options.pas• L248-354
Connection preferences
Connection preferences describe how one named Transmission profile reaches its daemon. They include the host and port, security, login behavior, proxy use, path mapping, speed presets, and related translation settings.
The connection dialog validates the selected profile before it saves it. Named profiles can be created, renamed, selected, and deleted. A change to the active profile is reported to the main window, which can reconnect and apply the new remote session.
References: connoptions.pas• L51-145 connoptions.pas• L153-225 connoptions.pas• L250-307 connoptions.pas• L427-445 connoptions.pas• L594-708 main.pas• L5611-5627
Preference lifecycle
Preferences follow a load, apply, and restore cycle. Startup selects the settings location and loads the values that shape the first window. Modal dialogs validate and write accepted changes. Window close saves the final layout and list presentation before the client disconnects.
The saved data is not one uniform set. Global settings use shared sections, connection settings use profile-specific sections, and list layouts use one section for each list. Code that changes a preference must preserve both the read path that starts a session and the write path that keeps the next session consistent.
References: main.pas• L1321-1402 main.pas• L1717-1812 main.pas• L3124-3168 connoptions.pas• L509-519 options.pas• L257-354
More detail about setting storage and history keys is available in Preferences and history.
Interaction history
Interaction history saves repeated user input that is useful during torrent intake and relocation. The main history is the set of recent destination folders, kept per connection so a path choice fits the daemon profile that uses it.
Folder history
Folder history appears in destination selectors for adding torrents and moving torrent data. The client normalizes paths, removes duplicate entries, remembers the last selected value, and keeps a usage count and last-use date for each saved folder. Add-torrent entries can also retain the extension pattern linked to a folder.
When a folder is used, its usage value and date rise. When the list exceeds its configured limit, the client removes the entries with the weakest combined use and age value. This keeps often-used folders available without allowing old choices to grow without bound.
References: main.pas• L7908-7981 main.pas• L7983-8056 addtorrent.pas• L936-1012 addtorrent.pas• L1072-1087
History boundaries
The folder history limit is a user preference with a safe range of 10 to 99 entries. Stored counts and usage values are normalized when they are read, so old or invalid settings do not create negative counts or unbounded list growth.
History is stored under the active connection profile. Renaming a profile must keep its add-torrent history with the profile, while deleting a profile removes its profile-specific settings. A missing or invalid history entry falls back to the current input instead of blocking the form.
References: folderhistory.pas• L8-16 folderhistory.pas• L20-54 connoptions.pas• L469-503 connoptions.pas• L265-306 main.pas• L8025-8055
Change checklist
When these files or sections are changed, remember to consider these:
- A new preference must have matching startup read, dialog load, accepted-value write, and runtime application paths.
- A preference that needs a restart must keep its startup read and user notice aligned with the interface state it changes.
- A form or page visibility change must still work with shared scaling and automatic sizing on each supported desktop platform.
- A profile rename or delete must keep the profile section, active-profile pointer, and
AddTorrent.<profile>history section aligned. - A change to the folder limit must use the same bounds and normalization rules in the options dialog, history loader, and pruning paths.
- A list layout change must preserve stable column identity and the link between visible fields and the data requested for them.
- A settings-section or key rename must define how existing user files are read or migrated. Otherwise the client silently returns to defaults.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A preference is written under a new key but startup still reads the old key. | The dialog appears to save the choice, but the next session restores the old behavior. | Keep the load and save paths in the same preference contract. |
| A language, text-direction, or scale choice changes without a restart. | Part of the interface uses the old layout or language rules. | Mark the change as restart-required and reload it during startup. |
| A profile is renamed without moving its add-torrent section. | Recent folders and profile-specific intake values appear lost for the renamed profile. | Rename the connection and AddTorrent sections together. |
| A saved folder count or limit is outside its supported range. | The selector can show too many entries or process an invalid count. | Normalize limits and counts before loading and pruning. |
| A layout reuses a column identity for another field. | A restart can apply an old width or visibility choice to the wrong data. | Treat column IDs as stable and update saved-layout handling when they change. |
| The active connection changes while its form values are invalid. | The user can leave the profile with incomplete connection data or lose the pending edit. | Validate before switching profiles or accepting the dialog. |
Key files
| File | Why to read it |
|---|---|
main.pas | Coordinates the main window, settings load and save, list layouts, connection changes, and folder history. |
main.lfm | Shows the default desktop layout and the shared list views placed in the main window. |
baseform.pas | Defines common form scaling, control sizing, and platform adjustments. |
options.pas | Defines the global preference surface and the rules for applying accepted interface choices. |
connoptions.pas | Defines named connection profiles, validation, profile persistence, and profile history boundaries. |
addtorrent.pas | Shows how destination input uses and updates folder history during torrent intake. |
folderhistory.pas | Defines the safe bounds and normalization rules for saved folder history. |
colsetup.pas | Defines the shared user flow for showing, hiding, and reordering list columns. |