This patch adds two new flags to the callback function -- did_connect and did_timeout -- that are calculated inside of web.c using information from libcurl. This allows the announcer to detect timeouts more accurately and also to distinguish between unresponsive peers (which get the preexisting "Tracker did not respond" error message) and unconnectable peers (which get a new error message, "Could not connect to tracker").
Looking over the 2.20 tickets, this one keeps sticking out. A popup menu may be useful if the "delete files" ticket is accepted in 2.30, but for this release (2.20) it doesn't really add anything new. One lesson from the 2.1x cycle was that features are a harder to remove than to add. So I'm going to hold off on adding this feature until it has a clear raison d'être.
When libtransmission gets a "remove torrent" request from RPC, it tries to delegate the work. This is because the GTK+ and Mac clients don't want torrents disappearing in a different thread and causing possible thread issues. So the GTK+ and Mac clients get notification about this via libtransmission's RPC callback and remove the torrents themselves. Unfortunately, that notification doesn't include information about whether or not to delete local data.
This commit adds that information to the RPC callback so that the Mac and GTK+ clients will know whether or not to trash the local files when a third-party RPC client requests that at torrent and its files be deleted.
gtk/main.c's onRPCChanged() is called from inside the libtransmission thread, yet it still made GTK+ calls to modify the GTK+ client's tr-core object when a torrent was added. This caused a race condition inside of the GTK+ internals. onRPCChanged() already knows to delegate work back to the GTK+ thread when a torrent is removed via RPC. This commit uses the same kind of mechanism to delegate work back to the GTK+ thread when a torrent is added via RPC.
make sure to call gtk_list_store_set() on rows matching torrents whose tr_stat.recheckProgress value has changed, triggering a row change event that causes the verify progress change to be displayed.
Clearing the model on shutdown generated a warning because it used the wrong cast. Rather than fixing the cast, add tr_core_clear() for symmetry with tr_core_load().
Long description in #3970. Split tr_core's torrent GtkTreeModel into two models: one low-level unsorted one, and one proxy sorted one. That way we don't have to disable sorting before walking through the low-level one to sync the table's attributes with the tr_torrent and tr_stat.
the callback function for GtkWidget's focus-in-event should return TRUE to stop other handlers from being invoked for the event or FALSE to propagate the event further.
The patch avoids use of GtkCellRendererText's "sensitive" property, and instead renders paused torrents' text using the widget's style's color for insensitive text. This approach honors the theme's "insensitive" color setting and uses it to draw insensitive text with no etching or shadowing.
The better option is still for Murrine to fix its text shadow issue... but until then, here is a workaround.
According to the GTK+ documentation, this "can be an advantage in situations where resizing the label because of text changes would be distracting, e.g. in a statusbar." It doesn't seem to prevent relayout in GTK+ 2.20.1, but maybe other versions of GTK+ will make better use of the flag.
The main window called gtk_tree_model_filter_refilter() once per second to refresh the torrent list's filtering. This is not an efficient approach: gtk_tree_model_filter_refilter() emits a "row changed" event for every row, causing unnecessary re-rendering.
I've removed the call to gtk_tree_model_filter_refilter() and expanded the model to includes all the fields necessary for filtering. That way we only fire "row changed" events for rows that actually change.
By reducing the number of renders in steady state, this might ameliorate https://bugs.launchpad.net/ubuntu/+source/transmission/+bug/655024
However it will *not* help the related "CPU spikes to 100% on scrolling" ticket at https://trac.transmissionbt.com/ticket/3887 because rendering paused torrents is still exceptionally expensive in the murrine theme.
Some of the refresh events to the main window's torrent list are caused by main window relayout caused by the toolbar's GtkLabels recalculating their size after being updated once per second. To prevent relayout in some trivial cases, I'm replacing the gtk_label_set_text() calls with gtr_label_set_text() because the latter doesn't update the label widget if the old and new text strings are the same.
There are other changes that can handle more important cases -- I'll test those out next.