Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
-
298a6900
by wurstsalat at 2022-01-23T19:06:13+01:00
-
e797ae75
by wurstsalat at 2022-01-23T19:25:36+01:00
3 changed files:
Changes:
| ... | ... | @@ -1748,112 +1748,7 @@ |
| 1748 | 1748 |
</packing>
|
| 1749 | 1749 |
</child>
|
| 1750 | 1750 |
<child>
|
| 1751 |
- <object class="GtkBox">
|
|
| 1752 |
- <property name="visible">True</property>
|
|
| 1753 |
- <property name="can-focus">False</property>
|
|
| 1754 |
- <property name="orientation">vertical</property>
|
|
| 1755 |
- <child>
|
|
| 1756 |
- <!-- n-columns=1 n-rows=3 -->
|
|
| 1757 |
- <object class="GtkGrid">
|
|
| 1758 |
- <property name="visible">True</property>
|
|
| 1759 |
- <property name="can-focus">False</property>
|
|
| 1760 |
- <property name="halign">center</property>
|
|
| 1761 |
- <property name="valign">center</property>
|
|
| 1762 |
- <property name="hexpand">True</property>
|
|
| 1763 |
- <property name="vexpand">True</property>
|
|
| 1764 |
- <property name="row-spacing">12</property>
|
|
| 1765 |
- <child>
|
|
| 1766 |
- <object class="GtkLabel">
|
|
| 1767 |
- <property name="visible">True</property>
|
|
| 1768 |
- <property name="can-focus">False</property>
|
|
| 1769 |
- <property name="label" translatable="yes">Rename This Chat</property>
|
|
| 1770 |
- <property name="xalign">0</property>
|
|
| 1771 |
- <style>
|
|
| 1772 |
- <class name="bold16"/>
|
|
| 1773 |
- </style>
|
|
| 1774 |
- </object>
|
|
| 1775 |
- <packing>
|
|
| 1776 |
- <property name="left-attach">0</property>
|
|
| 1777 |
- <property name="top-attach">0</property>
|
|
| 1778 |
- </packing>
|
|
| 1779 |
- </child>
|
|
| 1780 |
- <child>
|
|
| 1781 |
- <object class="GtkEntry" id="name_entry">
|
|
| 1782 |
- <property name="width-request">200</property>
|
|
| 1783 |
- <property name="visible">True</property>
|
|
| 1784 |
- <property name="can-focus">True</property>
|
|
| 1785 |
- <property name="activates-default">True</property>
|
|
| 1786 |
- <property name="caps-lock-warning">False</property>
|
|
| 1787 |
- <property name="secondary-icon-name">face-smile-symbolic</property>
|
|
| 1788 |
- <property name="secondary-icon-tooltip-text" translatable="yes">Insert Emoji</property>
|
|
| 1789 |
- <property name="secondary-icon-tooltip-markup" translatable="yes">Insert Emoji</property>
|
|
| 1790 |
- </object>
|
|
| 1791 |
- <packing>
|
|
| 1792 |
- <property name="left-attach">0</property>
|
|
| 1793 |
- <property name="top-attach">1</property>
|
|
| 1794 |
- </packing>
|
|
| 1795 |
- </child>
|
|
| 1796 |
- <child>
|
|
| 1797 |
- <object class="GtkBox">
|
|
| 1798 |
- <property name="visible">True</property>
|
|
| 1799 |
- <property name="can-focus">False</property>
|
|
| 1800 |
- <property name="homogeneous">True</property>
|
|
| 1801 |
- <child>
|
|
| 1802 |
- <object class="GtkButton">
|
|
| 1803 |
- <property name="label" translatable="yes">_Cancel</property>
|
|
| 1804 |
- <property name="visible">True</property>
|
|
| 1805 |
- <property name="can-focus">True</property>
|
|
| 1806 |
- <property name="receives-default">True</property>
|
|
| 1807 |
- <property name="halign">start</property>
|
|
| 1808 |
- <property name="valign">start</property>
|
|
| 1809 |
- <property name="use-underline">True</property>
|
|
| 1810 |
- <signal name="clicked" handler="_on_page_cancel_clicked" swapped="no"/>
|
|
| 1811 |
- </object>
|
|
| 1812 |
- <packing>
|
|
| 1813 |
- <property name="expand">False</property>
|
|
| 1814 |
- <property name="fill">True</property>
|
|
| 1815 |
- <property name="position">0</property>
|
|
| 1816 |
- </packing>
|
|
| 1817 |
- </child>
|
|
| 1818 |
- <child>
|
|
| 1819 |
- <object class="GtkButton" id="rename_button">
|
|
| 1820 |
- <property name="label" translatable="yes">_Rename</property>
|
|
| 1821 |
- <property name="visible">True</property>
|
|
| 1822 |
- <property name="can-focus">True</property>
|
|
| 1823 |
- <property name="can-default">True</property>
|
|
| 1824 |
- <property name="receives-default">True</property>
|
|
| 1825 |
- <property name="halign">end</property>
|
|
| 1826 |
- <property name="valign">start</property>
|
|
| 1827 |
- <property name="use-underline">True</property>
|
|
| 1828 |
- <signal name="clicked" handler="_on_rename_clicked" swapped="no"/>
|
|
| 1829 |
- <style>
|
|
| 1830 |
- <class name="suggested-action"/>
|
|
| 1831 |
- </style>
|
|
| 1832 |
- </object>
|
|
| 1833 |
- <packing>
|
|
| 1834 |
- <property name="expand">False</property>
|
|
| 1835 |
- <property name="fill">True</property>
|
|
| 1836 |
- <property name="position">1</property>
|
|
| 1837 |
- </packing>
|
|
| 1838 |
- </child>
|
|
| 1839 |
- </object>
|
|
| 1840 |
- <packing>
|
|
| 1841 |
- <property name="left-attach">0</property>
|
|
| 1842 |
- <property name="top-attach">2</property>
|
|
| 1843 |
- </packing>
|
|
| 1844 |
- </child>
|
|
| 1845 |
- </object>
|
|
| 1846 |
- <packing>
|
|
| 1847 |
- <property name="expand">False</property>
|
|
| 1848 |
- <property name="fill">True</property>
|
|
| 1849 |
- <property name="position">0</property>
|
|
| 1850 |
- </packing>
|
|
| 1851 |
- </child>
|
|
| 1852 |
- </object>
|
|
| 1853 |
- <packing>
|
|
| 1854 |
- <property name="name">rename</property>
|
|
| 1855 |
- <property name="position">10</property>
|
|
| 1856 |
- </packing>
|
|
| 1751 |
+ <placeholder/>
|
|
| 1857 | 1752 |
</child>
|
| 1858 | 1753 |
<child>
|
| 1859 | 1754 |
<object class="GtkBox">
|
| ... | ... | @@ -1934,9 +1829,6 @@ |
| 1934 | 1829 |
<property name="position">11</property>
|
| 1935 | 1830 |
</packing>
|
| 1936 | 1831 |
</child>
|
| 1937 |
- <child>
|
|
| 1938 |
- <placeholder/>
|
|
| 1939 |
- </child>
|
|
| 1940 | 1832 |
<child>
|
| 1941 | 1833 |
<object class="GtkBox">
|
| 1942 | 1834 |
<property name="visible">True</property>
|
| ... | ... | @@ -2148,7 +2040,7 @@ |
| 2148 | 2040 |
</object>
|
| 2149 | 2041 |
<packing>
|
| 2150 | 2042 |
<property name="name">muc-manage</property>
|
| 2151 |
- <property name="position">13</property>
|
|
| 2043 |
+ <property name="position">12</property>
|
|
| 2152 | 2044 |
</packing>
|
| 2153 | 2045 |
</child>
|
| 2154 | 2046 |
<child>
|
| ... | ... | @@ -2257,7 +2149,7 @@ |
| 2257 | 2149 |
</object>
|
| 2258 | 2150 |
<packing>
|
| 2259 | 2151 |
<property name="name">avatar-selector</property>
|
| 2260 |
- <property name="position">14</property>
|
|
| 2152 |
+ <property name="position">13</property>
|
|
| 2261 | 2153 |
</packing>
|
| 2262 | 2154 |
</child>
|
| 2263 | 2155 |
</object>
|
| ... | ... | @@ -286,7 +286,6 @@ def add_actions(self) -> None: |
| 286 | 286 |
super().add_actions()
|
| 287 | 287 |
actions = [
|
| 288 | 288 |
('groupchat-manage-', None, self._on_groupchat_manage),
|
| 289 |
- ('rename-groupchat-', None, self._on_rename_groupchat),
|
|
| 290 | 289 |
('change-nickname-', None, self._on_change_nick),
|
| 291 | 290 |
('destroy-', None, self._on_destroy_room),
|
| 292 | 291 |
('configure-', None, self._on_configure_room),
|
| ... | ... | @@ -385,7 +384,6 @@ def remove_actions(self) -> None: |
| 385 | 384 |
super().remove_actions()
|
| 386 | 385 |
actions = [
|
| 387 | 386 |
'groupchat-manage-',
|
| 388 |
- 'rename-groupchat-',
|
|
| 389 | 387 |
'change-nickname-',
|
| 390 | 388 |
'destroy-',
|
| 391 | 389 |
'configure-',
|
| ... | ... | @@ -1578,8 +1576,6 @@ def focus(self) -> None: |
| 1578 | 1576 |
self.xml.password_entry.grab_focus_without_selecting()
|
| 1579 | 1577 |
elif page_name == 'nickname':
|
| 1580 | 1578 |
self.xml.nickname_entry.grab_focus_without_selecting()
|
| 1581 |
- elif page_name == 'rename':
|
|
| 1582 |
- self.xml.name_entry.grab_focus_without_selecting()
|
|
| 1583 | 1579 |
elif page_name == 'subject':
|
| 1584 | 1580 |
self.xml.subject_textview.grab_focus()
|
| 1585 | 1581 |
elif page_name == 'captcha':
|
| ... | ... | @@ -1645,23 +1641,6 @@ def _on_nickname_change_clicked(self, _button: Gtk.Button) -> None: |
| 1645 | 1641 |
self._client.get_module('MUC').change_nick(self.room_jid, new_nick)
|
| 1646 | 1642 |
self._show_page('groupchat')
|
| 1647 | 1643 |
|
| 1648 |
- def _on_rename_groupchat(self,
|
|
| 1649 |
- _action: Gio.SimpleAction,
|
|
| 1650 |
- _param: Optional[GLib.Variant]
|
|
| 1651 |
- ) -> None:
|
|
| 1652 |
- if self._get_current_page() != 'groupchat':
|
|
| 1653 |
- return
|
|
| 1654 |
- self.xml.name_entry.set_text(self.contact.name)
|
|
| 1655 |
- self.xml.name_entry.grab_focus()
|
|
| 1656 |
- self.xml.rename_button.grab_default()
|
|
| 1657 |
- self._show_page('rename')
|
|
| 1658 |
- |
|
| 1659 |
- def _on_rename_clicked(self, _button: Gtk.Button) -> None:
|
|
| 1660 |
- new_name = self.xml.name_entry.get_text()
|
|
| 1661 |
- self._client.get_module('Bookmarks').modify(
|
|
| 1662 |
- self.room_jid, name=new_name)
|
|
| 1663 |
- self._show_page('groupchat')
|
|
| 1664 |
- |
|
| 1665 | 1644 |
def _on_manage_save_clicked(self, _button: Gtk.Button) -> None:
|
| 1666 | 1645 |
if self._room_config_form is not None:
|
| 1667 | 1646 |
name = self.xml.muc_name_entry.get_text()
|
| ... | ... | @@ -64,35 +64,36 @@ def get_singlechat_menu(control_id: str, |
| 64 | 64 |
is_self_contact = jid.bare == client.get_own_jid().bare
|
| 65 | 65 |
contact = client.get_module('Contacts').get_contact(jid)
|
| 66 | 66 |
|
| 67 |
- singlechat_menu: list[tuple[str, Any]] = [
|
|
| 67 |
+ self_contact_menu: list[tuple[str, Any]] = [
|
|
| 68 |
+ ('profile', _('Profile')),
|
|
| 68 | 69 |
(_('Send File'), [
|
| 69 | 70 |
('win.send-file-httpupload-', _('Upload File…')),
|
| 70 | 71 |
('win.send-file-jingle-', _('Send File Directly…'))
|
| 71 |
- ])
|
|
| 72 |
+ ]),
|
|
| 73 |
+ ('app.remove-history', _('Remove History…')),
|
|
| 74 |
+ ('win.search-history', _('Search…'))
|
|
| 72 | 75 |
]
|
| 73 | 76 |
|
| 74 |
- additional_menu: list[tuple[str, Any]] = [
|
|
| 77 |
+ singlechat_menu: list[tuple[str, Any]] = [
|
|
| 78 |
+ ('win.information-', _('Details')),
|
|
| 75 | 79 |
('win.send-marker-', _('Send Read Markers')),
|
| 76 | 80 |
(_('Send Chatstate'), ['chatstate']),
|
| 77 | 81 |
('win.block-contact-', _('Block Contact…')),
|
| 82 |
+ (_('Send File'), [
|
|
| 83 |
+ ('win.send-file-httpupload-', _('Upload File…')),
|
|
| 84 |
+ ('win.send-file-jingle-', _('Send File Directly…'))
|
|
| 85 |
+ ]),
|
|
| 78 | 86 |
('win.start-call-', _('Start Call…')),
|
| 79 |
- ('win.information-', _('Information')),
|
|
| 80 |
- ('app.remove-history', _('Remove History…'))
|
|
| 87 |
+ ('app.remove-history', _('Remove History…')),
|
|
| 88 |
+ ('win.search-history', _('Search…'))
|
|
| 81 | 89 |
]
|
| 82 | 90 |
|
| 83 | 91 |
if not contact.is_in_roster:
|
| 84 | 92 |
if (type_.is_chat or
|
| 85 | 93 |
(type_.is_privatechat and contact.real_jid is not None)):
|
| 86 |
- additional_menu.append(
|
|
| 94 |
+ singlechat_menu.append(
|
|
| 87 | 95 |
('win.add-to-roster-', _('Add to Contact List…')))
|
| 88 | 96 |
|
| 89 |
- if is_self_contact:
|
|
| 90 |
- singlechat_menu.append(('profile', _('Profile')))
|
|
| 91 |
- else:
|
|
| 92 |
- singlechat_menu.extend(additional_menu)
|
|
| 93 |
- |
|
| 94 |
- singlechat_menu.append(('win.search-history', _('Search…')))
|
|
| 95 |
- |
|
| 96 | 97 |
def build_chatstate_menu() -> Gio.Menu:
|
| 97 | 98 |
menu = Gio.Menu()
|
| 98 | 99 |
entries = [
|
| ... | ... | @@ -112,7 +113,7 @@ def build_menu(preset: list[tuple[str, Any]]): |
| 112 | 113 |
for item in preset:
|
| 113 | 114 |
if isinstance(item[1], str):
|
| 114 | 115 |
action_name, label = item
|
| 115 |
- if action_name == 'win.send-marker-' and type_ == 'pm':
|
|
| 116 |
+ if action_name == 'win.send-marker-' and type_.is_privatechat:
|
|
| 116 | 117 |
continue
|
| 117 | 118 |
|
| 118 | 119 |
if action_name == 'win.search-history':
|
| ... | ... | @@ -142,6 +143,9 @@ def build_menu(preset: list[tuple[str, Any]]): |
| 142 | 143 |
menu.append_submenu(label, submenu)
|
| 143 | 144 |
return menu
|
| 144 | 145 |
|
| 146 |
+ if is_self_contact:
|
|
| 147 |
+ return build_menu(self_contact_menu)
|
|
| 148 |
+ |
|
| 145 | 149 |
return build_menu(singlechat_menu)
|
| 146 | 150 |
|
| 147 | 151 |
|
| ... | ... | @@ -152,12 +156,11 @@ def get_groupchat_menu(control_id: str, account: str, jid: JID) -> Gio.Menu: |
| 152 | 156 |
menulist: MenuItemListT = [
|
| 153 | 157 |
(_('Details'), f'win.groupchat-details-{control_id}', None),
|
| 154 | 158 |
(_('Manage…'), f'win.groupchat-manage-{control_id}', None),
|
| 155 |
- (_('Rename Chat…'), f'win.rename-groupchat-{control_id}', None),
|
|
| 156 | 159 |
(_('Change Nickname…'), f'win.change-nickname-{control_id}', None),
|
| 157 | 160 |
(_('Request Voice'), f'win.request-voice-{control_id}', None),
|
| 158 | 161 |
(_('Execute Command…'), f'win.execute-command-{control_id}', '""'),
|
| 159 |
- (_('Search…'), 'win.search-history', None),
|
|
| 160 |
- (_('Remove History…'), 'app.remove-history', params)
|
|
| 162 |
+ (_('Remove History…'), 'app.remove-history', params),
|
|
| 163 |
+ (_('Search…'), 'win.search-history', None)
|
|
| 161 | 164 |
]
|
| 162 | 165 |
|
| 163 | 166 |
return make_menu(menulist)
|
| ... | ... | @@ -408,7 +411,7 @@ def get_roster_menu(account: str, jid: str, gateway: bool = False) -> Gio.Menu: |
| 408 | 411 |
value = f'"{jid}"'
|
| 409 | 412 |
|
| 410 | 413 |
menuitems: MenuItemListT = [
|
| 411 |
- (_('Information'), f'win.contact-info-{account}', value),
|
|
| 414 |
+ (_('Details'), f'win.contact-info-{account}', value),
|
|
| 412 | 415 |
(_('Execute Command…'), f'win.execute-command-{account}', value),
|
| 413 | 416 |
(block_label, f'win.block-contact-{account}', value),
|
| 414 | 417 |
(_('Remove…'), f'win.remove-contact-{account}', value),
|
| ... | ... | @@ -429,7 +432,7 @@ def get_subscription_menu(account: str, jid: JID) -> Gio.Menu: |
| 429 | 432 |
value = f'"{jid}"'
|
| 430 | 433 |
menuitems: MenuItemListT = [
|
| 431 | 434 |
(_('Start Chat'), 'win.add-chat', params),
|
| 432 |
- (_('Information'), f'win.contact-info-{account}', value),
|
|
| 435 |
+ (_('Details'), f'win.contact-info-{account}', value),
|
|
| 433 | 436 |
(_('Block'), f'win.subscription-block-{account}', value),
|
| 434 | 437 |
(_('Report'), f'win.subscription-report-{account}', value),
|
| 435 | 438 |
(_('Deny'), f'win.subscription-deny-{account}', value),
|
| ... | ... | @@ -588,7 +591,7 @@ def get_groupchat_roster_menu(account: str, |
| 588 | 591 |
value = f'"{contact.name}"'
|
| 589 | 592 |
|
| 590 | 593 |
general_items: MenuItemListT = [
|
| 591 |
- (_('Information'), f'win.contact-information-{control_id}', value),
|
|
| 594 |
+ (_('Details'), f'win.contact-information-{control_id}', value),
|
|
| 592 | 595 |
(_('Execute Command…'), f'win.execute-command-{control_id}', value),
|
| 593 | 596 |
]
|
| 594 | 597 |
|