Philipp Hörist pushed to branch master at gajim / gajim

Commits:

3 changed files:

Changes:

  • gajim/common/setting_values.py
    ... ... @@ -46,7 +46,6 @@ class _ACCOUNT_DEFAULT:
    46 46
         'check_for_update',
    
    47 47
         'confirm_close_muc',
    
    48 48
         'confirm_on_window_delete',
    
    49
    -    'confirm_paste_image',
    
    50 49
         'dev_force_bookmark_2',
    
    51 50
         'dev_use_message_label',
    
    52 51
         'developer_modus',
    
    ... ... @@ -184,7 +183,6 @@ class _ACCOUNT_DEFAULT:
    184 183
         'confirm_block': '',
    
    185 184
         'confirm_close_muc': True,
    
    186 185
         'confirm_on_window_delete': True,
    
    187
    -    'confirm_paste_image': True,
    
    188 186
         'dark_theme': 2,
    
    189 187
         'date_timestamp_format': '%x',
    
    190 188
         'dev_force_bookmark_2': False,
    
    ... ... @@ -641,7 +639,6 @@ class WorkspaceSettings(TypedDict):
    641 639
             'confirm_close_muc': _('Ask before closing a group chat tab/window.'),
    
    642 640
             'confirm_on_window_delete': _(
    
    643 641
                 'Ask before quitting when Gajim’s window is closed'),
    
    644
    -        'confirm_paste_image': _('Ask before pasting an image.'),
    
    645 642
             'date_timestamp_format': 'https://docs.python.org/3/library/time.html#time.strftime',  # noqa: E501
    
    646 643
             'dev_force_bookmark_2': _('Force Bookmark 2 usage'),
    
    647 644
             'dev_use_message_label': '',
    

  • gajim/gtk/dialogs.py
    ... ... @@ -335,7 +335,7 @@ def _on_response(self,
    335 335
             super()._on_response(_dialog, response)
    
    336 336
     
    
    337 337
     
    
    338
    -class PastePreviewDialog(ConfirmationCheckDialog):
    
    338
    +class PastePreviewDialog(ConfirmationDialog):
    
    339 339
         def __init__(self,
    
    340 340
                      title: str,
    
    341 341
                      text: str,
    
    ... ... @@ -346,14 +346,13 @@ def __init__(self,
    346 346
                      modal: bool = True,
    
    347 347
                      transient_for: Optional[Gtk.Window] = None
    
    348 348
                      ) -> None:
    
    349
    -        ConfirmationCheckDialog.__init__(self,
    
    350
    -                                         title,
    
    351
    -                                         text,
    
    352
    -                                         sec_text,
    
    353
    -                                         check_text,
    
    354
    -                                         buttons,
    
    355
    -                                         transient_for=transient_for,
    
    356
    -                                         modal=modal)
    
    349
    +        ConfirmationDialog.__init__(self,
    
    350
    +                                    title,
    
    351
    +                                    text,
    
    352
    +                                    sec_text,
    
    353
    +                                    buttons,
    
    354
    +                                    transient_for=transient_for,
    
    355
    +                                    modal=modal)
    
    357 356
     
    
    358 357
             preview = Gtk.Image()
    
    359 358
             preview.set_halign(Gtk.Align.CENTER)
    

  • gajim/gtk/message_actions_box.py
    ... ... @@ -579,10 +579,6 @@ def _on_paste_clipboard(self,
    579 579
             if image is None:
    
    580 580
                 return
    
    581 581
     
    
    582
    -        if not app.settings.get('confirm_paste_image'):
    
    583
    -            self._paste_event_confirmed(True, image)
    
    584
    -            return
    
    585
    -
    
    586 582
             PastePreviewDialog(
    
    587 583
                 _('Paste Image'),
    
    588 584
                 _('You are trying to paste an image'),
    
    ... ... @@ -591,17 +587,14 @@ def _on_paste_clipboard(self,
    591 587
                 _('_Do not ask me again'),
    
    592 588
                 image,
    
    593 589
                 [DialogButton.make('Cancel'),
    
    594
    -                DialogButton.make('Accept',
    
    595
    -                                  text=_('_Paste'),
    
    596
    -                                  callback=self._paste_event_confirmed,
    
    597
    -                                  args=[image])]).show()
    
    590
    +             DialogButton.make('Accept',
    
    591
    +                               text=_('_Paste'),
    
    592
    +                               callback=self._paste_event_confirmed,
    
    593
    +                               args=[image])]).show()
    
    598 594
     
    
    599 595
         def _paste_event_confirmed(self,
    
    600
    -                               is_checked: bool,
    
    601 596
                                    image: GdkPixbuf.Pixbuf
    
    602 597
                                    ) -> None:
    
    603
    -        if is_checked:
    
    604
    -            app.settings.set('confirm_paste_image', False)
    
    605 598
     
    
    606 599
             dir_ = tempfile.gettempdir()
    
    607 600
             path = os.path.join(dir_, f'{uuid.uuid4()}.png')