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
Weblate
gajim
Commits
223a2627
Commit
223a2627
authored
19 years ago
by
dkirov
Browse files
Options
Downloads
Patches
Plain Diff
save prefs only on theme_manager destroy.
fixed bug in groupfontattr(s). tooglebuttons are loaded with theme
parent
159a4dad
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/common/config.py
+1
-1
1 addition, 1 deletion
src/common/config.py
src/gajim_themes_window.py
+38
-9
38 additions, 9 deletions
src/gajim_themes_window.py
src/gtkgui.glade
+1
-0
1 addition, 0 deletions
src/gtkgui.glade
src/gtkgui_helpers.py
+1
-0
1 addition, 0 deletions
src/gtkgui_helpers.py
with
41 additions
and
10 deletions
src/common/config.py
+
1
−
1
View file @
223a2627
...
...
@@ -216,7 +216,7 @@ class Config:
'
grouptextcolor
'
:
[
opt_color
,
'
white
'
],
'
groupbgcolor
'
:
[
opt_color
,
'
black
'
],
'
groupfont
'
:
[
opt_str
,
''
],
'
groupfontattr
'
:
[
opt_str
,
''
],
'
groupfontattr
s
'
:
[
opt_str
,
''
],
'
contacttextcolor
'
:
[
opt_color
,
'
white
'
],
'
contactbgcolor
'
:
[
opt_color
,
'
black
'
],
'
contactfont
'
:
[
opt_str
,
''
],
...
...
This diff is collapsed.
Click to expand it.
src/gajim_themes_window.py
+
38
−
9
View file @
223a2627
...
...
@@ -36,6 +36,10 @@ class GajimThemesWindow:
def
on_close_button_clicked
(
self
,
widget
):
self
.
window
.
destroy
()
def
on_gajim_themes_window_destroy_event
(
self
,
widget
):
'''
save settings only on exit - this makes UI faster
'''
self
.
plugin
.
save_config
()
def
__init__
(
self
,
plugin
):
self
.
xml
=
gtk
.
glade
.
XML
(
GTKGUI_GLADE
,
'
gajim_themes_window
'
,
APP
)
self
.
window
=
self
.
xml
.
get_widget
(
'
gajim_themes_window
'
)
...
...
@@ -63,6 +67,7 @@ class GajimThemesWindow:
renderer
.
connect
(
'
edited
'
,
self
.
on_theme_cell_edited
)
renderer
.
set_property
(
'
editable
'
,
True
)
self
.
current_theme
=
gajim
.
config
.
get
(
'
roster_theme
'
)
self
.
no_update
=
False
self
.
fill_themes_treeview
()
self
.
xml
.
signal_autoconnect
(
self
)
...
...
@@ -136,6 +141,7 @@ class GajimThemesWindow:
self
.
plugin
.
windows
[
'
preferences
'
].
update_preferences_window
()
def
set_theme_options
(
self
,
theme
,
option
=
'
account
'
):
self
.
no_update
=
True
self
.
options_combobox
.
set_active
(
self
.
options
.
index
(
option
))
textcolor
=
gajim
.
config
.
get_per
(
'
themes
'
,
theme
,
option
+
'
textcolor
'
)
...
...
@@ -146,8 +152,7 @@ class GajimThemesWindow:
state
=
False
self
.
textcolor_checkbutton
.
set_active
(
state
)
self
.
text_colorbutton
.
set_sensitive
(
state
)
bgcolor
=
gajim
.
config
.
get_per
(
'
themes
'
,
theme
,
option
+
'
bgcolor
'
)
bgcolor
=
gajim
.
config
.
get_per
(
'
themes
'
,
theme
,
option
+
'
bgcolor
'
)
if
bgcolor
:
state
=
True
self
.
background_colorbutton
.
set_color
(
gtk
.
gdk
.
color_parse
(
...
...
@@ -156,8 +161,11 @@ class GajimThemesWindow:
state
=
False
self
.
background_checkbutton
.
set_active
(
state
)
self
.
background_colorbutton
.
set_sensitive
(
state
)
font_name
=
gajim
.
config
.
get_per
(
'
themes
'
,
theme
,
option
+
'
font
'
)
#get the font name before we set widgets ant it will not be overriden
font_name
=
gajim
.
config
.
get_per
(
'
themes
'
,
theme
,
option
+
'
font
'
)
font_attrs
=
gajim
.
config
.
get_per
(
'
themes
'
,
theme
,
option
+
'
fontattrs
'
)
self
.
_set_font_widgets
(
font_attrs
)
if
font_name
:
state
=
True
self
.
text_fontbutton
.
set_font_name
(
font_name
)
...
...
@@ -165,8 +173,8 @@ class GajimThemesWindow:
state
=
False
self
.
textfont_checkbutton
.
set_active
(
state
)
self
.
text_fontbutton
.
set_sensitive
(
state
)
font_attrs
=
gajim
.
config
.
get_per
(
'
themes
'
,
theme
,
option
+
'
fontattrs
'
)
self
.
no_update
=
False
self
.
plugin
.
roster
.
draw_roster
(
)
def
on_textcolor_checkbutton_toggled
(
self
,
widget
):
state
=
widget
.
get_active
()
...
...
@@ -219,10 +227,13 @@ class GajimThemesWindow:
color_string
=
''
gajim
.
config
.
set_per
(
'
themes
'
,
self
.
current_theme
,
self
.
current_option
+
option
,
color_string
)
# use faster functions for this
if
self
.
current_option
==
'
banner
'
:
self
.
plugin
.
roster
.
repaint_themed_widgets
()
if
self
.
no_update
:
return
# FIXME check if this is currently selected theme
self
.
plugin
.
roster
.
draw_roster
()
self
.
plugin
.
save_config
()
def
_set_font
(
self
):
'''
set font value in prefs and update the UI
'''
...
...
@@ -236,12 +247,16 @@ class GajimThemesWindow:
font_attrs
=
self
.
_get_font_attrs
()
gajim
.
config
.
set_per
(
'
themes
'
,
self
.
current_theme
,
self
.
current_option
+
'
fontattrs
'
,
font_attrs
)
# use faster functions for this
if
self
.
current_option
==
'
banner
'
:
self
.
plugin
.
roster
.
repaint_themed_widgets
()
if
self
.
no_update
:
return
# FIXME check if this is currently selected theme
self
.
plugin
.
roster
.
draw_roster
()
self
.
plugin
.
save_config
()
def
_toggle_font_widgets
(
self
,
font_props
):
'''
toggle font buttons with the bool values of font_props tuple
'''
self
.
bold_togglebutton
.
set_active
(
font_props
[
0
])
self
.
italic_togglebutton
.
set_active
(
font_props
[
1
])
self
.
underline_togglebutton
.
set_active
(
font_props
[
2
])
...
...
@@ -256,7 +271,21 @@ class GajimThemesWindow:
fd
.
set_style
(
pango
.
STYLE_ITALIC
)
return
fd
def
_set_font_widgets
(
self
,
font_attrs
):
'''
set the correct toggle state of font style buttons by
a font string of type
'
BIU
'
'''
font_props
=
[
False
,
False
,
False
]
if
font_attrs
:
if
font_attrs
.
find
(
'
B
'
)
!=
-
1
:
font_props
[
0
]
=
True
if
font_attrs
.
find
(
'
I
'
)
!=
-
1
:
font_props
[
1
]
=
True
if
font_attrs
.
find
(
'
U
'
)
!=
-
1
:
font_props
[
2
]
=
True
self
.
_toggle_font_widgets
(
font_props
)
def
_get_font_attrs
(
self
):
'''
get a string with letters of font attribures:
'
BUI
'
'''
attrs
=
''
if
self
.
bold_togglebutton
.
get_active
():
attrs
+=
'
B
'
...
...
@@ -266,7 +295,7 @@ class GajimThemesWindow:
attrs
+=
'
U
'
return
attrs
def
_get_font_props
(
self
,
font_name
):
'''
get tuple of font properties: Weight, Style, Underline
'''
font_props
=
[
False
,
False
,
False
]
...
...
This diff is collapsed.
Click to expand it.
src/gtkgui.glade
+
1
−
0
View file @
223a2627
...
...
@@ -15944,6 +15944,7 @@ to the Jabber network.</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<signal name="destroy_event" handler="on_gajim_themes_window_destroy_event" last_modification_time="Sun, 18 Sep 2005 09:19:54 GMT"/>
<child>
<widget class="GtkVBox" id="vbox97">
...
...
This diff is collapsed.
Click to expand it.
src/gtkgui_helpers.py
+
1
−
0
View file @
223a2627
...
...
@@ -32,6 +32,7 @@ from common import helpers
screen_w
=
gtk
.
gdk
.
screen_width
()
screen_h
=
gtk
.
gdk
.
screen_height
()
def
get_theme_font_for_option
(
theme
,
option
):
'''
return string description of the font, stored in
theme preferences
'''
...
...
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