~indicator-multiload/indicator-multiload/trunk

1 by Michael Hofmann
Initial public version.
1
/******************************************************************************
87 by Michael Hofmann
Fix license headers.
2
 * Copyright (C) 2011-2013  Michael Hofmann <mh21@mh21.de>                    *
1 by Michael Hofmann
Initial public version.
3
 *                                                                            *
4
 * This program is free software; you can redistribute it and/or modify       *
5
 * it under the terms of the GNU General Public License as published by       *
6
 * the Free Software Foundation; either version 3 of the License, or          *
7
 * (at your option) any later version.                                        *
8
 *                                                                            *
9
 * This program is distributed in the hope that it will be useful,            *
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
12
 * GNU General Public License for more details.                               *
13
 *                                                                            *
14
 * You should have received a copy of the GNU General Public License along    *
15
 * with this program; if not, write to the Free Software Foundation, Inc.,    *
16
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.                *
17
 ******************************************************************************/
18
46 by Michael Hofmann
Code cleanups.
19
public class MemProvider : Provider {
20
    public MemProvider() {
130 by mh21 at mh21
Provide bitrate function to show speed in bit/s
21
        base("mem", {"user", "shared", "buffer", "cached", "total", "used"}, "i");
1 by Michael Hofmann
Initial public version.
22
    }
23
7 by Michael Hofmann
Use attention icon as secondary icon, avoids a dbus round trip. First implementation of text status in the menu.
24
    public override void update() {
1 by Michael Hofmann
Initial public version.
25
        GTop.Mem mem;
26
        GTop.get_mem(out mem);
27
46 by Michael Hofmann
Code cleanups.
28
        this.values[0] = mem.user;
48 by Michael Hofmann
Fix mem provider.
29
        this.values[1] = mem.shared;
30
        this.values[2] = mem.buffer;
31
        this.values[3] = mem.cached;
32
        this.values[4] = mem.total;
33
        this.values[5] = mem.shared + mem.buffer + mem.cached;
1 by Michael Hofmann
Initial public version.
34
    }
35
}
36