@@ -293,14 +293,6 @@ async def perform_action(self):
293
293
class RunTerminalItem (VMActionMenuItem ):
294
294
"""Run Terminal menu Item. When activated runs a terminal emulator."""
295
295
296
- __gsignals__ = {
297
- "set-terminal-user-root" : (
298
- GObject .SignalFlags .RUN_FIRST ,
299
- GObject .TYPE_NONE ,
300
- (bool ,),
301
- ),
302
- }
303
-
304
296
def __init__ (self , vm , icon_cache , as_root = False ):
305
297
label = Gtk .Label (label = RunTerminalItem .dynamic_label (as_root ))
306
298
super ().__init__ (
@@ -311,17 +303,16 @@ def __init__(self, vm, icon_cache, as_root=False):
311
303
)
312
304
self .as_root = as_root
313
305
self .label = label
314
- self .connect ("set-terminal-user-root" , self .set_as_root )
315
306
316
307
@staticmethod
317
308
def dynamic_label (as_root ):
318
309
if as_root :
319
310
return _ ("Run Root Terminal" )
320
311
return _ ("Run Terminal" )
321
312
322
- def set_as_root (self , _item , as_root ):
313
+ def set_as_root (self , as_root ):
323
314
self .as_root = as_root
324
- self .label .set_text (RunTerminalItem .dynamic_label (as_root ))
315
+ self .label .set_text (RunTerminalItem .dynamic_label (self . as_root ))
325
316
326
317
async def perform_action (self ):
327
318
service_args = {}
@@ -1117,10 +1108,8 @@ def terminal_as_root(self, as_root):
1117
1108
continue
1118
1109
1119
1110
def do_emit (child ):
1120
- try :
1121
- child .emit ("set-terminal-user-root" , as_root )
1122
- except Exception : # pylint: disable=broad-except
1123
- pass
1111
+ if isinstance (child , RunTerminalItem ):
1112
+ child .set_as_root (as_root )
1124
1113
1125
1114
submenu .foreach (do_emit )
1126
1115
0 commit comments