Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
a16cc047
by lovetox at 2022-01-22T20:27:57+01:00
6 changed files:
- gajim/data/gui/groupchat_control.ui
- gajim/gtk/controls/groupchat.py
- gajim/gtk/groupchat_details.py
- gajim/gtk/groupchat_settings.py
- gajim/gtk/menus.py
- pyrightconfig.json
Changes:
| ... | ... | @@ -1333,9 +1333,6 @@ |
| 1333 | 1333 |
<property name="position">6</property>
|
| 1334 | 1334 |
</packing>
|
| 1335 | 1335 |
</child>
|
| 1336 |
- <child>
|
|
| 1337 |
- <placeholder/>
|
|
| 1338 |
- </child>
|
|
| 1339 | 1336 |
<child>
|
| 1340 | 1337 |
<object class="GtkBox">
|
| 1341 | 1338 |
<property name="visible">True</property>
|
| ... | ... | @@ -1460,7 +1457,7 @@ |
| 1460 | 1457 |
</object>
|
| 1461 | 1458 |
<packing>
|
| 1462 | 1459 |
<property name="name">kick</property>
|
| 1463 |
- <property name="position">8</property>
|
|
| 1460 |
+ <property name="position">7</property>
|
|
| 1464 | 1461 |
</packing>
|
| 1465 | 1462 |
</child>
|
| 1466 | 1463 |
<child>
|
| ... | ... | @@ -1587,7 +1584,7 @@ |
| 1587 | 1584 |
</object>
|
| 1588 | 1585 |
<packing>
|
| 1589 | 1586 |
<property name="name">ban</property>
|
| 1590 |
- <property name="position">9</property>
|
|
| 1587 |
+ <property name="position">8</property>
|
|
| 1591 | 1588 |
</packing>
|
| 1592 | 1589 |
</child>
|
| 1593 | 1590 |
<child>
|
| ... | ... | @@ -1747,7 +1744,7 @@ |
| 1747 | 1744 |
</object>
|
| 1748 | 1745 |
<packing>
|
| 1749 | 1746 |
<property name="name">destroy</property>
|
| 1750 |
- <property name="position">10</property>
|
|
| 1747 |
+ <property name="position">9</property>
|
|
| 1751 | 1748 |
</packing>
|
| 1752 | 1749 |
</child>
|
| 1753 | 1750 |
<child>
|
| ... | ... | @@ -1855,7 +1852,7 @@ |
| 1855 | 1852 |
</object>
|
| 1856 | 1853 |
<packing>
|
| 1857 | 1854 |
<property name="name">rename</property>
|
| 1858 |
- <property name="position">11</property>
|
|
| 1855 |
+ <property name="position">10</property>
|
|
| 1859 | 1856 |
</packing>
|
| 1860 | 1857 |
</child>
|
| 1861 | 1858 |
<child>
|
| ... | ... | @@ -1934,119 +1931,11 @@ |
| 1934 | 1931 |
</object>
|
| 1935 | 1932 |
<packing>
|
| 1936 | 1933 |
<property name="name">invite</property>
|
| 1937 |
- <property name="position">12</property>
|
|
| 1934 |
+ <property name="position">11</property>
|
|
| 1938 | 1935 |
</packing>
|
| 1939 | 1936 |
</child>
|
| 1940 | 1937 |
<child>
|
| 1941 |
- <object class="GtkBox">
|
|
| 1942 |
- <property name="visible">True</property>
|
|
| 1943 |
- <property name="can-focus">False</property>
|
|
| 1944 |
- <property name="orientation">vertical</property>
|
|
| 1945 |
- <child>
|
|
| 1946 |
- <!-- n-columns=1 n-rows=3 -->
|
|
| 1947 |
- <object class="GtkGrid" id="settings_grid">
|
|
| 1948 |
- <property name="name">settings_grid</property>
|
|
| 1949 |
- <property name="visible">True</property>
|
|
| 1950 |
- <property name="can-focus">False</property>
|
|
| 1951 |
- <property name="hexpand">True</property>
|
|
| 1952 |
- <property name="vexpand">True</property>
|
|
| 1953 |
- <property name="row-spacing">12</property>
|
|
| 1954 |
- <child>
|
|
| 1955 |
- <object class="GtkBox">
|
|
| 1956 |
- <property name="visible">True</property>
|
|
| 1957 |
- <property name="can-focus">False</property>
|
|
| 1958 |
- <property name="halign">center</property>
|
|
| 1959 |
- <property name="margin-top">6</property>
|
|
| 1960 |
- <property name="spacing">12</property>
|
|
| 1961 |
- <child>
|
|
| 1962 |
- <object class="GtkButton">
|
|
| 1963 |
- <property name="label" translatable="yes">_Close</property>
|
|
| 1964 |
- <property name="visible">True</property>
|
|
| 1965 |
- <property name="can-focus">True</property>
|
|
| 1966 |
- <property name="receives-default">True</property>
|
|
| 1967 |
- <property name="use-underline">True</property>
|
|
| 1968 |
- <signal name="clicked" handler="_on_page_cancel_clicked" swapped="no"/>
|
|
| 1969 |
- </object>
|
|
| 1970 |
- <packing>
|
|
| 1971 |
- <property name="expand">False</property>
|
|
| 1972 |
- <property name="fill">True</property>
|
|
| 1973 |
- <property name="position">0</property>
|
|
| 1974 |
- </packing>
|
|
| 1975 |
- </child>
|
|
| 1976 |
- </object>
|
|
| 1977 |
- <packing>
|
|
| 1978 |
- <property name="left-attach">0</property>
|
|
| 1979 |
- <property name="top-attach">2</property>
|
|
| 1980 |
- </packing>
|
|
| 1981 |
- </child>
|
|
| 1982 |
- <child>
|
|
| 1983 |
- <object class="GtkLabel">
|
|
| 1984 |
- <property name="visible">True</property>
|
|
| 1985 |
- <property name="can-focus">False</property>
|
|
| 1986 |
- <property name="label" translatable="yes">Settings for This Chat</property>
|
|
| 1987 |
- <style>
|
|
| 1988 |
- <class name="bold16"/>
|
|
| 1989 |
- </style>
|
|
| 1990 |
- </object>
|
|
| 1991 |
- <packing>
|
|
| 1992 |
- <property name="left-attach">0</property>
|
|
| 1993 |
- <property name="top-attach">0</property>
|
|
| 1994 |
- </packing>
|
|
| 1995 |
- </child>
|
|
| 1996 |
- <child>
|
|
| 1997 |
- <object class="GtkScrolledWindow">
|
|
| 1998 |
- <property name="visible">True</property>
|
|
| 1999 |
- <property name="can-focus">True</property>
|
|
| 2000 |
- <property name="hexpand">True</property>
|
|
| 2001 |
- <property name="vexpand">True</property>
|
|
| 2002 |
- <property name="hscrollbar-policy">never</property>
|
|
| 2003 |
- <property name="shadow-type">in</property>
|
|
| 2004 |
- <property name="overlay-scrolling">False</property>
|
|
| 2005 |
- <child>
|
|
| 2006 |
- <object class="GtkViewport">
|
|
| 2007 |
- <property name="visible">True</property>
|
|
| 2008 |
- <property name="can-focus">False</property>
|
|
| 2009 |
- <child>
|
|
| 2010 |
- <object class="GtkBox" id="settings_scrolled_box">
|
|
| 2011 |
- <property name="visible">True</property>
|
|
| 2012 |
- <property name="can-focus">False</property>
|
|
| 2013 |
- <property name="hexpand">True</property>
|
|
| 2014 |
- <property name="vexpand">True</property>
|
|
| 2015 |
- <property name="orientation">vertical</property>
|
|
| 2016 |
- <child>
|
|
| 2017 |
- <placeholder/>
|
|
| 2018 |
- </child>
|
|
| 2019 |
- <style>
|
|
| 2020 |
- <class name="margin-18"/>
|
|
| 2021 |
- </style>
|
|
| 2022 |
- </object>
|
|
| 2023 |
- </child>
|
|
| 2024 |
- </object>
|
|
| 2025 |
- </child>
|
|
| 2026 |
- <style>
|
|
| 2027 |
- <class name="scrolled-no-border"/>
|
|
| 2028 |
- </style>
|
|
| 2029 |
- </object>
|
|
| 2030 |
- <packing>
|
|
| 2031 |
- <property name="left-attach">0</property>
|
|
| 2032 |
- <property name="top-attach">1</property>
|
|
| 2033 |
- </packing>
|
|
| 2034 |
- </child>
|
|
| 2035 |
- <style>
|
|
| 2036 |
- <class name="margin-18"/>
|
|
| 2037 |
- </style>
|
|
| 2038 |
- </object>
|
|
| 2039 |
- <packing>
|
|
| 2040 |
- <property name="expand">False</property>
|
|
| 2041 |
- <property name="fill">True</property>
|
|
| 2042 |
- <property name="position">0</property>
|
|
| 2043 |
- </packing>
|
|
| 2044 |
- </child>
|
|
| 2045 |
- </object>
|
|
| 2046 |
- <packing>
|
|
| 2047 |
- <property name="name">muc-settings</property>
|
|
| 2048 |
- <property name="position">13</property>
|
|
| 2049 |
- </packing>
|
|
| 1938 |
+ <placeholder/>
|
|
| 2050 | 1939 |
</child>
|
| 2051 | 1940 |
<child>
|
| 2052 | 1941 |
<object class="GtkBox">
|
| ... | ... | @@ -2259,7 +2148,7 @@ |
| 2259 | 2148 |
</object>
|
| 2260 | 2149 |
<packing>
|
| 2261 | 2150 |
<property name="name">muc-manage</property>
|
| 2262 |
- <property name="position">14</property>
|
|
| 2151 |
+ <property name="position">13</property>
|
|
| 2263 | 2152 |
</packing>
|
| 2264 | 2153 |
</child>
|
| 2265 | 2154 |
<child>
|
| ... | ... | @@ -2368,7 +2257,7 @@ |
| 2368 | 2257 |
</object>
|
| 2369 | 2258 |
<packing>
|
| 2370 | 2259 |
<property name="name">avatar-selector</property>
|
| 2371 |
- <property name="position">15</property>
|
|
| 2260 |
+ <property name="position">14</property>
|
|
| 2372 | 2261 |
</packing>
|
| 2373 | 2262 |
</child>
|
| 2374 | 2263 |
</object>
|
| ... | ... | @@ -78,7 +78,6 @@ |
| 78 | 78 |
from gajim.gui.avatar_selector import AvatarSelector
|
| 79 | 79 |
from gajim.gui.dataform import DataFormWidget
|
| 80 | 80 |
from gajim.gui.groupchat_inviter import GroupChatInviter
|
| 81 |
-from gajim.gui.groupchat_settings import GroupChatSettings
|
|
| 82 | 81 |
from gajim.gui.groupchat_roster import GroupchatRoster
|
| 83 | 82 |
from gajim.gui.groupchat_state import GroupchatState
|
| 84 | 83 |
from gajim.gui.message_input import MessageInputTextView
|
| ... | ... | @@ -172,9 +171,6 @@ def __init__(self, account: str, jid: JID) -> None: |
| 172 | 171 |
|
| 173 | 172 |
self._subject_text = ''
|
| 174 | 173 |
|
| 175 |
- # Groupchat settings
|
|
| 176 |
- self._groupchat_settings_box: Optional[GroupChatSettings] = None
|
|
| 177 |
- |
|
| 178 | 174 |
# Holds the room’s config form, which is requested when managing
|
| 179 | 175 |
# the room
|
| 180 | 176 |
self._room_config_form = None
|
| ... | ... | @@ -289,7 +285,6 @@ def disco_info(self): |
| 289 | 285 |
def add_actions(self) -> None:
|
| 290 | 286 |
super().add_actions()
|
| 291 | 287 |
actions = [
|
| 292 |
- ('groupchat-settings-', None, self._on_groupchat_settings),
|
|
| 293 | 288 |
('groupchat-manage-', None, self._on_groupchat_manage),
|
| 294 | 289 |
('rename-groupchat-', None, self._on_rename_groupchat),
|
| 295 | 290 |
('change-nickname-', None, self._on_change_nick),
|
| ... | ... | @@ -389,7 +384,6 @@ def update_actions(self, *args: Any) -> None: |
| 389 | 384 |
def remove_actions(self) -> None:
|
| 390 | 385 |
super().remove_actions()
|
| 391 | 386 |
actions = [
|
| 392 |
- 'groupchat-settings-',
|
|
| 393 | 387 |
'groupchat-manage-',
|
| 394 | 388 |
'rename-groupchat-',
|
| 395 | 389 |
'change-nickname-',
|
| ... | ... | @@ -447,20 +441,6 @@ def _on_details(self, |
| 447 | 441 |
) -> None:
|
| 448 | 442 |
open_window('GroupchatDetails', contact=self.contact)
|
| 449 | 443 |
|
| 450 |
- def _on_groupchat_settings(self,
|
|
| 451 |
- _action: Gio.SimpleAction,
|
|
| 452 |
- _param: Optional[GLib.Variant]
|
|
| 453 |
- ) -> None:
|
|
| 454 |
- if self._groupchat_settings_box is not None:
|
|
| 455 |
- self.xml.settings_scrolled_box.remove(self._groupchat_settings_box)
|
|
| 456 |
- self._groupchat_settings_box.destroy()
|
|
| 457 |
- |
|
| 458 |
- self._groupchat_settings_box = GroupChatSettings(
|
|
| 459 |
- self.account, self.contact.jid)
|
|
| 460 |
- self._groupchat_settings_box.show_all()
|
|
| 461 |
- self.xml.settings_scrolled_box.add(self._groupchat_settings_box)
|
|
| 462 |
- self._show_page('muc-settings')
|
|
| 463 |
- |
|
| 464 | 444 |
def _on_groupchat_manage(self,
|
| 465 | 445 |
_action: Gio.SimpleAction,
|
| 466 | 446 |
_param: Optional[GLib.Variant]
|
| ... | ... | @@ -22,6 +22,7 @@ |
| 22 | 22 |
from gajim.common.modules.contacts import GroupchatContact
|
| 23 | 23 |
|
| 24 | 24 |
from .groupchat_info import GroupChatInfoScrolled
|
| 25 |
+from .groupchat_settings import GroupChatSettings
|
|
| 25 | 26 |
from .sidebar_switcher import SideBarSwitcher
|
| 26 | 27 |
|
| 27 | 28 |
|
| ... | ... | @@ -47,6 +48,7 @@ def __init__(self, contact: GroupchatContact) -> None: |
| 47 | 48 |
main_box.add(self._stack)
|
| 48 | 49 |
|
| 49 | 50 |
self._add_groupchat_info()
|
| 51 |
+ self._add_groupchat_settings()
|
|
| 50 | 52 |
|
| 51 | 53 |
self._side_bar_switcher.set_stack(self._stack)
|
| 52 | 54 |
|
| ... | ... | @@ -67,6 +69,15 @@ def _add_groupchat_info(self) -> None: |
| 67 | 69 |
|
| 68 | 70 |
self._stack.add_titled(groupchat_info, 'info', _('Information'))
|
| 69 | 71 |
|
| 72 |
+ def _add_groupchat_settings(self) -> None:
|
|
| 73 |
+ scrolled_window = Gtk.ScrolledWindow()
|
|
| 74 |
+ scrolled_window.set_policy(Gtk.PolicyType.NEVER,
|
|
| 75 |
+ Gtk.PolicyType.AUTOMATIC)
|
|
| 76 |
+ |
|
| 77 |
+ settings_box = GroupChatSettings(self.account, self._contact.jid)
|
|
| 78 |
+ scrolled_window.add(settings_box)
|
|
| 79 |
+ self._stack.add_titled(scrolled_window, 'settings', _('Settings'))
|
|
| 80 |
+ |
|
| 70 | 81 |
def _on_key_press(self,
|
| 71 | 82 |
_widget: GroupchatDetails,
|
| 72 | 83 |
event: Gdk.EventKey) -> None:
|
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 |
|
| 27 | 27 |
class GroupChatSettings(SettingsBox):
|
| 28 | 28 |
def __init__(self, account: str, jid: JID) -> None:
|
| 29 |
- SettingsBox.__init__(self, account, jid)
|
|
| 29 |
+ SettingsBox.__init__(self, account, str(jid))
|
|
| 30 | 30 |
|
| 31 | 31 |
self.get_style_context().add_class('settings-border')
|
| 32 | 32 |
self.set_selection_mode(Gtk.SelectionMode.NONE)
|
| ... | ... | @@ -151,7 +151,6 @@ def get_groupchat_menu(control_id: str, account: str, jid: JID) -> Gio.Menu: |
| 151 | 151 |
|
| 152 | 152 |
menulist: MenuItemListT = [
|
| 153 | 153 |
(_('Details'), f'win.groupchat-details-{control_id}', None),
|
| 154 |
- (_('Settings…'), f'win.groupchat-settings-{control_id}', None),
|
|
| 155 | 154 |
(_('Manage…'), f'win.groupchat-manage-{control_id}', None),
|
| 156 | 155 |
(_('Rename Chat…'), f'win.rename-groupchat-{control_id}', None),
|
| 157 | 156 |
(_('Change Nickname…'), f'win.change-nickname-{control_id}', None),
|
| ... | ... | @@ -58,6 +58,7 @@ |
| 58 | 58 |
"gajim/gtk/groupchat_invitation.py",
|
| 59 | 59 |
"gajim/gtk/groupchat_inviter.py",
|
| 60 | 60 |
"gajim/gtk/groupchat_nick.py",
|
| 61 |
+ "gajim/gtk/groupchat_settings.py",
|
|
| 61 | 62 |
"gajim/gtk/groupchat_state.py",
|
| 62 | 63 |
"gajim/gtk/main_stack.py",
|
| 63 | 64 |
"gajim/gtk/manage_sounds.py",
|