OBS-URL: https://build.opensuse.org/package/show/X11:MATE:Factory/mate-system-monitor?expand=0&rev=41
This commit is contained in:
parent
74ee3ac123
commit
fed9c4c4a3
@ -15,7 +15,7 @@
|
|||||||
if (graph->type == LOAD_GRAPH_NET) {
|
if (graph->type == LOAD_GRAPH_NET) {
|
||||||
// operation orders matters so it's 0 if i == num_bars
|
// operation orders matters so it's 0 if i == num_bars
|
||||||
guint64 rate = graph->net.max - (i * graph->net.max / num_bars);
|
guint64 rate = graph->net.max - (i * graph->net.max / num_bars);
|
||||||
+#if GLIB_CHECK_VERSION(2, 58, 0)
|
+#if GLIB_CHECK_VERSION(2, 56, 0)
|
||||||
caption = g_format_size_full (network_in_bits ? rate*8 : rate, network_in_bits ? G_FORMAT_SIZE_BITS : G_FORMAT_SIZE_DEFAULT);
|
caption = g_format_size_full (network_in_bits ? rate*8 : rate, network_in_bits ? G_FORMAT_SIZE_BITS : G_FORMAT_SIZE_DEFAULT);
|
||||||
+#else
|
+#else
|
||||||
+ caption = g_format_size (rate);
|
+ caption = g_format_size (rate);
|
||||||
@ -27,7 +27,7 @@
|
|||||||
bool network_in_bits = ProcData::get_instance()->config.network_in_bits;
|
bool network_in_bits = ProcData::get_instance()->config.network_in_bits;
|
||||||
g_autofree gchar *str=NULL, *formatted_str=NULL;
|
g_autofree gchar *str=NULL, *formatted_str=NULL;
|
||||||
|
|
||||||
+#if GLIB_CHECK_VERSION(2, 58, 0)
|
+#if GLIB_CHECK_VERSION(2, 56, 0)
|
||||||
str = g_format_size_full (network_in_bits ? din*8 : din, network_in_bits ? G_FORMAT_SIZE_BITS : G_FORMAT_SIZE_DEFAULT);
|
str = g_format_size_full (network_in_bits ? din*8 : din, network_in_bits ? G_FORMAT_SIZE_BITS : G_FORMAT_SIZE_DEFAULT);
|
||||||
+#else
|
+#else
|
||||||
+ str = g_format_size (din);
|
+ str = g_format_size (din);
|
||||||
@ -35,14 +35,14 @@
|
|||||||
formatted_str = g_strdup_printf(_("%s/s"), str);
|
formatted_str = g_strdup_printf(_("%s/s"), str);
|
||||||
gtk_label_set_text (GTK_LABEL (graph->labels.net_in), formatted_str);
|
gtk_label_set_text (GTK_LABEL (graph->labels.net_in), formatted_str);
|
||||||
|
|
||||||
+#if GLIB_CHECK_VERSION(2, 58, 0)
|
+#if GLIB_CHECK_VERSION(2, 56, 0)
|
||||||
str = g_format_size_full (network_in_bits ? in*8 : in, network_in_bits ? G_FORMAT_SIZE_BITS : G_FORMAT_SIZE_DEFAULT);
|
str = g_format_size_full (network_in_bits ? in*8 : in, network_in_bits ? G_FORMAT_SIZE_BITS : G_FORMAT_SIZE_DEFAULT);
|
||||||
+#else
|
+#else
|
||||||
+ str = g_format_size (in);
|
+ str = g_format_size (in);
|
||||||
+#endif
|
+#endif
|
||||||
gtk_label_set_text (GTK_LABEL (graph->labels.net_in_total), str);
|
gtk_label_set_text (GTK_LABEL (graph->labels.net_in_total), str);
|
||||||
|
|
||||||
+#if GLIB_CHECK_VERSION(2, 58, 0)
|
+#if GLIB_CHECK_VERSION(2, 56, 0)
|
||||||
str = g_format_size_full (network_in_bits ? dout*8 : dout, network_in_bits ? G_FORMAT_SIZE_BITS : G_FORMAT_SIZE_DEFAULT);
|
str = g_format_size_full (network_in_bits ? dout*8 : dout, network_in_bits ? G_FORMAT_SIZE_BITS : G_FORMAT_SIZE_DEFAULT);
|
||||||
+#else
|
+#else
|
||||||
+ str = g_format_size (dout);
|
+ str = g_format_size (dout);
|
||||||
@ -50,7 +50,7 @@
|
|||||||
formatted_str = g_strdup_printf(_("%s/s"), str);
|
formatted_str = g_strdup_printf(_("%s/s"), str);
|
||||||
gtk_label_set_text (GTK_LABEL (graph->labels.net_out), formatted_str);
|
gtk_label_set_text (GTK_LABEL (graph->labels.net_out), formatted_str);
|
||||||
|
|
||||||
+#if GLIB_CHECK_VERSION(2, 58, 0)
|
+#if GLIB_CHECK_VERSION(2, 56, 0)
|
||||||
str = g_format_size_full (network_in_bits ? out*8 : out, network_in_bits ? G_FORMAT_SIZE_BITS : G_FORMAT_SIZE_DEFAULT);
|
str = g_format_size_full (network_in_bits ? out*8 : out, network_in_bits ? G_FORMAT_SIZE_BITS : G_FORMAT_SIZE_DEFAULT);
|
||||||
+#else
|
+#else
|
||||||
+ str = g_format_size (out);
|
+ str = g_format_size (out);
|
||||||
@ -64,7 +64,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
+#if GLIB_CHECK_VERSION(2, 58, 0)
|
+#if GLIB_CHECK_VERSION(2, 56, 0)
|
||||||
static void
|
static void
|
||||||
network_in_bits_toggled(GtkToggleButton *button, gpointer data)
|
network_in_bits_toggled(GtkToggleButton *button, gpointer data)
|
||||||
{
|
{
|
||||||
@ -80,7 +80,7 @@
|
|||||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), spin_button);
|
gtk_label_set_mnemonic_widget (GTK_LABEL (label), spin_button);
|
||||||
|
|
||||||
|
|
||||||
+#if GLIB_CHECK_VERSION(2, 58, 0)
|
+#if GLIB_CHECK_VERSION(2, 56, 0)
|
||||||
GtkWidget *bits_button;
|
GtkWidget *bits_button;
|
||||||
bits_button = gtk_check_button_new_with_mnemonic(_("Show network speed in bits"));
|
bits_button = gtk_check_button_new_with_mnemonic(_("Show network speed in bits"));
|
||||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bits_button),
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bits_button),
|
||||||
@ -98,7 +98,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
+#if GLIB_CHECK_VERSION(2, 58, 0)
|
+#if GLIB_CHECK_VERSION(2, 56, 0)
|
||||||
static void
|
static void
|
||||||
network_in_bits_changed_cb(GSettings *settings, const gchar *key, gpointer data)
|
network_in_bits_changed_cb(GSettings *settings, const gchar *key, gpointer data)
|
||||||
{
|
{
|
||||||
@ -114,7 +114,7 @@
|
|||||||
std::string detail_string("changed::" + procman::settings::solaris_mode);
|
std::string detail_string("changed::" + procman::settings::solaris_mode);
|
||||||
g_signal_connect(G_OBJECT(settings), detail_string.c_str(), G_CALLBACK(solaris_mode_changed_cb), pd);
|
g_signal_connect(G_OBJECT(settings), detail_string.c_str(), G_CALLBACK(solaris_mode_changed_cb), pd);
|
||||||
|
|
||||||
+#if GLIB_CHECK_VERSION(2, 58, 0)
|
+#if GLIB_CHECK_VERSION(2, 56, 0)
|
||||||
pd->config.network_in_bits = g_settings_get_boolean(settings, procman::settings::network_in_bits.c_str());
|
pd->config.network_in_bits = g_settings_get_boolean(settings, procman::settings::network_in_bits.c_str());
|
||||||
detail_string = "changed::" + procman::settings::network_in_bits;
|
detail_string = "changed::" + procman::settings::network_in_bits;
|
||||||
g_signal_connect(G_OBJECT(settings), detail_string.c_str(), G_CALLBACK(network_in_bits_changed_cb), pd);
|
g_signal_connect(G_OBJECT(settings), detail_string.c_str(), G_CALLBACK(network_in_bits_changed_cb), pd);
|
||||||
|
Loading…
Reference in New Issue
Block a user