summaryrefslogtreecommitdiff
path: root/src/trg-stats-dialog.c
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-08-27 17:15:31 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-08-27 17:15:31 +0000
commitbd758ee4fc423b9ca152a01f897609daa656c938 (patch)
tree0378306b5b007f38f0c4f6c0d868215f70fd70d6 /src/trg-stats-dialog.c
parentb8a1599a2ab9eafd496ba23179dda97d6e83e917 (diff)
Profile support! Please test and report bugs, as the config system is totally rewritten and may not be perfect. No more GConf (trying to implement profiles with this was UGLY), settings now (for most) live in JSON at $HOME/.config/transmission-remote-gtk/config.json. Hopefully windows support will be easier without GConf.
Diffstat (limited to 'src/trg-stats-dialog.c')
-rw-r--r--src/trg-stats-dialog.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/trg-stats-dialog.c b/src/trg-stats-dialog.c
index d5b6561..9ecbc28 100644
--- a/src/trg-stats-dialog.c
+++ b/src/trg-stats-dialog.c
@@ -45,13 +45,15 @@ enum {
PROP_CLIENT
};
+#define STATS_UPDATE_INTERVAL 5
+
G_DEFINE_TYPE(TrgStatsDialog, trg_stats_dialog, GTK_TYPE_DIALOG)
#define TRG_STATS_DIALOG_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), TRG_TYPE_STATS_DIALOG, TrgStatsDialogPrivate))
typedef struct _TrgStatsDialogPrivate TrgStatsDialogPrivate;
struct _TrgStatsDialogPrivate {
- trg_client *client;
+ TrgClient *client;
TrgMainWindow *parent;
GtkWidget *tv;
GtkListStore *model;
@@ -210,8 +212,8 @@ static void on_stats_reply(JsonObject * response, int status,
update_int_stat(args, priv->rr_session_count, "sessionCount");
update_time_stat(args, priv->rr_active, "secondsActive");
- if (priv->client->session)
- g_timeout_add_seconds(5, trg_update_stats_timerfunc, data);
+ if (trg_client_is_connected(priv->client))
+ g_timeout_add_seconds(STATS_UPDATE_INTERVAL, trg_update_stats_timerfunc, data);
} else {
trg_error_dialog(GTK_WINDOW(data), status, response);
}
@@ -351,7 +353,7 @@ static void trg_stats_dialog_init(TrgStatsDialog * self)
}
TrgStatsDialog *trg_stats_dialog_get_instance(TrgMainWindow * parent,
- trg_client * client)
+ TrgClient * client)
{
if (instance == NULL) {
instance = g_object_new(TRG_TYPE_STATS_DIALOG,