Skip to content
Snippets Groups Projects
Commit ead3e555 authored by dkirov's avatar dkirov
Browse files

set default font from the desktop default

application font setting (only Gnome for now)
parent 0d68d815
No related branches found
No related tags found
No related merge requests found
......@@ -128,7 +128,7 @@ class Config:
'confirm_close_muc': [opt_bool, True], # confirm closing MUC window
'notify_on_file_complete': [opt_bool, True], # notif. on file complete
'file_transfers_port': [opt_int, 28011], # port, used for file transfers
'conversation_font': [opt_str, 'Sans 10'],
'conversation_font': [opt_str, ''],
# IEC standard says KiB = 1024 bytes KB = 1000 bytes
'use_kib_mib': [opt_bool, False],
'notify_on_all_muc_messages': [opt_bool, False],
......
......@@ -239,6 +239,12 @@ def __init__(self, plugin):
#Font for messages
font = gajim.config.get('conversation_font')
# try to set default font for the current desktop env
if font == '':
font = gtkgui_helpers.get_default_font()
if font is None:
font = 'Sans 10'
gajim.config.set('conversation_font', font)
self.xml.get_widget('conversation_fontbutton').set_font_name(font)
# on new message
......
......@@ -28,6 +28,16 @@
_ = i18n._
from common import gajim
def get_default_font():
''' Get the desktop setting for application font.
(Currently it works only for Gnome) '''
try:
import gconf
client = gconf.client_get_default()
except:
return None
return client.get_string('/desktop/gnome/interface/font_name')
def reduce_chars_newlines(text, max_chars = 0, max_lines = 0,
widget = None):
''' Cut the chars after 'max_chars' on each line
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment