[zimio] filter in/out/stanza type in XML console. Fixes #4785

This commit is contained in:
Yann Leboulanger 2010-01-08 16:10:37 +01:00
parent 6978305528
commit 183eedd654
2 changed files with 431 additions and 382 deletions

View File

@ -1,376 +1,371 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<?xml version="1.0"?>
<glade-interface>
<widget class="GtkWindow" id="xml_console_window">
<property name="border_width">12</property>
<property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="default_width">550</property>
<property name="default_height">450</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</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="delete_event" handler="on_xml_console_window_delete_event" last_modification_time="Sat, 06 Aug 2005 00:03:05 GMT"/>
<child>
<widget class="GtkVBox" id="vbox">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkLabel" id="label342">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Jabber Traffic&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</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="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow43">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTextView" id="stanzas_log_textview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="overwrite">False</property>
<property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_CHAR</property>
<property name="cursor_visible">True</property>
<property name="pixels_above_lines">0</property>
<property name="pixels_below_lines">0</property>
<property name="pixels_inside_wrap">0</property>
<property name="left_margin">0</property>
<property name="right_margin">0</property>
<property name="indent">0</property>
<property name="text" translatable="yes"></property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox2988">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkCheckButton" id="enable_checkbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes" comments="XML Console enable checkbutton">Enable</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_enable_checkbutton_toggled" last_modification_time="Sat, 13 Aug 2005 14:36:52 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label351">
<property name="visible">True</property>
<property name="label" translatable="yes"></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.5</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="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="clear_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-clear</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_clear_button_clicked" last_modification_time="Sat, 06 Aug 2005 00:20:16 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkExpander" id="expander">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="expanded">False</property>
<property name="spacing">6</property>
<signal name="activate" handler="on_expander_activate" last_modification_time="Mon, 04 Jul 2005 22:24:33 GMT"/>
<child>
<widget class="GtkVBox" id="input_vbox">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow42">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
<property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTextView" id="input_textview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="overwrite">False</property>
<property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_CHAR</property>
<property name="cursor_visible">True</property>
<property name="pixels_above_lines">0</property>
<property name="pixels_below_lines">0</property>
<property name="pixels_inside_wrap">0</property>
<property name="left_margin">0</property>
<property name="right_margin">0</property>
<property name="indent">0</property>
<property name="text" translatable="yes"></property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox31">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">6</property>
<child>
<widget class="GtkButton" id="iq_button">
<property name="visible">True</property>
<property name="tooltip" translatable="yes" comments="Info/Query make the &quot;IQ&quot; initials. So translate like this 'YourLang/YourLang (Info/Query)'. Thanks (it's a tooltip so width is not a problem)">Info/Query</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes" comments="Info/Query: all(?) jabber xml start with &lt;iq Leaving it _IQ is not a bad idea unless you are sure your lang has this somehow else translated (NOTE: xml still will still say &lt;iq in your language (of course))">_IQ</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_iq_button_clicked" last_modification_time="Mon, 04 Jul 2005 19:35:55 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="presence_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Presence</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_presence_button_clicked" last_modification_time="Mon, 04 Jul 2005 19:36:08 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="message_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Message</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_message_button_clicked" last_modification_time="Mon, 04 Jul 2005 19:36:21 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="send_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_send_button_clicked" last_modification_time="Mon, 04 Jul 2005 19:36:26 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment80">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox2980">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image833">
<property name="visible">True</property>
<property name="stock">gtk-apply</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label341">
<property name="visible">True</property>
<property name="label" translatable="yes">_Send</property>
<property name="use_underline">True</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.5</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="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label343">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;XML Input&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</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="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
<!-- interface-requires gtk+ 2.6 -->
<!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="xml_console_window">
<property name="border_width">12</property>
<property name="default_width">550</property>
<property name="default_height">450</property>
<signal name="delete_event" handler="on_xml_console_window_delete_event"/>
<child>
<widget class="GtkVBox" id="vbox">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<widget class="GtkLabel" id="label342">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Jabber Traffic&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow43">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property>
<child>
<widget class="GtkTextView" id="stanzas_log_textview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="wrap_mode">char</property>
</widget>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox2988">
<property name="visible">True</property>
<child>
<widget class="GtkCheckButton" id="enable_checkbutton">
<property name="label" translatable="yes" comments="XML Console enable checkbutton">Enable</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_enable_checkbutton_toggled"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label351">
<property name="visible">True</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="clear_button">
<property name="label">gtk-clear</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_clear_button_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkExpander" id="expander1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="spacing">6</property>
<child>
<widget class="GtkVBox" id="input_vbox1">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<child>
<widget class="GtkCheckButton" id="in_stanza_checkbutton">
<property name="label" translatable="yes">Hide IN stanzas</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_in_stanza_checkbutton_toggled"/>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="out_stanza_checkbutton">
<property name="label" translatable="yes">Hide OUT stanzas</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_out_stanza_checkbutton_toggled"/>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="presence_stanza_checkbutton">
<property name="label" translatable="yes">Hide Presence stanzas</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_presence_stanza_checkbutton_toggled"/>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="iq_stanza_checkbutton">
<property name="label" translatable="yes">Hide IQ stanzas</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_iq_stanza_checkbutton_toggled"/>
</widget>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="message_stanza_checkbutton">
<property name="label" translatable="yes">Hide Message stanzas</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_message_stanza_checkbutton_toggled"/>
</widget>
<packing>
<property name="position">4</property>
</packing>
</child>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Filter&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
<widget class="GtkExpander" id="expander">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="spacing">6</property>
<signal name="activate" handler="on_expander_activate"/>
<child>
<widget class="GtkVBox" id="input_vbox">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow42">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<child>
<widget class="GtkTextView" id="input_textview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="wrap_mode">char</property>
</widget>
</child>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox31">
<property name="visible">True</property>
<property name="spacing">6</property>
<property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="iq_button">
<property name="label" translatable="yes" comments="Info/Query: all(?) jabber xml start with &lt;iq Leaving it _IQ is not a bad idea unless you are sure your lang has this somehow else translated (NOTE: xml still will still say &lt;iq in your language (of course))">_IQ</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip" translatable="yes" comments="Info/Query make the &quot;IQ&quot; initials. So translate like this 'YourLang/YourLang (Info/Query)'. Thanks (it's a tooltip so width is not a problem)">Info/Query</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_iq_button_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="presence_button">
<property name="label" translatable="yes">_Presence</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_presence_button_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="message_button">
<property name="label" translatable="yes">_Message</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_message_button_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="send_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<signal name="clicked" handler="on_send_button_clicked"/>
<child>
<widget class="GtkAlignment" id="alignment80">
<property name="visible">True</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<child>
<widget class="GtkHBox" id="hbox2980">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image833">
<property name="visible">True</property>
<property name="stock">gtk-apply</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label341">
<property name="visible">True</property>
<property name="label" translatable="yes">_Send</property>
<property name="use_underline">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label343">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;XML Input&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">4</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>

View File

@ -2847,14 +2847,23 @@ class XMLConsoleWindow:
self.tagIn = buffer_.create_tag('incoming')
color = gajim.config.get('inmsgcolor')
self.tagIn.set_property('foreground', color)
self.tagInComment = buffer_.create_tag('in_comment')
self.tagInComment.set_property('foreground', color)
self.tagInPresence = buffer_.create_tag('incoming_presence')
self.tagInPresence.set_property('foreground', color)
self.tagInMessage = buffer_.create_tag('incoming_message')
self.tagInMessage.set_property('foreground', color)
self.tagInIq = buffer_.create_tag('incoming_iq')
self.tagInIq.set_property('foreground', color)
self.tagOut = buffer_.create_tag('outgoing')
color = gajim.config.get('outmsgcolor')
self.tagOut.set_property('foreground', color)
self.tagOutComment = buffer_.create_tag('out_comment')
self.tagOutComment.set_property('foreground', color)
self.tagOutPresence = buffer_.create_tag('outgoing_presence')
self.tagOutPresence.set_property('foreground', color)
self.tagOutMessage = buffer_.create_tag('outgoing_message')
self.tagOutMessage.set_property('foreground', color)
self.tagOutIq = buffer_.create_tag('outgoing_iq')
self.tagOutIq.set_property('foreground', color)
buffer_.create_tag('') # Default tag
self.enabled = False
@ -2882,6 +2891,37 @@ class XMLConsoleWindow:
def on_enable_checkbutton_toggled(self, widget):
self.enabled = widget.get_active()
def on_in_stanza_checkbutton_toggled(self, widget):
active = widget.get_active()
self.tagIn.set_property('invisible', active)
self.tagInComment.set_property('invisible', active)
self.tagInPresence.set_property('invisible', active)
self.tagInMessage.set_property('invisible', active)
self.tagInIq.set_property('invisible', active)
def on_presence_stanza_checkbutton_toggled(self, widget):
active = widget.get_active()
self.tagInPresence.set_property('invisible', active)
self.tagOutPresence.set_property('invisible', active)
def on_out_stanza_checkbutton_toggled(self, widget):
active = widget.get_active()
self.tagOut.set_property('invisible', active)
self.tagOutComment.set_property('invisible', active)
self.tagOutPresence.set_property('invisible', active)
self.tagOutMessage.set_property('invisible', active)
self.tagOutIq.set_property('invisible', active)
def on_message_stanza_checkbutton_toggled(self, widget):
active = widget.get_active()
self.tagInMessage.set_property('invisible', active)
self.tagOutMessage.set_property('invisible', active)
def on_iq_stanza_checkbutton_toggled(self, widget):
active = widget.get_active()
self.tagInIq.set_property('invisible', active)
self.tagOutIq.set_property('invisible', active)
def scroll_to_end(self, ):
parent = self.stanzas_log_textview.get_parent()
buffer_ = self.stanzas_log_textview.get_buffer()
@ -2908,15 +2948,29 @@ class XMLConsoleWindow:
if end_rect.y <= (visible_rect.y + visible_rect.height):
at_the_end = True
end_iter = buffer.get_end_iter()
type_ = ''
if stanza[1:9] == 'presence':
type_ = 'presence'
elif stanza[1:8] == 'message':
type_ = 'message'
elif stanza[1:3] == 'iq':
type_ = 'iq'
if type_:
type_ = kind + '_' + type_
else:
type_ = kind # 'incoming' or 'outgoing'
if kind == 'incoming':
buffer.insert_with_tags_by_name(end_iter, '<!-- In -->\n',
'in_comment')
type_)
elif kind == 'outgoing':
buffer.insert_with_tags_by_name(end_iter, '<!-- Out -->\n',
'out_comment')
type_)
end_iter = buffer.get_end_iter()
buffer.insert_with_tags_by_name(end_iter, stanza.replace('><', '>\n<') + \
'\n\n', kind)
buffer.insert_with_tags_by_name(end_iter, stanza.replace('><', '>\n<') +\
'\n\n', type_)
if at_the_end:
gobject.idle_add(self.scroll_to_end)