[gnome-disk-utility] createfilesystempage: Add tooltip for missing utilities
- From: Kai Lüke <kailueke src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility] createfilesystempage: Add tooltip for missing utilities
- Date: Mon, 4 Apr 2022 19:56:10 +0000 (UTC)
commit 5b4141871d66f3c720a9bb37a9121114ff316d59
Author: Manuel Wassermann <manuel wassermann97 gmail com>
Date: Fri Mar 18 17:11:12 2022 +0100
createfilesystempage: Add tooltip for missing utilities
src/disks/gducreatefilesystempage.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
---
diff --git a/src/disks/gducreatefilesystempage.c b/src/disks/gducreatefilesystempage.c
index 5e50c522..bd64ee3a 100644
--- a/src/disks/gducreatefilesystempage.c
+++ b/src/disks/gducreatefilesystempage.c
@@ -177,6 +177,7 @@ gdu_create_filesystem_page_new (UDisksClient *client, UDisksDrive *drive)
{
GduCreateFilesystemPage *page;
GduCreateFilesystemPagePrivate *priv;
+ gchar *missing_util = NULL;
page = g_object_new (GDU_TYPE_CREATE_FILESYSTEM_PAGE, NULL);
priv = gdu_create_filesystem_page_get_instance_private (page);
@@ -207,8 +208,30 @@ gdu_create_filesystem_page_new (UDisksClient *client, UDisksDrive *drive)
}
}
- gtk_widget_set_sensitive (GTK_WIDGET (priv->windows_radiobutton), gdu_utils_can_format (client, "ntfs",
FALSE, NULL));
- gtk_widget_set_sensitive (GTK_WIDGET (priv->all_radiobutton), gdu_utils_can_format (client, "vfat", FALSE,
NULL));
+
+ if (!gdu_utils_can_format (client, "ntfs", FALSE, &missing_util))
+ {
+ gchar *s;
+
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->windows_radiobutton), FALSE);
+ s = g_strdup_printf (_("The utility %s is missing."), missing_util);
+ gtk_widget_set_tooltip_text (GTK_WIDGET (priv->windows_radiobutton), s);
+
+ g_free (s);
+ }
+ g_free (missing_util);
+
+ if (!gdu_utils_can_format (client, "vfat", FALSE, &missing_util))
+ {
+ gchar *s;
+
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->all_radiobutton), FALSE);
+ s = g_strdup_printf (_("The utility %s is missing."), missing_util);
+ gtk_widget_set_tooltip_text (GTK_WIDGET (priv->all_radiobutton), s);
+
+ g_free (s);
+ }
+ g_free (missing_util);
return page;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]