[commit-gajim] r11186 - in branches/osx_newbuildsys: data/glade src src/common
js at gajim.org
js at gajim.org
Sun Apr 5 13:57:16 CEST 2009
Author: js
Date: 2009-04-05 13:57:15 +0200 (Sun, 05 Apr 2009)
New Revision: 11186
Added:
branches/osx_newbuildsys/src/common/logging_helpers.py
Modified:
branches/osx_newbuildsys/data/glade/preferences_window.glade
branches/osx_newbuildsys/src/chat_control.py
branches/osx_newbuildsys/src/common/GnuPG.py
branches/osx_newbuildsys/src/common/Makefile
branches/osx_newbuildsys/src/common/dataforms.py
branches/osx_newbuildsys/src/common/gajim.py
branches/osx_newbuildsys/src/config.py
branches/osx_newbuildsys/src/dialogs.py
branches/osx_newbuildsys/src/gajim.py
Log:
Merge trunk r11155.
Modified: branches/osx_newbuildsys/data/glade/preferences_window.glade
===================================================================
--- branches/osx_newbuildsys/data/glade/preferences_window.glade 2009-04-04 05:06:46 UTC (rev 11185)
+++ branches/osx_newbuildsys/data/glade/preferences_window.glade 2009-04-05 11:57:15 UTC (rev 11186)
@@ -211,55 +211,45 @@
<property name="column_spacing">6</property>
<property name="row_spacing">6</property>
<child>
- <widget class="GtkComboBox" id="one_window_type_combobox">
- <property name="width_request">50</property>
+ <widget class="GtkLabel" id="label379">
<property name="visible">True</property>
- <property name="items" translatable="yes">Detached roster with detached chats
-Detached roster with single chat
-Single window for everything
-Detached roster with chat grouped by account
-Detached roster with chat grouped by type</property>
- <signal name="changed" handler="on_one_window_type_combo_changed"/>
+ <property name="xalign">0</property>
+ <property name="xpad">1</property>
+ <property name="label" translatable="yes">_Window behavior:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">one_window_type_combobox</property>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="speller_checkbutton">
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">If checked, Gajim will highlight spelling errors in input fields of chat windows. If no language is explicitly set via right click on the input field, the default language will be used for this contact or group chat.</property>
- <property name="label" translatable="yes">_Highlight misspelled words</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_speller_checkbutton_toggled"/>
+ <widget class="GtkComboBox" id="emoticons_combobox">
+ <property name="visible">True</property>
+ <signal name="changed" handler="on_emoticons_combobox_changed"/>
</widget>
<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">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="xhtml_checkbutton">
+ <widget class="GtkEventBox" id="eventbox5">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Some messages may include rich content (formatting, colors etc). If checked, Gajim will just display the raw message text.</property>
- <property name="label" translatable="yes">_Ignore rich content in incoming messages</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_xhtml_checkbutton_toggled"/>
+ <property name="tooltip" translatable="yes">If not disabled, Gajim will replace ascii smilies like ':)' with equivalent animated or static graphical emoticons</property>
+ <child>
+ <widget class="GtkLabel" id="label381">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">1</property>
+ <property name="label" translatable="yes">_Emoticons:</property>
+ <property name="use_underline">True</property>
+ </widget>
+ </child>
</widget>
<packing>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
@@ -281,46 +271,56 @@
</packing>
</child>
<child>
- <widget class="GtkEventBox" id="eventbox5">
+ <widget class="GtkCheckButton" id="xhtml_checkbutton">
<property name="visible">True</property>
- <property name="tooltip" translatable="yes">If not disabled, Gajim will replace ascii smilies like ':)' with equivalent animated or static graphical emoticons</property>
- <child>
- <widget class="GtkLabel" id="label381">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="xpad">1</property>
- <property name="label" translatable="yes">_Emoticons:</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">Some messages may include rich content (formatting, colors etc). If checked, Gajim will just display the raw message text.</property>
+ <property name="label" translatable="yes">_Ignore rich content in incoming messages</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_xhtml_checkbutton_toggled"/>
</widget>
<packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkComboBox" id="emoticons_combobox">
- <property name="visible">True</property>
- <signal name="changed" handler="on_emoticons_combobox_changed"/>
+ <widget class="GtkCheckButton" id="speller_checkbutton">
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">If checked, Gajim will highlight spelling errors in input fields of chat windows. If no language is explicitly set via right click on the input field, the default language will be used for this contact or group chat.</property>
+ <property name="label" translatable="yes">_Highlight misspelled words</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_speller_checkbutton_toggled"/>
</widget>
<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">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label379">
+ <widget class="GtkComboBox" id="one_window_type_combobox">
+ <property name="width_request">50</property>
<property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="xpad">1</property>
- <property name="label" translatable="yes">_Window behavior:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">one_window_type_combobox</property>
+ <property name="items" translatable="yes">Detached roster with detached chats
+Detached roster with single chat
+Single window for everything
+Detached roster with chat grouped by account
+Detached roster with chat grouped by type</property>
+ <signal name="changed" handler="on_one_window_type_combo_changed"/>
</widget>
<packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
</packing>
</child>
</widget>
@@ -730,67 +730,67 @@
<property name="column_spacing">6</property>
<property name="row_spacing">6</property>
<child>
- <widget class="GtkComboBox" id="outgoing_chat_states_combobox">
+ <widget class="GtkComboBox" id="displayed_chat_states_combobox">
<property name="visible">True</property>
<property name="items" translatable="yes">All chat states
Composing only
Disabled</property>
- <signal name="changed" handler="on_outgoing_chat_states_combobox_changed"/>
+ <signal name="changed" handler="on_displayed_chat_states_combobox_changed"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
</packing>
</child>
<child>
- <widget class="GtkEventBox" id="eventbox9">
+ <widget class="GtkEventBox" id="eventbox8">
<property name="visible">True</property>
- <property name="tooltip" translatable="yes">Gajim can send and receive meta-information related to a conversation you may have with a contact. Here you can specify which chatstates you want to send to the other party.</property>
+ <property name="tooltip" translatable="yes">Gajim can send and receive meta-information related to a conversation you may have with a contact. Here you can specify which chatstates you want to display in chat windows.</property>
<child>
- <widget class="GtkLabel" id="label34">
+ <widget class="GtkLabel" id="label33">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">_Send chat state notifications:</property>
+ <property name="label" translatable="yes">_Display chat state notifications:</property>
<property name="use_underline">True</property>
</widget>
</child>
</widget>
<packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkEventBox" id="eventbox8">
+ <widget class="GtkEventBox" id="eventbox9">
<property name="visible">True</property>
- <property name="tooltip" translatable="yes">Gajim can send and receive meta-information related to a conversation you may have with a contact. Here you can specify which chatstates you want to display in chat windows.</property>
+ <property name="tooltip" translatable="yes">Gajim can send and receive meta-information related to a conversation you may have with a contact. Here you can specify which chatstates you want to send to the other party.</property>
<child>
- <widget class="GtkLabel" id="label33">
+ <widget class="GtkLabel" id="label34">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">_Display chat state notifications:</property>
+ <property name="label" translatable="yes">_Send chat state notifications:</property>
<property name="use_underline">True</property>
</widget>
</child>
</widget>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkComboBox" id="displayed_chat_states_combobox">
+ <widget class="GtkComboBox" id="outgoing_chat_states_combobox">
<property name="visible">True</property>
<property name="items" translatable="yes">All chat states
Composing only
Disabled</property>
- <signal name="changed" handler="on_displayed_chat_states_combobox_changed"/>
+ <signal name="changed" handler="on_outgoing_chat_states_combobox_changed"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
</packing>
</child>
</widget>
@@ -854,60 +854,65 @@
<property name="column_spacing">12</property>
<property name="row_spacing">6</property>
<child>
- <widget class="GtkEntry" id="auto_xa_message_entry">
+ <widget class="GtkCheckButton" id="auto_away_checkbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">The auto not available status message. If empty, Gajim will not change the current status message
-$S will be replaced by previous status message
-$T will be replaced by auto-not-available timeout</property>
- <signal name="changed" handler="on_auto_xa_message_entry_changed"/>
+ <property name="tooltip" translatable="yes">If checked, Gajim will change status to Away when the computer is unused.</property>
+ <property name="label" translatable="yes">_Away after:</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_auto_away_checkbutton_toggled"/>
</widget>
<packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="auto_xa_checkbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">If checked, Gajim will change status to Not Available when the computer has not been used even longer</property>
+ <property name="label" translatable="yes">_Not available after:</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_auto_xa_checkbutton_toggled"/>
+ </widget>
+ <packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkEntry" id="auto_away_message_entry">
+ <widget class="GtkLabel" id="label77">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">The auto away status message. If empty, Gajim will not change the current status message
-$S will be replaced by previous status message
-$T will be replaced by auto-away timeout</property>
- <signal name="changed" handler="on_auto_away_message_entry_changed"/>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">minutes</property>
</widget>
<packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkAlignment" id="alignment34">
+ <widget class="GtkLabel" id="label78">
<property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="xscale">0</property>
- <child>
- <widget class="GtkSpinButton" id="auto_xa_time_spinbutton">
- <property name="width_request">50</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">20 1 1440 1 10 10</property>
- <property name="climb_rate">1</property>
- <signal name="value_changed" handler="on_auto_xa_time_spinbutton_value_changed"/>
- </widget>
- </child>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">minutes</property>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
+ <property name="y_options"></property>
</packing>
</child>
<child>
@@ -920,7 +925,7 @@
<property name="width_request">50</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">12 1 720 1 10 10</property>
+ <property name="adjustment">12 1 720 1 10 0</property>
<property name="climb_rate">1</property>
<signal name="value_changed" handler="on_auto_away_time_spinbutton_value_changed"/>
</widget>
@@ -934,67 +939,62 @@
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label78">
+ <widget class="GtkAlignment" id="alignment34">
<property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">minutes</property>
+ <property name="xalign">1</property>
+ <property name="xscale">0</property>
+ <child>
+ <widget class="GtkSpinButton" id="auto_xa_time_spinbutton">
+ <property name="width_request">50</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">20 1 1440 1 10 0</property>
+ <property name="climb_rate">1</property>
+ <signal name="value_changed" handler="on_auto_xa_time_spinbutton_value_changed"/>
+ </widget>
+ </child>
</widget>
<packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label77">
+ <widget class="GtkEntry" id="auto_away_message_entry">
<property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">minutes</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">The auto away status message. If empty, Gajim will not change the current status message
+$S will be replaced by previous status message
+$T will be replaced by auto-away timeout</property>
+ <signal name="changed" handler="on_auto_away_message_entry_changed"/>
</widget>
<packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="x_options">GTK_FILL</property>
+ <property name="left_attach">3</property>
+ <property name="right_attach">4</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="auto_xa_checkbutton">
+ <widget class="GtkEntry" id="auto_xa_message_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">If checked, Gajim will change status to Not Available when the computer has not been used even longer</property>
- <property name="label" translatable="yes">_Not available after:</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_auto_xa_checkbutton_toggled"/>
+ <property name="tooltip" translatable="yes">The auto not available status message. If empty, Gajim will not change the current status message
+$S will be replaced by previous status message
+$T will be replaced by auto-not-available timeout</property>
+ <signal name="changed" handler="on_auto_xa_message_entry_changed"/>
</widget>
<packing>
+ <property name="left_attach">3</property>
+ <property name="right_attach">4</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
- <child>
- <widget class="GtkCheckButton" id="auto_away_checkbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">If checked, Gajim will change status to Away when the computer is unused.</property>
- <property name="label" translatable="yes">_Away after:</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_auto_away_checkbutton_toggled"/>
- </widget>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
</widget>
</child>
</widget>
@@ -1152,24 +1152,40 @@
<placeholder/>
</child>
<child>
- <widget class="GtkScrolledWindow" id="scrolledwindow23">
+ <widget class="GtkVButtonBox" id="vbuttonbox3">
<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="spacing">5</property>
+ <property name="layout_style">GTK_BUTTONBOX_START</property>
<child>
- <widget class="GtkTextView" id="msg_textview">
+ <widget class="GtkButton" id="new_msg_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="border_width">3</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-new</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ <signal name="clicked" handler="on_new_msg_button_clicked"/>
</widget>
</child>
+ <child>
+ <widget class="GtkButton" id="delete_msg_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="label">gtk-delete</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ <signal name="clicked" handler="on_delete_msg_button_clicked"/>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
@@ -1192,40 +1208,24 @@
</widget>
</child>
<child>
- <widget class="GtkVButtonBox" id="vbuttonbox3">
+ <widget class="GtkScrolledWindow" id="scrolledwindow23">
<property name="visible">True</property>
- <property name="spacing">5</property>
- <property name="layout_style">GTK_BUTTONBOX_START</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>
<child>
- <widget class="GtkButton" id="new_msg_button">
+ <widget class="GtkTextView" id="msg_textview">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="label">gtk-new</property>
- <property name="use_stock">True</property>
- <property name="response_id">0</property>
- <signal name="clicked" handler="on_new_msg_button_clicked"/>
+ <property name="border_width">3</property>
+ <property name="wrap_mode">GTK_WRAP_WORD</property>
</widget>
</child>
- <child>
- <widget class="GtkButton" id="delete_msg_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="label">gtk-delete</property>
- <property name="use_stock">True</property>
- <property name="response_id">0</property>
- <signal name="clicked" handler="on_delete_msg_button_clicked"/>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="x_options">GTK_FILL</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
@@ -1291,14 +1291,15 @@
<placeholder/>
</child>
<child>
- <widget class="GtkLabel" id="label4">
+ <widget class="GtkFontButton" id="conversation_fontbutton">
<property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="label" translatable="yes">Chat message:</property>
+ <property name="can_focus">True</property>
+ <property name="response_id">0</property>
+ <signal name="font_set" handler="on_conversation_fontbutton_font_set"/>
</widget>
<packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
</packing>
</child>
<child>
@@ -1319,15 +1320,14 @@
</packing>
</child>
<child>
- <widget class="GtkFontButton" id="conversation_fontbutton">
+ <widget class="GtkLabel" id="label4">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="response_id">0</property>
- <signal name="font_set" handler="on_conversation_fontbutton_font_set"/>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Chat message:</property>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
</widget>
@@ -1377,43 +1377,35 @@
<placeholder/>
</child>
<child>
- <widget class="GtkLabel" id="label249">
+ <widget class="GtkCheckButton" id="transports_iconsets_checkbutton">
<property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">T_heme:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">theme_combobox</property>
- </widget>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="manage_theme_button">
- <property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Configure color and font of the interface</property>
- <property name="label" translatable="yes">Ma_nage...</property>
+ <property name="tooltip" translatable="yes">If checked, Gajim will use protocol-specific status icons. (eg. A contact from MSN will have the equivalent msn icon for status online, away, busy, etc...)</property>
+ <property name="label" translatable="yes">Use _transports icons</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
- <signal name="clicked" handler="on_manage_theme_button_clicked"/>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_transports_iconsets_checkbutton_toggled"/>
</widget>
<packing>
- <property name="left_attach">2</property>
+ <property name="left_attach">1</property>
<property name="right_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
- <widget class="GtkComboBox" id="theme_combobox">
+ <widget class="GtkComboBox" id="iconset_combobox">
<property name="visible">True</property>
- <signal name="changed" handler="on_theme_combobox_changed"/>
+ <signal name="changed" handler="on_iconset_combobox_changed"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
@@ -1432,37 +1424,45 @@
</packing>
</child>
<child>
- <widget class="GtkComboBox" id="iconset_combobox">
+ <widget class="GtkComboBox" id="theme_combobox">
<property name="visible">True</property>
- <signal name="changed" handler="on_iconset_combobox_changed"/>
+ <signal name="changed" handler="on_theme_combobox_changed"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="transports_iconsets_checkbutton">
+ <widget class="GtkButton" id="manage_theme_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">If checked, Gajim will use protocol-specific status icons. (eg. A contact from MSN will have the equivalent msn icon for status online, away, busy, etc...)</property>
- <property name="label" translatable="yes">Use _transports icons</property>
+ <property name="tooltip" translatable="yes">Configure color and font of the interface</property>
+ <property name="label" translatable="yes">Ma_nage...</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_transports_iconsets_checkbutton_toggled"/>
+ <signal name="clicked" handler="on_manage_theme_button_clicked"/>
</widget>
<packing>
- <property name="left_attach">1</property>
+ <property name="left_attach">2</property>
<property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
+ <child>
+ <widget class="GtkLabel" id="label249">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">T_heme:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">theme_combobox</property>
+ </widget>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
</widget>
</child>
</widget>
@@ -1502,119 +1502,62 @@
<property name="column_spacing">12</property>
<property name="row_spacing">6</property>
<child>
- <widget class="GtkHBox" id="hbox3022">
+ <widget class="GtkLabel" id="label72">
<property name="visible">True</property>
- <child>
- <widget class="GtkLabel" id="label383">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="reset_colors_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="focus_on_click">False</property>
- <property name="response_id">0</property>
- <signal name="clicked" handler="on_reset_colors_button_clicked"/>
- <child>
- <widget class="GtkAlignment" id="alignment52">
- <property name="visible">True</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <widget class="GtkHBox" id="hbox2936">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkImage" id="image439">
- <property name="visible">True</property>
- <property name="stock">gtk-revert-to-saved</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label217">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Reset to Default Colors</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">1</property>
- </packing>
- </child>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Incoming message:</property>
+ <property name="use_underline">True</property>
+ <property name="justify">GTK_JUSTIFY_CENTER</property>
+ <property name="wrap">True</property>
+ <property name="mnemonic_widget">incoming_msg_colorbutton</property>
</widget>
<packing>
- <property name="right_attach">4</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkColorButton" id="url_msg_colorbutton">
+ <widget class="GtkColorButton" id="incoming_msg_colorbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="response_id">0</property>
- <signal name="color_set" handler="on_url_msg_colorbutton_color_set"/>
+ <signal name="color_set" handler="on_incoming_msg_colorbutton_color_set"/>
</widget>
<packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="x_options"></property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label371">
+ <widget class="GtkLabel" id="label70">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">_URL highlight:</property>
+ <property name="label" translatable="yes">_Outgoing message:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">url_msg_colorbutton</property>
+ <property name="justify">GTK_JUSTIFY_CENTER</property>
+ <property name="wrap">True</property>
+ <property name="mnemonic_widget">outgoing_msg_colorbutton</property>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkColorButton" id="status_msg_colorbutton">
+ <widget class="GtkColorButton" id="outgoing_msg_colorbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="response_id">0</property>
- <signal name="color_set" handler="on_status_msg_colorbutton_color_set"/>
+ <signal name="color_set" handler="on_outgoing_msg_colorbutton_color_set"/>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
+ <property name="left_attach">3</property>
+ <property name="right_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
@@ -1636,63 +1579,120 @@
</packing>
</child>
<child>
- <widget class="GtkColorButton" id="outgoing_msg_colorbutton">
+ <widget class="GtkColorButton" id="status_msg_colorbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="response_id">0</property>
- <signal name="color_set" handler="on_outgoing_msg_colorbutton_color_set"/>
+ <signal name="color_set" handler="on_status_msg_colorbutton_color_set"/>
</widget>
<packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="x_options">GTK_FILL</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options"></property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label70">
+ <widget class="GtkLabel" id="label371">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">_Outgoing message:</property>
+ <property name="label" translatable="yes">_URL highlight:</property>
<property name="use_underline">True</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">True</property>
- <property name="mnemonic_widget">outgoing_msg_colorbutton</property>
+ <property name="mnemonic_widget">url_msg_colorbutton</property>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkColorButton" id="incoming_msg_colorbutton">
+ <widget class="GtkColorButton" id="url_msg_colorbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="response_id">0</property>
- <signal name="color_set" handler="on_incoming_msg_colorbutton_color_set"/>
+ <signal name="color_set" handler="on_url_msg_colorbutton_color_set"/>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="x_options"></property>
+ <property name="left_attach">3</property>
+ <property name="right_attach">4</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label72">
+ <widget class="GtkHBox" id="hbox3022">
<property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Incoming message:</property>
- <property name="use_underline">True</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">True</property>
- <property name="mnemonic_widget">incoming_msg_colorbutton</property>
+ <child>
+ <widget class="GtkLabel" id="label383">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="reset_colors_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="focus_on_click">False</property>
+ <property name="response_id">0</property>
+ <signal name="clicked" handler="on_reset_colors_button_clicked"/>
+ <child>
+ <widget class="GtkAlignment" id="alignment52">
+ <property name="visible">True</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <widget class="GtkHBox" id="hbox2936">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkImage" id="image439">
+ <property name="visible">True</property>
+ <property name="stock">gtk-revert-to-saved</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label217">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Reset to Default Colors</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">1</property>
+ </packing>
+ </child>
</widget>
<packing>
+ <property name="right_attach">4</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
</packing>
</child>
</widget>
@@ -1779,85 +1779,85 @@
<property name="column_spacing">12</property>
<property name="row_spacing">6</property>
<child>
- <widget class="GtkLabel" id="label199">
+ <widget class="GtkEntry" id="custom_file_manager_entry">
<property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Browser:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">custom_browser_entry</property>
+ <property name="can_focus">True</property>
+ <signal name="changed" handler="on_custom_file_manager_entry_changed"/>
</widget>
<packing>
- <property name="x_options">GTK_FILL</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label200">
+ <widget class="GtkLabel" id="label355">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">_Mail client:</property>
+ <property name="label" translatable="yes">_File manager:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">custom_mail_client_entry</property>
+ <property name="mnemonic_widget">custom_file_manager_entry</property>
</widget>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkEntry" id="custom_mail_client_entry">
+ <widget class="GtkEntry" id="custom_browser_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <signal name="changed" handler="on_custom_mail_client_entry_changed"/>
+ <signal name="changed" handler="on_custom_browser_entry_changed"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkEntry" id="custom_browser_entry">
+ <widget class="GtkEntry" id="custom_mail_client_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <signal name="changed" handler="on_custom_browser_entry_changed"/>
+ <signal name="changed" handler="on_custom_mail_client_entry_changed"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label355">
+ <widget class="GtkLabel" id="label200">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">_File manager:</property>
+ <property name="label" translatable="yes">_Mail client:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">custom_file_manager_entry</property>
+ <property name="mnemonic_widget">custom_mail_client_entry</property>
</widget>
<packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkEntry" id="custom_file_manager_entry">
+ <widget class="GtkLabel" id="label199">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <signal name="changed" handler="on_custom_file_manager_entry_changed"/>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Browser:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">custom_browser_entry</property>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
@@ -1917,23 +1917,21 @@
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="n_rows">3</property>
- <property name="n_columns">1</property>
<property name="column_spacing">6</property>
<property name="row_spacing">6</property>
<child>
- <widget class="GtkCheckButton" id="log_encrypted_chats_checkbutton">
+ <widget class="GtkCheckButton" id="ignore_events_from_unknown_contacts_checkbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">If checked, Gajim will keep logs for encrypted messages. Please note that when using E2E encryption the remote party has to agree on logging, else the messages will not be logged.</property>
- <property name="label" translatable="yes">Log _encrypted chat session</property>
+ <property name="tooltip" translatable="yes">If checked, Gajim will ignore incoming events from unauthorized contacts. Use with caution, because it blocks all messages from any contact that is not in the roster</property>
+ <property name="label" translatable="yes">_Ignore events from contacts not in the roster</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_log_encrypted_chats_checkbutton_toggled"/>
+ <signal name="toggled" handler="on_ignore_events_from_unknown_contacts_checkbutton_toggled"/>
</widget>
<packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
@@ -1953,18 +1951,19 @@
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="ignore_events_from_unknown_contacts_checkbutton">
+ <widget class="GtkCheckButton" id="log_encrypted_chats_checkbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">If checked, Gajim will ignore incoming events from unauthorized contacts. Use with caution, because it blocks all messages from any contact that is not in the roster</property>
- <property name="label" translatable="yes">_Ignore events from contacts not in the roster</property>
+ <property name="tooltip" translatable="yes">If checked, Gajim will keep logs for encrypted messages. Please note that when using E2E encryption the remote party has to agree on logging, else the messages will not be logged.</property>
+ <property name="label" translatable="yes">Log _encrypted chat session</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_ignore_events_from_unknown_contacts_checkbutton_toggled"/>
+ <signal name="toggled" handler="on_log_encrypted_chats_checkbutton_toggled"/>
</widget>
<packing>
- <property name="x_options">GTK_FILL</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
</widget>
Modified: branches/osx_newbuildsys/src/chat_control.py
===================================================================
--- branches/osx_newbuildsys/src/chat_control.py 2009-04-04 05:06:46 UTC (rev 11185)
+++ branches/osx_newbuildsys/src/chat_control.py 2009-04-05 11:57:15 UTC (rev 11186)
@@ -314,7 +314,7 @@
if lang:
self.msg_textview.lang = lang
spell.set_language(lang)
- except (gobject.GError, RuntimeError, TypeError):
+ except (gobject.GError, RuntimeError, TypeError, OSError):
dialogs.AspellDictError(lang)
def on_msg_textview_populate_popup(self, textview, menu):
Modified: branches/osx_newbuildsys/src/common/GnuPG.py
===================================================================
--- branches/osx_newbuildsys/src/common/GnuPG.py 2009-04-04 05:06:46 UTC (rev 11185)
+++ branches/osx_newbuildsys/src/common/GnuPG.py 2009-04-05 11:57:15 UTC (rev 11186)
@@ -111,7 +111,7 @@
# Encryption succeeded, even if there is output on stderr. Maybe
# verbose is on
error = ''
- return self._stripHeaderFooter(output), error
+ return self._stripHeaderFooter(output), helpers.decode_string(error)
def decrypt(self, str_, keyID):
proc = self.run(['--decrypt', '-q', '-u %s'%keyID], create_fhs=['stdin', 'stdout'])
Modified: branches/osx_newbuildsys/src/common/Makefile
===================================================================
--- branches/osx_newbuildsys/src/common/Makefile 2009-04-04 05:06:46 UTC (rev 11185)
+++ branches/osx_newbuildsys/src/common/Makefile 2009-04-05 11:57:15 UTC (rev 11186)
@@ -28,6 +28,7 @@
idle.py \
latex.py \
logger.py \
+ logging_helpers.py \
optparser.py \
passwords.py \
pep.py \
Modified: branches/osx_newbuildsys/src/common/dataforms.py
===================================================================
--- branches/osx_newbuildsys/src/common/dataforms.py 2009-04-04 05:06:46 UTC (rev 11185)
+++ branches/osx_newbuildsys/src/common/dataforms.py 2009-04-05 11:57:15 UTC (rev 11186)
@@ -159,7 +159,10 @@
def label():
'''Human-readable field name.'''
def fget(self):
- return self.getAttr('label')
+ l = self.getAttr('label')
+ if not l:
+ l = self.var
+ return l
def fset(self, value):
assert isinstance(value, basestring)
@@ -263,7 +266,10 @@
v = element.getTagData('value')
if v is None:
raise WrongFieldValue
- options.append((element.getAttr('label'), v))
+ l = element.getAttr('label')
+ if not l:
+ l = v
+ options.append((l, v))
return options
def fset(self, values):
Modified: branches/osx_newbuildsys/src/common/gajim.py
===================================================================
--- branches/osx_newbuildsys/src/common/gajim.py 2009-04-04 05:06:46 UTC (rev 11185)
+++ branches/osx_newbuildsys/src/common/gajim.py 2009-04-05 11:57:15 UTC (rev 11186)
@@ -67,16 +67,9 @@
config = config.Config()
version = config.get('version')
connections = {} # 'account name': 'account (connection.Connection) instance'
-verbose = False
ipython_window = None
-h = logging.StreamHandler()
-f = logging.Formatter('%(asctime)s %(name)s: %(message)s', '%d %b %Y %H:%M:%S')
-h.setFormatter(f)
-log = logging.getLogger('Gajim')
-log.addHandler(h)
-del h
-del f
+log = logging.getLogger('gajim')
import logger
logger = logger.Logger() # init the logger
Copied: branches/osx_newbuildsys/src/common/logging_helpers.py (from rev 11155, trunk/src/common/logging_helpers.py)
===================================================================
--- branches/osx_newbuildsys/src/common/logging_helpers.py (rev 0)
+++ branches/osx_newbuildsys/src/common/logging_helpers.py 2009-04-05 11:57:15 UTC (rev 11186)
@@ -0,0 +1,184 @@
+# -*- coding:utf-8 -*-
+## src/common/logging_helpers.py
+##
+## Copyright (C) 2009 Bruno Tarquini <btarquini AT gmail.com>
+##
+## This file is part of Gajim.
+##
+## Gajim is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published
+## by the Free Software Foundation; version 3 only.
+##
+## Gajim is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
+##
+
+import logging
+import i18n
+
+def parseLogLevel(arg):
+ """
+ eiter numeric value or level name from logging module
+ """
+ if arg.isdigit():
+ return int(arg)
+ elif arg.isupper():
+ return getattr(logging, arg)
+ else:
+ raise ValueError(_('%s is not a valid loglevel'), repr(arg))
+
+def parseLogTarget(arg):
+ """
+ [gajim.]c.x.y -> gajim.c.x.y
+ .other_logger -> other_logger
+ <None> -> gajim
+ """
+ arg = arg.lower()
+ if not arg:
+ return 'gajim'
+ elif arg.startswith('.'):
+ return arg[1:]
+ elif arg.startswith('gajim'):
+ return arg
+ else:
+ return 'gajim.' + arg
+
+def parseAndSetLogLevels(arg):
+ """
+ [=]LOGLEVEL -> gajim=LOGLEVEL
+ gajim=LOGLEVEL -> gajim=LOGLEVEL
+ .other=10 -> other=10
+ .=10 -> <nothing>
+ c.x.y=c.z=20 -> gajim.c.x.y=20
+ gajim.c.z=20
+ gajim=10,c.x=20 -> gajim=10
+ gajim.c.x=20
+ """
+ for directive in arg.split(','):
+ directive = directive.strip()
+ if not directive:
+ continue
+ if '=' not in directive:
+ directive = '=' + directive
+ targets, level = directive.rsplit('=', 1)
+ level = parseLogLevel(level.strip())
+ for target in targets.split('='):
+ target = parseLogTarget(target.strip())
+ if target:
+ logging.getLogger(target).setLevel(level)
+ print "Logger %s level set to %d" % (target, level)
+
+
+class colors:
+ NONE = chr(27) + "[0m"
+ BLACk = chr(27) + "[30m"
+ RED = chr(27) + "[31m"
+ GREEN = chr(27) + "[32m"
+ BROWN = chr(27) + "[33m"
+ BLUE = chr(27) + "[34m"
+ MAGENTA = chr(27) + "[35m"
+ CYAN = chr(27) + "[36m"
+ LIGHT_GRAY = chr(27) + "[37m"
+ DARK_GRAY = chr(27) + "[30;1m"
+ BRIGHT_RED = chr(27) + "[31;1m"
+ BRIGHT_GREEN = chr(27) + "[32;1m"
+ YELLOW = chr(27) + "[33;1m"
+ BRIGHT_BLUE = chr(27) + "[34;1m"
+ PURPLE = chr(27) + "[35;1m"
+ BRIGHT_CYAN = chr(27) + "[36;1m"
+ WHITE = chr(27) + "[37;1m"
+
+def colorize(text, color):
+ return color + text + colors.NONE
+
+class FancyFormatter(logging.Formatter):
+ """
+ A Eye-candy formatter with colors
+ """
+ colors_mapping = {
+ 'DEBUG': colors.BLUE,
+ 'INFO' : colors.GREEN,
+ 'WARNING': colors.BROWN,
+ 'ERROR': colors.RED,
+ 'CRITICAL': colors.BRIGHT_RED,
+ }
+
+ def __init__(self, fmt, datefmt=None, use_color=False):
+ logging.Formatter.__init__(self, fmt, datefmt)
+ self.use_color = use_color
+
+ def formatTime(self, record, datefmt=None):
+ f = logging.Formatter.formatTime(self, record, datefmt)
+ if self.use_color:
+ f = colorize(f, colors.DARK_GRAY)
+ return f
+
+ def format(self, record):
+ level = record.levelname
+ record.levelname = '(%s)' % level[0]
+
+ if self.use_color:
+ c = FancyFormatter.colors_mapping.get(level, '')
+ record.levelname = colorize(record.levelname, c)
+ record.name = colorize(record.name, colors.CYAN)
+ else:
+ record.name += ':'
+
+ return logging.Formatter.format(self, record)
+
+
+def init(use_color=False):
+ """
+ initialize the logging system
+ """
+ consoleloghandler = logging.StreamHandler()
+ consoleloghandler.setFormatter(
+ FancyFormatter(
+ '%(asctime)s %(levelname)s %(name)s %(message)s',
+ '%H:%M:%S',
+ use_color
+ )
+ )
+
+ # fake the root logger so we have 'gajim' root name instead of 'root'
+ root_log = logging.getLogger('gajim')
+ root_log.setLevel(logging.WARNING)
+ root_log.addHandler(consoleloghandler)
+ root_log.propagate = False
+
+def set_loglevels(loglevels_string):
+ parseAndSetLogLevels(loglevels_string)
+
+def set_verbose():
+ parseAndSetLogLevels('gajim=1')
+
+def set_quiet():
+ parseAndSetLogLevels('gajim=CRITICAL')
+
+
+# tests
+if __name__ == '__main__':
+ init(use_color=True)
+
+ set_loglevels('gajim.c=DEBUG,INFO')
+
+ log = logging.getLogger('gajim')
+ log.debug('debug')
+ log.info('info')
+ log.warn('warn')
+ log.error('error')
+ log.critical('critical')
+
+ log = logging.getLogger('gajim.c.x.dispatcher')
+ log.debug('debug')
+ log.info('info')
+ log.warn('warn')
+ log.error('error')
+ log.critical('critical')
+
+# vim: se ts=3:
Modified: branches/osx_newbuildsys/src/config.py
===================================================================
--- branches/osx_newbuildsys/src/config.py 2009-04-04 05:06:46 UTC (rev 11185)
+++ branches/osx_newbuildsys/src/config.py 2009-04-05 11:57:15 UTC (rev 11186)
@@ -522,8 +522,11 @@
self.window.hide()
def get_per_account_option(self, opt):
- '''Return the value of the option opt if it's the same in all accoutns
+ '''Return the value of the option opt if it's the same in all accounts
else returns "mixed"'''
+ if len(gajim.connections) == 0:
+ # a non existant key return default value
+ return gajim.config.get_per('accounts', '__default__', opt)
val = None
for account in gajim.connections:
v = gajim.config.get_per('accounts', account, opt)
@@ -636,7 +639,7 @@
if isinstance(ctrl, chat_control.ChatControlBase):
try:
spell_obj = gtkspell.get_from_text_view(ctrl.msg_textview)
- except (TypeError, RuntimeError):
+ except (TypeError, RuntimeError, OSError):
spell_obj = None
if not spell_obj:
@@ -663,7 +666,7 @@
tv = gtk.TextView()
try:
gtkspell.Spell(tv, lang)
- except (TypeError, RuntimeError):
+ except (TypeError, RuntimeError, OSError):
dialogs.ErrorDialog(
_('Dictionary for lang %s not available') % lang,
_('You have to install %s dictionary to use spellchecking, or '
Modified: branches/osx_newbuildsys/src/dialogs.py
===================================================================
--- branches/osx_newbuildsys/src/dialogs.py 2009-04-04 05:06:46 UTC (rev 11185)
+++ branches/osx_newbuildsys/src/dialogs.py 2009-04-05 11:57:15 UTC (rev 11186)
@@ -2203,7 +2203,7 @@
lang = gajim.LANG
gtkspell.Spell(self.conversation_textview.tv, lang)
gtkspell.Spell(self.message_textview, lang)
- except (gobject.GError, TypeError, RuntimeError):
+ except (gobject.GError, TypeError, RuntimeError, OSError):
AspellDictError(lang)
self.prepare_widgets_for(self.action)
Modified: branches/osx_newbuildsys/src/gajim.py
===================================================================
--- branches/osx_newbuildsys/src/gajim.py 2009-04-04 05:06:46 UTC (rev 11185)
+++ branches/osx_newbuildsys/src/gajim.py 2009-04-05 11:57:15 UTC (rev 11186)
@@ -66,56 +66,18 @@
# needed for docutils
sys.path.append('.')
+from common import logging_helpers
+logging_helpers.init('TERM' in os.environ)
+
import logging
-consoleloghandler = logging.StreamHandler()
-consoleloghandler.setLevel(1)
-consoleloghandler.setFormatter(
- logging.Formatter('%(asctime)s %(name)s: %(levelname)s: %(message)s')
- )
-log = logging.getLogger('gajim')
-log.setLevel(logging.WARNING)
-log.addHandler(consoleloghandler)
-log.propagate = False
+# gajim.gui or gajim.gtk more appropriate ?
log = logging.getLogger('gajim.gajim')
-# create intermediate loggers
-logging.getLogger('gajim.c')
-logging.getLogger('gajim.c.x')
-
import getopt
from common import i18n
-def parseLogLevel(arg):
- if arg.isdigit():
- return int(arg)
- if arg.isupper():
- return getattr(logging, arg)
- raise ValueError(_('%s is not a valid loglevel'), repr(arg))
-
-def parseLogTarget(arg):
- arg = arg.lower()
- if arg.startswith('.'): return arg[1:]
- if arg.startswith('gajim'): return arg
- return 'gajim.' + arg
-
-def parseAndSetLogLevels(arg):
- for directive in arg.split(','):
- directive = directive.strip()
- targets, level = directive.rsplit('=', 1)
- level = parseLogLevel(level.strip())
- for target in targets.split('='):
- target = parseLogTarget(target.strip())
- if target == '':
- consoleloghandler.setLevel(level)
- print "consoleloghandler level set to %s" % level
- else:
- logger = logging.getLogger(target)
- logger.setLevel(level)
- print "Logger %s level set to %d" % (target, level)
-
def parseOpts():
profile = ''
- verbose = False
config_path = None
try:
@@ -131,21 +93,19 @@
print 'gajim [--help] [--quiet] [--verbose] [--loglevel subsystem=level[,subsystem=level[...]]] [--profile name] [--config-path]'
sys.exit()
elif o in ('-q', '--quiet'):
- consoleloghandler.setLevel(logging.CRITICAL)
- verbose = False
+ logging_helpers.set_quiet()
elif o in ('-v', '--verbose'):
- consoleloghandler.setLevel(logging.INFO)
- verbose = True
+ logging_helpers.set_verbose()
elif o in ('-p', '--profile'): # gajim --profile name
profile = a
elif o in ('-l', '--loglevel'):
- parseAndSetLogLevels(a)
+ logging_helpers.set_loglevels(a)
elif o in ('-c', '--config-path'):
config_path = a
- return profile, verbose, config_path
+ return profile, config_path
-profile, verbose, config_path = parseOpts()
-del parseOpts, parseAndSetLogLevels, parseLogTarget, parseLogLevel
+profile, config_path = parseOpts()
+del parseOpts
import locale
profile = unicode(profile, locale.getpreferredencoding())
@@ -295,9 +255,6 @@
from common import dataforms
from common import passwords
-if verbose: gajim.verbose = True
-del verbose
-
gajimpaths = common.configpaths.gajimpaths
pid_filename = gajimpaths['PID_FILE']
@@ -3257,9 +3214,9 @@
}
cfg_was_read = parser.read()
- # Do not set gajim.verbose to False if -v option was given
+ # override logging settings from config (don't take care of '-q' option)
if gajim.config.get('verbose'):
- gajim.verbose = True
+ logging_helpers.set_verbose()
# Is Gajim default app?
if os.name != 'nt' and gajim.config.get('check_if_gajim_is_default'):
@@ -3307,11 +3264,6 @@
if gajim.config.get('autodetect_browser_mailer') or not cfg_was_read:
gtkgui_helpers.autodetect_browser_mailer()
- if gajim.verbose:
- gajim.log.setLevel(gajim.logging.DEBUG)
- else:
- gajim.log.setLevel(None)
-
gajim.idlequeue = idlequeue.get_idlequeue()
# resolve and keep current record of resolved hosts
gajim.resolver = resolver.get_resolver(gajim.idlequeue)
@@ -3468,7 +3420,7 @@
try:
import gtkspell
spell = gtkspell.Spell(tv, lang)
- except (ImportError, TypeError, RuntimeError):
+ except (ImportError, TypeError, RuntimeError, OSError):
dialogs.AspellDictError(lang)
if gajim.config.get('soundplayer') == '':
@@ -3511,9 +3463,8 @@
# ^C exits the application normally to delete pid file
signal.signal(signal.SIGINT, sigint_cb)
- if gajim.verbose:
- print >> sys.stderr, "Encodings: d:%s, fs:%s, p:%s" % \
- (sys.getdefaultencoding(), sys.getfilesystemencoding(), locale.getpreferredencoding())
+ log.info("Encodings: d:%s, fs:%s, p:%s", sys.getdefaultencoding(), \
+ sys.getfilesystemencoding(), locale.getpreferredencoding())
if ((os.name != 'nt') and (sys.platform != 'darwin')):
# Session Management support
More information about the Commits
mailing list