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
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
eta
gajim
Commits
67fce642
Commit
67fce642
authored
19 years ago
by
nicfit
Browse files
Options
Downloads
Patches
Plain Diff
Dynamic reconfig for one_message_window config changes
parent
f01c0eac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/config.py
+1
-58
1 addition, 58 deletions
src/config.py
src/message_window.py
+36
-2
36 additions, 2 deletions
src/message_window.py
with
37 additions
and
60 deletions
src/config.py
+
1
−
58
View file @
67fce642
...
...
@@ -534,69 +534,12 @@ class PreferencesWindow:
gajim
.
interface
.
roster
.
change_roster_style
(
None
)
gajim
.
interface
.
save_config
()
# FIXME: Remove or implement for new window code
def
merge_windows
(
self
,
kind
):
for
acct
in
gajim
.
connections
:
# save buffers and close windows
buf1
=
{}
buf2
=
{}
saved_var
=
{}
windows
=
gajim
.
interface
.
instances
[
acct
][
kind
]
jids
=
windows
.
keys
()
for
jid
in
jids
:
window
=
windows
[
jid
]
buf1
[
jid
]
=
window
.
conversation_textviews
[
jid
].
get_buffer
()
buf2
[
jid
]
=
window
.
message_textviews
[
jid
].
get_buffer
()
saved_var
[
jid
]
=
window
.
save_var
(
jid
)
window
.
window
.
destroy
()
# open new tabbed chat windows
for
jid
in
jids
:
if
kind
==
'
chats
'
:
c
=
gajim
.
contacts
.
get_contact_with_highest_priority
(
acct
,
jid
)
gajim
.
interface
.
roster
.
new_chat
(
c
,
acct
)
if
kind
==
'
gc
'
:
gajim
.
interface
.
roster
.
new_room
(
jid
,
saved_var
[
jid
][
'
nick
'
],
acct
)
window
=
windows
[
jid
]
window
.
conversation_textviews
[
jid
].
set_buffer
(
buf1
[
jid
])
window
.
message_textviews
[
jid
].
set_buffer
(
buf2
[
jid
])
window
.
load_var
(
jid
,
saved_var
[
jid
])
# FIXME: Remove or implement for new window code
def
split_windows
(
self
,
kind
):
for
acct
in
gajim
.
connections
:
# save buffers and close tabbed chat windows
buf1
=
{}
buf2
=
{}
saved_var
=
{}
windows
=
gajim
.
interface
.
instances
[
acct
][
kind
]
jids
=
windows
.
keys
()
if
not
'
tabbed
'
in
jids
:
continue
jids
.
remove
(
'
tabbed
'
)
for
jid
in
jids
:
window
=
windows
[
jid
]
buf1
[
jid
]
=
window
.
conversation_textviews
[
jid
].
get_buffer
()
buf2
[
jid
]
=
window
.
message_textviews
[
jid
].
get_buffer
()
saved_var
[
jid
]
=
window
.
save_var
(
jid
)
windows
[
'
tabbed
'
].
window
.
destroy
()
# open new tabbed chat windows
for
jid
in
jids
:
if
kind
==
'
chats
'
:
c
=
gajim
.
contacts
.
get_contact_with_highest_priority
(
acct
,
jid
)
gajim
.
interface
.
roster
.
new_chat
(
c
,
acct
)
if
kind
==
'
gc
'
:
gajim
.
interface
.
roster
.
new_room
(
jid
,
saved_var
[
jid
][
'
nick
'
],
acct
)
window
=
windows
[
jid
]
window
.
conversation_textviews
[
jid
].
set_buffer
(
buf1
[
jid
])
window
.
message_textviews
[
jid
].
set_buffer
(
buf2
[
jid
])
window
.
load_var
(
jid
,
saved_var
[
jid
])
def
on_one_window_type_combo_changed
(
self
,
widget
):
active
=
widget
.
get_active
()
config_type
=
common
.
config
.
opt_one_window_types
[
active
]
gajim
.
config
.
set
(
'
one_message_window
'
,
config_type
)
gajim
.
interface
.
save_config
()
# FIXME: Update current windows? Meh
gajim
.
interface
.
msg_win_mgr
.
reconfig
()
def
apply_speller
(
self
,
kind
):
for
acct
in
gajim
.
connections
:
...
...
This diff is collapsed.
Click to expand it.
src/message_window.py
+
36
−
2
View file @
67fce642
...
...
@@ -409,8 +409,9 @@ class MessageWindow:
def
_on_notebook_switch_page
(
self
,
notebook
,
page
,
page_num
):
old_no
=
notebook
.
get_current_page
()
old_ctrl
=
self
.
_widget_to_control
(
notebook
.
get_nth_page
(
old_no
))
old_ctrl
.
set_control_active
(
False
)
if
old_no
>=
0
:
old_ctrl
=
self
.
_widget_to_control
(
notebook
.
get_nth_page
(
old_no
))
old_ctrl
.
set_control_active
(
False
)
new_ctrl
=
self
.
_widget_to_control
(
notebook
.
get_nth_page
(
page_num
))
new_ctrl
.
set_control_active
(
True
)
...
...
@@ -706,6 +707,7 @@ class MessageWindowMgr:
for
w
in
self
.
windows
():
self
.
save_state
(
w
)
w
.
window
.
hide
()
w
.
window
.
destroy
()
def
save_state
(
self
,
msg_win
):
if
not
gajim
.
config
.
get
(
'
saveposition
'
):
...
...
@@ -746,3 +748,35 @@ class MessageWindowMgr:
gajim
.
config
.
set
(
pos_y_key
,
y
)
gajim
.
config
.
set
(
size_width_key
,
width
)
gajim
.
config
.
set
(
size_height_key
,
height
)
def
reconfig
(
self
):
for
w
in
self
.
_windows
.
values
():
self
.
save_state
(
w
)
# Map the mode to a int constant for frequent compares
mode
=
gajim
.
config
.
get
(
'
one_message_window
'
)
if
self
.
mode
==
common
.
config
.
opt_one_window_types
.
index
(
mode
):
# No change
return
self
.
mode
=
common
.
config
.
opt_one_window_types
.
index
(
mode
)
controls
=
[]
for
w
in
self
.
_windows
.
values
():
w
.
window
.
hide
()
while
w
.
notebook
.
get_n_pages
():
page
=
w
.
notebook
.
get_nth_page
(
0
)
ctrl
=
w
.
_widget_to_control
(
page
)
w
.
notebook
.
remove_page
(
0
)
page
.
unparent
()
controls
.
append
(
ctrl
)
w
.
window
.
destroy
()
for
k
in
self
.
_windows
.
keys
():
del
self
.
_windows
[
k
]
self
.
_windows
=
{}
for
ctrl
in
controls
:
mw
=
self
.
get_window
(
ctrl
.
contact
.
jid
)
if
not
mw
:
mw
=
self
.
create_window
(
ctrl
.
contact
,
ctrl
.
account
,
ctrl
.
type_id
)
ctrl
.
parent_win
=
mw
mw
.
new_tab
(
ctrl
)
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