Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
4f7a0fa9
by lovetox at 2022-06-23T21:55:00+02:00
2 changed files:
Changes:
| ... | ... | @@ -151,12 +151,12 @@ def _on_chat_selected(self, |
| 151 | 151 | account: str,
|
| 152 | 152 | jid: JID) -> None:
|
| 153 | 153 | |
| 154 | - self._control_stack.show_chat(account, jid)
|
|
| 154 | + self._chat_stack.show_chat(account, jid)
|
|
| 155 | 155 | self._search_view.set_context(account, jid)
|
| 156 | 156 | self.emit('chat-selected', workspace_id, account, jid)
|
| 157 | 157 | |
| 158 | 158 | def _on_chat_unselected(self, _chat_list_stack: ChatListStack) -> None:
|
| 159 | - self._control_stack.clear()
|
|
| 159 | + self._chat_stack.clear()
|
|
| 160 | 160 | self._search_view.set_context(None, None)
|
| 161 | 161 | |
| 162 | 162 | def _on_search_history(self,
|
| ... | ... | @@ -185,7 +185,7 @@ def _on_chat_list_changed(self, |
| 185 | 185 | self._ui.search_entry.set_text('')
|
| 186 | 186 | |
| 187 | 187 | def process_event(self, event: ApplicationEvent):
|
| 188 | - self._control_stack.process_event(event)
|
|
| 188 | + self._chat_stack.process_event(event)
|
|
| 189 | 189 | self._chat_list_stack.process_event(event)
|
| 190 | 190 | |
| 191 | 191 | def add_chat_list(self, workspace_id: str) -> None:
|
| ... | ... | @@ -12,9 +12,12 @@ |
| 12 | 12 | # You should have received a copy of the GNU General Public License
|
| 13 | 13 | # along with Gajim. If not, see <http://www.gnu.org/licenses/>.
|
| 14 | 14 | |
| 15 | +from typing import Any
|
|
| 16 | + |
|
| 15 | 17 | import logging
|
| 16 | 18 | |
| 17 | 19 | from gi.repository import Gtk
|
| 20 | +from nbxmpp.protocol import JID
|
|
| 18 | 21 | |
| 19 | 22 | from .control_stack import ControlStack
|
| 20 | 23 | from .util import EventHelper
|
| ... | ... | @@ -32,7 +35,7 @@ def __init__(self): |
| 32 | 35 | |
| 33 | 36 | self._control_stack = ControlStack()
|
| 34 | 37 | |
| 35 | - box = Gtk.Box()
|
|
| 38 | + box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
|
| 36 | 39 | box.add(self._control_stack)
|
| 37 | 40 | |
| 38 | 41 | self.add_named(box, 'controls')
|
| ... | ... | @@ -41,3 +44,12 @@ def __init__(self): |
| 41 | 44 | |
| 42 | 45 | def get_control_stack(self) -> ControlStack:
|
| 43 | 46 | return self._control_stack
|
| 47 | + |
|
| 48 | + def show_chat(self, account: str, jid: JID) -> None:
|
|
| 49 | + self._control_stack.show_chat(account, jid)
|
|
| 50 | + |
|
| 51 | + def clear(self) -> None:
|
|
| 52 | + self._control_stack.clear()
|
|
| 53 | + |
|
| 54 | + def process_event(self, event: Any) -> None:
|
|
| 55 | + self._control_stack.process_event(event) |