summaryrefslogtreecommitdiff
path: root/src/trg-main-window.c
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-09-14 11:08:34 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-09-14 11:08:34 +0000
commit8a020ef0e9acb803d48aca357879166269de6fa1 (patch)
tree37dd4c67f13aaddc89a65e01a4d7954705bea02f /src/trg-main-window.c
parentedfa8191b63504e93815955273d1645a84eea873 (diff)
need to clear the free space and speed indicators if there's a disconnect due to error.
Diffstat (limited to 'src/trg-main-window.c')
-rw-r--r--src/trg-main-window.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/trg-main-window.c b/src/trg-main-window.c
index 4f7b6df..61e5c45 100644
--- a/src/trg-main-window.c
+++ b/src/trg-main-window.c
@@ -883,14 +883,11 @@ static void on_torrent_get(JsonObject * response, int mode, int status,
trg_main_window_conn_changed(TRG_MAIN_WINDOW(data), FALSE);
trg_dialog_error_handler(TRG_MAIN_WINDOW(data), response, status);
} else {
- const gchar *msg;
- gchar *statusBarMsg;
-
- msg = make_error_message(response, status);
- statusBarMsg = g_strdup_printf(_("Request %d/%d failed: %s"),
+ gchar *msg = make_error_message(response, status);
+ gchar *statusBarMsg = g_strdup_printf(_("Request %d/%d failed: %s"),
trg_client_get_failcount(client), TRG_MAX_RETRIES, msg);
trg_status_bar_push_connection_msg(priv->statusBar, statusBarMsg);
- g_free((gpointer) msg);
+ g_free(msg);
g_free(statusBarMsg);
g_timeout_add_seconds(interval, trg_update_torrents_timerfunc, data);
}
@@ -1059,6 +1056,7 @@ static gboolean trg_dialog_error_handler(TrgMainWindow * win,
const gchar *msg;
msg = make_error_message(response, status);
+ trg_status_bar_clear_indicators(priv->statusBar);
trg_status_bar_push_connection_msg(priv->statusBar, msg);
dialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", msg);