From 258a0a450fc822068dc7581b03590a29f93b903f Mon Sep 17 00:00:00 2001 From: Alan Fitton Date: Mon, 3 Oct 2011 10:24:33 +0000 Subject: issue 137 --- src/protocol-constants.h | 1 + src/requests.c | 2 ++ src/torrent.h | 1 + src/trg-general-panel.c | 7 +++++-- 4 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/protocol-constants.h b/src/protocol-constants.h index dc5c8b3..139acbc 100644 --- a/src/protocol-constants.h +++ b/src/protocol-constants.h @@ -67,6 +67,7 @@ #define FIELD_COMMENT "comment" #define FIELD_LEFTUNTILDONE "leftUntilDone" #define FIELD_ISFINISHED "isFinished" +#define FIELD_ISPRIVATE "isPrivate" #define FIELD_ERRORSTR "errorString" #define FIELD_BANDWIDTH_PRIORITY "bandwidthPriority" #define FIELD_UPLOAD_LIMIT "uploadLimit" diff --git a/src/requests.c b/src/requests.c index cd270d8..0bc52af 100644 --- a/src/requests.c +++ b/src/requests.c @@ -164,6 +164,8 @@ JsonNode *torrent_get(gint64 id) json_array_add_string_element(fields, FIELD_RATEUPLOAD); json_array_add_string_element(fields, FIELD_RATEDOWNLOAD); json_array_add_string_element(fields, FIELD_STATUS); + json_array_add_string_element(fields, FIELD_ISFINISHED); + json_array_add_string_element(fields, FIELD_ISPRIVATE); json_array_add_string_element(fields, FIELD_ADDED_DATE); json_array_add_string_element(fields, FIELD_DOWNLOADEDEVER); json_array_add_string_element(fields, FIELD_UPLOADEDEVER); diff --git a/src/torrent.h b/src/torrent.h index 3925fc6..3d78962 100644 --- a/src/torrent.h +++ b/src/torrent.h @@ -72,6 +72,7 @@ gdouble torrent_get_percent_done(JsonObject * t); gdouble torrent_get_recheck_progress(JsonObject * t); gint64 torrent_get_left_until_done(JsonObject * t); gboolean torrent_get_is_finished(JsonObject * t); +gboolean torrent_get_is_private(JsonObject * t); gboolean torrent_get_honors_session_limits(JsonObject * t); gint64 torrent_get_bandwidth_priority(JsonObject * t); gint64 torrent_get_upload_limit(JsonObject * t); diff --git a/src/trg-general-panel.c b/src/trg-general-panel.c index 0c7742e..f5b5698 100644 --- a/src/trg-general-panel.c +++ b/src/trg-general-panel.c @@ -108,7 +108,7 @@ void trg_general_panel_update(TrgGeneralPanel * panel, JsonObject * t, TrgGeneralPanelPrivate *priv; gchar buf[32]; gint sizeOfBuf; - gchar *statusString; + gchar *statusString, *fullStatusString; const gchar *errorStr; gint64 eta, uploaded, downloaded, rpcv; gint seeders, leechers; @@ -144,7 +144,10 @@ void trg_general_panel_update(TrgGeneralPanel * panel, JsonObject * t, } statusString = torrent_get_status_string(rpcv, torrent_get_status(t)); - gtk_label_set_text(GTK_LABEL(priv->gen_status_label), statusString); + fullStatusString = g_strdup_printf("%s %s", statusString, + torrent_get_is_private(t) ? _("(Private)") : _("(Public)")); + gtk_label_set_text(GTK_LABEL(priv->gen_status_label), fullStatusString); + g_free(fullStatusString); g_free(statusString); trg_strlpercent(buf, torrent_get_percent_done(t)); -- cgit v1.2.3