@@ -709,6 +709,21 @@ def filterAcceptsRow(self, sourceRow, sourceParent):
709709 if not self .window .show_internal_action .isChecked () and vm .internal :
710710 return False
711711
712+ if not self .window .show_unavailable_pool_action .isChecked ():
713+ pools = {}
714+ app = self .window .qubes_app
715+ persistent_volumes = (volume
716+ for volume in app .domains [vm .name ].volumes .values ()
717+ if volume .source is None and not volume .ephemeral
718+ )
719+ for volume in persistent_volumes :
720+ if not volume .pool in pools :
721+ pools [volume .pool ] = set ((
722+ volume .vid for volume in app .pools [volume .pool ].volumes
723+ ))
724+ if not volume .vid in pools [volume .pool ]:
725+ return False
726+
712727 if self .window .show_user .isChecked () \
713728 and vm .klass in ['AppVM' , 'StandaloneVM' ] \
714729 and not getattr (vm .vm , 'template_for_dispvms' , False ) \
@@ -818,6 +833,11 @@ def __init__(self, qt_app, qubes_app, dispatcher, _parent=None):
818833 self .show_internal_action .setCheckable (True )
819834 self .show_internal_action .toggled .connect (self .invalidate )
820835
836+ self .show_unavailable_pool_action = self .menu_view .addAction (
837+ self .tr ('Show qubes stored on unavailable storage pools' ))
838+ self .show_unavailable_pool_action .setCheckable (True )
839+ self .show_unavailable_pool_action .toggled .connect (self .invalidate )
840+
821841 self .menu_view .addSeparator ()
822842 self .menu_view .addAction (self .action_toolbar )
823843 self .menu_view .addAction (self .action_menubar )
@@ -1027,6 +1047,8 @@ def save_showing(self):
10271047 self .show_standalone .isChecked ())
10281048 self .manager_settings .setValue ('show/internal' ,
10291049 self .show_internal_action .isChecked ())
1050+ self .manager_settings .setValue ('show/unavailable_pool' ,
1051+ self .show_unavailable_pool_action .isChecked ())
10301052 self .manager_settings .setValue ('show/user' ,
10311053 self .show_user .isChecked ())
10321054 self .manager_settings .setValue ('show/all' ,
@@ -1260,6 +1282,8 @@ def load_manager_settings(self):
12601282
12611283 self .show_internal_action .setChecked (self .manager_settings .value (
12621284 'show/internal' , "false" ) == "true" )
1285+ self .show_unavailable_pool_action .setChecked (self .manager_settings .value (
1286+ 'show/unavailable_pool' , "true" ) == "true" )
12631287 # load last window size
12641288 self .resize (self .manager_settings .value ("window_size" ,
12651289 QSize (1100 , 600 )))
0 commit comments