Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
ba1f88a0
by Daniel Brötzmann at 2019-04-27T12:04:19Z
2 changed files:
Changes:
| 1 | 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 | 2 |
<!-- Generated with glade 3.22.1 -->
|
| 3 | 3 |
<interface>
|
| 4 |
- <requires lib="gtk+" version="3.12"/>
|
|
| 4 |
+ <requires lib="gtk+" version="3.20"/>
|
|
| 5 | 5 |
<object class="GtkListStore" id="blocking_store">
|
| 6 | 6 |
<columns>
|
| 7 | 7 |
<!-- column-name jid -->
|
| ... | ... | @@ -13,10 +13,7 @@ |
| 13 | 13 |
<property name="height_request">300</property>
|
| 14 | 14 |
<property name="visible">True</property>
|
| 15 | 15 |
<property name="can_focus">False</property>
|
| 16 |
- <property name="margin_left">18</property>
|
|
| 17 |
- <property name="margin_right">18</property>
|
|
| 18 |
- <property name="margin_top">18</property>
|
|
| 19 |
- <property name="margin_bottom">18</property>
|
|
| 16 |
+ <property name="border_width">18</property>
|
|
| 20 | 17 |
<property name="row_spacing">5</property>
|
| 21 | 18 |
<property name="column_spacing">10</property>
|
| 22 | 19 |
<child>
|
| ... | ... | @@ -83,6 +80,9 @@ |
| 83 | 80 |
<property name="halign">end</property>
|
| 84 | 81 |
<property name="always_show_image">True</property>
|
| 85 | 82 |
<signal name="clicked" handler="_on_save" swapped="no"/>
|
| 83 |
+ <style>
|
|
| 84 |
+ <class name="suggested-action"/>
|
|
| 85 |
+ </style>
|
|
| 86 | 86 |
</object>
|
| 87 | 87 |
<packing>
|
| 88 | 88 |
<property name="left_attach">1</property>
|
| ... | ... | @@ -64,8 +64,8 @@ from gajim.common.dbus import location |
| 64 | 64 |
from gajim.common import ged
|
| 65 | 65 |
from gajim.message_window import MessageWindowMgr
|
| 66 | 66 |
|
| 67 |
-from gajim.gtk.dialogs import ConfirmationDialogCheck
|
|
| 68 | 67 |
from gajim.gtk.dialogs import ConfirmationDialog
|
| 68 |
+from gajim.gtk.dialogs import ConfirmationDialogCheck
|
|
| 69 | 69 |
from gajim.gtk.dialogs import ErrorDialog
|
| 70 | 70 |
from gajim.gtk.dialogs import InputDialog
|
| 71 | 71 |
from gajim.gtk.dialogs import WarningDialog
|
| ... | ... | @@ -2789,6 +2789,15 @@ class RosterWindow: |
| 2789 | 2789 |
con = app.connections[acct]
|
| 2790 | 2790 |
con.get_module('PrivacyLists').block_contacts(l_, msg)
|
| 2791 | 2791 |
for contact in l_:
|
| 2792 |
+ ctrl = app.interface.msg_win_mgr.get_control(
|
|
| 2793 |
+ contact.jid, acct)
|
|
| 2794 |
+ if ctrl:
|
|
| 2795 |
+ ctrl.parent_win.remove_tab(
|
|
| 2796 |
+ ctrl, ctrl.parent_win.CLOSE_COMMAND, force=True)
|
|
| 2797 |
+ if contact.show == 'not in roster':
|
|
| 2798 |
+ self.remove_contact(contact.jid, acct, force=True,
|
|
| 2799 |
+ backend=True)
|
|
| 2800 |
+ return
|
|
| 2792 | 2801 |
self.draw_contact(contact.jid, acct)
|
| 2793 | 2802 |
else:
|
| 2794 | 2803 |
for acct in accounts:
|
| ... | ... | @@ -2801,7 +2810,7 @@ class RosterWindow: |
| 2801 | 2810 |
|
| 2802 | 2811 |
def _block_it(is_checked=None):
|
| 2803 | 2812 |
if is_checked is not None: # dialog has been shown
|
| 2804 |
- if is_checked: # user does not want to be asked again
|
|
| 2813 |
+ if is_checked: # user does not want to be asked again
|
|
| 2805 | 2814 |
app.config.set('confirm_block', 'no')
|
| 2806 | 2815 |
else:
|
| 2807 | 2816 |
app.config.set('confirm_block', 'yes')
|
| ... | ... | @@ -2811,12 +2820,17 @@ class RosterWindow: |
| 2811 | 2820 |
if confirm_block == 'no':
|
| 2812 | 2821 |
_block_it()
|
| 2813 | 2822 |
return
|
| 2814 |
- pritext = _('You are about to block a contact. Are you sure you want'
|
|
| 2815 |
- ' to continue?')
|
|
| 2816 |
- sectext = _('This contact will see you offline and you will not '
|
|
| 2817 |
- 'receive messages it sends you.')
|
|
| 2818 |
- ConfirmationDialogCheck(pritext, sectext,
|
|
| 2819 |
- _('_Do not ask me again'), on_response_ok=_block_it)
|
|
| 2823 |
+ NewConfirmationCheckDialog(_('Block Contact'),
|
|
| 2824 |
+ _('Really block this contact?'),
|
|
| 2825 |
+ _('This contact will see you offline and '
|
|
| 2826 |
+ 'you will not receive messages sent to '
|
|
| 2827 |
+ 'you by this contact.'),
|
|
| 2828 |
+ _('_Do not ask me again'),
|
|
| 2829 |
+ [DialogButton.make('Cancel'),
|
|
| 2830 |
+ DialogButton.make('Remove',
|
|
| 2831 |
+ text=_('Block Contact'),
|
|
| 2832 |
+ callback=_block_it)],
|
|
| 2833 |
+ modal=False).show()
|
|
| 2820 | 2834 |
|
| 2821 | 2835 |
def on_unblock(self, widget, list_, group=None):
|
| 2822 | 2836 |
"""
|