Hide partitions from "block attach" submenu (#623)
Still allow to detach partition if attached manually.
This commit is contained in:
		
							parent
							
								
									e8a0461bac
								
							
						
					
					
						commit
						b650a3a276
					
				@ -1654,6 +1654,9 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
 | 
				
			|||||||
                for d in self.blk_manager.free_devs:
 | 
					                for d in self.blk_manager.free_devs:
 | 
				
			||||||
                    if d.startswith(vm.name):
 | 
					                    if d.startswith(vm.name):
 | 
				
			||||||
                        continue
 | 
					                        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']
 | 
					                    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 = self.blk_menu.addAction(QIcon(":/add.png"), text)
 | 
				
			||||||
                    action.setData(QVariant(d))
 | 
					                    action.setData(QVariant(d))
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user