Actually implement allow_cloning

This commit is contained in:
Kovid Goyal 2022-04-16 22:40:05 +05:30
parent b45fedd794
commit 38e1d32065
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1015,11 +1015,15 @@ class Window:
if not msg: if not msg:
if self.current_clone_data: if self.current_clone_data:
cdata, self.current_clone_data = self.current_clone_data, '' cdata, self.current_clone_data = self.current_clone_data, ''
ac = get_options().allow_cloning
if ac == 'ask':
get_boss().confirm(_( get_boss().confirm(_(
'A program running in this window wants to clone it into another window.' 'A program running in this window wants to clone it into another window.'
' Allow it do so, once?'), ' Allow it do so, once?'),
partial(self.handle_remote_clone_confirmation, cdata), window=self, partial(self.handle_remote_clone_confirmation, cdata), window=self,
) )
elif ac == 'yes':
self.handle_remote_clone_confirmation(cdata, True)
self.current_clone_data = '' self.current_clone_data = ''
return return
num, rest = msg.split(':', 1) num, rest = msg.split(':', 1)