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
Dexter Gaon-Shatford
gajim
Commits
baac812e
Commit
baac812e
authored
5 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Themes: Fix pylint errors
parent
c1316483
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
gajim/gtk/themes.py
+13
-12
13 additions, 12 deletions
gajim/gtk/themes.py
with
13 additions
and
12 deletions
gajim/gtk/themes.py
+
13
−
12
View file @
baac812e
...
...
@@ -196,7 +196,7 @@ def _get_themes(self):
for
theme
in
app
.
css_config
.
themes
:
self
.
_ui
.
theme_store
.
append
([
theme
])
def
_on_theme_name_edit
(
self
,
renderer
,
path
,
new_name
):
def
_on_theme_name_edit
(
self
,
_
renderer
,
path
,
new_name
):
iter_
=
self
.
_ui
.
theme_store
.
get_iter
(
path
)
old_name
=
self
.
_ui
.
theme_store
[
iter_
][
Column
.
THEME
]
...
...
@@ -235,9 +235,9 @@ def _on_theme_selected(self, tree_selection):
app
.
css_config
.
change_preload_theme
(
theme
)
self
.
_ui
.
remove_theme_button
.
set_sensitive
(
True
)
self
.
_load_options
(
theme
)
self
.
_load_options
()
def
_load_options
(
self
,
name
):
def
_load_options
(
self
):
self
.
_ui
.
option_listbox
.
foreach
(
self
.
_remove_option
)
for
option
in
CSS_STYLE_OPTIONS
:
value
=
app
.
css_config
.
get_value
(
...
...
@@ -249,9 +249,9 @@ def _load_options(self, name):
row
=
Option
(
option
,
value
)
self
.
_ui
.
option_listbox
.
add
(
row
)
def
_add_option
(
self
,
listbox
,
row
):
def
_add_option
(
self
,
_
listbox
,
row
):
# Add theme if there is none
store
,
iter
_
=
self
.
_ui
.
theme_treeview
.
get_selection
().
get_selected
()
store
,
_
=
self
.
_ui
.
theme_treeview
.
get_selection
().
get_selected
()
first
=
store
.
get_iter_first
()
if
first
is
None
:
self
.
_on_add_new_theme
()
...
...
@@ -284,7 +284,8 @@ def _on_add_new_theme(self, *args):
self
.
_select_theme_row
(
iter_
)
self
.
_apply_theme
(
name
)
def
_apply_theme
(
self
,
theme
):
@staticmethod
def
_apply_theme
(
theme
):
app
.
config
.
set
(
'
roster_theme
'
,
theme
)
app
.
css_config
.
change_theme
(
theme
)
app
.
nec
.
push_incoming_event
(
NetworkEvent
(
'
theme-update
'
))
...
...
@@ -348,7 +349,7 @@ def _on_destroy(*args):
class
Option
(
Gtk
.
ListBoxRow
):
def
__init__
(
self
,
option
,
value
):
Gtk
.
ListBoxRow
.
__init__
(
self
)
self
.
_
option
=
option
self
.
option
=
option
self
.
_box
=
Gtk
.
Box
(
spacing
=
12
)
label
=
Gtk
.
Label
()
...
...
@@ -394,25 +395,25 @@ def _on_color_set(self, color_button):
color
=
color_button
.
get_rgba
()
color_string
=
color
.
to_string
()
app
.
css_config
.
set_value
(
self
.
_
option
.
selector
,
self
.
_
option
.
attr
,
color_string
,
pre
=
True
)
self
.
option
.
selector
,
self
.
option
.
attr
,
color_string
,
pre
=
True
)
app
.
nec
.
push_incoming_event
(
NetworkEvent
(
'
style-changed
'
))
def
_on_font_set
(
self
,
font_button
):
desc
=
font_button
.
get_font_desc
()
app
.
css_config
.
set_font
(
self
.
_
option
.
selector
,
desc
,
pre
=
True
)
app
.
css_config
.
set_font
(
self
.
option
.
selector
,
desc
,
pre
=
True
)
app
.
nec
.
push_incoming_event
(
NetworkEvent
(
'
style-changed
'
))
def
_on_remove
(
self
,
*
args
):
self
.
get_parent
().
remove
(
self
)
app
.
css_config
.
remove_value
(
self
.
_
option
.
selector
,
self
.
_
option
.
attr
,
pre
=
True
)
self
.
option
.
selector
,
self
.
option
.
attr
,
pre
=
True
)
app
.
nec
.
push_incoming_event
(
NetworkEvent
(
'
style-changed
'
))
self
.
destroy
()
def
__eq__
(
self
,
other
):
if
isinstance
(
other
,
ChooseOption
):
return
other
.
option
==
self
.
_
option
return
other
.
_
option
==
self
.
_
option
return
other
.
option
==
self
.
option
return
other
.
option
==
self
.
option
class
ChooseOption
(
Gtk
.
ListBoxRow
):
...
...
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