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


Commits:
a5ef6fec by Philipp Hörist at 2025-05-10T11:24:50+02:00
Fix menu text

- - - - -
83ac747b by Philipp Hörist at 2025-05-10T11:25:08+02:00
imprv dialog

- - - - -


3 changed files:

- gajim/data/gui/groupchat_blocks.ui
- gajim/gtk/groupchat_blocks.py
- gajim/gtk/menus.py


Changes:

=====================================
gajim/data/gui/groupchat_blocks.ui
=====================================
@@ -17,14 +17,13 @@
         </child>
         <child>
           <object class="GtkButton" id="remove_button">
-            <property name="action-name">win.export-to-csv</property>
             <property name="tooltip-text" translatable="yes">Unblock</property>
             <child>
               <object class="GtkBox">
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkImage">
-                    <property 
name="icon-name">lucide-file-down-symbolic</property>
+                    <property 
name="icon-name">feather-trash-symbolic</property>
                   </object>
                 </child>
                 <child>
@@ -32,6 +31,9 @@
                     <property name="label" 
translatable="yes">Unblock</property>
                   </object>
                 </child>
+                <style>
+                  <class name="destructive-action"/>
+                </style>
               </object>
             </child>
           </object>


=====================================
gajim/gtk/groupchat_blocks.py
=====================================
@@ -78,9 +78,6 @@ def __init__(self, client: Client, contact: GroupchatContact) 
-> None:
 
         self._connect(self._ui.search_entry, "search-changed", 
self._on_search_changed)
         self._connect(self._ui.remove_button, "clicked", 
self._on_remove_button_clicked)
-        self._connect(
-            self._selection_model, "selection-changed", 
self._on_selection_changed
-        )
 
     def _cleanup(self, *args: Any) -> None:
         self._client.disconnect_all_from_obj(self)
@@ -117,13 +114,6 @@ def remove(self, item: BlockListItem) -> None:
                 self._model.remove(index)
                 return
 
-    def _on_selection_changed(
-        self, selection_model: Gtk.SingleSelection, *args: Any
-    ) -> None:
-        print("chan")
-        items = self._get_selected_items()
-        self._ui.remove_button.set_sensitive(bool(items))
-
     def _get_selected_items(self) -> list[BlockListItem]:
         bitset = self._selection_model.get_selection()
         valid, iter_, value = Gtk.BitsetIter.init_first(bitset)
@@ -152,12 +142,14 @@ def _on_remove_button_clicked(self, _button: Gtk.Button) 
-> None:
         if not items:
             return
 
-        # occupant_ids = [item.id for item in items]
+        occupant_ids: list[str] = []
         for item in items:
+            occupant_ids.append(item.id)
             self.remove(item)
 
-        # self._client.get_module("MucBlocking").set_block_occupants(
-        # self._contact.jid, occupant_ids, False)
+        self._client.get_module("MucBlocking").set_block_occupants(
+            self._contact.jid, occupant_ids, False
+        )
 
 
 class BlockListItem(GObject.Object):


=====================================
gajim/gtk/menus.py
=====================================
@@ -712,13 +712,9 @@ def get_groupchat_participant_menu(
         )
 
     if contact.is_blocked:
-        general_items.append(
-            (_("Unblock Contact…"), "win.muc-user-unblock", occupant_param)
-        )
+        general_items.append((_("Unblock"), "win.muc-user-unblock", 
occupant_param))
     else:
-        general_items.append(
-            (_("Block Contact…"), "win.muc-user-block", occupant_param)
-        )
+        general_items.append((_("Block…"), "win.muc-user-block", 
occupant_param))
 
     real_contact = contact.get_real_contact()
     if real_contact is not None and can_add_to_roster(real_contact):



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/7cdfd4a5bf096786a50cf979bd093a2e725dcdcf...83ac747b12d8072c7278463429c20fcc20d7e12d

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/7cdfd4a5bf096786a50cf979bd093a2e725dcdcf...83ac747b12d8072c7278463429c20fcc20d7e12d
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to