[gnome-disk-utility/udisks2-port] Use a play icon in the grid to convey when a volume is mounted
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility/udisks2-port] Use a play icon in the grid to convey when a volume is mounted
- Date: Mon, 28 Mar 2011 22:23:12 +0000 (UTC)
commit b01895ed38dfb48a5e793c99663b15e5e4044c43
Author: David Zeuthen <davidz redhat com>
Date: Mon Mar 28 18:22:24 2011 -0400
Use a play icon in the grid to convey when a volume is mounted
Signed-off-by: David Zeuthen <davidz redhat com>
data/icons/scalable/Makefile.am | 1 +
data/icons/scalable/gdu-state-mounted-symbolic.svg | 29 ++++++++++++++++++++
src/palimpsest/gduvolumegrid.c | 22 +++++++++++++++
3 files changed, 52 insertions(+), 0 deletions(-)
---
diff --git a/data/icons/scalable/Makefile.am b/data/icons/scalable/Makefile.am
index 870b098..701a922 100644
--- a/data/icons/scalable/Makefile.am
+++ b/data/icons/scalable/Makefile.am
@@ -5,6 +5,7 @@ icon_DATA = \
gdu-action-mount-symbolic.svg \
gdu-action-unmount-symbolic.svg \
gdu-action-eject-symbolic.svg \
+ gdu-state-mounted-symbolic.svg \
$(NULL)
EXTRA_DIST = \
diff --git a/data/icons/scalable/gdu-state-mounted-symbolic.svg b/data/icons/scalable/gdu-state-mounted-symbolic.svg
new file mode 100644
index 0000000..50e3403
--- /dev/null
+++ b/data/icons/scalable/gdu-state-mounted-symbolic.svg
@@ -0,0 +1,29 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='media-playback-start-symbolic.svg' version='1.1' inkscape:version='0.48pre1 r9509' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'>
+ <metadata id='metadata90'>
+ <rdf:RDF>
+ <cc:Work rdf:about=''>
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/>
+ <dc:title>Gnome Symbolic Icon Theme</dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview inkscape:cy='122.27773' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:window-width='1310' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='true' bordercolor='#666666' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='54' inkscape:snap-global='true' inkscape:window-y='24' gridtolerance='10' inkscape:window-height='690' inkscape:snap-to-guides='true' inkscape:current-layer='layer12' inkscape:zoom='1' inkscape:cx='79.3513' inkscape:snap-grids='true' inkscape:pageopacity='1'>
+ <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/>
+ </sodipodi:namedview>
+ <title id='title9167'>Gnome Symbolic Icon Theme</title>
+ <defs id='defs7386'/>
+ <g inkscape:label='status' transform='translate(-79.99995,-606)' inkscape:groupmode='layer' id='layer9' style='display:inline'/>
+ <g inkscape:label='devices' transform='translate(-79.99995,-606)' inkscape:groupmode='layer' id='layer10'/>
+ <g inkscape:label='apps' transform='translate(-79.99995,-606)' inkscape:groupmode='layer' id='layer11'/>
+ <g inkscape:label='actions' transform='translate(-79.99995,-606)' inkscape:groupmode='layer' id='layer12'>
+
+ <path inkscape:connector-curvature='0' d='m 84,609 0,10 0.90625,0 L 85,619 c 0.174914,10e-4 0.347782,-0.0388 0.5,-0.125 l 7,-4 c 0.310699,-0.17189 0.46875,-0.52345 0.46875,-0.875 0,-0.35155 -0.158051,-0.70311 -0.46875,-0.875 l -7,-4 C 85.347782,609.03875 85.174914,608.99869 85,609 l -0.09375,0 z' id='path3807-1-1-9-38-4' sodipodi:nodetypes='ccccccsccccc' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#000000;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans'/>
+ </g>
+ <g inkscape:label='places' transform='translate(-79.99995,-606)' inkscape:groupmode='layer' id='layer13'/>
+ <g inkscape:label='mimetypes' transform='translate(-79.99995,-606)' inkscape:groupmode='layer' id='layer14'/>
+ <g inkscape:label='emblems' transform='translate(-79.99995,-606)' inkscape:groupmode='layer' id='layer15' style='display:inline'/>
+</svg>
diff --git a/src/palimpsest/gduvolumegrid.c b/src/palimpsest/gduvolumegrid.c
index ac7209a..eaba319 100644
--- a/src/palimpsest/gduvolumegrid.c
+++ b/src/palimpsest/gduvolumegrid.c
@@ -74,6 +74,7 @@ struct GridElement
gboolean show_spinner;
gboolean show_padlock_open;
gboolean show_padlock_closed;
+ gboolean show_mounted;
/* used for the job spinner */
guint spinner_current;
@@ -1230,12 +1231,20 @@ render_element (GduVolumeGrid *grid,
gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
"changes-prevent-symbolic",
12, 0, NULL));
+ if (element->show_mounted)
+ g_ptr_array_add (pixbufs_to_render,
+ gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
+ "gdu-state-mounted-symbolic",
+ 12, 0, NULL));
for (n = 0; n < pixbufs_to_render->len; n++)
{
GdkPixbuf *pixbuf = GDK_PIXBUF (pixbufs_to_render->pdata[n]);
guint icon_width;
guint icon_height;
+ if (pixbuf == NULL)
+ continue;
+
icon_width = gdk_pixbuf_get_width (pixbuf);
icon_height = gdk_pixbuf_get_height (pixbuf);
@@ -1924,12 +1933,25 @@ grid_element_set_details (GduVolumeGrid *grid,
else if (g_strcmp0 (usage, "filesystem") == 0)
{
const gchar *label;
+ UDisksFilesystem *filesystem;
+
label = udisks_block_device_get_id_label (block);
type_for_display = udisks_util_get_id_for_display (usage, type, version, FALSE);
if (strlen (label) == 0)
label = C_("volume-grid", "Filesystem");
s = g_strdup_printf ("%s\n%s %s", label, size_str, type_for_display);
g_free (type_for_display);
+
+ filesystem = UDISKS_PEEK_FILESYSTEM (element->object);
+ if (filesystem != NULL)
+ {
+ const gchar *const *mount_points;
+ mount_points = udisks_filesystem_get_mount_points (filesystem);
+ if (g_strv_length ((gchar **) mount_points) > 0)
+ {
+ element->show_mounted = TRUE;
+ }
+ }
}
else if (g_strcmp0 (usage, "other") == 0 && g_strcmp0 (type, "swap") == 0)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]