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
bce21fae
Commit
bce21fae
authored
18 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
update instantly privacy_lists window when we add or remove a privacy list in privacy_list window
parent
ce10327b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/dialogs.py
+29
-4
29 additions, 4 deletions
src/dialogs.py
with
29 additions
and
4 deletions
src/dialogs.py
+
29
−
4
View file @
bce21fae
...
...
@@ -1890,6 +1890,11 @@ class PrivacyListWindow:
self
.
privacy_list_name
,
tags
)
self
.
privacy_list_received
(
tags
)
self
.
add_edit_vbox
.
hide
()
if
not
tags
:
# we removed latest rule
if
'
privacy_lists
'
in
gajim
.
interface
.
instances
[
self
.
account
]:
win
=
gajim
.
interface
.
instances
[
self
.
account
][
'
privacy_lists
'
]
win
.
remove_privacy_list_from_combobox
(
self
.
privacy_list_name
)
win
.
draw_widgets
()
def
on_open_rule_button_clicked
(
self
,
widget
):
self
.
add_edit_rule_label
.
set_label
(
...
...
@@ -2031,6 +2036,10 @@ class PrivacyListWindow:
self
.
privacy_list_name
,
tags
)
self
.
privacy_list_received
(
tags
)
self
.
add_edit_vbox
.
hide
()
if
'
privacy_lists
'
in
gajim
.
interface
.
instances
[
self
.
account
]:
win
=
gajim
.
interface
.
instances
[
self
.
account
][
'
privacy_lists
'
]
win
.
add_privacy_list_to_combobox
(
self
.
privacy_list_name
)
win
.
draw_widgets
()
def
on_list_of_rules_combobox_changed
(
self
,
widget
):
self
.
add_edit_vbox
.
hide
()
...
...
@@ -2090,17 +2099,33 @@ class PrivacyListsWindow:
if
'
privacy_lists
'
in
gajim
.
interface
.
instances
[
self
.
account
]:
del
gajim
.
interface
.
instances
[
self
.
account
][
'
privacy_lists
'
]
def
remove_privacy_list_from_combobox
(
self
,
privacy_list
):
if
privacy_list
not
in
self
.
privacy_lists_save
:
return
privacy_list_index
=
self
.
privacy_lists_save
.
index
(
privacy_list
)
self
.
list_of_privacy_lists_combobox
.
remove_text
(
privacy_list_index
)
self
.
privacy_lists_save
.
remove
(
privacy_list
)
def
add_privacy_list_to_combobox
(
self
,
privacy_list
):
if
privacy_list
in
self
.
privacy_lists_save
:
return
self
.
list_of_privacy_lists_combobox
.
append_text
(
privacy_list
)
self
.
privacy_lists_save
.
append
(
privacy_list
)
def
draw_privacy_lists_in_combobox
(
self
,
privacy_lists
):
self
.
list_of_privacy_lists_combobox
.
set_active
(
-
1
)
self
.
list_of_privacy_lists_combobox
.
get_model
().
clear
()
self
.
privacy_lists_save
=
privacy_lists
self
.
privacy_lists_save
=
[]
for
add_item
in
privacy_lists
:
self
.
list_of_privacy_lists_combobox
.
append_text
(
add_item
)
if
len
(
privacy_lists
)
==
0
:
self
.
add_privacy_list_to_combobox
(
add_item
)
self
.
draw_widgets
()
def
draw_widgets
(
self
):
if
len
(
self
.
privacy_lists_save
)
==
0
:
self
.
list_of_privacy_lists_combobox
.
set_sensitive
(
False
)
self
.
open_privacy_list_button
.
set_sensitive
(
False
)
self
.
delete_privacy_list_button
.
set_sensitive
(
False
)
elif
len
(
privacy_lists
)
==
1
:
elif
len
(
self
.
privacy_lists
_save
)
==
1
:
self
.
list_of_privacy_lists_combobox
.
set_active
(
0
)
self
.
list_of_privacy_lists_combobox
.
set_sensitive
(
False
)
self
.
open_privacy_list_button
.
set_sensitive
(
True
)
...
...
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