Skip to content
Snippets Groups Projects
Commit 9385f107 authored by nkour's avatar nkour
Browse files

[greblus] preferences window now can control the color of URLs

parent 1b251aaa
No related branches found
No related tags found
No related merge requests found
......@@ -76,6 +76,7 @@ class Config:
'outmsgcolor': [ opt_color, '#164e6f' ],
'statusmsgcolor': [ opt_color, '#1eaa1e' ],
'markedmsgcolor': [ opt_color, '#ff8080' ],
'urlmsgcolor': [ opt_color, '#0000ff' ],
'collapsed_rows': [ opt_str, '' ],
'roster_theme': [ opt_str, 'green' ],
'saveposition': [ opt_bool, True ],
......
......@@ -43,6 +43,7 @@ def temp_failure_retry(func, *args, **kwargs):
try:
return func(*args, **kwargs)
except (os.error, IOError, select.error), ex:
print ex, dir(ex)
if ex.errno == errno.EINTR:
continue
else:
......
......@@ -222,6 +222,11 @@ def __init__(self):
colSt = gajim.config.get('statusmsgcolor')
self.xml.get_widget('status_msg_colorbutton').set_color(
gtk.gdk.color_parse(colSt))
#Color for hyperlinks
colSt = gajim.config.get('urlmsgcolor')
self.xml.get_widget('url_msg_colorbutton').set_color(
gtk.gdk.color_parse(colSt))
#Font for messages
font = gajim.config.get('conversation_font')
......@@ -719,6 +724,9 @@ def on_incoming_msg_colorbutton_color_set(self, widget):
def on_outgoing_msg_colorbutton_color_set(self, widget):
self.on_preference_widget_color_set(widget, 'outmsgcolor')
def on_url_msg_colorbutton_color_set(self, widget):
self.on_preference_widget_color_set(widget, 'urlmsgcolor')
def on_status_msg_colorbutton_color_set(self, widget):
self.on_preference_widget_color_set(widget, 'statusmsgcolor')
......@@ -726,7 +734,7 @@ def on_conversation_fontbutton_font_set(self, widget):
self.on_preference_widget_font_set(widget, 'conversation_font')
def on_reset_colors_button_clicked(self, widget):
for i in ('inmsgcolor', 'outmsgcolor', 'statusmsgcolor'):
for i in ('inmsgcolor', 'outmsgcolor', 'statusmsgcolor', 'urlmsgcolor'):
gajim.config.set(i, gajim.interface.default_values[i])
self.xml.get_widget('incoming_msg_colorbutton').set_color(\
......@@ -735,6 +743,8 @@ def on_reset_colors_button_clicked(self, widget):
gtk.gdk.color_parse(gajim.config.get('outmsgcolor')))
self.xml.get_widget('status_msg_colorbutton').set_color(\
gtk.gdk.color_parse(gajim.config.get('statusmsgcolor')))
self.xml.get_widget('url_msg_colorbutton').set_color(\
gtk.gdk.color_parse(gajim.config.get('urlmsgcolor')))
self.update_text_tags()
gajim.interface.save_config()
......
......@@ -100,12 +100,13 @@ def __init__(self, account):
tag.set_property('foreground', color)
tag = buffer.create_tag('url')
tag.set_property('foreground', 'blue')
color = gajim.config.get('urlmsgcolor')
tag.set_property('foreground', color)
tag.set_property('underline', pango.UNDERLINE_SINGLE)
tag.connect('event', self.hyperlink_handler, 'url')
tag = buffer.create_tag('mail')
tag.set_property('foreground', 'blue')
tag.set_property('foreground', color)
tag.set_property('underline', pango.UNDERLINE_SINGLE)
tag.connect('event', self.hyperlink_handler, 'mail')
......
......@@ -1310,6 +1310,7 @@ def __init__(self):
'inmsgcolor': gajim.config.get('inmsgcolor'),
'outmsgcolor': gajim.config.get('outmsgcolor'),
'statusmsgcolor': gajim.config.get('statusmsgcolor'),
'urlmsgcolor': gajim.config.get('urlmsgcolor'),
}
parser.read()
......
......@@ -4121,7 +4121,7 @@ Agent JID - node</property>
<child>
<widget class="GtkTable" id="table18">
<property name="visible">True</property>
<property name="n_rows">5</property>
<property name="n_rows">6</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
......@@ -4343,8 +4343,8 @@ Agent JID - node</property>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
......@@ -4371,8 +4371,8 @@ Agent JID - node</property>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
......@@ -4392,12 +4392,58 @@ Agent JID - node</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label371">
<property name="visible">True</property>
<property name="label" translatable="yes">URL:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkColorButton" id="url_msg_colorbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="use_alpha">False</property>
<property name="focus_on_click">True</property>
<signal name="color_set" handler="on_url_msg_colorbutton_color_set" last_modification_time="Sun, 25 Dec 2005 15:22:17 GMT"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options"></property>
<property name="y_options"></property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
......
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