[gnome-boxes] preferences, storage-row: Indicate when storage is not found



commit 9b284fbf15baa585f1bf05c2daeaea493fbc1d56
Author: Felipe Borges <felipeborges gnome org>
Date:   Thu Dec 16 16:08:07 2021 +0100

    preferences, storage-row: Indicate when storage is not found
    
    Sometimes users delete the storage backing files. We don't support
    users fiddling with the internal images/files but we shouldn't
    look broken because of it.

 data/ui/preferences/memory-row.ui | 1 +
 src/preferences/storage-row.vala  | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/data/ui/preferences/memory-row.ui b/data/ui/preferences/memory-row.ui
index d6565717..458bdd38 100644
--- a/data/ui/preferences/memory-row.ui
+++ b/data/ui/preferences/memory-row.ui
@@ -3,6 +3,7 @@
   <template class="BoxesMemoryRow" parent="HdyActionRow">
     <property name="can_focus">True</property>
     <property name="activatable">False</property>
+    <property name="subtitle-lines">2</property>
 
     <child>
       <object class="GtkStack" id="stack">
diff --git a/src/preferences/storage-row.vala b/src/preferences/storage-row.vala
index 5e9a0b14..585d15dd 100644
--- a/src/preferences/storage-row.vala
+++ b/src/preferences/storage-row.vala
@@ -76,10 +76,10 @@ private void setup_external_storage () {
                 FileInfo info = disk.query_info_async.end (res);
                 used_label.label = _("Used %s").printf (GLib.format_size (info.get_size ()));
             } catch (GLib.Error error) {
-                warning ("Failed to calculate disk size for '%s': %s", disk.get_path (),
+                message ("Failed to calculate disk size for '%s': %s", disk.get_path (),
                                                                        error.message);
-
-                used_label.visible = false;
+                subtitle = error.message;
+                used_label.visible = spin_button.visible = false;
             }
         });
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]