diff options
-rw-r--r-- | src/trg-torrent-graph.c | 4 | ||||
-rw-r--r-- | src/trg-torrent-graph.c.glg | 106 | ||||
-rw-r--r-- | src/trg-torrent-graph.h.glg | 56 |
3 files changed, 2 insertions, 164 deletions
diff --git a/src/trg-torrent-graph.c b/src/trg-torrent-graph.c index d4f5765..aaadd67 100644 --- a/src/trg-torrent-graph.c +++ b/src/trg-torrent-graph.c @@ -394,12 +394,12 @@ static void trg_torrent_graph_update_net(TrgTorrentGraph * g) fp[1] = 1.0f * priv->in / priv->max; trg_strlspeed(speed, (gint64)(priv->out/1024)); - labelMarkup = g_markup_printf_escaped("<span font_size=\"small\" color=\""GRAPH_OUT_COLOR"\">Outgoing: %s</span>", speed); + labelMarkup = g_markup_printf_escaped("<span font_size=\"small\" color=\""GRAPH_OUT_COLOR"\">Uploading: %s</span>", speed); gtk_label_set_markup(GTK_LABEL(priv->label_out), labelMarkup); g_free(labelMarkup); trg_strlspeed(speed, (gint64)(priv->in/1024)); - labelMarkup = g_markup_printf_escaped("<span font_size=\"small\" color=\""GRAPH_IN_COLOR"\">Incoming: %s</span>", speed); + labelMarkup = g_markup_printf_escaped("<span font_size=\"small\" color=\""GRAPH_IN_COLOR"\">Downloading: %s</span>", speed); gtk_label_set_markup(GTK_LABEL(priv->label_in), labelMarkup); g_free(labelMarkup); diff --git a/src/trg-torrent-graph.c.glg b/src/trg-torrent-graph.c.glg deleted file mode 100644 index 9479717..0000000 --- a/src/trg-torrent-graph.c.glg +++ /dev/null @@ -1,106 +0,0 @@ -/* - * transmission-remote-gtk - Transmission RPC client for GTK - * Copyright (C) 2011 Alan Fitton - - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <stdint.h> -#include <gtk/gtk.h> - -#include "util.h" -#include "glg.h" -#include "trg-torrent-model.h" -#include "trg-torrent-graph.h" - -/*enum { - PROP_0, - PROP_SIZE_VALUE -};*/ - -G_DEFINE_TYPE(TrgTorrentGraph, trg_torrent_graph, - GLG_TYPE_LINE_GRAPH) -#define TRG_TORRENT_GRAPH_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRG_TYPE_TORRENT_GRAPH, TrgTorrentGraphPrivate)) -typedef struct _TrgTorrentGraphPrivate TrgTorrentGraphPrivate; - -struct _TrgTorrentGraphPrivate { - gint global_down_id; - gint global_up_id; -}; - -static void -trg_torrent_graph_class_init(TrgTorrentGraphClass * klass) -{ - /*GObjectClass *object_class = G_OBJECT_CLASS(klass);*/ - g_type_class_add_private(klass, sizeof(TrgTorrentGraphPrivate)); -} - -static void trg_torrent_graph_init(TrgTorrentGraph * self) -{ - -} - -void trg_torrent_graph_update(TrgTorrentGraph *g, trg_torrent_model_update_stats *global) -{ - TrgTorrentGraphPrivate *priv = TRG_TORRENT_GRAPH_GET_PRIVATE(g); - - - glg_line_graph_data_series_add_value (GLG_LINE_GRAPH(g), priv->global_down_id, (gdouble)global->downRateTotal/1024); - glg_line_graph_data_series_add_value (GLG_LINE_GRAPH(g), priv->global_up_id, (gdouble)global->upRateTotal/1024); - - glg_line_graph_redraw (GLG_LINE_GRAPH(g)); -} - -TrgTorrentGraph *trg_torrent_graph_new(void) -{ - TrgTorrentGraphPrivate *priv; - - GObject *glg = g_object_new(TRG_TYPE_TORRENT_GRAPH, - "range-tick-minor-x", 1, - "range-tick-major-x", 120, - "range-scale-minor-x", 0, - "range-scale-major-x", 120, - "range-tick-minor-y", 1, - "range-tick-major-y", 10, - "range-scale-minor-y", 0, - "range-scale-major-y", 10, - NULL); - - priv = TRG_TORRENT_GRAPH_GET_PRIVATE(glg); - - g_object_set (glg, "chart-set-elements", - GLG_GRID_LABELS_Y | GLG_GRID_LINES, NULL); - - g_object_set (glg, "series-line-width", 3, NULL); - - g_object_set (glg, - "graph-title-foreground", "blue", - "graph-scale-foreground", "blue", - "graph-chart-background", "white", - "graph-window-background", "white", - NULL); - - g_object_set (glg, "text-title-yaxis", "Speed", - "text-title-xaxis", "Time", - NULL); - - priv->global_down_id = glg_line_graph_data_series_add (GLG_LINE_GRAPH(glg), "Global Down KB/s", "green"); - priv->global_up_id = glg_line_graph_data_series_add (GLG_LINE_GRAPH(glg), "Global Up KB/s", "red"); - - glg_line_graph_redraw (GLG_LINE_GRAPH(glg)); - - return TRG_TORRENT_GRAPH(glg); -} diff --git a/src/trg-torrent-graph.h.glg b/src/trg-torrent-graph.h.glg deleted file mode 100644 index a49cf40..0000000 --- a/src/trg-torrent-graph.h.glg +++ /dev/null @@ -1,56 +0,0 @@ -/* - * transmission-remote-gtk - Transmission RPC client for GTK - * Copyright (C) 2011 Alan Fitton - - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - - -#ifndef TRG_TORRENT_GRAPH_H_ -#define TRG_TORRENT_GRAPH_H_ - -#include <glib-object.h> -#include <gtk/gtk.h> - -#include "glg.h" -#include "trg-torrent-model.h" - -G_BEGIN_DECLS -#define TRG_TYPE_TORRENT_GRAPH trg_torrent_graph_get_type() -#define TRG_TORRENT_GRAPH(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRG_TYPE_TORRENT_GRAPH, TrgTorrentGraph)) -#define TRG_TORRENT_GRAPH_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), TRG_TYPE_TORRENT_GRAPH, TrgTorrentGraphClass)) -#define TRG_IS_TORRENT_GRAPH(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRG_TYPE_TORRENT_GRAPH)) -#define TRG_IS_TORRENT_GRAPH_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), TRG_TYPE_TORRENT_GRAPH)) -#define TRG_TORRENT_GRAPH_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), TRG_TYPE_TORRENT_GRAPH, TrgTorrentGraphClass)) - typedef struct { - GlgLineGraph parent; -} TrgTorrentGraph; - -typedef struct { - GlgLineGraphClass parent_class; -} TrgTorrentGraphClass; - -GType trg_torrent_graph_get_type(void); - -TrgTorrentGraph *trg_torrent_graph_new(void); -void trg_torrent_graph_update(TrgTorrentGraph *g, trg_torrent_model_update_stats *global); - -G_END_DECLS -#endif /* TRG_TORRENT_GRAPH_H_ */ |