From b650a3a27678a3be0bc8ca6fc79c72f7333516d1 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Fri, 13 Jul 2012 01:42:48 +0200 Subject: [PATCH] Hide partitions from "block attach" submenu (#623) Still allow to detach partition if attached manually. --- qubesmanager/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qubesmanager/main.py b/qubesmanager/main.py index f2a5d9d..e56eec3 100755 --- a/qubesmanager/main.py +++ b/qubesmanager/main.py @@ -1654,6 +1654,9 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): for d in self.blk_manager.free_devs: if d.startswith(vm.name): continue + # skip partitions heuristic + if d[-1].isdigit() and d[0:-1] in self.blk_manager.current_blk: + continue text = "Attach " + d + " " + unicode(self.blk_manager.free_devs[d]['size']) + " " + self.blk_manager.free_devs[d]['desc'] action = self.blk_menu.addAction(QIcon(":/add.png"), text) action.setData(QVariant(d))