Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mesonium
gajim
Commits
b56ee020
Commit
b56ee020
authored
2 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
refactor: Rename ChatStack
parent
0ae36837
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gajim/gtk/chat_page.py
+16
-16
16 additions, 16 deletions
gajim/gtk/chat_page.py
gajim/gtk/control_stack.py
+2
-2
2 additions, 2 deletions
gajim/gtk/control_stack.py
pyrightconfig.json
+1
-1
1 addition, 1 deletion
pyrightconfig.json
with
19 additions
and
19 deletions
gajim/gtk/chat_page.py
+
16
−
16
View file @
b56ee020
...
...
@@ -34,7 +34,7 @@
from
.chat_filter
import
ChatFilter
from
.chat_list
import
ChatList
from
.chat_list_stack
import
ChatListStack
from
.c
hat
_stack
import
C
hat
Stack
from
.c
ontrol
_stack
import
C
ontrol
Stack
from
.search_view
import
SearchView
from
.types
import
ControlT
...
...
@@ -57,8 +57,8 @@ def __init__(self):
self
.
add
(
self
.
_ui
.
paned
)
self
.
_ui
.
connect_signals
(
self
)
self
.
_c
hat
_stack
=
C
hat
Stack
()
self
.
_ui
.
right_grid_overlay
.
add
(
self
.
_c
hat
_stack
)
self
.
_c
ontrol
_stack
=
C
ontrol
Stack
()
self
.
_ui
.
right_grid_overlay
.
add
(
self
.
_c
ontrol
_stack
)
self
.
_search_view
=
SearchView
()
self
.
_search_view
.
connect
(
'
hide-search
'
,
self
.
_on_search_hide
)
...
...
@@ -118,8 +118,8 @@ def set_startup_finished(self) -> None:
def
get_chat_list_stack
(
self
)
->
ChatListStack
:
return
self
.
_chat_list_stack
def
get_c
hat
_stack
(
self
)
->
C
hat
Stack
:
return
self
.
_c
hat
_stack
def
get_c
ontrol
_stack
(
self
)
->
C
ontrol
Stack
:
return
self
.
_c
ontrol
_stack
@staticmethod
def
_on_start_chat_clicked
(
_button
:
Gtk
.
Button
)
->
None
:
...
...
@@ -148,12 +148,12 @@ def _on_chat_selected(self,
account
:
str
,
jid
:
JID
)
->
None
:
self
.
_c
hat
_stack
.
show_chat
(
account
,
jid
)
self
.
_c
ontrol
_stack
.
show_chat
(
account
,
jid
)
self
.
_search_view
.
set_context
(
account
,
jid
)
self
.
emit
(
'
chat-selected
'
,
workspace_id
,
account
,
jid
)
def
_on_chat_unselected
(
self
,
_chat_list_stack
:
ChatListStack
)
->
None
:
self
.
_c
hat
_stack
.
clear
()
self
.
_c
ontrol
_stack
.
clear
()
self
.
_search_view
.
set_context
(
None
,
None
)
def
_on_search_history
(
self
,
...
...
@@ -182,7 +182,7 @@ def _on_chat_list_changed(self,
self
.
_ui
.
search_entry
.
set_text
(
''
)
def
process_event
(
self
,
event
:
ApplicationEvent
):
self
.
_c
hat
_stack
.
process_event
(
event
)
self
.
_c
ontrol
_stack
.
process_event
(
event
)
self
.
_chat_list_stack
.
process_event
(
event
)
def
add_chat_list
(
self
,
workspace_id
:
str
)
->
None
:
...
...
@@ -227,15 +227,15 @@ def add_chat_for_workspace(self,
return
if
type_
==
'
groupchat
'
:
self
.
_c
hat
_stack
.
add_group_chat
(
account
,
jid
)
self
.
_c
ontrol
_stack
.
add_group_chat
(
account
,
jid
)
elif
type_
==
'
pm
'
:
if
not
self
.
_startup_finished
:
# TODO: Currently we can’t load private chats at start
# because the Contacts dont exist yet
return
self
.
_c
hat
_stack
.
add_private_chat
(
account
,
jid
)
self
.
_c
ontrol
_stack
.
add_private_chat
(
account
,
jid
)
else
:
self
.
_c
hat
_stack
.
add_chat
(
account
,
jid
)
self
.
_c
ontrol
_stack
.
add_chat
(
account
,
jid
)
self
.
_chat_list_stack
.
add_chat
(
workspace_id
,
account
,
jid
,
type_
,
pinned
)
...
...
@@ -279,7 +279,7 @@ def remove_chat(self, account: str, jid: JID) -> None:
def
_on_chat_removed
(
self
,
_chat_list
:
ChatList
,
account
:
str
,
jid
:
JID
,
type_
:
str
)
->
None
:
self
.
_c
hat
_stack
.
remove_chat
(
account
,
jid
)
self
.
_c
ontrol
_stack
.
remove_chat
(
account
,
jid
)
if
type_
==
'
groupchat
'
:
client
=
app
.
get_client
(
account
)
client
.
get_module
(
'
MUC
'
).
leave
(
jid
)
...
...
@@ -290,10 +290,10 @@ def remove_chats_for_account(self, account: str) -> None:
chat_list
.
unselect_all
()
self
.
_chat_list_stack
.
remove_chats_for_account
(
account
)
self
.
_c
hat
_stack
.
remove_chats_for_account
(
account
)
self
.
_c
ontrol
_stack
.
remove_chats_for_account
(
account
)
def
get_control
(
self
,
account
:
str
,
jid
:
JID
)
->
Optional
[
ControlT
]:
return
self
.
_c
hat
_stack
.
get_control
(
account
,
jid
)
return
self
.
_c
ontrol
_stack
.
get_control
(
account
,
jid
)
def
get_active_control
(
self
)
->
Optional
[
ControlT
]:
chat
=
self
.
_chat_list_stack
.
get_selected_chat
()
...
...
@@ -302,11 +302,11 @@ def get_active_control(self) -> Optional[ControlT]:
return
self
.
get_control
(
chat
.
account
,
chat
.
jid
)
def
is_chat_loaded
(
self
,
account
:
str
,
jid
:
JID
)
->
bool
:
return
self
.
_c
hat
_stack
.
is_chat_loaded
(
account
,
jid
)
return
self
.
_c
ontrol
_stack
.
is_chat_loaded
(
account
,
jid
)
def
get_controls
(
self
,
account
:
Optional
[
str
]
)
->
Generator
[
ControlT
,
None
,
None
]:
return
self
.
_c
hat
_stack
.
get_controls
(
account
)
return
self
.
_c
ontrol
_stack
.
get_controls
(
account
)
def
hide_search
(
self
)
->
bool
:
if
self
.
_search_revealer
.
get_reveal_child
():
...
...
This diff is collapsed.
Click to expand it.
gajim/gtk/c
hat
_stack.py
→
gajim/gtk/c
ontrol
_stack.py
+
2
−
2
View file @
b56ee020
...
...
@@ -34,10 +34,10 @@
from
.types
import
ControlT
from
.util
import
EventHelper
log
=
logging
.
getLogger
(
'
gajim.gui.c
hat
stack
'
)
log
=
logging
.
getLogger
(
'
gajim.gui.c
ontrol
stack
'
)
class
C
hat
Stack
(
Gtk
.
Stack
,
EventHelper
):
class
C
ontrol
Stack
(
Gtk
.
Stack
,
EventHelper
):
def
__init__
(
self
):
Gtk
.
Stack
.
__init__
(
self
)
EventHelper
.
__init__
(
self
)
...
...
This diff is collapsed.
Click to expand it.
pyrightconfig.json
+
1
−
1
View file @
b56ee020
...
...
@@ -61,7 +61,7 @@
"gajim/gtk/chat_list_stack.py"
,
"gajim/gtk/chat_list.py"
,
"gajim/gtk/chat_page.py"
,
"gajim/gtk/c
hat
_stack.py"
,
"gajim/gtk/c
ontrol
_stack.py"
,
"gajim/gtk/const.py"
,
"gajim/gtk/contact_info.py"
,
"gajim/gtk/contacts_flowbox.py"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment