Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Settings
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
683
Issues
683
List
Boards
Labels
Service Desk
Milestones
Merge Requests
55
Merge Requests
55
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
Settings
Commits
b31b0e0f
Commit
b31b0e0f
authored
Jan 10, 2011
by
William Jon McCann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
info: add primary disk size info
parent
42732d45
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
panels/info/cc-info-panel.c
panels/info/cc-info-panel.c
+27
-3
No files found.
panels/info/cc-info-panel.c
View file @
b31b0e0f
...
...
@@ -21,6 +21,8 @@
#include "cc-info-panel.h"
#include <sys/vfs.h>
#include <glib.h>
#include <glib/gi18n.h>
...
...
@@ -240,6 +242,23 @@ get_os_type (void)
return
g_strdup_printf
(
_
(
"%d-bit"
),
bits
);
}
static
char
*
get_primary_disc_info
(
void
)
{
guint64
total_bytes
;
struct
statfs
buf
;
if
(
statfs
(
"/"
,
&
buf
)
<
0
)
{
g_warning
(
"Unable to stat / filesystem: %s"
,
g_strerror
(
errno
));
return
NULL
;
}
else
total_bytes
=
(
guint64
)
buf
.
f_blocks
*
buf
.
f_bsize
;
return
g_format_size_for_display
(
total_bytes
);
}
static
char
*
get_cpu_info
(
const
glibtop_sysinfo
*
info
)
{
...
...
@@ -333,19 +352,24 @@ cc_info_panel_init (CcInfoPanel *self)
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
);
gtk_label_set_text
(
GTK_LABEL
(
widget
),
text
?
text
:
""
);
g_free
(
text
);
info
=
glibtop_get_sysinfo
();
widget
=
WID
(
self
->
priv
->
builder
,
"processor_label"
);
text
=
get_cpu_info
(
info
);
gtk_label_set_text
(
GTK_LABEL
(
widget
),
text
);
gtk_label_set_text
(
GTK_LABEL
(
widget
),
text
?
text
:
""
);
g_free
(
text
);
widget
=
WID
(
self
->
priv
->
builder
,
"os_type_label"
);
text
=
get_os_type
();
gtk_label_set_text
(
GTK_LABEL
(
widget
),
text
);
gtk_label_set_text
(
GTK_LABEL
(
widget
),
text
?
text
:
""
);
g_free
(
text
);
widget
=
WID
(
self
->
priv
->
builder
,
"disk_label"
);
text
=
get_primary_disc_info
();
gtk_label_set_text
(
GTK_LABEL
(
widget
),
text
?
text
:
""
);
g_free
(
text
);
widget
=
WID
(
self
->
priv
->
builder
,
"info_vbox"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment