@@ -522,15 +522,24 @@ async def perform_action(self):
522522class InternalInfoItem (Gtk .MenuItem ):
523523 """Internal info label."""
524524
525- def __init__ (self ):
525+ def __init__ (self , is_preload = False ):
526526 super ().__init__ ()
527527 self .label = Gtk .Label (xalign = 0 )
528- self .label .set_markup (_ ("<b>Internal qube</b>" ))
529- self .set_tooltip_text (
530- "Internal qubes are used by the operating system. Do not modify"
531- " them or run programs in them unless you really "
532- "know what you are doing."
528+ title = "Internal qube"
529+ if is_preload :
530+ title += "\n (preloaded)"
531+ tooltip = (
532+ "Internal qubes are used by the operating system. Do not modify "
533+ "them or run programs in them unless you really know what you "
534+ "are doing."
533535 )
536+ if is_preload :
537+ tooltip += (
538+ "\n \n To configure preloading, see Qubes Global Config and Qube "
539+ "Settings"
540+ )
541+ self .label .set_markup (_ ("<b>" + title + "</b>" ))
542+ self .set_tooltip_text (tooltip )
534543 self .add (self .label )
535544 self .set_sensitive (False )
536545
@@ -625,7 +634,7 @@ def __init__(self, vm, icon_cache):
625634class InternalMenu (Gtk .Menu ):
626635 """Sub-menu for Internal qubes"""
627636
628- def __init__ (self , vm , icon_cache , working_correctly = True ):
637+ def __init__ (self , vm , icon_cache , working_correctly = True , is_preload = False ):
629638 """
630639 :param vm: relevant Internal qube
631640 :param icon_cache: IconCache object
@@ -635,7 +644,7 @@ def __init__(self, vm, icon_cache, working_correctly=True):
635644 super ().__init__ ()
636645 self .vm = vm
637646
638- self .add (InternalInfoItem ())
647+ self .add (InternalInfoItem (is_preload = is_preload ))
639648
640649 logs = [
641650 (
@@ -749,8 +758,12 @@ def __init__(self, vm, app, icon_cache, state=None):
749758
750759 def _set_submenu (self , state ):
751760 if self .vm .features .get ("internal" , False ):
761+ is_preload = getattr (self .vm , "is_preload" , False )
752762 submenu = InternalMenu (
753- self .vm , self .icon_cache , working_correctly = (state == "Running" )
763+ self .vm ,
764+ self .icon_cache ,
765+ working_correctly = (state == "Running" ),
766+ is_preload = is_preload ,
754767 )
755768 elif state == "Running" :
756769 submenu = StartedMenu (self .vm , self .app , self .icon_cache )
@@ -919,6 +932,9 @@ def register_events(self):
919932 "domain-feature-delete:expert-mode" , self .debug_change
920933 )
921934
935+ self .dispatcher .add_handler (
936+ "property-reset:is_preload" , self .update_domain_item
937+ )
922938 self .dispatcher .add_handler (
923939 "domain-feature-set:internal" , self .update_domain_item
924940 )
@@ -1168,6 +1184,9 @@ def update_domain_item(self, vm, event, **kwargs):
11681184
11691185 item .update_state (state )
11701186
1187+ if event == "property-reset:is_preload" :
1188+ item .name .update_preload ()
1189+
11711190 if event == "domain-shutdown" :
11721191 self .handle_domain_shutdown (vm )
11731192 # if the VM was shut down, it is no longer outdated
0 commit comments