File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -33,27 +33,24 @@ export const CommandWidget = GObject.registerClass({
33
33
_init ( params ) {
34
34
super . _init ( params ) ;
35
35
36
- insert_settings_actions ( this , this . settings , [
36
+ const actions = insert_settings_actions ( this , this . settings , [
37
37
'command' ,
38
38
'preserve-working-directory' ,
39
39
] ) ;
40
40
41
41
bind_widget ( this . settings , 'custom-command' , this . custom_command_entry ) ;
42
42
43
- const handler = this . settings . connect (
44
- 'changed::command' ,
45
- this . enable_custom_command_entry . bind ( this )
43
+ actions . lookup_action ( 'command' ) . bind_property_full (
44
+ 'state' ,
45
+ this . custom_command_entry . parent ,
46
+ 'sensitive' ,
47
+ GObject . BindingFlags . SYNC_CREATE ,
48
+ ( binding , state ) => [ true , state ?. unpack ( ) === 'custom-command' ] ,
49
+ null
46
50
) ;
47
- this . connect ( 'destroy' , ( ) => this . settings . disconnect ( handler ) ) ;
48
- this . enable_custom_command_entry ( ) ;
49
51
}
50
52
51
53
get title ( ) {
52
54
return this . gettext_context . gettext ( 'Command' ) ;
53
55
}
54
-
55
- enable_custom_command_entry ( ) {
56
- this . custom_command_entry . parent . sensitive =
57
- this . settings . get_string ( 'command' ) === 'custom-command' ;
58
- }
59
56
} ) ;
You can’t perform that action at this time.
0 commit comments