Daniel Brötzmann pushed to branch newcontrol at gajim / gajim
Commits:
-
3c6ace6b
by wurstsalat at 2022-06-27T23:55:51+02:00
9 changed files:
- gajim/data/gui/chat_control.ui
- gajim/data/gui/groupchat_control.ui
- gajim/gtk/builder.pyi
- gajim/gtk/chat_banner.py
- gajim/gtk/control_stack.py
- gajim/gtk/controls/base.py
- gajim/gtk/controls/chat.py
- gajim/gtk/controls/groupchat.py
- gajim/gtk/controls/private.py
Changes:
| ... | ... | @@ -95,144 +95,7 @@ |
| 95 | 95 | <property name="can-focus">False</property>
|
| 96 | 96 | <property name="orientation">vertical</property>
|
| 97 | 97 | <child>
|
| 98 | - <object class="GtkEventBox" id="banner_eventbox">
|
|
| 99 | - <property name="name">ChatControl-BannerEventBox</property>
|
|
| 100 | - <property name="can-focus">False</property>
|
|
| 101 | - <property name="no-show-all">True</property>
|
|
| 102 | - <child>
|
|
| 103 | - <object class="GtkBox">
|
|
| 104 | - <property name="visible">True</property>
|
|
| 105 | - <property name="can-focus">False</property>
|
|
| 106 | - <property name="spacing">6</property>
|
|
| 107 | - <child>
|
|
| 108 | - <object class="GtkEventBox" id="avatar_eventbox">
|
|
| 109 | - <property name="visible">True</property>
|
|
| 110 | - <property name="can-focus">False</property>
|
|
| 111 | - <property name="visible-window">False</property>
|
|
| 112 | - <child>
|
|
| 113 | - <object class="GtkImage" id="avatar_image">
|
|
| 114 | - <property name="width-request">48</property>
|
|
| 115 | - <property name="height-request">48</property>
|
|
| 116 | - <property name="visible">True</property>
|
|
| 117 | - <property name="can-focus">False</property>
|
|
| 118 | - </object>
|
|
| 119 | - </child>
|
|
| 120 | - </object>
|
|
| 121 | - <packing>
|
|
| 122 | - <property name="expand">False</property>
|
|
| 123 | - <property name="fill">False</property>
|
|
| 124 | - <property name="position">0</property>
|
|
| 125 | - </packing>
|
|
| 126 | - </child>
|
|
| 127 | - <child>
|
|
| 128 | - <!-- n-columns=3 n-rows=3 -->
|
|
| 129 | - <object class="GtkGrid">
|
|
| 130 | - <property name="visible">True</property>
|
|
| 131 | - <property name="can-focus">False</property>
|
|
| 132 | - <property name="valign">center</property>
|
|
| 133 | - <property name="hexpand">True</property>
|
|
| 134 | - <property name="row-spacing">3</property>
|
|
| 135 | - <property name="column-spacing">3</property>
|
|
| 136 | - <child>
|
|
| 137 | - <object class="GtkLabel" id="banner_name_label">
|
|
| 138 | - <property name="name">ChatControl-BannerNameLabel</property>
|
|
| 139 | - <property name="visible">True</property>
|
|
| 140 | - <property name="can-focus">False</property>
|
|
| 141 | - <property name="halign">start</property>
|
|
| 142 | - <property name="hexpand">True</property>
|
|
| 143 | - <property name="label">Contact name</property>
|
|
| 144 | - <property name="ellipsize">end</property>
|
|
| 145 | - <property name="xalign">0</property>
|
|
| 146 | - <style>
|
|
| 147 | - <class name="large-header"/>
|
|
| 148 | - </style>
|
|
| 149 | - </object>
|
|
| 150 | - <packing>
|
|
| 151 | - <property name="left-attach">0</property>
|
|
| 152 | - <property name="top-attach">0</property>
|
|
| 153 | - <property name="width">2</property>
|
|
| 154 | - </packing>
|
|
| 155 | - </child>
|
|
| 156 | - <child>
|
|
| 157 | - <object class="GtkLabel" id="banner_label">
|
|
| 158 | - <property name="name">ChatControl-BannerLabel</property>
|
|
| 159 | - <property name="visible">True</property>
|
|
| 160 | - <property name="can-focus">False</property>
|
|
| 161 | - <property name="halign">start</property>
|
|
| 162 | - <property name="hexpand">True</property>
|
|
| 163 | - <property name="label">label</property>
|
|
| 164 | - <property name="selectable">True</property>
|
|
| 165 | - <property name="ellipsize">end</property>
|
|
| 166 | - <property name="xalign">0</property>
|
|
| 167 | - </object>
|
|
| 168 | - <packing>
|
|
| 169 | - <property name="left-attach">1</property>
|
|
| 170 | - <property name="top-attach">1</property>
|
|
| 171 | - </packing>
|
|
| 172 | - </child>
|
|
| 173 | - <child>
|
|
| 174 | - <object class="GtkImage" id="phone_image">
|
|
| 175 | - <property name="can-focus">False</property>
|
|
| 176 | - <property name="no-show-all">True</property>
|
|
| 177 | - <property name="tooltip-text" translatable="yes">The last message was written on a mobile client</property>
|
|
| 178 | - <property name="halign">start</property>
|
|
| 179 | - <property name="margin-end">4</property>
|
|
| 180 | - <property name="icon-name">phone-apple-iphone-symbolic</property>
|
|
| 181 | - </object>
|
|
| 182 | - <packing>
|
|
| 183 | - <property name="left-attach">0</property>
|
|
| 184 | - <property name="top-attach">1</property>
|
|
| 185 | - </packing>
|
|
| 186 | - </child>
|
|
| 187 | - <child>
|
|
| 188 | - <object class="GtkBox" id="account_badge_box">
|
|
| 189 | - <property name="can-focus">False</property>
|
|
| 190 | - <property name="no-show-all">True</property>
|
|
| 191 | - <property name="halign">end</property>
|
|
| 192 | - <property name="valign">center</property>
|
|
| 193 | - <property name="orientation">vertical</property>
|
|
| 194 | - <child>
|
|
| 195 | - <placeholder/>
|
|
| 196 | - </child>
|
|
| 197 | - </object>
|
|
| 198 | - <packing>
|
|
| 199 | - <property name="left-attach">2</property>
|
|
| 200 | - <property name="top-attach">0</property>
|
|
| 201 | - </packing>
|
|
| 202 | - </child>
|
|
| 203 | - <child>
|
|
| 204 | - <placeholder/>
|
|
| 205 | - </child>
|
|
| 206 | - <child>
|
|
| 207 | - <placeholder/>
|
|
| 208 | - </child>
|
|
| 209 | - <child>
|
|
| 210 | - <placeholder/>
|
|
| 211 | - </child>
|
|
| 212 | - <child>
|
|
| 213 | - <placeholder/>
|
|
| 214 | - </child>
|
|
| 215 | - </object>
|
|
| 216 | - <packing>
|
|
| 217 | - <property name="expand">False</property>
|
|
| 218 | - <property name="fill">True</property>
|
|
| 219 | - <property name="position">1</property>
|
|
| 220 | - </packing>
|
|
| 221 | - </child>
|
|
| 222 | - <child>
|
|
| 223 | - <placeholder/>
|
|
| 224 | - </child>
|
|
| 225 | - </object>
|
|
| 226 | - </child>
|
|
| 227 | - <style>
|
|
| 228 | - <class name="gajim-banner"/>
|
|
| 229 | - </style>
|
|
| 230 | - </object>
|
|
| 231 | - <packing>
|
|
| 232 | - <property name="expand">False</property>
|
|
| 233 | - <property name="fill">True</property>
|
|
| 234 | - <property name="position">0</property>
|
|
| 235 | - </packing>
|
|
| 98 | + <placeholder/>
|
|
| 236 | 99 | </child>
|
| 237 | 100 | <child>
|
| 238 | 101 | <object class="GtkSeparator">
|
| ... | ... | @@ -105,181 +105,7 @@ |
| 105 | 105 | <property name="hexpand">True</property>
|
| 106 | 106 | <property name="orientation">vertical</property>
|
| 107 | 107 | <child>
|
| 108 | - <object class="GtkEventBox" id="banner_eventbox">
|
|
| 109 | - <property name="name">GroupChatControl-BannerEventBox</property>
|
|
| 110 | - <property name="can-focus">False</property>
|
|
| 111 | - <property name="no-show-all">True</property>
|
|
| 112 | - <child>
|
|
| 113 | - <object class="GtkBox">
|
|
| 114 | - <property name="visible">True</property>
|
|
| 115 | - <property name="can-focus">False</property>
|
|
| 116 | - <property name="spacing">6</property>
|
|
| 117 | - <child>
|
|
| 118 | - <object class="GtkImage" id="avatar_image">
|
|
| 119 | - <property name="width-request">48</property>
|
|
| 120 | - <property name="height-request">48</property>
|
|
| 121 | - <property name="visible">True</property>
|
|
| 122 | - <property name="can-focus">False</property>
|
|
| 123 | - </object>
|
|
| 124 | - <packing>
|
|
| 125 | - <property name="expand">False</property>
|
|
| 126 | - <property name="fill">True</property>
|
|
| 127 | - <property name="position">0</property>
|
|
| 128 | - </packing>
|
|
| 129 | - </child>
|
|
| 130 | - <child>
|
|
| 131 | - <object class="GtkLabel" id="banner_name_label">
|
|
| 132 | - <property name="name">GroupChatControl-BannerNameLabel</property>
|
|
| 133 | - <property name="visible">True</property>
|
|
| 134 | - <property name="can-focus">False</property>
|
|
| 135 | - <property name="hexpand">True</property>
|
|
| 136 | - <property name="label">Group Chat Name</property>
|
|
| 137 | - <property name="selectable">True</property>
|
|
| 138 | - <property name="ellipsize">end</property>
|
|
| 139 | - <property name="single-line-mode">True</property>
|
|
| 140 | - <property name="xalign">0</property>
|
|
| 141 | - <style>
|
|
| 142 | - <class name="large-header"/>
|
|
| 143 | - </style>
|
|
| 144 | - </object>
|
|
| 145 | - <packing>
|
|
| 146 | - <property name="expand">False</property>
|
|
| 147 | - <property name="fill">True</property>
|
|
| 148 | - <property name="position">1</property>
|
|
| 149 | - </packing>
|
|
| 150 | - </child>
|
|
| 151 | - <child>
|
|
| 152 | - <object class="GtkBox" id="visitor_box">
|
|
| 153 | - <property name="can-focus">False</property>
|
|
| 154 | - <property name="no-show-all">True</property>
|
|
| 155 | - <property name="spacing">12</property>
|
|
| 156 | - <child>
|
|
| 157 | - <object class="GtkLabel">
|
|
| 158 | - <property name="visible">True</property>
|
|
| 159 | - <property name="can-focus">False</property>
|
|
| 160 | - <property name="label" translatable="yes">You are a visitor</property>
|
|
| 161 | - </object>
|
|
| 162 | - <packing>
|
|
| 163 | - <property name="expand">False</property>
|
|
| 164 | - <property name="fill">True</property>
|
|
| 165 | - <property name="position">0</property>
|
|
| 166 | - </packing>
|
|
| 167 | - </child>
|
|
| 168 | - <child>
|
|
| 169 | - <object class="GtkMenuButton" id="visitor_menu_button">
|
|
| 170 | - <property name="visible">True</property>
|
|
| 171 | - <property name="can-focus">True</property>
|
|
| 172 | - <property name="focus-on-click">False</property>
|
|
| 173 | - <property name="receives-default">True</property>
|
|
| 174 | - <property name="tooltip-text" translatable="yes">What does this mean?</property>
|
|
| 175 | - <property name="valign">center</property>
|
|
| 176 | - <property name="popover">visitor_popover</property>
|
|
| 177 | - <child>
|
|
| 178 | - <object class="GtkImage">
|
|
| 179 | - <property name="visible">True</property>
|
|
| 180 | - <property name="can-focus">False</property>
|
|
| 181 | - <property name="icon-name">dialog-information-symbolic</property>
|
|
| 182 | - </object>
|
|
| 183 | - </child>
|
|
| 184 | - <style>
|
|
| 185 | - <class name="suggested-action"/>
|
|
| 186 | - </style>
|
|
| 187 | - </object>
|
|
| 188 | - <packing>
|
|
| 189 | - <property name="expand">False</property>
|
|
| 190 | - <property name="fill">True</property>
|
|
| 191 | - <property name="position">1</property>
|
|
| 192 | - </packing>
|
|
| 193 | - </child>
|
|
| 194 | - </object>
|
|
| 195 | - <packing>
|
|
| 196 | - <property name="expand">False</property>
|
|
| 197 | - <property name="fill">True</property>
|
|
| 198 | - <property name="position">2</property>
|
|
| 199 | - </packing>
|
|
| 200 | - </child>
|
|
| 201 | - <child>
|
|
| 202 | - <object class="GtkBox" id="account_badge_box">
|
|
| 203 | - <property name="can-focus">False</property>
|
|
| 204 | - <property name="no-show-all">True</property>
|
|
| 205 | - <property name="halign">end</property>
|
|
| 206 | - <property name="valign">center</property>
|
|
| 207 | - <property name="margin-end">6</property>
|
|
| 208 | - <property name="hexpand">True</property>
|
|
| 209 | - <property name="orientation">vertical</property>
|
|
| 210 | - <child>
|
|
| 211 | - <placeholder/>
|
|
| 212 | - </child>
|
|
| 213 | - </object>
|
|
| 214 | - <packing>
|
|
| 215 | - <property name="expand">False</property>
|
|
| 216 | - <property name="fill">True</property>
|
|
| 217 | - <property name="position">3</property>
|
|
| 218 | - </packing>
|
|
| 219 | - </child>
|
|
| 220 | - <child>
|
|
| 221 | - <object class="GtkButton" id="toggle_roster_button">
|
|
| 222 | - <property name="visible">True</property>
|
|
| 223 | - <property name="can-focus">True</property>
|
|
| 224 | - <property name="receives-default">True</property>
|
|
| 225 | - <property name="tooltip-text" translatable="yes">Toggle participants list</property>
|
|
| 226 | - <property name="valign">center</property>
|
|
| 227 | - <signal name="clicked" handler="_show_roster" swapped="no"/>
|
|
| 228 | - <child>
|
|
| 229 | - <object class="GtkBox">
|
|
| 230 | - <property name="visible">True</property>
|
|
| 231 | - <property name="can-focus">False</property>
|
|
| 232 | - <property name="spacing">3</property>
|
|
| 233 | - <child>
|
|
| 234 | - <object class="GtkImage">
|
|
| 235 | - <property name="visible">True</property>
|
|
| 236 | - <property name="can-focus">False</property>
|
|
| 237 | - <property name="icon-name">system-users-symbolic</property>
|
|
| 238 | - </object>
|
|
| 239 | - <packing>
|
|
| 240 | - <property name="expand">False</property>
|
|
| 241 | - <property name="fill">True</property>
|
|
| 242 | - <property name="position">0</property>
|
|
| 243 | - </packing>
|
|
| 244 | - </child>
|
|
| 245 | - <child>
|
|
| 246 | - <object class="GtkImage" id="toggle_roster_image">
|
|
| 247 | - <property name="visible">True</property>
|
|
| 248 | - <property name="can-focus">False</property>
|
|
| 249 | - <property name="icon-name">go-previous-symbolic</property>
|
|
| 250 | - </object>
|
|
| 251 | - <packing>
|
|
| 252 | - <property name="expand">False</property>
|
|
| 253 | - <property name="fill">True</property>
|
|
| 254 | - <property name="position">1</property>
|
|
| 255 | - </packing>
|
|
| 256 | - </child>
|
|
| 257 | - <style>
|
|
| 258 | - <class name="dim-label"/>
|
|
| 259 | - </style>
|
|
| 260 | - </object>
|
|
| 261 | - </child>
|
|
| 262 | - <style>
|
|
| 263 | - <class name="flat"/>
|
|
| 264 | - </style>
|
|
| 265 | - </object>
|
|
| 266 | - <packing>
|
|
| 267 | - <property name="expand">False</property>
|
|
| 268 | - <property name="fill">True</property>
|
|
| 269 | - <property name="position">4</property>
|
|
| 270 | - </packing>
|
|
| 271 | - </child>
|
|
| 272 | - </object>
|
|
| 273 | - </child>
|
|
| 274 | - <style>
|
|
| 275 | - <class name="gajim-banner"/>
|
|
| 276 | - </style>
|
|
| 277 | - </object>
|
|
| 278 | - <packing>
|
|
| 279 | - <property name="expand">False</property>
|
|
| 280 | - <property name="fill">True</property>
|
|
| 281 | - <property name="position">0</property>
|
|
| 282 | - </packing>
|
|
| 108 | + <placeholder/>
|
|
| 283 | 109 | </child>
|
| 284 | 110 | <child>
|
| 285 | 111 | <object class="GtkSeparator">
|
| ... | ... | @@ -1612,12 +1438,6 @@ |
| 1612 | 1438 | <property name="position">9</property>
|
| 1613 | 1439 | </packing>
|
| 1614 | 1440 | </child>
|
| 1615 | - <child>
|
|
| 1616 | - <placeholder/>
|
|
| 1617 | - </child>
|
|
| 1618 | - <child>
|
|
| 1619 | - <placeholder/>
|
|
| 1620 | - </child>
|
|
| 1621 | 1441 | </object>
|
| 1622 | 1442 | <packing>
|
| 1623 | 1443 | <property name="index">-1</property>
|
| ... | ... | @@ -1631,70 +1451,4 @@ |
| 1631 | 1451 | </packing>
|
| 1632 | 1452 | </child>
|
| 1633 | 1453 | </object>
|
| 1634 | - <object class="GtkPopover" id="visitor_popover">
|
|
| 1635 | - <property name="can-focus">False</property>
|
|
| 1636 | - <property name="relative-to">visitor_menu_button</property>
|
|
| 1637 | - <property name="position">bottom</property>
|
|
| 1638 | - <child>
|
|
| 1639 | - <object class="GtkBox">
|
|
| 1640 | - <property name="visible">True</property>
|
|
| 1641 | - <property name="can-focus">False</property>
|
|
| 1642 | - <property name="orientation">vertical</property>
|
|
| 1643 | - <property name="spacing">6</property>
|
|
| 1644 | - <child>
|
|
| 1645 | - <object class="GtkLabel">
|
|
| 1646 | - <property name="visible">True</property>
|
|
| 1647 | - <property name="can-focus">False</property>
|
|
| 1648 | - <property name="label" translatable="yes">You are a visitor</property>
|
|
| 1649 | - <style>
|
|
| 1650 | - <class name="bold"/>
|
|
| 1651 | - </style>
|
|
| 1652 | - </object>
|
|
| 1653 | - <packing>
|
|
| 1654 | - <property name="expand">False</property>
|
|
| 1655 | - <property name="fill">True</property>
|
|
| 1656 | - <property name="position">0</property>
|
|
| 1657 | - </packing>
|
|
| 1658 | - </child>
|
|
| 1659 | - <child>
|
|
| 1660 | - <object class="GtkLabel">
|
|
| 1661 | - <property name="visible">True</property>
|
|
| 1662 | - <property name="can-focus">False</property>
|
|
| 1663 | - <property name="label" translatable="yes">In order to write messages in this chat, you need to request voice first.
|
|
| 1664 | -A moderator will process your request.</property>
|
|
| 1665 | - <property name="wrap">True</property>
|
|
| 1666 | - <property name="max-width-chars">30</property>
|
|
| 1667 | - </object>
|
|
| 1668 | - <packing>
|
|
| 1669 | - <property name="expand">False</property>
|
|
| 1670 | - <property name="fill">True</property>
|
|
| 1671 | - <property name="position">1</property>
|
|
| 1672 | - </packing>
|
|
| 1673 | - </child>
|
|
| 1674 | - <child>
|
|
| 1675 | - <object class="GtkButton">
|
|
| 1676 | - <property name="label" translatable="yes">_Request</property>
|
|
| 1677 | - <property name="visible">True</property>
|
|
| 1678 | - <property name="can-focus">True</property>
|
|
| 1679 | - <property name="receives-default">True</property>
|
|
| 1680 | - <property name="halign">center</property>
|
|
| 1681 | - <property name="use-underline">True</property>
|
|
| 1682 | - <signal name="clicked" handler="_on_request_voice_clicked" swapped="no"/>
|
|
| 1683 | - <style>
|
|
| 1684 | - <class name="suggested-action"/>
|
|
| 1685 | - </style>
|
|
| 1686 | - </object>
|
|
| 1687 | - <packing>
|
|
| 1688 | - <property name="expand">False</property>
|
|
| 1689 | - <property name="fill">True</property>
|
|
| 1690 | - <property name="pack-type">end</property>
|
|
| 1691 | - <property name="position">2</property>
|
|
| 1692 | - </packing>
|
|
| 1693 | - </child>
|
|
| 1694 | - <style>
|
|
| 1695 | - <class name="padding-6"/>
|
|
| 1696 | - </style>
|
|
| 1697 | - </object>
|
|
| 1698 | - </child>
|
|
| 1699 | - </object>
|
|
| 1700 | 1454 | </interface> |
| ... | ... | @@ -217,13 +217,6 @@ class ChatControlBuilder(Builder): |
| 217 | 217 | chat_control_hbox: Gtk.Box
|
| 218 | 218 | overlay: Gtk.Overlay
|
| 219 | 219 | textview_box: Gtk.Box
|
| 220 | - banner_eventbox: Gtk.EventBox
|
|
| 221 | - avatar_eventbox: Gtk.EventBox
|
|
| 222 | - avatar_image: Gtk.Image
|
|
| 223 | - banner_name_label: Gtk.Label
|
|
| 224 | - banner_label: Gtk.Label
|
|
| 225 | - phone_image: Gtk.Image
|
|
| 226 | - account_badge_box: Gtk.Box
|
|
| 227 | 220 | conv_view_overlay: Gtk.Overlay
|
| 228 | 221 | hbox: Gtk.Box
|
| 229 | 222 | emoticons_button: Gtk.MenuButton
|
| ... | ... | @@ -418,14 +411,6 @@ class GroupchatControlBuilder(Builder): |
| 418 | 411 | stack: Gtk.Stack
|
| 419 | 412 | groupchat_control_vbox: Gtk.Box
|
| 420 | 413 | textview_box: Gtk.Box
|
| 421 | - banner_eventbox: Gtk.EventBox
|
|
| 422 | - avatar_image: Gtk.Image
|
|
| 423 | - banner_name_label: Gtk.Label
|
|
| 424 | - visitor_box: Gtk.Box
|
|
| 425 | - visitor_menu_button: Gtk.MenuButton
|
|
| 426 | - account_badge_box: Gtk.Box
|
|
| 427 | - toggle_roster_button: Gtk.Button
|
|
| 428 | - toggle_roster_image: Gtk.Image
|
|
| 429 | 414 | conv_view_overlay: Gtk.Overlay
|
| 430 | 415 | hbox: Gtk.Box
|
| 431 | 416 | quick_invite_button: Gtk.Button
|
| ... | ... | @@ -463,7 +448,6 @@ class GroupchatControlBuilder(Builder): |
| 463 | 448 | destroy_reason_entry: Gtk.Entry
|
| 464 | 449 | invite_grid: Gtk.Grid
|
| 465 | 450 | invite_button: Gtk.Button
|
| 466 | - visitor_popover: Gtk.Popover
|
|
| 467 | 451 | |
| 468 | 452 | |
| 469 | 453 | class GroupchatCreationBuilder(Builder):
|
| ... | ... | @@ -61,7 +61,9 @@ def __init__(self) -> None: |
| 61 | 61 | self.register_events([
|
| 62 | 62 | ('message-received', ged.GUI1, self._on_message_received),
|
| 63 | 63 | ('bookmarks-received', ged.GUI1, self._on_bookmarks_received),
|
| 64 | - ('muc-disco-update', ged.GUI1, self._on_muc_disco_update)
|
|
| 64 | + ('muc-disco-update', ged.GUI1, self._on_muc_disco_update),
|
|
| 65 | + ('account-enabled', ged.GUI2, self._on_account_changed),
|
|
| 66 | + ('account-disabled', ged.GUI2, self._on_account_changed)
|
|
| 65 | 67 | ])
|
| 66 | 68 | |
| 67 | 69 | app.settings.connect_signal(
|
| ... | ... | @@ -200,6 +202,9 @@ def _on_muc_disco_update(self, event: MucDiscoUpdate) -> None: |
| 200 | 202 | |
| 201 | 203 | self._update_content()
|
| 202 | 204 | |
| 205 | + def _on_account_changed(self, *args: Any) -> None:
|
|
| 206 | + self._update_account_badge()
|
|
| 207 | + |
|
| 203 | 208 | def _on_message_received(self, event: MessageReceived) -> None:
|
| 204 | 209 | if not event.msgtxt or self._contact is None:
|
| 205 | 210 | return
|
| ... | ... | @@ -24,7 +24,6 @@ |
| 24 | 24 | from nbxmpp import JID
|
| 25 | 25 | |
| 26 | 26 | from gajim.common import app
|
| 27 | -from gajim.common import ged
|
|
| 28 | 27 | from gajim.common.i18n import _
|
| 29 | 28 | |
| 30 | 29 | from .controls.chat import ChatControl
|
| ... | ... | @@ -32,26 +31,18 @@ |
| 32 | 31 | from .controls.private import PrivateChatControl
|
| 33 | 32 | |
| 34 | 33 | from .types import ControlT
|
| 35 | -from .util import EventHelper
|
|
| 36 | 34 | |
| 37 | 35 | log = logging.getLogger('gajim.gui.controlstack')
|
| 38 | 36 | |
| 39 | 37 | |
| 40 | -class ControlStack(Gtk.Stack, EventHelper):
|
|
| 38 | +class ControlStack(Gtk.Stack):
|
|
| 41 | 39 | def __init__(self):
|
| 42 | 40 | Gtk.Stack.__init__(self)
|
| 43 | - EventHelper.__init__(self)
|
|
| 44 | - |
|
| 45 | 41 | self.set_vexpand(True)
|
| 46 | 42 | self.set_hexpand(True)
|
| 47 | 43 | |
| 48 | 44 | self.add_named(ChatPlaceholderBox(), 'empty')
|
| 49 | 45 | |
| 50 | - self.register_events([
|
|
| 51 | - ('account-enabled', ged.GUI2, self._on_account_changed),
|
|
| 52 | - ('account-disabled', ged.GUI2, self._on_account_changed),
|
|
| 53 | - ])
|
|
| 54 | - |
|
| 55 | 46 | self.show_all()
|
| 56 | 47 | self._controls: dict[tuple[str, JID], ControlT] = {}
|
| 57 | 48 | self._current_control = None
|
| ... | ... | @@ -148,10 +139,6 @@ def remove_chats_for_account(self, account: str) -> None: |
| 148 | 139 | continue
|
| 149 | 140 | self.remove_chat(account, jid)
|
| 150 | 141 | |
| 151 | - def _on_account_changed(self, *args: Any) -> None:
|
|
| 152 | - for control in self._controls.values():
|
|
| 153 | - control.update_account_badge()
|
|
| 154 | - |
|
| 155 | 142 | |
| 156 | 143 | class ChatPlaceholderBox(Gtk.Box):
|
| 157 | 144 | def __init__(self):
|
| ... | ... | @@ -71,7 +71,6 @@ |
| 71 | 71 | from gajim.gui.builder import get_builder
|
| 72 | 72 | from gajim.gui.util import set_urgency_hint
|
| 73 | 73 | from gajim.gui.util import scroll_to_end
|
| 74 | -from gajim.gui.util import AccountBadge
|
|
| 75 | 74 | from gajim.gui.const import ControlType
|
| 76 | 75 | from gajim.gui.const import TARGET_TYPE_URI_LIST
|
| 77 | 76 | |
| ... | ... | @@ -142,11 +141,6 @@ def __init__(self, widget_name: str, account: str, jid: JID) -> None: |
| 142 | 141 | # self.xml.connect_signals(self)
|
| 143 | 142 | self.widget: Gtk.Box = self.xml.get_object(f'{widget_name}_hbox')
|
| 144 | 143 | |
| 145 | - self._account_badge = AccountBadge(self.account)
|
|
| 146 | - self.xml.account_badge_box.add(self._account_badge)
|
|
| 147 | - show_account_badge = len(app.settings.get_active_accounts()) > 1
|
|
| 148 | - self.xml.account_badge_box.set_visible(show_account_badge)
|
|
| 149 | - |
|
| 150 | 144 | # Drag and drop
|
| 151 | 145 | self.xml.overlay.add_overlay(self.xml.drop_area)
|
| 152 | 146 | self.xml.drop_area.hide()
|
| ... | ... | @@ -985,10 +979,6 @@ def has_focus(self) -> bool: |
| 985 | 979 | return True
|
| 986 | 980 | return False
|
| 987 | 981 | |
| 988 | - def update_account_badge(self) -> None:
|
|
| 989 | - show = len(app.settings.get_active_accounts()) > 1
|
|
| 990 | - self.xml.account_badge_box.set_visible(show)
|
|
| 991 | - |
|
| 992 | 982 | |
| 993 | 983 | class ScrolledWindow(Gtk.ScrolledWindow):
|
| 994 | 984 | def __init__(self, *args: Any, **kwargs: Any) -> None:
|
| ... | ... | @@ -45,7 +45,6 @@ |
| 45 | 45 | from gajim.common.client import Client
|
| 46 | 46 | from gajim.common.i18n import _
|
| 47 | 47 | from gajim.common.helpers import AdditionalDataDict
|
| 48 | -from gajim.common.const import AvatarSize
|
|
| 49 | 48 | from gajim.common.const import SimpleClientState
|
| 50 | 49 | from gajim.common.const import KindConstant
|
| 51 | 50 | from gajim.common.modules.contacts import BareContact
|
| ... | ... | @@ -57,7 +56,6 @@ |
| 57 | 56 | from gajim.command_system.implementation.hosts import ChatCommands
|
| 58 | 57 | from gajim.command_system.framework import CommandHost
|
| 59 | 58 | |
| 60 | - |
|
| 61 | 59 | log = logging.getLogger('gajim.gui.controls.chat')
|
| 62 | 60 | |
| 63 | 61 |
| ... | ... | @@ -46,10 +46,8 @@ |
| 46 | 46 | |
| 47 | 47 | from gajim.common import app
|
| 48 | 48 | from gajim.common import events
|
| 49 | -from gajim.common import ged
|
|
| 50 | 49 | from gajim.common import helpers
|
| 51 | 50 | from gajim.common.client import Client
|
| 52 | -from gajim.common.const import AvatarSize
|
|
| 53 | 51 | from gajim.common.const import SimpleClientState
|
| 54 | 52 | from gajim.common.helpers import AdditionalDataDict
|
| 55 | 53 | from gajim.common.helpers import event_filter
|
| ... | ... | @@ -74,9 +72,6 @@ |
| 74 | 72 | from gajim.gui.groupchat_state import GroupchatState
|
| 75 | 73 | from gajim.gui.util import open_window
|
| 76 | 74 | |
| 77 | -from ..menus import get_encryption_menu
|
|
| 78 | -from ..menus import get_groupchat_menu
|
|
| 79 | - |
|
| 80 | 75 | log = logging.getLogger('gajim.gui.controls.groupchat')
|
| 81 | 76 | |
| 82 | 77 | |
| ... | ... | @@ -133,10 +128,6 @@ def __init__(self, account: str, jid: JID) -> None: |
| 133 | 128 | 'hide_groupchat_occupants_list',
|
| 134 | 129 | self.xml.roster_revealer,
|
| 135 | 130 | 'set_reveal_child')
|
| 136 | - self._set_toggle_roster_button_icon(show_roster)
|
|
| 137 | - app.settings.connect_signal(
|
|
| 138 | - 'hide_groupchat_occupants_list',
|
|
| 139 | - self._set_toggle_roster_button_icon)
|
|
| 140 | 131 | self.roster.connect('row-activated', self._on_roster_row_activated)
|
| 141 | 132 | |
| 142 | 133 | self.add_actions()
|
| ... | ... | @@ -146,8 +137,6 @@ def __init__(self, account: str, jid: JID) -> None: |
| 146 | 137 | # if True, the room has mentioned us
|
| 147 | 138 | self.attention_flag: bool = False
|
| 148 | 139 | |
| 149 | - self._update_avatar()
|
|
| 150 | - |
|
| 151 | 140 | # Holds CaptchaRequest widget
|
| 152 | 141 | self._captcha_request: Optional[DataFormWidget] = None
|
| 153 | 142 | |
| ... | ... | @@ -182,7 +171,6 @@ def __init__(self, account: str, jid: JID) -> None: |
| 182 | 171 | def _connect_contact_signals(self) -> None:
|
| 183 | 172 | self.contact.multi_connect({
|
| 184 | 173 | 'state-changed': self._on_muc_state_changed,
|
| 185 | - 'avatar-update': self._on_avatar_update,
|
|
| 186 | 174 | 'user-joined': self._on_user_joined,
|
| 187 | 175 | 'user-left': self._on_user_left,
|
| 188 | 176 | 'user-affiliation-changed': self._on_user_affiliation_changed,
|
| ... | ... | @@ -476,17 +464,8 @@ def _on_change_affiliation(self, |
| 476 | 464 | self.room_jid,
|
| 477 | 465 | {jid: {'affiliation': affiliation}})
|
| 478 | 466 | |
| 479 | - def _set_toggle_roster_button_icon(self,
|
|
| 480 | - show_roster: bool,
|
|
| 481 | - *args: Any) -> None:
|
|
| 482 | - icon = 'go-next-symbolic' if show_roster else 'go-previous-symbolic'
|
|
| 483 | - self.xml.toggle_roster_image.set_from_icon_name(
|
|
| 484 | - icon, Gtk.IconSize.BUTTON)
|
|
| 485 | - |
|
| 486 | 467 | def _show_roster(self, *args: Any) -> None:
|
| 487 | 468 | show = not self.xml.roster_revealer.get_reveal_child()
|
| 488 | - self._set_toggle_roster_button_icon(show)
|
|
| 489 | - |
|
| 490 | 469 | transition = Gtk.RevealerTransitionType.SLIDE_RIGHT
|
| 491 | 470 | if show:
|
| 492 | 471 | transition = Gtk.RevealerTransitionType.SLIDE_LEFT
|
| ... | ... | @@ -510,17 +489,6 @@ def _on_roster_row_activated(self, |
| 510 | 489 | contact = self.contact.get_resource(nick)
|
| 511 | 490 | app.window.add_private_chat(self.account, contact.jid, select=True)
|
| 512 | 491 | |
| 513 | - def _on_avatar_update(self,
|
|
| 514 | - _contact: GroupchatContact,
|
|
| 515 | - _signal_name: str
|
|
| 516 | - ) -> None:
|
|
| 517 | - self._update_avatar()
|
|
| 518 | - |
|
| 519 | - def _update_avatar(self) -> None:
|
|
| 520 | - surface = self.contact.get_avatar(
|
|
| 521 | - AvatarSize.CHAT, app.window.get_scale_factor())
|
|
| 522 | - self.xml.avatar_image.set_from_surface(surface)
|
|
| 523 | - |
|
| 524 | 492 | def _on_room_voice_request(self,
|
| 525 | 493 | _contact: GroupchatContact,
|
| 526 | 494 | _signal_name: str,
|
| ... | ... | @@ -701,11 +669,8 @@ def _nec_ping(self, event: events.ApplicationEvent) -> None: |
| 701 | 669 | self.add_info_message(event.error)
|
| 702 | 670 | |
| 703 | 671 | def _set_control_active(self) -> None:
|
| 704 | - contact = self.contact.get_self()
|
|
| 705 | - if contact.role.is_visitor:
|
|
| 706 | - self.xml.visitor_box.show()
|
|
| 707 | - else:
|
|
| 708 | - self.set_message_input_state(True)
|
|
| 672 | + self_contact = self.contact.get_self()
|
|
| 673 | + self.set_message_input_state(not self_contact.role.is_visitor)
|
|
| 709 | 674 | |
| 710 | 675 | self.roster.initial_draw()
|
| 711 | 676 | self.conversation_view.update_avatars()
|
| ... | ... | @@ -714,7 +679,6 @@ def _set_control_active(self) -> None: |
| 714 | 679 | |
| 715 | 680 | def _set_control_inactive(self) -> None:
|
| 716 | 681 | self.set_message_input_state(False)
|
| 717 | - self.xml.visitor_box.hide()
|
|
| 718 | 682 | |
| 719 | 683 | self.roster.enable_sort(False)
|
| 720 | 684 | self.roster.clear()
|
| ... | ... | @@ -858,10 +822,6 @@ def _on_user_role_changed(self, |
| 858 | 822 | actor = '' if actor is None else _(' by {actor}').format(actor=actor)
|
| 859 | 823 | |
| 860 | 824 | if properties.is_muc_self_presence:
|
| 861 | - if user_contact.role.is_visitor:
|
|
| 862 | - self.xml.visitor_box.show()
|
|
| 863 | - else:
|
|
| 864 | - self.xml.visitor_box.hide()
|
|
| 865 | 825 | self.set_message_input_state(not user_contact.role.is_visitor)
|
| 866 | 826 | message = _('** Your Role has been set to '
|
| 867 | 827 | '{role}{actor}{reason}').format(role=role,
|
| ... | ... | @@ -24,8 +24,6 @@ |
| 24 | 24 | # You should have received a copy of the GNU General Public License
|
| 25 | 25 | # along with Gajim. If not, see <http://www.gnu.org/licenses/>.
|
| 26 | 26 | |
| 27 | -from typing import Any
|
|
| 28 | - |
|
| 29 | 27 | from nbxmpp import JID
|
| 30 | 28 | from nbxmpp.structs import MessageProperties
|
| 31 | 29 | from nbxmpp.structs import PresenceProperties
|