summaryrefslogtreecommitdiff
path: root/src/trg-main-window.c
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-02-08 10:14:46 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-02-08 10:14:46 +0000
commit2a1c6fc96ff03c84723ca1fb7d3a48e0cd3df115 (patch)
treedd4eec987c7dcb2b7f0c361831c697c95901f4c9 /src/trg-main-window.c
parent3938a1340d62d6e207b117e0bc84ddb4f62cf6c8 (diff)
if the torrent selection changes as a result of an update, was possible that it would select another item which has no JSON but isn't removed from the model yet. use updateSerial and updateMutex to ignore these.
Diffstat (limited to 'src/trg-main-window.c')
-rw-r--r--src/trg-main-window.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/trg-main-window.c b/src/trg-main-window.c
index 3f8e9fd..fe650c0 100644
--- a/src/trg-main-window.c
+++ b/src/trg-main-window.c
@@ -172,7 +172,7 @@ static gboolean update_selected_torrent_notebook(TrgMainWindow * win,
priv = TRG_MAIN_WINDOW_GET_PRIVATE(win);
newFirstSelected =
- get_first_selected(priv->torrentTreeView, &iter, &json);
+ get_first_selected(priv->client, priv->torrentTreeView, &iter, &json);
if (priv->selectedTorrentId >= 0
&& (priv->selectedTorrentId != newFirstSelected
@@ -574,20 +574,20 @@ static void remove_cb(GtkWidget * w G_GNUC_UNUSED, gpointer data)
{
TrgMainWindowPrivate *priv;
GtkTreeSelection *selection;
+ JsonArray *ids;
priv = TRG_MAIN_WINDOW_GET_PRIVATE(data);
selection =
gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->torrentTreeView));
-
+ ids = build_json_id_array(priv->torrentTreeView);
if (confirm_action_dialog
(GTK_WINDOW(data), selection,
"<big><b>Remove torrent \"%s\"?</b></big>",
"<big><b>Remove %d torrents?</b></big>",
GTK_STOCK_REMOVE) == GTK_RESPONSE_ACCEPT)
dispatch_async(priv->client,
- torrent_remove(build_json_id_array
- (priv->torrentTreeView),
+ torrent_remove(ids,
FALSE),
on_generic_interactive_action, data);
}
@@ -596,11 +596,13 @@ static void delete_cb(GtkWidget * w G_GNUC_UNUSED, gpointer data)
{
TrgMainWindowPrivate *priv;
GtkTreeSelection *selection;
+ JsonArray *ids;
priv = TRG_MAIN_WINDOW_GET_PRIVATE(data);
selection =
gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->torrentTreeView));
+ ids = build_json_id_array(priv->torrentTreeView);
if (confirm_action_dialog
(GTK_WINDOW(data), selection,
@@ -608,8 +610,7 @@ static void delete_cb(GtkWidget * w G_GNUC_UNUSED, gpointer data)
"<big><b>Remove and delete %d torrents?</b></big>",
GTK_STOCK_DELETE) == GTK_RESPONSE_ACCEPT)
dispatch_async(priv->client,
- torrent_remove(build_json_id_array
- (priv->torrentTreeView),
+ torrent_remove(ids,
TRUE),
on_generic_interactive_action, data);
}
@@ -1122,6 +1123,8 @@ static gboolean torrent_tv_key_press_event(GtkWidget * w,
delete_cb(w, data);
else
remove_cb(w, data);
+ } else if (key->keyval == GDK_Return) {
+ open_props_cb(w, data);
}
return FALSE;
}