[gnome-disk-utility/udisks2-port] Use new Block:HintPartitionable property to determine if "Format Disk" is shown
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility/udisks2-port] Use new Block:HintPartitionable property to determine if "Format Disk" is shown
- Date: Wed, 16 Nov 2011 21:29:17 +0000 (UTC)
commit 03afc1507781980512df629df027a0a926cd3e1a
Author: David Zeuthen <davidz redhat com>
Date: Wed Nov 16 16:28:48 2011 -0500
Use new Block:HintPartitionable property to determine if "Format Disk" is shown
Signed-off-by: David Zeuthen <davidz redhat com>
src/palimpsest/gduwindow.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/palimpsest/gduwindow.c b/src/palimpsest/gduwindow.c
index b96cf29..1793ed7 100644
--- a/src/palimpsest/gduwindow.c
+++ b/src/palimpsest/gduwindow.c
@@ -330,6 +330,15 @@ update_for_show_flags (GduWindow *window,
gtk_widget_set_visible (GTK_WIDGET (window->generic_menu_item_format_disk), is_drive);
gtk_widget_set_visible (GTK_WIDGET (window->generic_menu_item_drive_separator), is_drive);
+ /* except, if FORMAT_DISK is set (example: partitionable non-drive, e.g. /dev/loop0), then
+ * show the separator and the FORMAT_DISK item
+ */
+ if (!is_drive && (show_flags & SHOW_FLAGS_POPUP_MENU_FORMAT_DISK))
+ {
+ gtk_widget_set_visible (GTK_WIDGET (window->generic_menu_item_format_disk), TRUE);
+ gtk_widget_set_visible (GTK_WIDGET (window->generic_menu_item_drive_separator), TRUE);
+ }
+
gtk_widget_set_sensitive (GTK_WIDGET (window->generic_menu_item_view_smart),
show_flags & SHOW_FLAGS_POPUP_MENU_VIEW_SMART);
gtk_widget_set_sensitive (GTK_WIDGET (window->generic_menu_item_format_disk),
@@ -1785,8 +1794,8 @@ update_device_page_for_block (GduWindow *window,
/* TODO: don't show on CD-ROM drives etc. */
if (udisks_block_get_size (block) > 0 && !read_only)
{
- /* TODO: if not partitioned, don't show FORMAT_DISK on non-partitionable media like floppy disks */
- *show_flags |= SHOW_FLAGS_POPUP_MENU_FORMAT_DISK;
+ if (udisks_block_get_hint_partitionable (block))
+ *show_flags |= SHOW_FLAGS_POPUP_MENU_FORMAT_DISK;
*show_flags |= SHOW_FLAGS_POPUP_MENU_FORMAT_VOLUME;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]