9
9
from core .utils .widgets .power import PowerOperations
10
10
from core .utils .utilities import PopupWidget
11
11
from core .utils .widgets .animation_manager import AnimationManager
12
+ import logging
12
13
13
14
class HomeWidget (BaseWidget ):
14
15
validation_schema = VALIDATION_SCHEMA
@@ -95,9 +96,10 @@ def process_content(content):
95
96
96
97
97
98
def create_menu_action (self ,path ):
98
- expanded_path = os .path .expanduser (path )
99
- return lambda :os .startfile (expanded_path )
100
-
99
+ path = os .path .expanduser (path )
100
+ return lambda :os .startfile (path )if os .path .exists (path )else logging .error (f"The system cannot find the file specified: '{ path } '" )
101
+
102
+
101
103
def _create_menu (self ):
102
104
self ._menu = PopupWidget (self ,self ._blur ,self ._round_corners ,self ._round_corners_type ,self ._border_color )
103
105
self ._menu .setProperty ('class' ,'home-menu' )
@@ -119,6 +121,7 @@ def _create_menu(self):
119
121
120
122
self ._add_menu_item (main_layout ,self ._menu_labels ['system' ],
121
123
lambda :os .startfile ("ms-settings:" ))
124
+
122
125
self ._add_menu_item (main_layout ,self ._menu_labels ['task_manager' ],
123
126
lambda :subprocess .Popen ("taskmgr" ,shell = True ,creationflags = subprocess .CREATE_NO_WINDOW ))
124
127