Commit 176e072b authored by William Jon McCann's avatar William Jon McCann

info: add memory info

parent 53a2f10a
......@@ -115,6 +115,8 @@ AC_SUBST(GTK_ENGINE_DIR)
PKG_CHECK_MODULES(GLIB, glib-2.0)
PKG_CHECK_MODULES(LIBGTOP, libgtop-2.0)
PKG_CHECK_MODULES(POLKIT, polkit-gobject-1 >= 0.97)
PKG_CHECK_MODULES(CHEESE, gstreamer-0.10 cheese-gtk >= 2.29.90, have_cheese=yes, have_cheese=no)
......
INCLUDES = \
$(PANEL_CFLAGS) \
$(LIBGTOP_CFLAGS) \
$(GNOMECC_CAPPLETS_CFLAGS) \
-DGNOMECC_UI_DIR="\"$(uidir)\"" \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
......@@ -15,7 +16,7 @@ libinfo_la_SOURCES = \
cc-info-panel.c \
cc-info-panel.h
libinfo_la_LIBADD = $(PANEL_LIBS) $(CAPPLET_LIBS)
libinfo_la_LIBADD = $(PANEL_LIBS) $(CAPPLET_LIBS) $(LIBGTOP_LIBS)
libinfo_la_LDFLAGS = $(PANEL_LDFLAGS)
uidir = $(pkgdatadir)/ui
......
......@@ -21,6 +21,11 @@
#include "cc-info-panel.h"
#include <glibtop/fsusage.h>
#include <glibtop/mountlist.h>
#include <glibtop/mem.h>
#include <glibtop/sysinfo.h>
#define WID(b, w) (GtkWidget *) gtk_builder_get_object (b, w)
G_DEFINE_DYNAMIC_TYPE (CcInfoPanel, cc_info_panel, CC_TYPE_PANEL)
......@@ -226,6 +231,8 @@ cc_info_panel_init (CcInfoPanel *self)
GError *error;
GtkWidget *widget;
gboolean res;
glibtop_mem mem;
char *text;
self->priv = INFO_PANEL_PRIVATE (self);
......@@ -248,13 +255,18 @@ cc_info_panel_init (CcInfoPanel *self)
&self->priv->gnome_date);
if (res)
{
char *text;
widget = WID (self->priv->builder, "version_label");
text = g_strdup_printf ("Version %s", self->priv->gnome_version);
gtk_label_set_text (GTK_LABEL (widget), text);
g_free (text);
}
glibtop_get_mem (&mem);
text = g_format_size_for_display (mem.total);
widget = WID (self->priv->builder, "memory_label");
gtk_label_set_text (GTK_LABEL (widget), text);
g_free (text);
widget = WID (self->priv->builder, "info_vbox");
gtk_widget_reparent (widget, (GtkWidget *) self);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment