Author: asterix Date: 2009-03-10 12:27:24 +0100 (Tue, 10 Mar 2009) New Revision: 11146
Added: branches/gajim_0.12/data/pixmaps/events/subscription_request.png branches/gajim_0.12/data/pixmaps/events/unsubscribed.png branches/gajim_0.12/src/common/latex.py Removed: branches/gajim_0.12/data/glade/zeroconf_properties_window.glade branches/gajim_0.12/scripts/gajim-remote.in Modified: branches/gajim_0.12/Makefile.am branches/gajim_0.12/README.html branches/gajim_0.12/configure.ac branches/gajim_0.12/data/defs.py.in branches/gajim_0.12/data/glade/accounts_window.glade branches/gajim_0.12/data/glade/vcard_information_window.glade branches/gajim_0.12/m4/acinclude.m4 branches/gajim_0.12/scripts/gajim.in branches/gajim_0.12/src/Makefile.am branches/gajim_0.12/src/chat_control.py branches/gajim_0.12/src/common/GnuPG.py branches/gajim_0.12/src/common/atom.py branches/gajim_0.12/src/common/config.py branches/gajim_0.12/src/common/configpaths.py branches/gajim_0.12/src/common/connection.py branches/gajim_0.12/src/common/connection_handlers.py branches/gajim_0.12/src/common/dataforms.py branches/gajim_0.12/src/common/dbus_support.py branches/gajim_0.12/src/common/defs.py branches/gajim_0.12/src/common/events.py branches/gajim_0.12/src/common/exceptions.py branches/gajim_0.12/src/common/gajim.py branches/gajim_0.12/src/common/helpers.py branches/gajim_0.12/src/common/i18n.py branches/gajim_0.12/src/common/optparser.py branches/gajim_0.12/src/common/proxy65_manager.py branches/gajim_0.12/src/common/stanza_session.py branches/gajim_0.12/src/common/xmpp/auth_nb.py branches/gajim_0.12/src/common/xmpp/dispatcher_nb.py branches/gajim_0.12/src/common/xmpp/transports_nb.py branches/gajim_0.12/src/config.py branches/gajim_0.12/src/conversation_textview.py branches/gajim_0.12/src/dialogs.py branches/gajim_0.12/src/disco.py branches/gajim_0.12/src/features_window.py branches/gajim_0.12/src/gajim-remote.py branches/gajim_0.12/src/gajim.py branches/gajim_0.12/src/groupchat_control.py branches/gajim_0.12/src/gtkgui_helpers.py branches/gajim_0.12/src/history_manager.py branches/gajim_0.12/src/htmltextview.py branches/gajim_0.12/src/message_window.py branches/gajim_0.12/src/music_track_listener.py branches/gajim_0.12/src/network_manager_listener.py branches/gajim_0.12/src/notify.py branches/gajim_0.12/src/osx/Makefile.am branches/gajim_0.12/src/osx/growl/Makefile.am branches/gajim_0.12/src/osx/growl/_growl.c branches/gajim_0.12/src/osx/growl/_growlImage.m branches/gajim_0.12/src/osx/nsapp.m branches/gajim_0.12/src/osx/syncmenu/Makefile.am branches/gajim_0.12/src/osx/syncmenu/pysyncmenu.c branches/gajim_0.12/src/remote_control.py branches/gajim_0.12/src/roster_window.py branches/gajim_0.12/src/secrets.py branches/gajim_0.12/src/session.py branches/gajim_0.12/src/statusicon.py branches/gajim_0.12/src/systray.py branches/gajim_0.12/src/tooltips.py Log: import buxfixes from trunk: [10911] [10929] [10930] [10934] [10935] [10936] [10938] [10939] [10941] [10946] [10947] [10948] [10949] [10950] [10951] [10954] [10956] [10976] [10977] [10978] [10979] [10980] [10986] [10987] [10988] [10990] [10991] [10993] [10995] [10999] [11003] [11004] [11005] [11009] [11011] [11013] [11014] [11028] [11029] [11030] [11031] [11032] [11033] [11036] [11037] [11038] [11040] [11042] [11043] [11044] [11046] [11047] [11048] [11051] [11052] [11053] [11054] [11056] [11057] [11058] [r1060] [r1061] [11064] [11065] [11069] [11070] [11071] [11072] [11073] [11074] [11075] [11079] [11080] [11082] [11084] [11088] [11089] [11098] [11105] [11106] [11111] [11112] [11113] [11115] [11116] [11118] [11119] [11122] [11123] [11125] [11127] [11128] [11137] [11139] [11140]
Fixes #4616, #4605, #4627, #4638, #4624, #4618, #4641, #4652, #4631, #4667, #4670, #4642, #4650, #4618, #4692, #4658, #4630, #4705, #4629, #4712, #4684, #4720, #4672, #663, #4703, #4710, #3474, #4715, #4735, #4730, #4739, #4737, #4741, #4748, #4744, #4738, #4760, #4762, #4764, #4767, #4556, #4774, #4788, #4783, #4770, #4798, #4801, #4436, #4708, #2243, #4800, #4536, #4299, #3781, #4820, #4819, #4826, #4263, #4831, #4834, #4832, #4847, #4855, #4828
Modified: branches/gajim_0.12/Makefile.am =================================================================== --- branches/gajim_0.12/Makefile.am 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/Makefile.am 2009-03-10 11:27:24 UTC (rev 11146) @@ -8,7 +8,7 @@ OPTIONAL_BIN = endif
-bin_SCRIPTS = scripts/gajim $(OPTIONAL_BIN) +bin_SCRIPTS = scripts/gajim scripts/gajim-history-manager $(OPTIONAL_BIN)
docfilesdir = $(docdir) @@ -28,15 +28,15 @@ intltool-update.in \ gajim.nsi \ setup_win32.py \ - scripts/gajim.in \ - scripts/gajim-remote.in + scripts/gajim.in DISTCLEANFILES = \ intltool-extract \ intltool-merge \ intltool-update \ scripts/gajim \ - scripts/gajim-remote + scripts/gajim-remote \ + scripts/gajim-histrory-manager
MAINTAINERCLEANFILES = \ configure \
Modified: branches/gajim_0.12/README.html =================================================================== --- branches/gajim_0.12/README.html 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/README.html 2009-03-10 11:27:24 UTC (rev 11146) @@ -31,12 +31,12 @@ <li><a href="http://pyopenssl.sourceforge.net/">PyOpenSSL</a> (python-pyopenssl package in Debian) for <em>secure</em> SSL/TLS. Python's default SSL is insecure, so this package is highly recommended!</li> <li>python-crypto to enable End to end encryption</li> <li>For zeroconf (bonjour), the "enable link-local messaging" checkbox, you need dbus-glib, python-avahi</li> -<li>dnsutils (or whatever package provides the nslookup binary) for SRV support; if you don't know what that is, you don't need it</li> +<li>dnsutils (or whatever package provides the nslookup binary) for SRV support</li> <li>gtkspell and aspell-LANG where lang is your locale eg. en, fr etc</li> <li>GnomePythonExtras 2.10 or above (aka gnome-python-desktop) so you can avoid compiling trayicon and gtkspell</li> <li>gnome-python-desktop (for GnomeKeyring support)</li> <li>notification-daemon or notify-python (and D-Bus) to get cooler popups</li> -<li>D-Bus running to have gajim-remote working</li> +<li>D-Bus running to have gajim-remote working. Some distributions split dbus-x11, which is needed for dbus to work with Gajim.</li> <li>python-dbus bindings</li> <li>python-sexy to have clickable URLs in chat windows</li> <li>python-kerberos to use GSSAPI authentication. Note: version1.1 or higher is required</li>
Modified: branches/gajim_0.12/configure.ac =================================================================== --- branches/gajim_0.12/configure.ac 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/configure.ac 2009-03-10 11:27:24 UTC (rev 11146) @@ -1,5 +1,5 @@ AC_INIT([Gajim - A Jabber Instant Messager], - [0.12.1],[http://trac.gajim.org/%5D,%5Bgajim]) + [0.12.2],[http://trac.gajim.org/%5D,%5Bgajim]) AC_PREREQ([2.59]) AM_INIT_AUTOMAKE([1.8]) AC_CONFIG_HEADER(config.h) @@ -207,18 +207,12 @@ AC_SUBST([PYTHON_INCLUDES])
AS_AC_EXPAND(DATADIR, "${datadir}") - -AS_AC_EXPAND(LIBDIR, ${libdir}) - +AS_AC_EXPAND(LIBDIR, "${libdir}") AS_AC_EXPAND(DOCDIR, "${docdir}") +AS_AC_EXPAND(LOCALEDIR, "${localedir}")
AC_SUBST(VERSION) AC_SUBST(PACKAGE) -AC_SUBST(DATADIR) -AC_SUBST(LIBDIR) -AS_AC_EXPAND(DATADIR, "${DATADIR}") -AC_SUBST(DOCDIR) -AS_AC_EXPAND(DOCDIR, "${DOCDIR}")
AC_CONFIG_FILES([ Makefile @@ -237,7 +231,8 @@ src/osx/growl/Makefile src/osx/syncmenu/Makefile scripts/gajim - scripts/gajim-remote + scripts/gajim-remote:scripts/gajim.in + scripts/gajim-history-manager:scripts/gajim.in po/Makefile.in ]) AC_OUTPUT
Modified: branches/gajim_0.12/data/defs.py.in =================================================================== --- branches/gajim_0.12/data/defs.py.in 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/data/defs.py.in 2009-03-10 11:27:24 UTC (rev 11146) @@ -5,3 +5,5 @@ datadir = "@DATADIR@"
version = "@VERSION@" + +localedir = "@LOCALEDIR@"
Modified: branches/gajim_0.12/data/glade/accounts_window.glade =================================================================== --- branches/gajim_0.12/data/glade/accounts_window.glade 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/data/glade/accounts_window.glade 2009-03-10 11:27:24 UTC (rev 11146) @@ -178,134 +178,32 @@ <property name="column_spacing">6</property> <property name="row_spacing">6</property> <child> - <widget class="GtkLabel" id="label2"> + <widget class="GtkEntry" id="resource_entry1"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">_Jabber ID:</property> - <property name="use_underline">True</property> - </widget> - <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label3"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">_Password:</property> - <property name="use_underline">True</property> - </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="password_entry1"> - <property name="visible">True</property> - <property name="sensitive">False</property> <property name="can_focus">True</property> - <property name="visibility">False</property> - <property name="activates_default">True</property> - <signal name="changed" handler="on_password_entry1_changed"/> + <property name="tooltip" translatable="yes">Resource is sent to the Jabber server in order to separate the same JID in two or more parts depending on the number of the clients connected in the same server with the same account. So you might be connected in the same account with resource 'Home' and 'Work' at the same time. The resource which has the highest priority will get the events. (see below)</property> + <property name="text" translatable="yes">Gajim</property> + <signal name="focus_out_event" handler="on_resource_entry1_focus_out_event"/> </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_EXPAND | GTK_SHRINK | GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="save_password_checkbutton1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip" translatable="yes">If checked, Gajim will remember the password for this account</property> - <property name="label" translatable="yes">Save pass_word</property> - <property name="use_underline">True</property> - <property name="focus_on_click">False</property> - <property name="response_id">0</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_save_password_checkbutton1_toggled"/> - </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="GtkLabel" id="label4"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Resour_ce:</property> - <property name="use_underline">True</property> - </widget> - <packing> <property name="top_attach">2</property> <property name="bottom_attach">3</property> - <property name="x_options">GTK_FILL</property> + <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="label5"> + <widget class="GtkEntry" id="jid_entry1"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Priori_ty:</property> - <property name="use_underline">True</property> - </widget> - <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="adjust_priority_with_status_checkbutton1"> - <property name="visible">True</property> <property name="can_focus">True</property> - <property name="tooltip" translatable="yes">Priority will change automatically according to your status.</property> - <property name="label" translatable="yes">_Adjust to status</property> - <property name="use_underline">True</property> - <property name="response_id">0</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_adjust_priority_with_status_checkbutton1_toggled"/> + <property name="activates_default">True</property> + <signal name="focus_out_event" handler="on_jid_entry1_focus_out_event"/> </widget> <packing> <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkSpinButton" id="priority_spinbutton1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip" translatable="yes">Priority is used in Jabber to determine who gets the events from the jabber server when two or more clients are connected using the same account; The client with the highest priority gets the events</property> - <property name="adjustment">5 0 127 1 5 5</property> - <property name="climb_rate">1</property> - <property name="numeric">True</property> - <signal name="value_changed" handler="on_priority_spinbutton1_value_changed"/> - </widget> - <packing> - <property name="left_attach">2</property> <property name="right_attach">3</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> @@ -368,35 +266,141 @@ </packing> </child> <child> - <widget class="GtkEntry" id="jid_entry1"> + <widget class="GtkSpinButton" id="priority_spinbutton1"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="activates_default">True</property> - <signal name="focus_out_event" handler="on_jid_entry1_focus_out_event"/> + <property name="tooltip" translatable="yes">Priority is used in Jabber to determine who gets the events from the jabber server when two or more clients are connected using the same account; The client with the highest priority gets the events</property> + <property name="adjustment">5 0 127 1 5 5</property> + <property name="climb_rate">1</property> + <property name="numeric">True</property> + <signal name="value_changed" handler="on_priority_spinbutton1_value_changed"/> </widget> <packing> - <property name="left_attach">1</property> + <property name="left_attach">2</property> <property name="right_attach">3</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkEntry" id="resource_entry1"> + <widget class="GtkCheckButton" id="adjust_priority_with_status_checkbutton1"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="tooltip" translatable="yes">Resource is sent to the Jabber server in order to separate the same JID in two or more parts depending on the number of the clients connected in the same server with the same account. So you might be connected in the same account with resource 'Home' and 'Work' at the same time. The resource which has the highest priority will get the events. (see below)</property> - <property name="text" translatable="yes">Gajim</property> - <signal name="focus_out_event" handler="on_resource_entry1_focus_out_event"/> + <property name="tooltip" translatable="yes">Priority will change automatically according to your status.</property> + <property name="label" translatable="yes">A_djust to status</property> + <property name="use_underline">True</property> + <property name="response_id">0</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_adjust_priority_with_status_checkbutton1_toggled"/> </widget> <packing> <property name="left_attach">1</property> - <property name="right_attach">3</property> + <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> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Priori_ty:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">priority_spinbutton1</property> + </widget> + <packing> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Resour_ce:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">resource_entry1</property> + </widget> + <packing> <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="GtkCheckButton" id="save_password_checkbutton1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip" translatable="yes">If checked, Gajim will remember the password for this account</property> + <property name="label" translatable="yes">Save pass_word</property> + <property name="use_underline">True</property> + <property name="focus_on_click">False</property> + <property name="response_id">0</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_save_password_checkbutton1_toggled"/> + </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="GtkEntry" id="password_entry1"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="visibility">False</property> + <property name="activates_default">True</property> + <signal name="changed" handler="on_password_entry1_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_EXPAND | GTK_SHRINK | GTK_FILL</property> <property name="y_options"></property> </packing> </child> + <child> + <widget class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Password:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">password_entry1</property> + </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="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Jabber ID:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">jid_entry1</property> + </widget> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> </widget> </child> <child> @@ -541,7 +545,8 @@ <property name="visible">True</property> <property name="can_focus">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">use HTTP_PROXY environment variable</property> + <property name="label" translatable="yes">_use HTTP__PROXY environment variable</property> + <property name="use_underline">True</property> <property name="response_id">0</property> <property name="draw_indicator">True</property> <signal name="toggled" handler="on_use_env_http_proxy_checkbutton1_toggled"/> @@ -565,7 +570,7 @@ <widget class="GtkButton" id="manage_proxies_button1"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Manage...</property> + <property name="label" translatable="yes">_Manage...</property> <property name="use_underline">True</property> <property name="response_id">0</property> <signal name="clicked" handler="on_manage_proxies_button1_clicked"/> @@ -634,7 +639,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="tooltip" translatable="yes">If checked, Gajim will send keep-alive packets to prevent connection timeout which results in disconnection</property> - <property name="label" translatable="yes">Send keep-alive packets</property> + <property name="label" translatable="yes">Send _keep-alive packets</property> <property name="use_underline">True</property> <property name="response_id">0</property> <property name="active">True</property> @@ -651,7 +656,7 @@ <widget class="GtkCheckButton" id="custom_host_port_checkbutton1"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Use custom hostname/port</property> + <property name="label" translatable="yes">Use cust_om hostname/port</property> <property name="use_underline">True</property> <property name="response_id">0</property> <property name="draw_indicator">True</property> @@ -671,7 +676,8 @@ <child> <widget class="GtkLabel" id="label10"> <property name="visible">True</property> - <property name="label" translatable="yes">Hostname: </property> + <property name="label" translatable="yes">_Hostname: </property> + <property name="use_underline">True</property> </widget> <packing> <property name="expand">False</property> @@ -691,7 +697,8 @@ <child> <widget class="GtkLabel" id="label18"> <property name="visible">True</property> - <property name="label" translatable="yes">Port: </property> + <property name="label" translatable="yes">_Port: </property> + <property name="use_underline">True</property> </widget> <packing> <property name="expand">False</property> @@ -824,7 +831,7 @@ <property name="sensitive">False</property> <property name="can_focus">True</property> <property name="tooltip" translatable="yes">If checked, Gajim will get the password from a GPG agent like seahorse</property> - <property name="label" translatable="yes">Use GPG _Agent</property> + <property name="label" translatable="yes">Use G_PG Agent</property> <property name="use_underline">True</property> <property name="response_id">0</property> <property name="draw_indicator">True</property> @@ -870,7 +877,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="tooltip" translatable="yes">Information about you, as stored in the server</property> - <property name="label" translatable="yes">Edit Personal Information...</property> + <property name="label" translatable="yes">_Edit Personal Information...</property> <property name="use_underline">True</property> <property name="response_id">0</property> <signal name="clicked" handler="on_edit_details_button1_clicked"/> @@ -930,7 +937,8 @@ <property name="visible">True</property> <property name="can_focus">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">Enable</property> + <property name="label" translatable="yes">_Enable</property> + <property name="use_underline">True</property> <property name="response_id">0</property> <property name="draw_indicator">True</property> <signal name="toggled" handler="on_enable_zeroconf_checkbutton2_toggled"/> @@ -953,7 +961,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="tooltip" translatable="yes">If checked, Gajim, when launched, will automatically connect to jabber using this account</property> - <property name="label" translatable="yes">C_onnect on Gajim startup</property> + <property name="label" translatable="yes">Co_nnect on Gajim startup</property> <property name="use_underline">True</property> <property name="response_id">0</property> <property name="draw_indicator">True</property> @@ -985,7 +993,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="tooltip" translatable="yes">If checked, any change to the global status (handled by the combobox at the bottom of the roster window) will change the status of this account accordingly</property> - <property name="label" translatable="yes">Synch_ronize account status with global status</property> + <property name="label" translatable="yes">Synchroni_ze account status with global status</property> <property name="use_underline">True</property> <property name="response_id">0</property> <property name="draw_indicator">True</property> @@ -1006,7 +1014,7 @@ <property name="can_focus">True</property> <property name="tooltip" translatable="yes">If the default port that is used for incoming messages is unfitting for your setup you can select another one here. You might consider to change possible firewall settings.</property> - <property name="label" translatable="yes">Use custom port:</property> + <property name="label" translatable="yes">Use cust_om port:</property> <property name="use_underline">True</property> <property name="response_id">0</property> <property name="draw_indicator">True</property> @@ -1059,123 +1067,65 @@ <property name="column_spacing">2</property> <property name="row_spacing">5</property> <child> - <widget class="GtkVBox" id="vbox10"> + <widget class="GtkEntry" id="jabber_id_entry2"> <property name="visible">True</property> - <property name="spacing">5</property> - <child> - <widget class="GtkLabel" id="label17"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes"><b>OpenPGP</b></property> - <property name="use_markup">True</property> - </widget> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - <child> - <widget class="GtkHBox" id="hbox6"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <widget class="GtkLabel" id="gpg_key_label2"> - <property name="visible">True</property> - <property name="label" translatable="yes">No key selected</property> - </widget> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="gpg_name_label2"> - <property name="visible">True</property> - </widget> - <packing> - <property name="position">1</property> - </packing> - </child> - <child> - <widget class="GtkButton" id="gpg_choose_button2"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Choose _Key...</property> - <property name="use_underline">True</property> - <property name="response_id">0</property> - <signal name="clicked" handler="on_gpg_choose_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="position">1</property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="use_gpg_agent_checkbutton2"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip" translatable="yes">If checked, Gajim will get the password from a GPG agent like seahorse</property> - <property name="label" translatable="yes">Use GPG _Agent</property> - <property name="use_underline">True</property> - <property name="response_id">0</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_use_gpg_agent_checkbutton_toggled"/> - </widget> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">2</property> - </packing> - </child> + <property name="can_focus">True</property> + <signal name="changed" handler="on_jabber_id_entry2_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="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="label" translatable="yes">Jabber ID:</property> + </widget> + <packing> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="label16"> + <widget class="GtkLabel" id="label13"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes"><b>Personal Information</b></property> - <property name="use_markup">True</property> + <property name="label" translatable="yes">E-Mail:</property> </widget> <packing> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkEntry" id="first_name_entry2"> + <widget class="GtkEntry" id="email_entry2"> <property name="visible">True</property> <property name="can_focus">True</property> - <signal name="changed" handler="on_first_name_entry2_changed"/> + <signal name="changed" handler="on_email_entry2_changed"/> </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="top_attach">5</property> + <property name="bottom_attach">6</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="label15"> + <widget class="GtkLabel" id="label14"> <property name="visible">True</property> - <property name="label" translatable="yes">First Name:</property> + <property name="label" translatable="yes">Last Name:</property> </widget> <packing> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> @@ -1195,69 +1145,127 @@ </packing> </child> <child> - <widget class="GtkLabel" id="label14"> + <widget class="GtkLabel" id="label15"> <property name="visible">True</property> - <property name="label" translatable="yes">Last Name:</property> + <property name="label" translatable="yes">First Name:</property> </widget> <packing> - <property name="top_attach">3</property> - <property name="bottom_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="GtkEntry" id="email_entry2"> + <widget class="GtkEntry" id="first_name_entry2"> <property name="visible">True</property> <property name="can_focus">True</property> - <signal name="changed" handler="on_email_entry2_changed"/> + <signal name="changed" handler="on_first_name_entry2_changed"/> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</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="label13"> + <widget class="GtkLabel" id="label16"> <property name="visible">True</property> - <property name="label" translatable="yes">E-Mail:</property> + <property name="xalign">0</property> + <property name="label" translatable="yes"><b>Personal Information</b></property> + <property name="use_markup">True</property> </widget> <packing> - <property name="top_attach">5</property> - <property name="bottom_attach">6</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> </packing> </child> <child> - <widget class="GtkLabel" id="label12"> + <widget class="GtkVBox" id="vbox10"> <property name="visible">True</property> - <property name="label" translatable="yes">Jabber ID:</property> + <property name="spacing">5</property> + <child> + <widget class="GtkLabel" id="label17"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes"><b>OpenPGP</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + <child> + <widget class="GtkHBox" id="hbox6"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <widget class="GtkLabel" id="gpg_key_label2"> + <property name="visible">True</property> + <property name="label" translatable="yes">No key selected</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="gpg_name_label2"> + <property name="visible">True</property> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkButton" id="gpg_choose_button2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Choose _Key...</property> + <property name="use_underline">True</property> + <property name="response_id">0</property> + <signal name="clicked" handler="on_gpg_choose_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="position">1</property> + </packing> + </child> + <child> + <widget class="GtkCheckButton" id="use_gpg_agent_checkbutton2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip" translatable="yes">If checked, Gajim will get the password from a GPG agent like seahorse</property> + <property name="label" translatable="yes">Use G_PG Agent</property> + <property name="use_underline">True</property> + <property name="response_id">0</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_use_gpg_agent_checkbutton_toggled"/> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">2</property> + </packing> + </child> </widget> <packing> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> + <property name="right_attach">2</property> <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> </packing> </child> - <child> - <widget class="GtkEntry" id="jabber_id_entry2"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <signal name="changed" handler="on_jabber_id_entry2_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="y_options"></property> - </packing> - </child> </widget> <packing> <property name="position">1</property>
Modified: branches/gajim_0.12/data/glade/vcard_information_window.glade =================================================================== --- branches/gajim_0.12/data/glade/vcard_information_window.glade 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/data/glade/vcard_information_window.glade 2009-03-10 11:27:24 UTC (rev 11146) @@ -43,52 +43,80 @@ <property name="column_spacing">12</property> <property name="row_spacing">6</property> <child> - <widget class="GtkEventBox" id="status_label_eventbox"> + <widget class="GtkLabel" id="label51"> <property name="visible">True</property> - <child> - <widget class="GtkLabel" id="status_label"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> - <property name="ellipsize">PANGO_ELLIPSIZE_END</property> - </widget> - </child> + <property name="xalign">1</property> + <property name="yalign">0</property> + <property name="label" translatable="yes"><b>Jabber ID:</b></property> + <property name="use_markup">True</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"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label53"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="yalign">0</property> + <property name="label" translatable="yes"><b>Resource:</b></property> + <property name="use_markup">True</property> + </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="GtkLabel" id="label54"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="yalign">0</property> + <property name="label" translatable="yes"><b>Status:</b></property> + <property name="use_markup">True</property> + </widget> + <packing> <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> + <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="os_label"> + <widget class="GtkLabel" id="label55"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="xalign">0</property> + <property name="xalign">1</property> <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="wrap">True</property> - <property name="selectable">True</property> - <property name="ellipsize">PANGO_ELLIPSIZE_END</property> + <property name="label" translatable="yes"><b>Client:</b></property> + <property name="use_markup">True</property> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label56"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="yalign">0</property> + <property name="label" translatable="yes"><b>System:</b></property> + <property name="use_markup">True</property> + </widget> + <packing> <property name="top_attach">4</property> <property name="bottom_attach">5</property> + <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="client_name_version_label"> + <widget class="GtkLabel" id="jid_label"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="xalign">0</property> @@ -96,13 +124,10 @@ <property name="xpad">5</property> <property name="ypad">5</property> <property name="selectable">True</property> - <property name="ellipsize">PANGO_ELLIPSIZE_END</property> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> <property name="y_options"></property> </packing> </child> @@ -131,7 +156,7 @@ </packing> </child> <child> - <widget class="GtkLabel" id="jid_label"> + <widget class="GtkLabel" id="client_name_version_label"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="xalign">0</property> @@ -139,86 +164,61 @@ <property name="xpad">5</property> <property name="ypad">5</property> <property name="selectable">True</property> + <property name="ellipsize">PANGO_ELLIPSIZE_END</property> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="label56"> + <widget class="GtkLabel" id="os_label"> <property name="visible">True</property> - <property name="xalign">1</property> + <property name="can_focus">True</property> + <property name="xalign">0</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>System:</b></property> - <property name="use_markup">True</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="wrap">True</property> + <property name="selectable">True</property> + <property name="ellipsize">PANGO_ELLIPSIZE_END</property> </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> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="label55"> + <widget class="GtkEventBox" id="status_label_eventbox"> <property name="visible">True</property> - <property name="xalign">1</property> - <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Client:</b></property> - <property name="use_markup">True</property> + <child> + <widget class="GtkLabel" id="status_label"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> + <property name="ellipsize">PANGO_ELLIPSIZE_END</property> + </widget> + </child> </widget> <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label54"> - <property name="visible">True</property> - <property name="xalign">1</property> - <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Status:</b></property> - <property name="use_markup">True</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> + <property name="y_options">GTK_FILL</property> </packing> </child> - <child> - <widget class="GtkLabel" id="label53"> - <property name="visible">True</property> - <property name="xalign">1</property> - <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Resource:</b></property> - <property name="use_markup">True</property> - </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="GtkLabel" id="label51"> - <property name="visible">True</property> - <property name="xalign">1</property> - <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Jabber ID:</b></property> - <property name="use_markup">True</property> - </widget> - <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> </widget> </child> <child> @@ -286,6 +286,10 @@ </packing> </child> </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> </child> <child> <widget class="GtkExpander" id="expander5"> @@ -300,34 +304,26 @@ <property name="column_spacing">12</property> <property name="row_spacing">6</property> <child> - <widget class="GtkLabel" id="ask_title_label"> + <widget class="GtkEventBox" id="subscription_label_eventbox"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="label" translatable="yes" comments="Given Name"><b>Ask:</b></property> - <property name="use_markup">True</property> + <property name="visible_window">False</property> + <child> + <widget class="GtkLabel" id="subscription_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + </widget> + </child> </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">1</property> + <property name="right_attach">2</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="subscription_title_label"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="label" translatable="yes" comments="Family Name"><b>Subscription:</b></property> - <property name="use_markup">True</property> - </widget> - <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> <widget class="GtkEventBox" id="ask_label_eventbox"> <property name="visible">True</property> <property name="visible_window">False</property> @@ -348,25 +344,33 @@ </packing> </child> <child> - <widget class="GtkEventBox" id="subscription_label_eventbox"> + <widget class="GtkLabel" id="subscription_title_label"> <property name="visible">True</property> - <property name="visible_window">False</property> - <child> - <widget class="GtkLabel" id="subscription_label"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - </widget> - </child> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="label" translatable="yes" comments="Family Name"><b>Subscription:</b></property> + <property name="use_markup">True</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"></property> </packing> </child> + <child> + <widget class="GtkLabel" id="ask_title_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="label" translatable="yes" comments="Given Name"><b>Ask:</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <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> </widget> </child> <child> @@ -382,6 +386,8 @@ </child> </widget> <packing> + <property name="expand">False</property> + <property name="fill">False</property> <property name="position">1</property> </packing> </child> @@ -417,268 +423,128 @@ <placeholder/> </child> <child> - <widget class="GtkLabel" id="BDAY_label"> + <widget class="GtkExpander" id="expander1"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="TEL_HOME_NUMBER_label"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="EMAIL_HOME_USERID_label"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">4</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="FN_label"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="NICKNAME_label"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label57"> - <property name="visible">True</property> - <property name="xalign">1</property> - <property name="label" translatable="yes"><b>E-Mail:</b></property> - <property name="use_markup">True</property> - </widget> - <packing> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkEventBox" id="eventbox1"> - <property name="visible">True</property> - <property name="tooltip" translatable="yes" comments="Do NOT change sequence. Just translate YYYY and MM and DD (from Year, Month, Day accordingly)">Format: YYYY-MM-DD</property> <child> - <widget class="GtkLabel" id="label13"> + <widget class="GtkTable" id="table3"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Birthday:</b></property> - <property name="use_markup">True</property> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label23"> - <property name="visible">True</property> - <property name="xalign">1</property> - <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Phone No.:</b></property> - <property name="use_markup">True</property> - </widget> - <packing> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label20"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Nickname:</b></property> - <property name="use_markup">True</property> - </widget> - <packing> - <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="GtkLabel" id="label24"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Name:</b></property> - <property name="use_markup">True</property> - </widget> - <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label22"> - <property name="visible">True</property> - <property name="xalign">1</property> - <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Homepage:</b></property> - <property name="use_markup">True</property> - </widget> - <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options"></property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkExpander" id="expander2"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <child> - <widget class="GtkTable" id="table_ADR_STREET"> - <property name="visible">True</property> <property name="border_width">6</property> <property name="n_rows">3</property> <property name="n_columns">4</property> - <property name="column_spacing">5</property> - <property name="row_spacing">5</property> + <property name="column_spacing">12</property> + <property name="row_spacing">6</property> <child> - <widget class="GtkLabel" id="label25"> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <widget class="GtkLabel" id="N_FAMILY_label"> <property name="visible">True</property> + <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Country:</b></property> - <property name="use_markup">True</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> </widget> <packing> - <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="left_attach">1</property> + <property name="right_attach">2</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="label26"> + <widget class="GtkLabel" id="N_GIVEN_label"> <property name="visible">True</property> + <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Postal Code:</b></property> - <property name="use_markup">True</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> </widget> <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> + <property name="left_attach">3</property> + <property name="right_attach">4</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="N_MIDDLE_label"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</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> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="label29"> + <widget class="GtkLabel" id="N_PREFIX_label"> <property name="visible">True</property> + <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Extra Address:</b></property> - <property name="use_markup">True</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> </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">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="label27"> + <widget class="GtkLabel" id="N_SUFFIX_label"> <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> + </widget> + <packing> + <property name="left_attach">3</property> + <property name="right_attach">4</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="label18"> + <property name="visible">True</property> <property name="xalign">1</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>State:</b></property> + <property name="label" translatable="yes" comments="Family Name"><b>Family:</b></property> <property name="use_markup">True</property> </widget> <packing> - <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="GtkLabel" id="label28"> + <widget class="GtkLabel" id="label16"> <property name="visible">True</property> <property name="xalign">1</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>City:</b></property> + <property name="label" translatable="yes" comments="Middle Name"><b>Middle:</b></property> <property name="use_markup">True</property> </widget> <packing> @@ -689,38 +555,88 @@ </packing> </child> <child> - <widget class="GtkLabel" id="label31"> + <widget class="GtkLabel" id="label15"> <property name="visible">True</property> <property name="xalign">1</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Street:</b></property> + <property name="label" translatable="yes" comments="Prefix in Name"><b>Prefix:</b></property> <property name="use_markup">True</property> </widget> <packing> + <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="GtkLabel" id="ADR_HOME_CTRY_label"> + <widget class="GtkLabel" id="label17"> <property name="visible">True</property> - <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> + <property name="label" translatable="yes" comments="Given Name"><b>Given:</b></property> + <property name="use_markup">True</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="GtkLabel" id="label14"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="label" translatable="yes" comments="Suffix in Name"><b>Suffix:</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <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"></property> </packing> </child> + </widget> + </child> + <child> + <widget class="GtkLabel" id="label19"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="label" translatable="yes"><b>Full Name</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="right_attach">4</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkExpander" id="expander2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <child> + <widget class="GtkTable" id="table_ADR_STREET"> + <property name="visible">True</property> + <property name="border_width">6</property> + <property name="n_rows">3</property> + <property name="n_columns">4</property> + <property name="column_spacing">5</property> + <property name="row_spacing">5</property> <child> - <widget class="GtkLabel" id="ADR_HOME_REGION_label"> + <widget class="GtkLabel" id="ADR_HOME_STREET_label"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="xalign">0</property> @@ -732,13 +648,11 @@ <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="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="ADR_HOME_PCODE_label"> + <widget class="GtkLabel" id="ADR_HOME_EXTADR_label"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="xalign">0</property> @@ -750,8 +664,6 @@ <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="y_options"></property> </packing> </child> @@ -774,7 +686,7 @@ </packing> </child> <child> - <widget class="GtkLabel" id="ADR_HOME_EXTADR_label"> + <widget class="GtkLabel" id="ADR_HOME_PCODE_label"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="xalign">0</property> @@ -786,11 +698,13 @@ <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="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="ADR_HOME_STREET_label"> + <widget class="GtkLabel" id="ADR_HOME_REGION_label"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="xalign">0</property> @@ -802,102 +716,48 @@ <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="y_options"></property> </packing> </child> - </widget> - </child> - <child> - <widget class="GtkLabel" id="label30"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Address</b></property> - <property name="use_markup">True</property> - </widget> - <packing> - <property name="type">label_item</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="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkExpander" id="expander1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <child> - <widget class="GtkTable" id="table3"> - <property name="visible">True</property> - <property name="border_width">6</property> - <property name="n_rows">3</property> - <property name="n_columns">4</property> - <property name="column_spacing">12</property> - <property name="row_spacing">6</property> <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <widget class="GtkLabel" id="label14"> + <widget class="GtkLabel" id="ADR_HOME_CTRY_label"> <property name="visible">True</property> + <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="label" translatable="yes" comments="Suffix in Name"><b>Suffix:</b></property> - <property name="use_markup">True</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> </widget> <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> + <property name="left_attach">3</property> + <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="GtkLabel" id="label17"> + <widget class="GtkLabel" id="label31"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="label" translatable="yes" comments="Given Name"><b>Given:</b></property> - <property name="use_markup">True</property> - </widget> - <packing> - <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="GtkLabel" id="label15"> - <property name="visible">True</property> <property name="xalign">1</property> <property name="yalign">0</property> - <property name="label" translatable="yes" comments="Prefix in Name"><b>Prefix:</b></property> + <property name="label" translatable="yes"><b>Street:</b></property> <property name="use_markup">True</property> </widget> <packing> - <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="GtkLabel" id="label16"> + <widget class="GtkLabel" id="label28"> <property name="visible">True</property> <property name="xalign">1</property> <property name="yalign">0</property> - <property name="label" translatable="yes" comments="Middle Name"><b>Middle:</b></property> + <property name="label" translatable="yes"><b>City:</b></property> <property name="use_markup">True</property> </widget> <packing> @@ -908,112 +768,77 @@ </packing> </child> <child> - <widget class="GtkLabel" id="label18"> + <widget class="GtkLabel" id="label27"> <property name="visible">True</property> <property name="xalign">1</property> <property name="yalign">0</property> - <property name="label" translatable="yes" comments="Family Name"><b>Family:</b></property> + <property name="label" translatable="yes"><b>State:</b></property> <property name="use_markup">True</property> </widget> <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="N_SUFFIX_label"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> - </widget> - <packing> - <property name="left_attach">3</property> - <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="GtkLabel" id="N_PREFIX_label"> + <widget class="GtkLabel" id="label29"> <property name="visible">True</property> - <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> + <property name="label" translatable="yes"><b>Extra Address:</b></property> + <property name="use_markup">True</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="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="GtkLabel" id="N_MIDDLE_label"> + <widget class="GtkLabel" id="label26"> <property name="visible">True</property> - <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> + <property name="label" translatable="yes"><b>Postal Code:</b></property> + <property name="use_markup">True</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"></property> </packing> </child> <child> - <widget class="GtkLabel" id="N_GIVEN_label"> + <widget class="GtkLabel" id="label25"> <property name="visible">True</property> - <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> + <property name="label" translatable="yes"><b>Country:</b></property> + <property name="use_markup">True</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="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="GtkLabel" id="N_FAMILY_label"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="y_options"></property> - </packing> - </child> </widget> </child> <child> - <widget class="GtkLabel" id="label19"> + <widget class="GtkLabel" id="label30"> <property name="visible">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Full Name</b></property> + <property name="label" translatable="yes"><b>Address</b></property> <property name="use_markup">True</property> </widget> <packing> @@ -1023,11 +848,192 @@ </widget> <packing> <property name="right_attach">4</property> - <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="y_options"></property> </packing> </child> + <child> + <widget class="GtkLabel" id="label22"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="yalign">0</property> + <property name="label" translatable="yes"><b>Homepage:</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options"></property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label24"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="label" translatable="yes"><b>Name:</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label20"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="label" translatable="yes"><b>Nickname:</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <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="GtkLabel" id="label23"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="yalign">0</property> + <property name="label" translatable="yes"><b>Phone No.:</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkEventBox" id="eventbox1"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes" comments="Do NOT change sequence. Just translate YYYY and MM and DD (from Year, Month, Day accordingly)">Format: YYYY-MM-DD</property> + <child> + <widget class="GtkLabel" id="label13"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="label" translatable="yes"><b>Birthday:</b></property> + <property name="use_markup">True</property> + </widget> + </child> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label57"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes"><b>E-Mail:</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="NICKNAME_label"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> + </widget> + <packing> + <property name="left_attach">3</property> + <property name="right_attach">4</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="FN_label"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="EMAIL_HOME_USERID_label"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">4</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="TEL_HOME_NUMBER_label"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="BDAY_label"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> + </widget> + <packing> + <property name="left_attach">3</property> + <property name="right_attach">4</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + <property name="y_options"></property> + </packing> + </child> </widget> <packing> <property name="position">1</property> @@ -1061,98 +1067,80 @@ <placeholder/> </child> <child> - <widget class="GtkLabel" id="label33"> + <widget class="GtkLabel" id="ORG_ORGNAME_label"> <property name="visible">True</property> - <property name="xalign">1</property> + <property name="can_focus">True</property> + <property name="xalign">0</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Phone No.:</b></property> - <property name="use_markup">True</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> + <property name="ellipsize">PANGO_ELLIPSIZE_END</property> </widget> <packing> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">GTK_FILL</property> + <property name="left_attach">1</property> + <property name="right_attach">2</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="label32"> + <widget class="GtkLabel" id="ORG_ORGUNIT_label"> <property name="visible">True</property> - <property name="xalign">1</property> + <property name="can_focus">True</property> + <property name="xalign">0</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>E-Mail:</b></property> - <property name="use_markup">True</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> + <property name="ellipsize">PANGO_ELLIPSIZE_END</property> </widget> <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</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="GtkLabel" id="label41"> + <widget class="GtkLabel" id="TITLE_label"> <property name="visible">True</property> + <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Role:</b></property> - <property name="use_markup">True</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> + <property name="ellipsize">PANGO_ELLIPSIZE_END</property> </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> </packing> </child> <child> - <widget class="GtkLabel" id="label43"> + <widget class="GtkLabel" id="ROLE_label"> <property name="visible">True</property> + <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Department:</b></property> - <property name="use_markup">True</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> + <property name="ellipsize">PANGO_ELLIPSIZE_END</property> </widget> <packing> - <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="GtkLabel" id="label42"> - <property name="visible">True</property> - <property name="xalign">1</property> - <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Position:</b></property> - <property name="use_markup">True</property> - </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="GtkLabel" id="label44"> + <widget class="GtkLabel" id="EMAIL_WORK_USERID_label"> <property name="visible">True</property> - <property name="xalign">1</property> - <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Company:</b></property> - <property name="use_markup">True</property> - </widget> - <packing> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="TEL_WORK_NUMBER_label"> - <property name="visible">True</property> <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -1162,9 +1150,9 @@ </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="right_attach">4</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> <property name="y_options"></property> </packing> </child> @@ -1181,95 +1169,88 @@ <property name="column_spacing">5</property> <property name="row_spacing">5</property> <child> - <widget class="GtkLabel" id="label34"> + <widget class="GtkLabel" id="ADR_WORK_STREET_label"> <property name="visible">True</property> + <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Country:</b></property> - <property name="use_markup">True</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> </widget> <packing> - <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="left_attach">1</property> + <property name="right_attach">2</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="label35"> + <widget class="GtkLabel" id="ADR_WORK_EXTADR_label"> <property name="visible">True</property> + <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Postal Code:</b></property> - <property name="use_markup">True</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</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="left_attach">3</property> + <property name="right_attach">4</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="label38"> + <widget class="GtkLabel" id="ADR_WORK_LOCALITY_label"> <property name="visible">True</property> + <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Extra Address:</b></property> - <property name="use_markup">True</property> - <property name="single_line_mode">True</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> </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">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="label36"> + <widget class="GtkLabel" id="ADR_WORK_PCODE_label"> <property name="visible">True</property> - <property name="xalign">1</property> + <property name="can_focus">True</property> + <property name="xalign">0</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>State:</b></property> - <property name="use_markup">True</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> </widget> <packing> - <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="GtkLabel" id="label37"> - <property name="visible">True</property> - <property name="xalign">1</property> - <property name="yalign">0</property> - <property name="label" translatable="yes"><b>City:</b></property> - <property name="use_markup">True</property> - </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="GtkLabel" id="label39"> + <widget class="GtkLabel" id="ADR_WORK_REGION_label"> <property name="visible">True</property> - <property name="xalign">1</property> + <property name="can_focus">True</property> + <property name="xalign">0</property> <property name="yalign">0</property> - <property name="label" translatable="yes"><b>Street:</b></property> - <property name="use_markup">True</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + <property name="selectable">True</property> </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> @@ -1292,88 +1273,95 @@ </packing> </child> <child> - <widget class="GtkLabel" id="ADR_WORK_REGION_label"> + <widget class="GtkLabel" id="label39"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="xalign">0</property> + <property name="xalign">1</property> <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> + <property name="label" translatable="yes"><b>Street:</b></property> + <property name="use_markup">True</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> <child> - <widget class="GtkLabel" id="ADR_WORK_PCODE_label"> + <widget class="GtkLabel" id="label37"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="xalign">0</property> + <property name="xalign">1</property> <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> + <property name="label" translatable="yes"><b>City:</b></property> + <property name="use_markup">True</property> </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="GtkLabel" id="ADR_WORK_LOCALITY_label"> + <widget class="GtkLabel" id="label36"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="xalign">1</property> + <property name="yalign">0</property> + <property name="label" translatable="yes"><b>State:</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <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="GtkLabel" id="label38"> + <property name="visible">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> + <property name="label" translatable="yes"><b>Extra Address:</b></property> + <property name="use_markup">True</property> + <property name="single_line_mode">True</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="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="GtkLabel" id="ADR_WORK_EXTADR_label"> + <widget class="GtkLabel" id="label35"> <property name="visible">True</property> - <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> + <property name="label" translatable="yes"><b>Postal Code:</b></property> + <property name="use_markup">True</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="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="ADR_WORK_STREET_label"> + <widget class="GtkLabel" id="label34"> <property name="visible">True</property> - <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> + <property name="label" translatable="yes"><b>Country:</b></property> + <property name="use_markup">True</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">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> @@ -1400,7 +1388,7 @@ </packing> </child> <child> - <widget class="GtkLabel" id="EMAIL_WORK_USERID_label"> + <widget class="GtkLabel" id="TEL_WORK_NUMBER_label"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="xalign">0</property> @@ -1411,81 +1399,99 @@ </widget> <packing> <property name="left_attach">1</property> - <property name="right_attach">4</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="right_attach">2</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="ROLE_label"> + <widget class="GtkLabel" id="label44"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="xalign">0</property> + <property name="xalign">1</property> <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> - <property name="ellipsize">PANGO_ELLIPSIZE_END</property> + <property name="label" translatable="yes"><b>Company:</b></property> + <property name="use_markup">True</property> </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="GtkLabel" id="label42"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="yalign">0</property> + <property name="label" translatable="yes"><b>Position:</b></property> + <property name="use_markup">True</property> + </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="GtkLabel" id="TITLE_label"> + <widget class="GtkLabel" id="label43"> <property name="visible">True</property> - <property name="can_focus">True</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> - <property name="ellipsize">PANGO_ELLIPSIZE_END</property> + <property name="label" translatable="yes"><b>Department:</b></property> + <property name="use_markup">True</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="x_options">GTK_FILL</property> + <property name="y_options"></property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label41"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="label" translatable="yes"><b>Role:</b></property> + <property name="use_markup">True</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="GtkLabel" id="ORG_ORGUNIT_label"> + <widget class="GtkLabel" id="label32"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="xalign">0</property> + <property name="xalign">1</property> <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> - <property name="ellipsize">PANGO_ELLIPSIZE_END</property> + <property name="label" translatable="yes"><b>E-Mail:</b></property> + <property name="use_markup">True</property> </widget> <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="ORG_ORGNAME_label"> + <widget class="GtkLabel" id="label33"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="xalign">0</property> + <property name="xalign">1</property> <property name="yalign">0</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - <property name="selectable">True</property> - <property name="ellipsize">PANGO_ELLIPSIZE_END</property> + <property name="label" translatable="yes"><b>Phone No.:</b></property> + <property name="use_markup">True</property> </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> <property name="y_options"></property> </packing> </child>
Deleted: branches/gajim_0.12/data/glade/zeroconf_properties_window.glade =================================================================== --- branches/gajim_0.12/data/glade/zeroconf_properties_window.glade 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/data/glade/zeroconf_properties_window.glade 2009-03-10 11:27:24 UTC (rev 11146) @@ -1,683 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - -<glade-interface> - -<widget class="GtkWindow" id="zeroconf_properties_window"> - <property name="border_width">12</property> - <property name="title" translatable="yes">Modify Account</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</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="destroy" handler="on_zeroconf_properties_window_destroy" last_modification_time="Tue, 19 Sep 2006 22:21:09 GMT"/> - - <child> - <widget class="GtkVBox" id="vbox7"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkHBox" id="hbox23"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">5</property> - - <child> - <widget class="GtkNotebook" id="notebook1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="show_tabs">True</property> - <property name="show_border">True</property> - <property name="tab_pos">GTK_POS_TOP</property> - <property name="scrollable">False</property> - <property name="enable_popup">False</property> - - <child> - <widget class="GtkVBox" id="vbox38"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkCheckButton" id="autoconnect_checkbutton"> - <property name="visible">True</property> - <property name="tooltip" translatable="yes">If checked, Gajim, when launched, will automatically connect to jabber using this account</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">C_onnect on Gajim startup</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> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="log_history_checkbutton"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Save conversation _logs for all contacts</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> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="sync_with_global_status_checkbutton"> - <property name="visible">True</property> - <property name="tooltip" translatable="yes">If checked, any change to the global status (handled by the combobox at the bottom of the roster window) will change the status of this account accordingly</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Synch_ronize account status with global status</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> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox24"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkCheckButton" id="custom_port_checkbutton"> - <property name="visible">True</property> - <property name="tooltip" translatable="yes">If the default port that is used for incoming messages is unfitting for your setup you can select another one here. -You might consider to change possible firewall settings.</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Use custom port:</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_custom_port_checkbutton_toggled" last_modification_time="Wed, 20 Sep 2006 18:29:49 GMT"/> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="custom_port_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="activates_default">False</property> - <property name="width_chars">6</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">10</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label7"> - <property name="visible">True</property> - <property name="label" translatable="yes">General</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.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="type">tab</property> - </packing> - </child> - - <child> - <widget class="GtkTable" id="table1"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="n_rows">6</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">5</property> - <property name="column_spacing">2</property> - - <child> - <widget class="GtkEntry" id="jabber_id_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="activates_default">False</property> - </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="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label363"> - <property name="visible">True</property> - <property name="label" translatable="yes">Jabber ID:</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="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label364"> - <property name="visible">True</property> - <property name="label" translatable="yes">E-Mail:</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="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="email_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label362"> - <property name="visible">True</property> - <property name="label" translatable="yes">Last Name:</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="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="last_name_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label361"> - <property name="visible">True</property> - <property name="label" translatable="yes">First Name:</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="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="first_name_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="activates_default">False</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="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label366"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Personal Information</b></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="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox96"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">5</property> - - <child> - <widget class="GtkLabel" id="label365"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>OpenPGP</b></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="GtkHBox" id="hbox25"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">5</property> - - <child> - <widget class="GtkLabel" id="gpg_key_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">No key selected</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">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="gpg_name_label"> - <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="gpg_choose_button"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Choose _Key...</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_gpg_choose_button_clicked" last_modification_time="Mon, 02 Oct 2006 00:23:00 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">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox26"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkCheckButton" id="gpg_save_password_checkbutton"> - <property name="visible">True</property> - <property name="tooltip" translatable="yes">If checked, Gajim will store the password in ~/.gajim/config with 'read' permission only for you</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Save _passphrase (insecure)</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_gpg_save_password_checkbutton_toggled" last_modification_time="Mon, 02 Oct 2006 00:27:36 GMT"/> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="gpg_password_entry"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">False</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label360"> - <property name="visible">True</property> - <property name="label" translatable="yes">Personal Information</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="type">tab</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">2</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHButtonBox" id="hbuttonbox6"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_END</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkButton" id="cancel_button"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-cancel</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_cancel_button_clicked" last_modification_time="Sun, 17 Apr 2005 18:17:10 GMT"/> - <accelerator key="Escape" modifiers="0" signal="clicked"/> - </widget> - </child> - - <child> - <widget class="GtkButton" id="save_button"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-save</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_save_button_clicked" last_modification_time="Mon, 28 Feb 2005 20:30:56 GMT"/> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - -</glade-interface>
Copied: branches/gajim_0.12/data/pixmaps/events/subscription_request.png (from rev 11084, trunk/data/pixmaps/events/subscription_request.png) =================================================================== (Binary files differ)
Copied: branches/gajim_0.12/data/pixmaps/events/unsubscribed.png (from rev 11084, trunk/data/pixmaps/events/unsubscribed.png) =================================================================== (Binary files differ)
Modified: branches/gajim_0.12/m4/acinclude.m4 =================================================================== --- branches/gajim_0.12/m4/acinclude.m4 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/m4/acinclude.m4 2009-03-10 11:27:24 UTC (rev 11146) @@ -1,6 +1,15 @@ +dnl as-ac-expand.m4 0.2.0 -*- autoconf -*- +dnl autostars m4 macro for expanding directories using configure's prefix + +dnl (C) 2003, 2004, 2005 Thomas Vander Stichele <thomas at apestaart dot org> + +dnl Copying and distribution of this file, with or without modification, +dnl are permitted in any medium without royalty provided the copyright +dnl notice and this notice are preserved. + dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR) -dnl -dnl example + +dnl example: dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir) dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
@@ -15,7 +24,7 @@
dnl if no prefix given, then use /usr/local, the default prefix if test "x$prefix" = "xNONE"; then - prefix=$ac_default_prefix + prefix="$ac_default_prefix" fi dnl if no exec_prefix given, then use prefix if test "x$exec_prefix" = "xNONE"; then @@ -26,7 +35,7 @@ dnl loop until it doesn't change anymore while true; do new_full_var="`eval echo $full_var`" - if test "x$new_full_var"="x$full_var"; then break; fi + if test "x$new_full_var" = "x$full_var"; then break; fi full_var=$new_full_var done
Deleted: branches/gajim_0.12/scripts/gajim-remote.in =================================================================== --- branches/gajim_0.12/scripts/gajim-remote.in 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/scripts/gajim-remote.in 2009-03-10 11:27:24 UTC (rev 11146) @@ -1,32 +0,0 @@ -#!/bin/sh -## scripts/gajim-remote.in -## -## Copyright (C) 2006 Yann Leboulanger <asterix AT lagaule.org> -## Copyright (C) 2008 Jonathan Schleifer <js-gajim AT webkeks.org> -## -## 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/. -## - -if test $(id -u) -eq 0; then - echo "You must not launch gajim-remote as root, it is INSECURE" - exit 1 -fi - -datadir=@DATADIR@ -PYTHON_EXEC=@PYTHON@ - -cd ${datadir}/gajim/src -export PYTHONPATH="$PYTHONPATH:@LIBDIR@/gajim" -exec ${PYTHON_EXEC} -OO gajim-remote.py "$@"
Modified: branches/gajim_0.12/scripts/gajim.in =================================================================== --- branches/gajim_0.12/scripts/gajim.in 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/scripts/gajim.in 2009-03-10 11:27:24 UTC (rev 11146) @@ -21,14 +21,17 @@ ## along with Gajim. If not, see http://www.gnu.org/licenses/. ##
+APP=`basename $0` if test $(id -u) -eq 0; then - echo "You must not launch Gajim as root, it is INSECURE" + echo "You must not launch $APP as root, it is INSECURE" exit 1 fi
-datadir=@DATADIR@ +[ "$APP" = "gajim-history-manager" ] && APP="history_manager" + +export datadir=@DATADIR@/gajim PYTHON_EXEC=@PYTHON@
-cd ${datadir}/gajim/src +cd ${datadir}/src export PYTHONPATH="$PYTHONPATH:@LIBDIR@/gajim" -exec ${PYTHON_EXEC} -OO gajim.py $@ +exec ${PYTHON_EXEC} -OO $APP.py "$@"
Modified: branches/gajim_0.12/src/Makefile.am =================================================================== --- branches/gajim_0.12/src/Makefile.am 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/Makefile.am 2009-03-10 11:27:24 UTC (rev 11146) @@ -8,7 +8,7 @@
if BUILD_GTKSPELL gtkspelllib_LTLIBRARIES = gtkspell.la -gtkspelllibdir = $(libdir)/gajim +gtkspelllibdir = $(pkglibdir)
gtkspell_la_LIBADD = \ $(GTKSPELL_LIBS) $(PYGTK_LIBS) @@ -23,7 +23,7 @@ endif if BUILD_TRAYICON trayiconlib_LTLIBRARIES = trayicon.la -trayiconlibdir = $(libdir)/gajim +trayiconlibdir = $(pkglibdir) trayicon_la_LIBADD = $(PYGTK_LIBS) trayicon_la_SOURCES = \ eggtrayicon.c \
Modified: branches/gajim_0.12/src/chat_control.py =================================================================== --- branches/gajim_0.12/src/chat_control.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/chat_control.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -135,7 +135,9 @@
def handle_message_textview_mykey_press(self, widget, event_keyval, event_keymod): - pass # Derived should implement this rather than connecting to the event itself. + # Derived should implement this rather than connecting to the event + # itself. + pass
def status_url_clicked(self, widget, url): helpers.launch_browser_mailer('url', url) @@ -164,17 +166,18 @@
# Create banner and connect signals widget = self.xml.get_widget('banner_eventbox') - widget.set_property('height-request', gajim.config.get('chat_avatar_height')) id = widget.connect('button-press-event', self._on_banner_eventbox_button_press_event) self.handlers[id] = widget
- self.urlfinder = re.compile(r"(www.(?!.)|[a-z][a-z0-9+.-]*://)[^\s<>'"]+[^!,.\s<>)'"]]") + self.urlfinder = re.compile( + r"(www.(?!.)|[a-z][a-z0-9+.-]*://)[^\s<>'"]+[^!,.\s<>)'"]]")
if gajim.HAVE_PYSEXY: import sexy self.banner_status_label = sexy.UrlLabel() - self.banner_status_label.connect('url_activated', self.status_url_clicked) + self.banner_status_label.connect('url_activated', + self.status_url_clicked) else: self.banner_status_label = gtk.Label() self.banner_status_label.set_selectable(True) @@ -273,29 +276,7 @@
# Attach speller if gajim.config.get('use_speller') and HAS_GTK_SPELL: - try: - spell = gtkspell.Spell(self.msg_textview) - # loop removing non-existant dictionaries - # iterating on a copy - for lang in dict(langs): - try: - spell.set_language(langs[lang]) - except Exception: - del langs[lang] - # now set the one the user selected - per_type = 'contacts' - if self.type_id == message_control.TYPE_GC: - per_type = 'rooms' - lang = gajim.config.get_per(per_type, self.contact.jid, - 'speller_language') - if not lang: - # use the default one - lang = gajim.config.get('speller_language') - if lang: - self.msg_textview.lang = lang - spell.set_language(lang) - except (gobject.GError, RuntimeError), msg: - dialogs.AspellDictError(lang) + self.set_speller() self.conv_textview.tv.show() self._paint_banner()
@@ -305,8 +286,37 @@ self.smooth = True self.msg_textview.grab_focus()
+ def set_speller(self): + try: + lang = gajim.config.get('speller_language') + if not lang: + lang = gajim.LANG + spell = gtkspell.Spell(self.msg_textview, lang) + # loop removing non-existant dictionaries + # iterating on a copy + for lang in dict(langs): + try: + spell.set_language(langs[lang]) + except Exception: + del langs[lang] + # now set the one the user selected + per_type = 'contacts' + if self.type_id == message_control.TYPE_GC: + per_type = 'rooms' + lang = gajim.config.get_per(per_type, self.contact.jid, + 'speller_language') + if not lang: + # use the default one + lang = gajim.config.get('speller_language') + if lang: + self.msg_textview.lang = lang + spell.set_language(lang) + except (gobject.GError, RuntimeError), msg: + dialogs.AspellDictError(lang) + def on_msg_textview_populate_popup(self, textview, menu): - '''we override the default context menu and we prepend an option to switch languages''' + '''we override the default context menu and we prepend an option to switch + languages''' def _on_select_dictionary(widget, lang): per_type = 'contacts' if self.type_id == message_control.TYPE_GC: @@ -668,7 +678,7 @@ # other_tags_for_text == ['marked'] --> highlighted gc message gajim.last_message_time[self.account][full_jid] = time.time()
- if kind in ('incoming', 'incoming_queue'): + if kind in ('incoming', 'incoming_queue', 'error'): gc_message = False if self.type_id == message_control.TYPE_GC: gc_message = True @@ -678,7 +688,7 @@ not self.parent_win.is_active() or not end)) or \ (gc_message and \ jid in gajim.interface.minimized_controls[self.account])) and \ - kind in ('incoming', 'incoming_queue'): + kind in ('incoming', 'incoming_queue', 'error'): # we want to have save this message in events list # other_tags_for_text == ['marked'] --> highlighted gc message if gc_message: @@ -710,7 +720,7 @@ if (not self.parent_win.get_active_control() or \ self != self.parent_win.get_active_control() or \ not self.parent_win.is_active() or not end) and \ - kind in ('incoming', 'incoming_queue'): + kind in ('incoming', 'incoming_queue', 'error'): self.parent_win.redraw_tab(self) if not self.parent_win.is_active(): self.parent_win.show_title(True, self) # Enabled Urgent hint @@ -1017,6 +1027,7 @@ ChatControlBase.__init__(self, self.TYPE_ID, parent_win, 'chat_child_vbox', contact, acct, resource)
+ self.gpg_is_active = False # for muc use: # widget = self.xml.get_widget('muc_window_actions_button') self.actions_button = self.xml.get_widget('message_window_actions_button') @@ -1107,6 +1118,8 @@ self.handlers[id] = message_tv_buffer
widget = self.xml.get_widget('avatar_eventbox') + widget.set_property('height-request', gajim.config.get( + 'chat_avatar_height')) id = widget.connect('enter-notify-event', self.on_avatar_eventbox_enter_notify_event) self.handlers[id] = widget @@ -1139,7 +1152,6 @@ # Enable encryption if needed self.no_autonegotiation = False e2e_is_active = self.session and self.session.enable_encryption - self.gpg_is_active = False gpg_pref = gajim.config.get_per('contacts', contact.jid, 'gpg_enabled')
@@ -1549,7 +1561,8 @@ ChatControlBase.print_conversation_line(self, msg, 'status', '', None)
- loggable = gajim.config.get('log_encrypted_sessions') + loggable = gajim.config.get_per('accounts', self.account, + 'log_encrypted_sessions')
if self.session: self.session.loggable = loggable @@ -1829,12 +1842,13 @@
def print_conversation(self, text, frm='', tim=None, encrypted=False, subject=None, xhtml=None, simple=False, xep0184_id=None): - # TODO: contact? ITYM frm. '''Print a line in the conversation: - if contact is set to status: it's a status message - if contact is set to another value: it's an outgoing message - if contact is set to print_queue: it is incomming from queue - if contact is not set: it's an incomming message''' + if frm is set to status: it's a status message + if frm is set to error: it's an error message + if frm is set to info: it's a information message + if frm is set to print_queue: it is incomming from queue + if frm is set to another value: it's an outgoing message + if frm is not set: it's an incomming message''' contact = self.contact jid = contact.jid
@@ -1843,6 +1857,9 @@ return kind = 'status' name = '' + elif frm == 'error': + kind = 'error' + name = '' elif frm == 'info': kind = 'info' name = '' @@ -2336,10 +2353,10 @@
e2e_is_active = self.session and \ self.session.enable_encryption - e2e_pref = gajim.config.get_per('accounts', - self.account, 'autonegotiate_esessions') and \ - gajim.config.get_per('contacts', - self.contact.jid, 'autonegotiate_esessions') + e2e_pref = gajim.config.get_per('accounts', self.account, + 'enable_esessions') and gajim.config.get_per('accounts', + self.account, 'autonegotiate_esessions') and gajim.config.get_per( + 'contacts', self.contact.jid, 'autonegotiate_esessions') want_e2e = not e2e_is_active and not self.gpg_is_active \ and e2e_pref
Modified: branches/gajim_0.12/src/common/GnuPG.py =================================================================== --- branches/gajim_0.12/src/common/GnuPG.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/GnuPG.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -35,11 +35,15 @@ GnuPGInterface.GnuPG.__init__(self) self.use_agent = use_agent self._setup_my_options() + self.always_trust = False
def _setup_my_options(self): self.options.armor = 1 self.options.meta_interactive = 0 self.options.extra_args.append('--no-secmem-warning') + # disable photo viewer when verifying keys + self.options.extra_args.append('--verify-options') + self.options.extra_args.append('no-show-photo') if self.use_agent: self.options.extra_args.append('--use-agent')
@@ -68,10 +72,13 @@ resp[ keyword ] = "" return resp
- def encrypt(self, str_, recipients): + def encrypt(self, str_, recipients, always_trust=False): self.options.recipients = recipients # a list!
- proc = self.run(['--encrypt'], create_fhs=['stdin', 'stdout', 'status', + opt = ['--encrypt'] + if always_trust or self.always_trust: + opt.append('--always-trust') + proc = self.run(opt, create_fhs=['stdin', 'stdout', 'status', 'stderr']) proc.handles['stdin'].write(str_) try: @@ -97,6 +104,9 @@
try: proc.wait() except IOError: pass + if 'INV_RECP' in resp and resp['INV_RECP'].split()[0] == '10': + # unusable recipient "Key not trusted" + return '', 'NOT_TRUSTED' if 'BEGIN_ENCRYPTION' in resp and 'END_ENCRYPTION' in resp: # Encryption succeeded, even if there is output on stderr. Maybe # verbose is on @@ -142,6 +152,8 @@ except IOError: pass if 'GOOD_PASSPHRASE' in resp or 'SIG_CREATED' in resp: return self._stripHeaderFooter(output) + if 'KEYEXPIRED' in resp: + return 'KEYEXPIRED' return 'BAD_PASSPHRASE'
def verify(self, str_, sign):
Modified: branches/gajim_0.12/src/common/atom.py =================================================================== --- branches/gajim_0.12/src/common/atom.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/atom.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -64,7 +64,7 @@ xmpp.Node.__init__(self, 'entry', node=node)
def __repr__(self): - return '<Atom:Entry object of id="%r">' % self.id + return '<Atom:Entry object of id="%r">' % self.getAttr('id')
class OldEntry(xmpp.Node, object): ''' Parser for feeds from pubsub.com. They use old Atom 0.3 format with @@ -74,7 +74,7 @@ xmpp.Node.__init__(self, 'entry', node=node)
def __repr__(self): - return '<Atom0.3:Entry object of id="%r">' % self.id + return '<Atom0.3:Entry object of id="%r">' % self.getAttr('id')
def get_feed_title(self): ''' Returns title of feed, where the entry was created. The result is the feed name
Modified: branches/gajim_0.12/src/common/config.py =================================================================== --- branches/gajim_0.12/src/common/config.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/config.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -80,7 +80,6 @@ 'notify_on_new_message': [ opt_bool, True ], 'autopopupaway': [ opt_bool, False ], 'use_notif_daemon': [ opt_bool, True , _('Use D-Bus and Notification-Daemon to show notifications') ], - 'ignore_unknown_contacts': [ opt_bool, False ], 'showoffline': [ opt_bool, False ], 'show_transports_group': [ opt_bool, True ], 'autoaway': [ opt_bool, True ], @@ -136,6 +135,7 @@ 'gc-hpaned-position': [opt_int, 430], 'gc_refer_to_nick_char': [opt_str, ',', _('Character to add after nickname when using nick completion (tab) in group chat.')], 'gc_proposed_nick_char': [opt_str, '_', _('Character to propose to add after desired nickname when desired nickname is used by someone else in group chat.')], + 'msgwin-max-state': [opt_bool, False], 'msgwin-x-position': [opt_int, -1], # Default is to let the window manager decide 'msgwin-y-position': [opt_int, -1], # Default is to let the window manager decide 'msgwin-width': [opt_int, 500], @@ -161,7 +161,6 @@ 'time_stamp': [ opt_str, '[%X] ', _('This option let you customize timestamp that is printed in conversation. For exemple "[%H:%M] " will show "[hour:minute] ". See python doc on strftime for full documentation: http://docs.python.org/lib/module-time.html') ], 'before_nickname': [ opt_str, '', _('Characters that are printed before the nickname in conversations') ], 'after_nickname': [ opt_str, ':', _('Characters that are printed after the nickname in conversations') ], - 'send_os_info': [ opt_bool, True ], 'notify_on_new_gmail_email': [ opt_bool, True ], 'notify_on_new_gmail_email_extra': [ opt_bool, False ], 'use_gpg_agent': [ opt_bool, False ], @@ -200,7 +199,6 @@ 'tabs_always_visible': [opt_bool, False, _('Show tab when only one conversation?')], 'tabs_border': [opt_bool, False, _('Show tabbed notebook border in chat windows?')], 'tabs_close_button': [opt_bool, True, _('Show close button in tab?')], - 'log_encrypted_sessions': [opt_bool, True, _('When negotiating an encrypted session, should Gajim assume you want your messages to be logged?')], 'esession_modp': [opt_str, '5,14', _('A list of modp groups to use in a Diffie-Hellman, highest preference first, separated by commas. Valid groups are 1, 2, 5, 14, 15, 16, 17 and 18. Higher numbers are more secure, but take longer to calculate when you start a session.')], 'chat_avatar_width': [opt_int, 52], 'chat_avatar_height': [opt_int, 52], @@ -338,6 +336,9 @@ 'subscribe_activity': [opt_bool, True], 'subscribe_tune': [opt_bool, True], 'subscribe_nick': [opt_bool, True], + 'ignore_unknown_contacts': [ opt_bool, False ], + 'send_os_info': [ opt_bool, True ], + 'log_encrypted_sessions': [opt_bool, True, _('When negotiating an encrypted session, should Gajim assume you want your messages to be logged?')], }, {}), 'statusmsg': ({ 'message': [ opt_str, '' ],
Modified: branches/gajim_0.12/src/common/configpaths.py =================================================================== --- branches/gajim_0.12/src/common/configpaths.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/configpaths.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -114,9 +114,19 @@ for n, p in zip(k, v): self.add_from_root(n, p)
- self.add('DATA', os.path.join(u'..', windowsify(u'data'))) + datadir = '' + if u'datadir' in os.environ: + datadir = fse(os.environ[u'datadir']) + if not datadir: + datadir = u'..' + self.add('DATA', os.path.join(datadir, windowsify(u'data'))) self.add('HOME', fse(os.path.expanduser('~'))) - self.add('TMP', fse(tempfile.gettempdir())) + try: + self.add('TMP', fse(tempfile.gettempdir())) + except IOError, e: + print >> sys.stderr, 'Error opening tmp folder: %s\nUsing %s' % ( + str(e), os.path.expanduser('~')) + self.add('TMP', fse(os.path.expanduser('~')))
try: import svn_config
Modified: branches/gajim_0.12/src/common/connection.py =================================================================== --- branches/gajim_0.12/src/common/connection.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/connection.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -153,6 +153,7 @@ self.blocked_list = [] self.blocked_contacts = [] self.blocked_groups = [] + self.blocked_all = False self.music_track_info = 0 self.pep_supported = False self.mood = {} @@ -180,6 +181,7 @@
def put_event(self, ev): if ev[0] in gajim.handlers: + log.debug('Sending %s event to GUI: %s' % (ev[0], ev[1:])) gajim.handlers[ev[0]](self.name, ev[1])
def dispatch(self, event, data): @@ -222,7 +224,7 @@ if gajim.account_is_connected(self.name): # we cannot change our status to offline or connecting # after we auth to server - self.old_show = STATUS_LIST[self.connected] + self.old_show = gajim.SHOW_LIST[self.connected] self.connected = 0 if not self.on_purpose: self.dispatch('STATUS', 'offline') @@ -680,6 +682,9 @@ self.dispatch('FINGERPRINT_ERROR', (con.Connection.ssl_fingerprint_sha1,)) return True + else: + gajim.config.set_per('accounts', self.name, 'ssl_fingerprint_sha1', + con.Connection.ssl_fingerprint_sha1) self._register_handlers(con, con_type) con.auth(name, self.password, self.server_resource, 1, self.__on_auth)
@@ -824,14 +829,39 @@ return common.xmpp.features_nb.setDefaultPrivacyList(self.connection, listname)
- def build_privacy_rule(self, name, action): + def build_privacy_rule(self, name, action, order=1): '''Build a Privacy rule stanza for invisibility''' iq = common.xmpp.Iq('set', common.xmpp.NS_PRIVACY, xmlns = '') l = iq.getTag('query').setTag('list', {'name': name}) - i = l.setTag('item', {'action': action, 'order': '1'}) + i = l.setTag('item', {'action': action, 'order': str(order)}) i.setTag('presence-out') return iq
+ def build_invisible_rule(self): + iq = common.xmpp.Iq('set', common.xmpp.NS_PRIVACY, xmlns = '') + l = iq.getTag('query').setTag('list', {'name': 'invisible'}) + if self.name in gajim.interface.status_sent_to_groups and \ + len(gajim.interface.status_sent_to_groups[self.name]) > 0: + for group in gajim.interface.status_sent_to_groups[self.name]: + i = l.setTag('item', {'type': 'group', 'value': group, + 'action': 'allow', 'order': '1'}) + i.setTag('presence-out') + if self.name in gajim.interface.status_sent_to_users and \ + len(gajim.interface.status_sent_to_users[self.name]) > 0: + for jid in gajim.interface.status_sent_to_users[self.name]: + i = l.setTag('item', {'type': 'jid', 'value': jid, + 'action': 'allow', 'order': '2'}) + i.setTag('presence-out') + i = l.setTag('item', {'action': 'deny', 'order': '3'}) + i.setTag('presence-out') + return iq + + def set_invisible_rule(self): + if not gajim.account_is_connected(self.name): + return + iq = self.build_invisible_rule() + self.connection.send(iq) + def activate_privacy_rule(self, name): '''activate a privacy rule''' if not self.connection: @@ -860,7 +890,7 @@ self.connection.send(p)
# try to set the privacy rule - iq = self.build_privacy_rule('invisible', 'deny') + iq = self.build_invisible_rule() self.connection.SendAndCallForResponse(iq, self._continue_invisible, {'msg': msg, 'signed': signed, 'initial': initial})
@@ -870,7 +900,7 @@ # active the privacy rule self.privacy_rules_supported = True self.activate_privacy_rule('invisible') - self.connected = STATUS_LIST.index('invisible') + self.connected = gajim.SHOW_LIST.index('invisible') self.status = msg priority = unicode(gajim.get_priority(self.name, 'invisible')) p = common.xmpp.Presence(priority = priority) @@ -896,13 +926,18 @@ self.dispatch('SIGNED_IN', ())
def test_gpg_passphrase(self, password): + '''Returns 'ok', 'bad_pass' or 'expired' ''' if not self.gpg: return False self.gpg.passphrase = password keyID = gajim.config.get_per('accounts', self.name, 'keyid') signed = self.gpg.sign('test', keyID) self.gpg.password = None - return signed != 'BAD_PASSPHRASE' + if signed == 'KEYEXPIRED': + return 'expired' + elif signed == 'BAD_PASSPHRASE': + return 'bad_pass' + return 'ok'
def get_signed_presence(self, msg, callback = None): if gajim.config.get_per('accounts', self.name, 'gpg_sign_presence'): @@ -952,7 +987,7 @@ self.connection.send(iq)
def send_custom_status(self, show, msg, jid): - if not show in STATUS_LIST: + if not show in gajim.SHOW_LIST: return -1 if not self.connection: return @@ -978,7 +1013,7 @@ self.connection.send(p)
def change_status(self, show, msg, auto = False): - if not show in STATUS_LIST: + if not show in gajim.SHOW_LIST: return -1 sshow = helpers.get_xmpp_show(show) if not msg: @@ -1033,8 +1068,8 @@ signed = self.get_signed_presence(msg) self.send_invisible_presence(msg, signed) return - was_invisible = self.connected == STATUS_LIST.index('invisible') - self.connected = STATUS_LIST.index(show) + was_invisible = self.connected == gajim.SHOW_LIST.index('invisible') + self.connected = gajim.SHOW_LIST.index(show) if was_invisible and self.privacy_rules_supported: iq = self.build_privacy_rule('visible', 'allow') self.connection.send(iq) @@ -1054,11 +1089,11 @@
def _on_disconnected(self): ''' called when a disconnect request has completed successfully''' + self.disconnect(on_purpose=True) self.dispatch('STATUS', 'offline') - self.disconnect()
def get_status(self): - return STATUS_LIST[self.connected] + return gajim.SHOW_LIST[self.connected]
def send_motd(self, jid, subject = '', msg = '', xhtml = None): @@ -1091,25 +1126,52 @@ fjid = str(session.jid)
if keyID and self.USE_GPG: + xhtml = None if keyID == 'UNKNOWN': error = _('Neither the remote presence is signed, nor a key was assigned.') elif keyID.endswith('MISMATCH'): error = _('The contact's key (%s) does not match the key assigned in Gajim.' % keyID[:8]) else: + def _on_encrypted(msgenc, error): + output = (msgenc, error) + if error == 'NOT_TRUSTED': + def _on_always_trust(answer): + if answer: + msgenc, error = self.gpg.encrypt(msg, [keyID], False) + return _on_encrypted(msgenc, error) + else: + return self._on_message_encrypted(output, type_, msg, + msgtxt, original_message, fjid, resource, jid, xhtml, + subject, chatstate, composing_xep, forward_from, + delayed, session, form_node, user_nick, keyID) + self.dispatch('GPG_ALWAYS_TRUST', _on_always_trust) + else: + return self._on_message_encrypted(output, type_, msg, msgtxt, + original_message, fjid, resource, jid, xhtml, subject, + chatstate, composing_xep, forward_from, delayed, session, + form_node, user_nick, keyID) #encrypt - msgenc, error = self.gpg.encrypt(msg, [keyID]) - if msgenc and not error: - msgtxt = '[This message is *encrypted* (See :XEP:`27`]' - lang = os.getenv('LANG') - if lang is not None and lang != 'en': # we're not english - # one in locale and one en - msgtxt = _('[This message is *encrypted* (See :XEP:`27`]') + \ - ' (' + msgtxt + ')' - else: - # Encryption failed, do not send message - tim = localtime() - self.dispatch('MSGNOTSENT', (jid, error, msgtxt, tim, session)) - return 3 + msgenc, error = self.gpg.encrypt(msg, [keyID], False) + return _on_encrypted(msgenc, error) + + def _on_message_encrypted(self, output, type_, msg, msgtxt, original_message, + fjid, resource, jid, xhtml, subject, chatstate, composing_xep, forward_from, + delayed, session, form_node, user_nick, keyID): + msgenc, error = output + + if not msgenc or error: + # Encryption failed, do not send message + tim = localtime() + self.dispatch('MSGNOTSENT', (jid, error, msgtxt, tim, session)) + return 3 + + msgtxt = '[This message is *encrypted* (See :XEP:`27`]' + lang = os.getenv('LANG') + if lang is not None and lang != 'en': # we're not english + # one in locale and one en + msgtxt = _('[This message is *encrypted* (See :XEP:`27`]') + \ + ' (' + msgtxt + ')' + if type_ == 'chat': msg_iq = common.xmpp.Message(to = fjid, body = msgtxt, typ = type_, xhtml = xhtml) @@ -1494,7 +1556,7 @@ def send_agent_status(self, agent, ptype): if not self.connection: return - show = helpers.get_xmpp_show(STATUS_LIST[self.connected]) + show = helpers.get_xmpp_show(gajim.SHOW_LIST[self.connected]) p = common.xmpp.Presence(to = agent, typ = ptype, show = show) p = self.add_sha(p, ptype != 'unavailable') self.connection.send(p) @@ -1517,7 +1579,7 @@ # FIXME: This room JID needs to be normalized; see #1364 if not self.connection: return - show = helpers.get_xmpp_show(STATUS_LIST[self.connected]) + show = helpers.get_xmpp_show(gajim.SHOW_LIST[self.connected]) if show == 'invisible': # Never join a room when invisible return @@ -1586,7 +1648,7 @@ self.connection.send(iq)
def send_gc_status(self, nick, jid, show, status): - if not self.connection: + if not gajim.account_is_connected(self.name): return if show == 'invisible': show = 'offline'
Modified: branches/gajim_0.12/src/common/connection_handlers.py =================================================================== --- branches/gajim_0.12/src/common/connection_handlers.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/connection_handlers.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -55,8 +55,9 @@ import dbus from music_track_listener import MusicTrackListener
-STATUS_LIST = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd', - 'invisible', 'error'] +import logging +log = logging.getLogger('gajim.c.connection_handlers') + # kind of events we can wait for an answer VCARD_PUBLISHED = 'vcard_published' VCARD_ARRIVED = 'vcard_arrived' @@ -631,16 +632,26 @@ def request_register_agent_info(self, agent): if not self.connection or self.connected < 2: return None - iq=common.xmpp.Iq('get', common.xmpp.NS_REGISTER, to=agent) + iq = common.xmpp.Iq('get', common.xmpp.NS_REGISTER, to=agent) id = self.connection.getAnID() iq.setID(id) # Wait the answer during 30 secondes self.awaiting_timeouts[gajim.idlequeue.current_time() + 30] = (id, - _('Registration information for transport %s has not arrived in time') % \ - agent) + _('Registration information for transport %s has not arrived in time')\ + % agent) self.connection.SendAndCallForResponse(iq, self._ReceivedRegInfo, {'agent': agent})
+ def _agent_registered_cb(self, con, resp, agent): + if resp.getType() == 'result': + self.dispatch('INFORMATION', (_('Registration succeeded'), + _('Resgitration with agent %s succeeded') % agent)) + if resp.getType() == 'error': + self.dispatch('ERROR', (_('Registration failed'), _('Resgitration with' + ' agent %(agent)s failed with error %(error)s: %(error_msg)s') % { + 'agent': agent, 'error': resp.getError(), + 'error_msg': resp.getErrorMsg()})) + def register_agent(self, agent, info, is_form = False): if not self.connection or self.connected < 2: return @@ -649,7 +660,8 @@ query = iq.getTag('query') info.setAttr('type', 'submit') query.addChild(node = info) - self.connection.send(iq) + self.connection.SendAndCallForResponse(iq, self._agent_registered_cb, + {'agent': agent}) else: # fixed: blocking common.xmpp.features_nb.register(self.connection, agent, info, None) @@ -725,9 +737,9 @@ hostname = gajim.config.get_per('accounts', self.name, 'hostname') id = iq_obj.getID() - if jid == hostname and id[0] == 'p': + if jid == hostname and id[0] == 'Gajim_': for item in items: - self.discoverInfo(item['jid'], id_prefix='p') + self.discoverInfo(item['jid'], id_prefix='Gajim_') else: self.dispatch('AGENT_INFO_ITEMS', (jid, node, items))
@@ -759,7 +771,7 @@ raise common.xmpp.NodeProcessed
id = unicode(iq_obj.getAttr('id')) - if id[0] == 'p': + if id[0] == 'Gajim_': # We get this request from echo.server raise common.xmpp.NodeProcessed
@@ -829,7 +841,7 @@ if not identities: # ejabberd doesn't send identities when we browse online users #FIXME: see http://www.jabber.ru/bugzilla/show_bug.cgi?id=225 identities = [{'category': 'server', 'type': 'im', 'name': node}] - if id[0] == 'p': + if id[0] == 'Gajim_': if jid == gajim.config.get_per('accounts', self.name, 'hostname'): if features.__contains__(common.xmpp.NS_GMAILNOTIFY): gajim.gmail_domains.append(jid) @@ -1056,12 +1068,12 @@ self.save_vcard_to_hd(our_jid, vcard_iq)
# Send new presence if sha changed and we are not invisible - if self.vcard_sha != new_sha and STATUS_LIST[self.connected] != \ + if self.vcard_sha != new_sha and gajim.SHOW_LIST[self.connected] !=\ 'invisible': if not self.connection or self.connected < 2: return self.vcard_sha = new_sha - sshow = helpers.get_xmpp_show(STATUS_LIST[self.connected]) + sshow = helpers.get_xmpp_show(gajim.SHOW_LIST[self.connected]) p = common.xmpp.Presence(typ = None, priority = self.priority, show = sshow, status = self.status) p = self.add_sha(p) @@ -1228,11 +1240,11 @@ if self.vcard_sha == avatar_sha: return self.vcard_sha = avatar_sha - if STATUS_LIST[self.connected] == 'invisible': + if gajim.SHOW_LIST[self.connected] == 'invisible': return if not self.connection: return - sshow = helpers.get_xmpp_show(STATUS_LIST[self.connected]) + sshow = helpers.get_xmpp_show(gajim.SHOW_LIST[self.connected]) p = common.xmpp.Presence(typ = None, priority = self.priority, show = sshow, status = self.status) p = self.add_sha(p) @@ -1501,6 +1513,12 @@ for group in item.getTags('group'): groups.append(group.getData()) self.dispatch('ROSTER_INFO', (jid, name, sub, ask, groups)) + if not self.connection or self.connected < 2: + raise common.xmpp.NodeProcessed + server = gajim.config.get_per('accounts', self.name, 'hostname') + reply = common.xmpp.Iq(typ='result', attrs={'id': iq_obj.getID()}, + to=server, frm=iq_obj.getTo(), xmlns=None) + self.connection.send(reply) raise common.xmpp.NodeProcessed def _VersionCB(self, con, iq_obj): @@ -1511,7 +1529,7 @@ qp = iq_obj.getTag('query') qp.setTagData('name', 'Gajim') qp.setTagData('version', gajim.version) - send_os = gajim.config.get('send_os_info') + send_os = gajim.config.get_per('accounts', self.name, 'send_os_info') if send_os: qp.setTagData('os', helpers.get_os_info()) self.connection.send(iq_obj) @@ -1594,7 +1612,8 @@ qp = iq_obj.setTag('time', namespace=common.xmpp.NS_TIME_REVISED) qp.setTagData('utc', strftime('%Y-%m-%dT%H:%M:%SZ', gmtime())) - zone = -(timezone, altzone)[daylight] / 60 + isdst = localtime().tm_isdst + zone = -(timezone, altzone)[isdst] / 60 tzo = (zone / 60, abs(zone % 60)) qp.setTagData('tzo', '%+03d:%02d' % (tzo)) self.connection.send(iq_obj) @@ -1812,7 +1831,7 @@ if keyID: decmsg = self.gpg.decrypt(encmsg, keyID) # \x00 chars are not allowed in C (so in GTK) - msgtxt = decmsg.replace('\x00', '') + msgtxt = helpers.decode_string(decmsg.replace('\x00', '')) encrypted = 'xep27' if mtype == 'error': self.dispatch_error_message(msg, msgtxt, session, frm, tim) @@ -2292,13 +2311,14 @@ raise common.xmpp.NodeProcessed
def _getRosterCB(self, con, iq_obj): + log.debug('getRosterCB') if not self.connection: return self.connection.getRoster(self._on_roster_set) self.discoverItems(gajim.config.get_per('accounts', self.name, - 'hostname'), id_prefix='p') + 'hostname'), id_prefix='Gajim_') self.discoverInfo(gajim.config.get_per('accounts', self.name, - 'hostname'), id_prefix='p') + 'hostname'), id_prefix='Gajim_') if gajim.config.get_per('accounts', self.name, 'use_ft_proxies'): self.discover_ft_proxies() @@ -2365,7 +2385,7 @@ _('You will be connected to %s without OpenPGP.') % self.name)) self.USE_GPG = False signed = '' - self.connected = STATUS_LIST.index(show) + self.connected = gajim.SHOW_LIST.index(show) sshow = helpers.get_xmpp_show(show) # send our presence if show == 'invisible':
Modified: branches/gajim_0.12/src/common/dataforms.py =================================================================== --- branches/gajim_0.12/src/common/dataforms.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/dataforms.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -56,7 +56,7 @@ ''' Helper function to create a field of given type. ''' f = { 'boolean': BooleanField, - 'fixed': TextMultiField, # not editable, still can have multiple lines of text + 'fixed': StringField, 'hidden': StringField, 'text-private': StringField, 'text-single': StringField, @@ -76,7 +76,7 @@ typ=node.getAttr('type') f = { 'boolean': BooleanField, - 'fixed': TextMultiField, + 'fixed': StringField, 'hidden': StringField, 'text-private': StringField, 'text-single': StringField,
Modified: branches/gajim_0.12/src/common/dbus_support.py =================================================================== --- branches/gajim_0.12/src/common/dbus_support.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/dbus_support.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -40,6 +40,8 @@ pass import dbus import dbus.glib + # test if dbus-x11 is installed + bus = dbus.SessionBus() supported = True # does user have D-Bus bindings? except ImportError: supported = False
Modified: branches/gajim_0.12/src/common/defs.py =================================================================== --- branches/gajim_0.12/src/common/defs.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/defs.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -27,8 +27,9 @@
docdir = '../' datadir = '../' +localedir = '../po'
-version = '0.12.1' +version = '0.12.2'
import sys, os.path for base in ('.', 'common'):
Modified: branches/gajim_0.12/src/common/events.py =================================================================== --- branches/gajim_0.12/src/common/events.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/events.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -28,11 +28,12 @@
class Event: '''Information concerning each event''' - def __init__(self, type_, time_, parameters, show_in_roster = False, - show_in_systray = True): + def __init__(self, type_, time_, parameters, show_in_roster=False, + show_in_systray=True): ''' type_ in chat, normal, file-request, file-error, file-completed, file-request-error, file-send-error, file-stopped, gc_msg, pm, - printed_chat, printed_gc_msg, printed_marked_gc_msg, printed_pm + printed_chat, printed_gc_msg, printed_marked_gc_msg, printed_pm, + gc-invitation, subscription_request, unsubscribed parameters is (per type_): chat, normal, pm: [message, subject, kind, time, encrypted, resource, msg_id] @@ -41,7 +42,11 @@ gc_msg: None printed_chat: control printed_*: None - messages that are already printed in chat, but not read''' + messages that are already printed in chat, but not read + gc-invitation: [room_jid, reason, password, is_continued] + subscription_request: [text, nick] + unsubscribed: contact + ''' self.type_ = type_ self.time_ = time_ self.parameters = parameters
Modified: branches/gajim_0.12/src/common/exceptions.py =================================================================== --- branches/gajim_0.12/src/common/exceptions.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/exceptions.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -83,7 +83,7 @@ pass
class LatexError(Exception): - '''sqlite2 raised pysqlite2.dbapi2.OperationalError''' + '''LaTeX processing failed for some reason''' def __init__(self, text=''): Exception.__init__(self) self.text = text
Modified: branches/gajim_0.12/src/common/gajim.py =================================================================== --- branches/gajim_0.12/src/common/gajim.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/gajim.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -105,6 +105,8 @@ else: LANG = LANG[:2] # en, fr, el etc..
+os_info = None # used to cache os information + gmail_domains = ['gmail.com', 'googlemail.com']
transport_type = {} # list the type of transport @@ -174,6 +176,9 @@ if system('gpg -h >/dev/null 2>&1'): HAVE_GPG = False
+import latex +HAVE_LATEX = latex.check_for_latex_support() + gajim_identity = {'type': 'pc', 'category': 'client', 'name': 'Gajim'} gajim_common_features = [xmpp.NS_BYTESTREAM, xmpp.NS_SI, xmpp.NS_FILE, xmpp.NS_MUC, xmpp.NS_MUC_USER, xmpp.NS_MUC_ADMIN, xmpp.NS_MUC_OWNER,
Modified: branches/gajim_0.12/src/common/helpers.py =================================================================== --- branches/gajim_0.12/src/common/helpers.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/helpers.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -41,7 +41,6 @@ import sys from encodings.punycode import punycode_encode
-import gajim from i18n import Q_ from i18n import ngettext import xmpp @@ -59,11 +58,6 @@ hash_sha1 = sha.new
try: - from osx import nsapp -except ImportError: - pass - -try: import winsound # windows-only built-in module for playing wav import win32api import win32con @@ -198,65 +192,6 @@ else: raise
-def convert_bytes(string): - suffix = '' - # IEC standard says KiB = 1024 bytes KB = 1000 bytes - # but do we use the standard? - use_kib_mib = gajim.config.get('use_kib_mib') - align = 1024. - bytes = float(string) - if bytes >= align: - bytes = round(bytes/align, 1) - if bytes >= align: - bytes = round(bytes/align, 1) - if bytes >= align: - bytes = round(bytes/align, 1) - if use_kib_mib: - #GiB means gibibyte - suffix = _('%s GiB') - else: - #GB means gigabyte - suffix = _('%s GB') - else: - if use_kib_mib: - #MiB means mibibyte - suffix = _('%s MiB') - else: - #MB means megabyte - suffix = _('%s MB') - else: - if use_kib_mib: - #KiB means kibibyte - suffix = _('%s KiB') - else: - #KB means kilo bytes - suffix = _('%s KB') - else: - #B means bytes - suffix = _('%s B') - return suffix % unicode(bytes) - - -def get_contact_dict_for_account(account): - ''' create a dict of jid, nick -> contact with all contacts of account. - Can be used for completion lists''' - contacts_dict = {} - for jid in gajim.contacts.get_jid_list(account): - contact = gajim.contacts.get_contact_with_highest_priority(account, - jid) - contacts_dict[jid] = contact - name = contact.name - if name in contacts_dict: - contact1 = contacts_dict[name] - del contacts_dict[name] - contacts_dict['%s (%s)' % (name, contact1.jid)] = contact1 - contacts_dict['%s (%s)' % (name, jid)] = contact - else: - if contact.name == gajim.get_nick_from_jid(jid): - del contacts_dict[jid] - contacts_dict[name] = contact - return contacts_dict - def get_uf_show(show, use_mnemonic = False): '''returns a userfriendly string for dnd/xa/chat and makes all strings translatable @@ -445,6 +380,347 @@ command = '%s "%s"' % (executable, parameter) return command
+def get_file_path_from_dnd_dropped_uri(uri): + path = urllib.unquote(uri) # escape special chars + path = path.strip('\r\n\x00') # remove \r\n and NULL + # get the path to file + if re.match('^file:///[a-zA-Z]:/', path): # windows + path = path[8:] # 8 is len('file:///') + elif path.startswith('file://'): # nautilus, rox + if sys.platform == 'darwin': + # OS/X includes hostname in file:// URI + path = re.sub('file://[^/]*', '', path) + else: + path = path[7:] # 7 is len('file://') + elif path.startswith('file:'): # xffm + path = path[5:] # 5 is len('file:') + return path + +def from_xs_boolean_to_python_boolean(value): + # this is xs:boolean so 'true', 'false', '1', '0' + # convert those to True/False (python booleans) + if value in ('1', 'true'): + val = True + else: # '0', 'false' or anything else + val = False + + return val + +def get_xmpp_show(show): + if show in ('online', 'offline'): + return None + return show + +def get_output_of_command(command): + try: + child_stdin, child_stdout = os.popen2(command) + except ValueError: + return None + + output = child_stdout.readlines() + child_stdout.close() + child_stdin.close() + + return output + +def decode_string(string): + '''try to decode (to make it Unicode instance) given string''' + if isinstance(string, unicode): + return string + # by the time we go to iso15 it better be the one else we show bad characters + encodings = (locale.getpreferredencoding(), 'utf-8', 'iso-8859-15') + for encoding in encodings: + try: + string = string.decode(encoding) + except UnicodeError: + continue + break + + return string + +def ensure_utf8_string(string): + '''make sure string is in UTF-8''' + try: + string = decode_string(string).encode('utf-8') + except Exception: + pass + return string + +def get_windows_reg_env(varname, default=''): + '''asks for paths commonly used but not exposed as ENVs + in english Windows 2003 those are: + 'AppData' = %USERPROFILE%\Application Data (also an ENV) + 'Desktop' = %USERPROFILE%\Desktop + 'Favorites' = %USERPROFILE%\Favorites + 'NetHood' = %USERPROFILE%\NetHood + 'Personal' = D:\My Documents (PATH TO MY DOCUMENTS) + 'PrintHood' = %USERPROFILE%\PrintHood + 'Programs' = %USERPROFILE%\Start Menu\Programs + 'Recent' = %USERPROFILE%\Recent + 'SendTo' = %USERPROFILE%\SendTo + 'Start Menu' = %USERPROFILE%\Start Menu + 'Startup' = %USERPROFILE%\Start Menu\Programs\Startup + 'Templates' = %USERPROFILE%\Templates + 'My Pictures' = D:\My Documents\My Pictures + 'Local Settings' = %USERPROFILE%\Local Settings + 'Local AppData' = %USERPROFILE%\Local Settings\Application Data + 'Cache' = %USERPROFILE%\Local Settings\Temporary Internet Files + 'Cookies' = %USERPROFILE%\Cookies + 'History' = %USERPROFILE%\Local Settings\History + ''' + + if os.name != 'nt': + return '' + + val = default + try: + rkey = win32api.RegOpenKey(win32con.HKEY_CURRENT_USER, +r'Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders') + try: + val = str(win32api.RegQueryValueEx(rkey, varname)[0]) + val = win32api.ExpandEnvironmentStrings(val) # expand using environ + except Exception: + pass + finally: + win32api.RegCloseKey(rkey) + return val + +def get_my_pictures_path(): + '''windows-only atm. [Unix lives in the past]''' + return get_windows_reg_env('My Pictures') + +def get_desktop_path(): + if os.name == 'nt': + path = get_windows_reg_env('Desktop') + else: + path = os.path.join(os.path.expanduser('~'), 'Desktop') + return path + +def get_documents_path(): + if os.name == 'nt': + path = get_windows_reg_env('Personal') + else: + path = os.path.expanduser('~') + return path + +def sanitize_filename(filename): + '''makes sure the filename we will write does contain only acceptable and + latin characters, and is not too long (in that case hash it)''' + # 48 is the limit + if len(filename) > 48: + hash = hash_md5(filename) + filename = base64.b64encode(hash.digest()) + + filename = punycode_encode(filename) # make it latin chars only + filename = filename.replace('/', '_') + if os.name == 'nt': + filename = filename.replace('?', '_').replace(':', '_')\ + .replace('\', '_').replace('"', "'").replace('|', '_')\ + .replace('*', '_').replace('<', '_').replace('>', '_') + + return filename + +def reduce_chars_newlines(text, max_chars = 0, max_lines = 0): + '''Cut the chars after 'max_chars' on each line + and show only the first 'max_lines'. + If any of the params is not present (None or 0) the action + on it is not performed''' + + def _cut_if_long(string): + if len(string) > max_chars: + string = string[:max_chars - 3] + '...' + return string + + if isinstance(text, str): + text = text.decode('utf-8') + + if max_lines == 0: + lines = text.split('\n') + else: + lines = text.split('\n', max_lines)[:max_lines] + if max_chars > 0: + if lines: + lines = map(lambda e: _cut_if_long(e), lines) + if lines: + reduced_text = '\n'.join(lines) + if reduced_text != text: + reduced_text += '...' + else: + reduced_text = '' + return reduced_text + +def get_account_status(account): + status = reduce_chars_newlines(account['status_line'], 100, 1) + return status + +def get_avatar_path(prefix): + '''Returns the filename of the avatar, distinguishes between user- and + contact-provided one. Returns None if no avatar was found at all. + prefix is the path to the requested avatar just before the ".png" or + ".jpeg".''' + # First, scan for a local, user-set avatar + for type_ in ('jpeg', 'png'): + file_ = prefix + '_local.' + type_ + if os.path.exists(file_): + return file_ + # If none available, scan for a contact-provided avatar + for type_ in ('jpeg', 'png'): + file_ = prefix + '.' + type_ + if os.path.exists(file_): + return file_ + return None + +def datetime_tuple(timestamp): + '''Converts timestamp using strptime and the format: %Y%m%dT%H:%M:%S + Because of various datetime formats are used the following exceptions + are handled: + - Optional milliseconds appened to the string are removed + - Optional Z (that means UTC) appened to the string are removed + - XEP-082 datetime strings have all '-' cahrs removed to meet + the above format.''' + timestamp = timestamp.split('.')[0] + timestamp = timestamp.replace('-', '') + timestamp = timestamp.replace('z', '') + timestamp = timestamp.replace('Z', '') + from time import strptime + return strptime(timestamp, '%Y%m%dT%H:%M:%S') + +def sort_identities_func(i1, i2): + cat1 = i1['category'] + cat2 = i2['category'] + if cat1 < cat2: + return -1 + if cat1 > cat2: + return 1 + type1 = i1.get('type', '') + type2 = i2.get('type', '') + if type1 < type2: + return -1 + if type1 > type2: + return 1 + lang1 = i1.get('xml:lang', '') + lang2 = i2.get('xml:lang', '') + if lang1 < lang2: + return -1 + if lang1 > lang2: + return 1 + return 0 + +def sort_dataforms_func(d1, d2): + f1 = d1.getField('FORM_TYPE') + f2 = d2.getField('FORM_TYPE') + if f1 and f2 and (f1.getValue() < f2.getValue()): + return -1 + return 1 + +def compute_caps_hash(identities, features, dataforms=[], hash_method='sha-1'): + '''Compute caps hash according to XEP-0115, V1.5 + + dataforms are xmpp.DataForms objects as common.dataforms don't allow several + values without a field type list-multi''' + S = '' + identities.sort(cmp=sort_identities_func) + for i in identities: + c = i['category'] + type_ = i.get('type', '') + lang = i.get('xml:lang', '') + name = i.get('name', '') + S += '%s/%s/%s/%s<' % (c, type_, lang, name) + features.sort() + for f in features: + S += '%s<' % f + dataforms.sort(cmp=sort_dataforms_func) + for dataform in dataforms: + # fields indexed by var + fields = {} + for f in dataform.getChildren(): + fields[f.getVar()] = f + form_type = fields.get('FORM_TYPE') + if form_type: + S += form_type.getValue() + '<' + del fields['FORM_TYPE'] + vars = sorted(fields.keys()) + for var in vars: + S += '%s<' % var + values = sorted(fields[var].getValues()) + for value in values: + S += '%s<' % value + + if hash_method == 'sha-1': + hash = hash_sha1(S) + elif hash_method == 'md5': + hash = hash_md5(S) + else: + return '' + return base64.b64encode(hash.digest()) + +# import gajim only when needed (after decode_string is defined) see #4764 + +import gajim + +try: + from osx import nsapp +except ImportError: + pass + +def convert_bytes(string): + suffix = '' + # IEC standard says KiB = 1024 bytes KB = 1000 bytes + # but do we use the standard? + use_kib_mib = gajim.config.get('use_kib_mib') + align = 1024. + bytes = float(string) + if bytes >= align: + bytes = round(bytes/align, 1) + if bytes >= align: + bytes = round(bytes/align, 1) + if bytes >= align: + bytes = round(bytes/align, 1) + if use_kib_mib: + #GiB means gibibyte + suffix = _('%s GiB') + else: + #GB means gigabyte + suffix = _('%s GB') + else: + if use_kib_mib: + #MiB means mibibyte + suffix = _('%s MiB') + else: + #MB means megabyte + suffix = _('%s MB') + else: + if use_kib_mib: + #KiB means kibibyte + suffix = _('%s KiB') + else: + #KB means kilo bytes + suffix = _('%s KB') + else: + #B means bytes + suffix = _('%s B') + return suffix % unicode(bytes) + +def get_contact_dict_for_account(account): + ''' create a dict of jid, nick -> contact with all contacts of account. + Can be used for completion lists''' + contacts_dict = {} + for jid in gajim.contacts.get_jid_list(account): + contact = gajim.contacts.get_contact_with_highest_priority(account, + jid) + contacts_dict[jid] = contact + name = contact.name + if name in contacts_dict: + contact1 = contacts_dict[name] + del contacts_dict[name] + contacts_dict['%s (%s)' % (name, contact1.jid)] = contact1 + contacts_dict['%s (%s)' % (name, jid)] = contact + else: + if contact.name == gajim.get_nick_from_jid(jid): + del contacts_dict[jid] + contacts_dict[name] = contact + return contacts_dict + def launch_browser_mailer(kind, uri): #kind = 'url' or 'mail' if os.name == 'nt': @@ -536,49 +812,6 @@ command = build_command(player, path_to_soundfile) exec_command(command)
-def get_file_path_from_dnd_dropped_uri(uri): - path = urllib.unquote(uri) # escape special chars - path = path.strip('\r\n\x00') # remove \r\n and NULL - # get the path to file - if re.match('^file:///[a-zA-Z]:/', path): # windows - path = path[8:] # 8 is len('file:///') - elif path.startswith('file://'): # nautilus, rox - if sys.platform == 'darwin': - # OS/X includes hostname in file:// URI - path = re.sub('file://[^/]*', '', path) - else: - path = path[7:] # 7 is len('file://') - elif path.startswith('file:'): # xffm - path = path[5:] # 5 is len('file:') - return path - -def from_xs_boolean_to_python_boolean(value): - # this is xs:boolean so 'true', 'false', '1', '0' - # convert those to True/False (python booleans) - if value in ('1', 'true'): - val = True - else: # '0', 'false' or anything else - val = False - - return val - -def get_xmpp_show(show): - if show in ('online', 'offline'): - return None - return show - -def get_output_of_command(command): - try: - child_stdin, child_stdout = os.popen2(command) - except ValueError: - return None - - output = child_stdout.readlines() - child_stdout.close() - child_stdin.close() - - return output - def get_global_show(): maxi = 0 for account in gajim.connections: @@ -644,91 +877,6 @@ return contact.show return 'not in roster'
-def decode_string(string): - '''try to decode (to make it Unicode instance) given string''' - if isinstance(string, unicode): - return string - # by the time we go to iso15 it better be the one else we show bad characters - encodings = (locale.getpreferredencoding(), 'utf-8', 'iso-8859-15') - for encoding in encodings: - try: - string = string.decode(encoding) - except UnicodeError: - continue - break - - return string - -def ensure_utf8_string(string): - '''make sure string is in UTF-8''' - try: - string = decode_string(string).encode('utf-8') - except Exception: - pass - return string - -def remove_invalid_xml_chars(string): - if string: - string = re.sub(gajim.interface.invalid_XML_chars_re, '', string) - return string - -def get_windows_reg_env(varname, default=''): - '''asks for paths commonly used but not exposed as ENVs - in english Windows 2003 those are: - 'AppData' = %USERPROFILE%\Application Data (also an ENV) - 'Desktop' = %USERPROFILE%\Desktop - 'Favorites' = %USERPROFILE%\Favorites - 'NetHood' = %USERPROFILE%\NetHood - 'Personal' = D:\My Documents (PATH TO MY DOCUMENTS) - 'PrintHood' = %USERPROFILE%\PrintHood - 'Programs' = %USERPROFILE%\Start Menu\Programs - 'Recent' = %USERPROFILE%\Recent - 'SendTo' = %USERPROFILE%\SendTo - 'Start Menu' = %USERPROFILE%\Start Menu - 'Startup' = %USERPROFILE%\Start Menu\Programs\Startup - 'Templates' = %USERPROFILE%\Templates - 'My Pictures' = D:\My Documents\My Pictures - 'Local Settings' = %USERPROFILE%\Local Settings - 'Local AppData' = %USERPROFILE%\Local Settings\Application Data - 'Cache' = %USERPROFILE%\Local Settings\Temporary Internet Files - 'Cookies' = %USERPROFILE%\Cookies - 'History' = %USERPROFILE%\Local Settings\History - ''' - - if os.name != 'nt': - return '' - - val = default - try: - rkey = win32api.RegOpenKey(win32con.HKEY_CURRENT_USER, -r'Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders') - try: - val = str(win32api.RegQueryValueEx(rkey, varname)[0]) - val = win32api.ExpandEnvironmentStrings(val) # expand using environ - except Exception: - pass - finally: - win32api.RegCloseKey(rkey) - return val - -def get_my_pictures_path(): - '''windows-only atm. [Unix lives in the past]''' - return get_windows_reg_env('My Pictures') - -def get_desktop_path(): - if os.name == 'nt': - path = get_windows_reg_env('Desktop') - else: - path = os.path.join(os.path.expanduser('~'), 'Desktop') - return path - -def get_documents_path(): - if os.name == 'nt': - path = get_windows_reg_env('Personal') - else: - path = os.path.expanduser('~') - return path - def get_full_jid_from_iq(iq_obj): '''return the full jid (with resource) from an iq as unicode''' return parse_jid(str(iq_obj.getFrom())) @@ -742,6 +890,10 @@ ''' return sha of sid + initiator + target used for proxy auth''' return sha.new("%s%s%s" % (sid, initiator, target)).hexdigest()
+def remove_invalid_xml_chars(string): + if string: + string = re.sub(gajim.interface.invalid_XML_chars_re, '', string) + return string
distro_info = { 'Arch Linux': '/etc/arch-release', @@ -776,6 +928,8 @@ return ''.join(sample(char_sequence, 16)) def get_os_info(): + if gajim.os_info: + return gajim.os_info if os.name == 'nt': ver = os.sys.getwindowsversion() ver_format = ver[3], ver[0], ver[1] @@ -790,9 +944,11 @@ (2, 6, 0): 'Vista', } if ver_format in win_version: - return 'Windows' + ' ' + win_version[ver_format] + os_info = 'Windows' + ' ' + win_version[ver_format] else: - return 'Windows' + os_info = 'Windows' + gajim.os_info = os_info + return os_info elif os.name == 'posix': executable = 'lsb_release' params = ' --description --codename --release --short' @@ -805,6 +961,7 @@ output = temp_failure_retry(p.stdout.readline).strip() # some distros put n/a in places, so remove those output = output.replace('n/a', '').replace('N/A', '') + gajim.os_info = output return output
# lsb_release executable not available, so parse files @@ -832,31 +989,20 @@ text = distro_name elif path_to_file.endswith('lfs-release'): # file just has version text = distro_name + ' ' + text - return text.replace('\n', '') + os_info = text.replace('\n', '') + gajim.os_info = os_info + return os_info
# our last chance, ask uname and strip it uname_output = get_output_of_command('uname -sr') if uname_output is not None: - return uname_output[0] # only first line - return 'N/A' + os_info = uname_output[0] # only first line + gajim.os_info = os_info + return os_info + os_info = 'N/A' + gajim.os_info = os_info + return os_info
-def sanitize_filename(filename): - '''makes sure the filename we will write does contain only acceptable and - latin characters, and is not too long (in that case hash it)''' - # 48 is the limit - if len(filename) > 48: - hash = hash_md5(filename) - filename = base64.b64encode(hash.digest()) - - filename = punycode_encode(filename) # make it latin chars only - filename = filename.replace('/', '_') - if os.name == 'nt': - filename = filename.replace('?', '_').replace(':', '_')\ - .replace('\', '_').replace('"', "'").replace('|', '_')\ - .replace('*', '_').replace('<', '_').replace('>', '_') - - return filename - def allow_showing_notification(account, type_ = 'notify_on_new_message', advanced_notif_num = None, is_first_message = True): '''is it allowed to show nofication? @@ -927,39 +1073,6 @@ # unknown contact or offline message return gajim.interface.msg_win_mgr.get_control(contact.jid, account)
-def reduce_chars_newlines(text, max_chars = 0, max_lines = 0): - '''Cut the chars after 'max_chars' on each line - and show only the first 'max_lines'. - If any of the params is not present (None or 0) the action - on it is not performed''' - - def _cut_if_long(string): - if len(string) > max_chars: - string = string[:max_chars - 3] + '...' - return string - - if isinstance(text, str): - text = text.decode('utf-8') - - if max_lines == 0: - lines = text.split('\n') - else: - lines = text.split('\n', max_lines)[:max_lines] - if max_chars > 0: - if lines: - lines = map(lambda e: _cut_if_long(e), lines) - if lines: - reduced_text = '\n'.join(lines) - if reduced_text != text: - reduced_text += '...' - else: - reduced_text = '' - return reduced_text - -def get_account_status(account): - status = reduce_chars_newlines(account['status_line'], 100, 1) - return status - def get_notification_icon_tooltip_dict(): '''returns a dict of the form {acct: {'show': show, 'message': message, 'event_lines': [list of text lines to show in tooltip]}''' @@ -1094,38 +1207,6 @@ 'show': status, 'message': message}) return accounts
-def get_avatar_path(prefix): - '''Returns the filename of the avatar, distinguishes between user- and - contact-provided one. Returns None if no avatar was found at all. - prefix is the path to the requested avatar just before the ".png" or - ".jpeg".''' - # First, scan for a local, user-set avatar - for type_ in ('jpeg', 'png'): - file_ = prefix + '_local.' + type_ - if os.path.exists(file_): - return file_ - # If none available, scan for a contact-provided avatar - for type_ in ('jpeg', 'png'): - file_ = prefix + '.' + type_ - if os.path.exists(file_): - return file_ - return None - -def datetime_tuple(timestamp): - '''Converts timestamp using strptime and the format: %Y%m%dT%H:%M:%S - Because of various datetime formats are used the following exceptions - are handled: - - Optional milliseconds appened to the string are removed - - Optional Z (that means UTC) appened to the string are removed - - XEP-082 datetime strings have all '-' cahrs removed to meet - the above format.''' - timestamp = timestamp.split('.')[0] - timestamp = timestamp.replace('-', '') - timestamp = timestamp.replace('z', '') - timestamp = timestamp.replace('Z', '') - from time import strptime - return strptime(timestamp, '%Y%m%dT%H:%M:%S') - def get_iconset_path(iconset): if os.path.isdir(os.path.join(gajim.DATA_DIR, 'iconsets', iconset)): return os.path.join(gajim.DATA_DIR, 'iconsets', iconset) @@ -1187,75 +1268,6 @@ keyID = 'UNKNOWN' return keyID
-def sort_identities_func(i1, i2): - cat1 = i1['category'] - cat2 = i2['category'] - if cat1 < cat2: - return -1 - if cat1 > cat2: - return 1 - type1 = i1.get('type', '') - type2 = i2.get('type', '') - if type1 < type2: - return -1 - if type1 > type2: - return 1 - lang1 = i1.get('xml:lang', '') - lang2 = i2.get('xml:lang', '') - if lang1 < lang2: - return -1 - if lang1 > lang2: - return 1 - return 0 - -def sort_dataforms_func(d1, d2): - f1 = d1.getField('FORM_TYPE') - f2 = d2.getField('FORM_TYPE') - if f1 and f2 and (f1.getValue() < f2.getValue()): - return -1 - return 1 - -def compute_caps_hash(identities, features, dataforms=[], hash_method='sha-1'): - '''Compute caps hash according to XEP-0115, V1.5 - - dataforms are xmpp.DataForms objects as common.dataforms don't allow several - values without a field type list-multi''' - S = '' - identities.sort(cmp=sort_identities_func) - for i in identities: - c = i['category'] - type_ = i.get('type', '') - lang = i.get('xml:lang', '') - name = i.get('name', '') - S += '%s/%s/%s/%s<' % (c, type_, lang, name) - features.sort() - for f in features: - S += '%s<' % f - dataforms.sort(cmp=sort_dataforms_func) - for dataform in dataforms: - # fields indexed by var - fields = {} - for f in dataform.getChildren(): - fields[f.getVar()] = f - form_type = fields.get('FORM_TYPE') - if form_type: - S += form_type.getValue() + '<' - del fields['FORM_TYPE'] - vars = sorted(fields.keys()) - for var in vars: - S += '%s<' % var - values = sorted(fields[var].getValues()) - for value in values: - S += '%s<' % value - - if hash_method == 'sha-1': - hash = hash_sha1(S) - elif hash_method == 'md5': - hash = hash_md5(S) - else: - return '' - return base64.b64encode(hash.digest()) - def update_optional_features(account = None): if account: accounts = [account] @@ -1290,4 +1302,12 @@ gajim.connections[a].change_status(gajim.SHOW_LIST[connected], gajim.connections[a].status)
+def jid_is_blocked(account, jid): + return ((jid in gajim.connections[account].blocked_contacts) or \ + gajim.connections[account].blocked_all) + +def group_is_blocked(account, group): + return ((group in gajim.connections[account].blocked_groups) or \ + gajim.connections[account].blocked_all) + # vim: se ts=3:
Modified: branches/gajim_0.12/src/common/i18n.py =================================================================== --- branches/gajim_0.12/src/common/i18n.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/i18n.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -24,12 +24,10 @@ import locale import gettext import os +import defs
APP = 'gajim' -if os.path.isdir('../po'): - DIR = '../po' -else: - DIR = '../../locale' +DIR = defs.localedir
# set '' so each part of the locale that should be modified is set # according to the environment variables
Copied: branches/gajim_0.12/src/common/latex.py (from rev 10950, trunk/src/common/latex.py) =================================================================== --- branches/gajim_0.12/src/common/latex.py (rev 0) +++ branches/gajim_0.12/src/common/latex.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -0,0 +1,158 @@ +# -*- coding:utf-8 -*- +## src/common/latex.py +## +## Copyright (C) 2005 Norman Rasmussen <norman AT rasmussen.co.za> +## Copyright (C) 2005-2006 Alex Mauer <hawke AT hawkesnest.net> +## Travis Shirk <travis AT pobox.com> +## Copyright (C) 2005-2007 Nikos Kouremenos <kourem AT gmail.com> +## Copyright (C) 2005-2008 Yann Leboulanger <asterix AT lagaule.org> +## Copyright (C) 2006 Dimitur Kirov <dkirov AT gmail.com> +## Copyright (C) 2006-2008 Jean-Marie Traissard <jim AT lapin.org> +## Copyright (C) 2008 Jonathan Schleifer <js-gajim AT webkeks.org> +## Julien Pivotto <roidelapluie AT gmail.com> +## Stephan Erb <steve-e AT h3c.de> +## +## 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 os +import random +from tempfile import gettempdir +from subprocess import Popen, PIPE + +import logging +log = logging.getLogger('gajim.c.latex') + +import gajim +from exceptions import LatexError +import helpers + +# some latex commands are really bad +blacklist = ['\def', '\let', '\futurelet', + '\newcommand', '\renewcomment', '\else', '\fi', '\write', + '\input', '\include', '\chardef', '\catcode', '\makeatletter', + '\noexpand', '\toksdef', '\every', '\errhelp', '\errorstopmode', + '\scrollmode', '\nonstopmode', '\batchmode', '\read', '\csname', + '\newhelp', '\relax', '\afterground', '\afterassignment', + '\expandafter', '\noexpand', '\special', '\command', '\loop', + '\repeat', '\toks', '\output', '\line', '\mathcode', '\name', + '\item', '\section', '\mbox', '\DeclareRobustCommand', '\[', + '\]'] +# True if the string matches the blacklist +def check_blacklist(str_): + for word in blacklist: + if word in str_: + return True + return False + +def get_tmpfile_name(): + random.seed() + int_ = random.randint(0, 100) + return os.path.join(gettempdir(), 'gajimtex_' + int_.__str__()) + +def write_latex(filename, str_): + texstr = '\documentclass[12pt]{article}\usepackage[dvips]{graphicx}' + texstr += '\usepackage{amsmath}\usepackage{amssymb}' + texstr += '\pagestyle{empty}' + texstr += '\begin{document}\begin{large}\begin{gather*}' + texstr += str_ + texstr += '\end{gather*}\end{large}\end{document}' + + file_ = open(filename, "w+") + file_.write(texstr) + file_.flush() + file_.close() + +# a wrapper for Popen so that no window gets opened on Windows +# (i think this is the reason we're using Popen rather than just system()) +# stdout goes to a pipe so that it can be read +def popen_nt_friendly(command): + if os.name == 'nt': + # CREATE_NO_WINDOW + return Popen(command, creationflags=0x08000000, cwd=gettempdir(), stdout=PIPE) + else: + return Popen(command, cwd=gettempdir(), stdout=PIPE) + +def check_for_latex_support(): + '''check is latex is available and if it can create a picture.''' + + try: + filename = latex_to_image("test") + if filename: + # we have a file, conversion succeeded + os.remove(filename) + return True + return False + except LatexError: + return False + +def latex_to_image(str_): + result = None + exitcode = 0 + + # filter latex code with bad commands + if check_blacklist(str_): + # we triggered the blacklist, immediately return None + return None + + tmpfile = get_tmpfile_name() + + # build latex string + write_latex(os.path.join(tmpfile + '.tex'), str_) + + # convert TeX to dvi + try: + p = popen_nt_friendly(['latex', '--interaction=nonstopmode', + tmpfile + '.tex']) + out = p.communicate()[0] + log.info(out) + exitcode = p.wait() + except Exception, e: + exitcode = _('Error executing "%(command)s": %(error)s') % { + 'command': 'latex --interaction=nonstopmode %s.tex' % tmpfile, + 'error': helpers.decode_string(e.message)} + + if exitcode == 0: + # convert dvi to png + latex_png_dpi = gajim.config.get('latex_png_dpi') + try: + p = popen_nt_friendly(['dvipng', '-bg', 'rgb 1.0 1.0 1.0', '-T', + 'tight', '-D', latex_png_dpi, tmpfile + '.dvi', '-o', + tmpfile + '.png']) + out = p.communicate()[0] + log.info(out) + exitcode = p.wait() + except Exception, e: + exitcode = _('Error executing "%(command)s": %(error)s') % { + 'command': 'dvipng -bg rgb 1.0 1.0 1.0 -T tight -D %s %s.dvi -o ' + '%s.png' % (latex_png_dpi, tmpfile, tmpfile), 'error': str(e)} + + # remove temp files created by us and TeX + extensions = ['.tex', '.log', '.aux', '.dvi'] + for ext in extensions: + try: + os.remove(tmpfile + ext) + except Exception: + pass + + if isinstance(exitcode, (unicode, str)): + raise LatexError(exitcode) + + if exitcode == 0: + result = tmpfile + '.png' + + return result + +# vim: se ts=3:
Modified: branches/gajim_0.12/src/common/optparser.py =================================================================== --- branches/gajim_0.12/src/common/optparser.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/optparser.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -185,6 +185,8 @@ self.update_config_to_01143() if old < [0, 11, 4, 4] and new >= [0, 11, 4, 4]: self.update_config_to_01144() + if old < [0, 12, 1, 2] and new >= [0, 12, 1, 2]: + self.update_config_to_01212()
gajim.logger.init_vars() gajim.config.set('version', new_version) @@ -599,4 +601,13 @@ con.close() gajim.config.set('version', '0.11.4.4')
+ def update_config_to_01212(self): + for opt in ('ignore_unknown_contacts', 'send_os_info', + 'log_encrypted_sessions'): + if opt in self.old_values: + val = self.old_values[opt] + for account in gajim.config.get_per('accounts'): + gajim.config.set_per('accounts', account, opt, val) + gajim.config.set('version', '0.12.1.2') + # vim: se ts=3:
Modified: branches/gajim_0.12/src/common/proxy65_manager.py =================================================================== --- branches/gajim_0.12/src/common/proxy65_manager.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/proxy65_manager.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -23,6 +23,8 @@ import socket import struct import errno +import logging +log = logging.getLogger('gajim.c.proxy65_manager')
import common.xmpp from common import gajim @@ -105,21 +107,22 @@ self.port = int(port) self.jid = unicode(jid) self.state = S_RESOLVED - #FIXME: re-enable proxy testing - self.state = S_FINISHED - return + log.info('start resolving %s:%s' % (self.host, self.port)) self.receiver_tester = ReceiverTester(self.host, self.port, self.jid, self.sid, self.sender_jid, self._on_receiver_success, self._on_connect_failure) self.receiver_tester.connect() def _on_receiver_success(self): + log.debug('Receiver successfully connected %s:%s' % (self.host, + self.port)) self.host_tester = HostTester(self.host, self.port, self.jid, self.sid, self.sender_jid, self._on_connect_success, self._on_connect_failure) self.host_tester.connect()
def _on_connect_success(self): + log.debug('Host successfully connected %s:%s' % (self.host, self.port)) iq = common.xmpp.Protocol(name='iq', to=self.jid, typ='set') query = iq.setTag('query') query.setNamespace(common.xmpp.NS_BYTESTREAM) @@ -129,13 +132,22 @@ activate.setData('test@gajim.org/test2')
if self.active_connection: - self.active_connection.SendAndCallForResponse(iq, self.keep_conf) + log.debug('Activating bytestream on %s:%s' % (self.host, self.port)) + self.active_connection.SendAndCallForResponse(iq, + self._result_received) self.state = S_ACTIVATED else: self.state = S_INITIAL
- def keep_conf(self, data=None): + def _result_received(self, data): self.disconnect(self.active_connection) + if data.getType() == 'result': + self.keep_conf() + else: + self._on_connect_failure() + + def keep_conf(self): + log.debug('Bytestream activated %s:%s' % (self.host, self.port)) self.state = S_FINISHED
def _on_connect_failure(self): @@ -269,7 +281,9 @@ data = self._get_request_buff(self._get_sha1_auth()) self.send_raw(data) self.state += 1 + log.debug('Host authenticating to %s:%s' % (self.host, self.port)) elif self.state == 3: + log.debug('Host authenticated to %s:%s' % (self.host, self.port)) self.on_success() self.state += 1
@@ -277,6 +291,7 @@ try: self._sock.connect((self.host, self.port)) self._sock.setblocking(False) + log.debug('Host Connecting to %s:%s' % (self.host, self.port)) self._send = self._sock.send self._recv = self._sock.recv except Exception, ee: @@ -296,6 +311,7 @@ self._recv = self._sock.recv self.buff = '' self.state = 1 # connected + log.debug('Host connected to %s:%s' % (self.host, self.port)) self.idlequeue.plug_idle(self, True, False) return
@@ -371,6 +387,7 @@ if version != 0x05 or method == 0xff: self.pollend() return + log.debug('Receiver authenticating to %s:%s' % (self.host, self.port)) data = self._get_request_buff(self._get_sha1_auth()) self.send_raw(data) self.state += 1 @@ -382,13 +399,15 @@ if version != 0x05 or reply != 0x00: self.pollend() return + log.debug('Receiver authenticated to %s:%s' % (self.host, self.port)) self.on_success() self.state += 1
def do_connect(self): try: + self._sock.setblocking(False) self._sock.connect((self.host, self.port)) - self._sock.setblocking(False) + log.debug('Receiver Connecting to %s:%s' % (self.host, self.port)) self._send = self._sock.send self._recv = self._sock.recv except Exception, ee: @@ -408,7 +427,7 @@ self._recv = self._sock.recv self.buff = '' self.state = 1 # connected + log.debug('Receiver connected to %s:%s' % (self.host, self.port)) self.idlequeue.plug_idle(self, True, False) - return
# vim: se ts=3:
Modified: branches/gajim_0.12/src/common/stanza_session.py =================================================================== --- branches/gajim_0.12/src/common/stanza_session.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/stanza_session.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -351,7 +351,8 @@ return self.decrypter.decrypt(ciphertext)
def logging_preference(self): - if gajim.config.get('log_encrypted_sessions'): + if gajim.config.get_per('accounts', self.conn.name, + 'log_encrypted_sessions'): return ['may', 'mustnot'] else: return ['mustnot', 'may']
Modified: branches/gajim_0.12/src/common/xmpp/auth_nb.py =================================================================== --- branches/gajim_0.12/src/common/xmpp/auth_nb.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/xmpp/auth_nb.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -160,14 +160,18 @@ self.mechanism = "DIGEST-MD5" elif "PLAIN" in self.mecs: self.mecs.remove("PLAIN") - sasl_data='%s\x00%s\x00%s' % (self.username+'@' + self._owner.Server, - self.username, self.password) - node=Node('auth', attrs={'xmlns':NS_SASL,'mechanism':'PLAIN'}, - payload=[base64.encodestring(sasl_data).replace('\n','')]) + sasl_data = u'%s\x00%s\x00%s' % (self.username + '@' + \ + self._owner.Server, self.username, self.password) + asl_data = sasl_data.encode('utf-8').encode('base64').replace( + '\n','') + node = Node('auth', attrs={'xmlns': NS_SASL, 'mechanism': 'PLAIN'}, + payload=[sasl_data]) self.mechanism = "PLAIN" else: self.startsasl='failure' self.DEBUG('I can only use DIGEST-MD5, GSSAPI and PLAIN mecanisms.', 'error') + if self.on_sasl: + self.on_sasl() return self.startsasl='in-process' self._owner.send(node.__str__()) @@ -249,15 +253,15 @@ resp['qop'], HH(A2)])) resp['response'] = response resp['charset'] = 'utf-8' - sasl_data='' + sasl_data = u'' for key in ('charset', 'username', 'realm', 'nonce', 'nc', 'cnonce', 'digest-uri', 'response', 'qop'): if key in ['nc','qop','response','charset']: - sasl_data += "%s=%s," % (key,resp[key]) + sasl_data += u"%s=%s," % (key,resp[key]) else: - sasl_data += '%s="%s",' % (key,resp[key]) -########################################3333 - node=Node('response', attrs={'xmlns':NS_SASL}, - payload=[base64.encodestring(sasl_data[:-1]).replace('\r','').replace('\n','')]) + sasl_data += u'%s="%s",' % (key,resp[key]) + sasl_data = sasl_data[:-1].encode('utf-8').encode('base64').replace( + '\r','').replace('\n','') + node = Node('response', attrs={'xmlns':NS_SASL}, payload=[sasl_data]) self._owner.send(node.__str__()) elif 'rspauth' in chal: self._owner.send(Node('response', attrs={'xmlns':NS_SASL}).__str__())
Modified: branches/gajim_0.12/src/common/xmpp/dispatcher_nb.py =================================================================== --- branches/gajim_0.12/src/common/xmpp/dispatcher_nb.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/xmpp/dispatcher_nb.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -374,31 +374,34 @@ if not res: return self._owner.remove_timeout() - if self._expected[self._witid] is None: - return - if self._witid in self.on_responses: - i = self._witid # copy id cause it can change in resp() call - self._owner.onreceive(None) - resp, args = self.on_responses[self._witid] - del(self.on_responses[self._witid]) - if args is None: - resp(self._expected[self._witid]) - else: - resp(self._owner, self._expected[self._witid], **args) - del self._expected[i] + for (_id, _iq) in self._expected.items(): + if _iq is None: + # If the expected Stanza would have arrived, ProcessNonBlocking + # would have placed the reply stanza in there + continue + if _id in self.on_responses: + if len(self._expected) == 1: + self._owner.onreceive(None) + resp, args = self.on_responses[_id] + del self.on_responses[_id] + if args is None: + resp(_iq) + else: + resp(self._owner, _iq, **args) + del self._expected[_id] def SendAndWaitForResponse(self, stanza, timeout=None, func=None, args=None): ''' Put stanza on the wire and wait for recipient's response to it. ''' if timeout is None: timeout = DEFAULT_TIMEOUT_SECONDS - self._witid = self.send(stanza) + _waitid = self.send(stanza) if func: - self.on_responses[self._witid] = (func, args) + self.on_responses[_waitid] = (func, args) if timeout: self._owner.set_timeout(timeout) self._owner.onreceive(self.WaitForData) - self._expected[self._witid] = None - return self._witid + self._expected[_waitid] = None + return _waitid def SendAndCallForResponse(self, stanza, func=None, args=None): ''' Put stanza on the wire and call back when recipient replies.
Modified: branches/gajim_0.12/src/common/xmpp/transports_nb.py =================================================================== --- branches/gajim_0.12/src/common/xmpp/transports_nb.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/common/xmpp/transports_nb.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -466,7 +466,7 @@ errtxt = "Connection closed unexpectedly"
if errnum in (ERR_DISCONN, errno.ECONNRESET, errno.ENOTCONN, errno.ESHUTDOWN): - log.error("Connection to %s lost: %s [%d]", self.getName(), errtxt, errnum) + log.info("Connection to %s lost: %s [%d]", self.getName(), errtxt, errnum) self.printed_error = True if not errors_only: self.pollend(retry=(errnum in (ERR_DISCONN, errno.ECONNRESET))) @@ -481,7 +481,7 @@ return elif errnum != 0: self.DEBUG(errtxt, 'error') - log.error("Connection to %s lost: %s [%d]", self.getName(), errtxt, errnum) + log.info("Connection to %s lost: %s [%d]", self.getName(), errtxt, errnum) self._owner.disconnected() self.printed_error = True if not errors_only and self.state >= 0:
Modified: branches/gajim_0.12/src/config.py =================================================================== --- branches/gajim_0.12/src/config.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/config.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -486,20 +486,32 @@ self.xml.get_widget('log_show_changes_checkbutton').set_active(st)
# log encrypted chat sessions - st = gajim.config.get('log_encrypted_sessions') - self.xml.get_widget('log_encrypted_chats_checkbutton').set_active(st) + w = self.xml.get_widget('log_encrypted_chats_checkbutton') + st = self.get_per_account_option('log_encrypted_sessions') + if st == 'mixed': + w.set_inconsistent(True) + else: + w.set_active(st)
# send os info - st = gajim.config.get('send_os_info') - self.xml.get_widget('send_os_info_checkbutton').set_active(st) + w = self.xml.get_widget('send_os_info_checkbutton') + st = self.get_per_account_option('send_os_info') + if st == 'mixed': + w.set_inconsistent(True) + else: + w.set_active(st)
# check if gajm is default st = gajim.config.get('check_if_gajim_is_default') self.xml.get_widget('check_default_client_checkbutton').set_active(st)
# Ignore messages from unknown contacts - self.xml.get_widget('ignore_events_from_unknown_contacts_checkbutton').\ - set_active(gajim.config.get('ignore_unknown_contacts')) + w = self.xml.get_widget('ignore_events_from_unknown_contacts_checkbutton') + st = self.get_per_account_option('ignore_unknown_contacts') + if st == 'mixed': + w.set_inconsistent(True) + else: + w.set_active(st)
self.xml.signal_autoconnect(self)
@@ -523,14 +535,36 @@ if event.keyval == gtk.keysyms.Escape: 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 + else returns "mixed"''' + val = None + for account in gajim.connections: + v = gajim.config.get_per('accounts', account, opt) + if val is None: + val = v + elif val != v: + return 'mixed' + return val + def on_checkbutton_toggled(self, widget, config_name, - change_sensitivity_widgets = None): + change_sensitivity_widgets=None): gajim.config.set(config_name, widget.get_active()) if change_sensitivity_widgets: for w in change_sensitivity_widgets: w.set_sensitive(widget.get_active()) gajim.interface.save_config()
+ def on_per_account_checkbutton_toggled(self, widget, config_name, + change_sensitivity_widgets=None): + for account in gajim.connections: + gajim.config.set_per('accounts', account, config_name, + widget.get_active()) + if change_sensitivity_widgets: + for w in change_sensitivity_widgets: + w.set_sensitive(widget.get_active()) + gajim.interface.save_config() + def on_sort_by_show_in_roster_checkbutton_toggled(self, widget): self.on_checkbutton_toggled(widget, 'sort_by_show_in_roster') gajim.interface.roster.setup_and_draw_roster() @@ -621,7 +655,7 @@ spell_obj = None
if not spell_obj: - gtkspell.Spell(ctrl.msg_textview) + ctrl.set_speller()
def remove_speller(self): for acct in gajim.connections: @@ -727,7 +761,8 @@ gajim.config.set('displayed_chat_state_notifications', 'disabled')
def on_ignore_events_from_unknown_contacts_checkbutton_toggled(self, widget): - self.on_checkbutton_toggled(widget, 'ignore_unknown_contacts') + widget.set_inconsistent(False) + self.on_per_account_checkbutton_toggled(widget, 'ignore_unknown_contacts')
def on_on_event_combobox_changed(self, widget): active = widget.get_active() @@ -968,10 +1003,12 @@ self.on_checkbutton_toggled(widget, 'log_contact_status_changes') def on_log_encrypted_chats_checkbutton_toggled(self, widget): - self.on_checkbutton_toggled(widget, 'log_encrypted_sessions') + widget.set_inconsistent(False) + self.on_per_account_checkbutton_toggled(widget, 'log_encrypted_sessions')
def on_send_os_info_checkbutton_toggled(self, widget): - self.on_checkbutton_toggled(widget, 'send_os_info') + widget.set_inconsistent(False) + self.on_per_account_checkbutton_toggled(widget, 'send_os_info')
def on_check_default_client_checkbutton_toggled(self, widget): self.on_checkbutton_toggled(widget, 'check_if_gajim_is_default') @@ -1615,10 +1652,12 @@ custom_host = gajim.config.get_per('accounts', account, 'custom_host') if not custom_host: custom_host = gajim.config.get_per('accounts', account, 'hostname') + gajim.config.set_per('accounts', account, 'custom_host', custom_host) self.xml.get_widget('custom_host_entry1').set_text(custom_host) custom_port = gajim.config.get_per('accounts', account, 'custom_port') if not custom_port: custom_port = 5222 + gajim.config.set_per('accounts', account, 'custom_port', custom_port) self.xml.get_widget('custom_port_entry1').set_text(unicode(custom_port))
# Personal tab @@ -1756,7 +1795,8 @@ # change account variable for chat / gc controls gajim.interface.msg_win_mgr.change_account_name(old_name, new_name) # upgrade account variable in opened windows - for kind in ('infos', 'disco', 'gc_config', 'search'): + for kind in ('infos', 'disco', 'gc_config', 'search', + 'online_dialog'): for j in gajim.interface.instances[new_name][kind]: gajim.interface.instances[new_name][kind][j].account = \ new_name @@ -2177,7 +2217,7 @@ self.init_account_gpg() # update variables gajim.interface.instances[gajim.ZEROCONF_ACC_NAME] = {'infos': {}, - 'disco': {}, 'gc_config': {}, 'search': {}} + 'disco': {}, 'gc_config': {}, 'search': {}, 'online_dialog': {}} gajim.interface.minimized_controls[gajim.ZEROCONF_ACC_NAME] = {} gajim.connections[gajim.ZEROCONF_ACC_NAME].connected = 0 gajim.groups[gajim.ZEROCONF_ACC_NAME] = {} @@ -2406,6 +2446,8 @@ renderer = gtk.CellRendererText() col = gtk.TreeViewColumn(_('JID'), renderer) col.add_attribute(renderer, 'text', 0) + col.set_resizable(True) + col.set_sort_column_id(0) self.affiliation_treeview[affiliation].append_column(col)
if affiliation == 'outcast': @@ -2414,15 +2456,21 @@ renderer.connect('edited', self.on_cell_edited) col = gtk.TreeViewColumn(_('Reason'), renderer) col.add_attribute(renderer, 'text', 1) + col.set_resizable(True) + col.set_sort_column_id(1) self.affiliation_treeview[affiliation].append_column(col) elif affiliation == 'member': renderer = gtk.CellRendererText() col = gtk.TreeViewColumn(_('Nick'), renderer) col.add_attribute(renderer, 'text', 2) + col.set_resizable(True) + col.set_sort_column_id(2) self.affiliation_treeview[affiliation].append_column(col) renderer = gtk.CellRendererText() col = gtk.TreeViewColumn(_('Role'), renderer) col.add_attribute(renderer, 'text', 3) + col.set_resizable(True) + col.set_sort_column_id(3) self.affiliation_treeview[affiliation].append_column(col)
sw = gtk.ScrolledWindow() @@ -3018,6 +3066,8 @@ # connection instance is saved in gajim.connections and we canceled the # addition of the account del gajim.connections[self.account] + if self.account in gajim.config.get_per('accounts'): + gajim.config.del_per('accounts', self.account) del gajim.interface.instances['account_creation_wizard']
def on_register_server_features_button_clicked(self, widget): @@ -3277,6 +3327,8 @@ if self.update_progressbar_timeout_id is not None: gobject.source_remove(self.update_progressbar_timeout_id) del gajim.connections[self.account] + if self.account in gajim.config.get_per('accounts'): + gajim.config.del_per('accounts', self.account) self.back_button.show() self.cancel_button.show() self.go_online_checkbutton.hide() @@ -3321,6 +3373,8 @@ self.go_online_checkbutton.hide() self.show_vcard_checkbutton.hide() del gajim.connections[self.account] + if self.account in gajim.config.get_per('accounts'): + gajim.config.del_per('accounts', self.account) img = self.xml.get_widget('finish_image') img.set_from_stock(gtk.STOCK_DIALOG_ERROR, gtk.ICON_SIZE_DIALOG) finish_text = '<big><b>%s</b></big>\n\n%s' % (_('An error occurred during ' @@ -3432,7 +3486,7 @@
# update variables gajim.interface.instances[self.account] = {'infos': {}, 'disco': {}, - 'gc_config': {}, 'search': {}} + 'gc_config': {}, 'search': {}, 'online_dialog': {}} gajim.interface.minimized_controls[self.account] = {} gajim.connections[self.account].connected = 0 gajim.connections[self.account].keepalives = gajim.config.get_per(
Modified: branches/gajim_0.12/src/conversation_textview.py =================================================================== --- branches/gajim_0.12/src/conversation_textview.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/conversation_textview.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -27,9 +27,6 @@ ## along with Gajim. If not, see http://www.gnu.org/licenses/. ##
-import random -from tempfile import gettempdir -from subprocess import Popen from threading import Timer # for smooth scrolling
import gtk @@ -45,6 +42,7 @@ import gtkgui_helpers from common import gajim from common import helpers +from common import latex from calendar import timegm from common.fuzzyclock import FuzzyClock
@@ -623,6 +621,10 @@ # Check if we should hide the line tooltip if not over_line: self.line_tooltip.hide_tooltip() + if self.xep0184_warning_tooltip.timeout != 0: + # Check if we should hide the XEP-184 warning tooltip + if not xep0184_warning: + self.xep0184_warning_tooltip.hide_tooltip() if over_line and not self.line_tooltip.win: self.line_tooltip.timeout = gobject.timeout_add(500, self.show_line_tooltip) @@ -923,95 +925,6 @@
return index # the position after *last* special text
- def latex_to_image(self, str_): - result = None - exitcode = 0 - - # some latex commands are really bad - blacklist = ['\def', '\let', '\futurelet', - '\newcommand', '\renewcomment', '\else', '\fi', '\write', - '\input', '\include', '\chardef', '\catcode', '\makeatletter', - '\noexpand', '\toksdef', '\every', '\errhelp', '\errorstopmode', - '\scrollmode', '\nonstopmode', '\batchmode', '\read', '\csname', - '\newhelp', '\relax', '\afterground', '\afterassignment', - '\expandafter', '\noexpand', '\special', '\command', '\loop', - '\repeat', '\toks', '\output', '\line', '\mathcode', '\name', - '\item', '\section', '\mbox', '\DeclareRobustCommand', '\[', - '\]'] - - str_ = str_[2:len(str_)-2] - - # filter latex code with bad commands - for word in blacklist: - if word in str_: - exitcode = 1 - break - - if exitcode == 0: - random.seed() - tmpfile = os.path.join(gettempdir(), 'gajimtex_' + random.randint(0, - 100).__str__()) - - # build latex string - texstr = '\documentclass[12pt]{article}\usepackage[dvips]{graphicx}' - texstr += '\usepackage{amsmath}\usepackage{amssymb}' - texstr += '\pagestyle{empty}' - texstr += '\begin{document}\begin{large}\begin{gather*}' - texstr += str_ - texstr += '\end{gather*}\end{large}\end{document}' - - file = open(os.path.join(tmpfile + '.tex'), 'w+') - file.write(texstr) - file.flush() - file.close() - - try: - if os.name == 'nt': - # CREATE_NO_WINDOW - p = Popen(['latex', '--interaction=nonstopmode', - tmpfile + '.tex'], creationflags=0x08000000, cwd=gettempdir()) - else: - p = Popen(['latex', '--interaction=nonstopmode', - tmpfile + '.tex'], cwd=gettempdir()) - exitcode = p.wait() - except Exception, e: - exitcode = _('Error executing "%(command)s": %(error)s') % { - 'command': 'latex --interaction=nonstopmode %s.tex' % tmpfile, - 'error': str(e)} - - if exitcode == 0: - latex_png_dpi = gajim.config.get('latex_png_dpi') - try: - if os.name == 'nt': - # CREATE_NO_WINDOW - p = Popen(['dvipng', '-bg', 'rgb 1.0 1.0 1.0', '-T', 'tight', - '-D', latex_png_dpi, tmpfile + '.dvi', '-o', - tmpfile + '.png'], creationflags=0x08000000, cwd=gettempdir()) - else: - p = Popen(['dvipng', '-bg', 'rgb 1.0 1.0 1.0', '-T', 'tight', - '-D', latex_png_dpi, tmpfile + '.dvi', '-o', - tmpfile + '.png'], cwd=gettempdir()) - exitcode = p.wait() - except Exception, e: - exitcode = _('Error executing "%(command)s": %(error)s') % { - 'command': 'dvipng -bg rgb 1.0 1.0 1.0 -T tight -D %s %s.dvi -o ' - '%s.png' % (latex_png_dpi, tmpfile, tmpfile), 'error': str(e)} - - extensions = ['.tex', '.log', '.aux', '.dvi'] - for ext in extensions: - try: - os.remove(tmpfile + ext) - except Exception: - pass - - if isinstance(exitcode, (unicode, str)): - raise LatexError(exitcode) - - if exitcode == 0: - result = tmpfile + '.png' - - return result - def print_special_text(self, special_text, other_tags): '''is called by detect_and_print_special_text and prints special text (emots, links, formatting)''' @@ -1100,17 +1013,18 @@ else: if not show_ascii_formatting_chars: special_text = special_text[1:-1] # remove _ _ - elif special_text.startswith('$$') and special_text.endswith('$$'): + elif gajim.HAVE_LATEX and special_text.startswith('$$') and \ + special_text.endswith('$$'): try: - imagepath = self.latex_to_image(special_text) + imagepath = latex.latex_to_image(special_text[2:-2]) except LatexError, e: # print the error after the line has been written gobject.idle_add(self.print_conversation_line, str(e), '', 'info', '', None) imagepath = None end_iter = buffer.get_end_iter() - anchor = buffer.create_child_anchor(end_iter) if imagepath is not None: + anchor = buffer.create_child_anchor(end_iter) img = gtk.Image() img.set_from_file(imagepath) img.show() @@ -1203,7 +1117,7 @@ buffer.insert_with_tags_by_name(end_iter, tim_format + '\n', 'time_sometimes') # kind = info, we print things as if it was a status: same color, ... - if kind == 'info': + if kind in ('error', 'info'): kind = 'status' other_text_tag = self.detect_other_text_tag(text, kind) text_tags = other_tags_for_text[:] # create a new list
Modified: branches/gajim_0.12/src/dialogs.py =================================================================== --- branches/gajim_0.12/src/dialogs.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/dialogs.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -161,9 +161,6 @@ continue groups[g] = 0 c_groups = contact.groups - # FIXME: Move to backend - if not c_groups: - c_groups = [_('General')] for g in c_groups: groups[g] += 1 group_list = [] @@ -1648,6 +1645,9 @@ def on_deny_button_clicked(self, widget): '''refuse the request''' gajim.connections[self.account].refuse_authorization(self.jid) + contact = gajim.contacts.get_contact(self.account, self.jid) + if contact and _('Not in Roster') in contact.get_shown_groups(): + gajim.interface.roster.remove_contact(self.jid, self.account) self.window.destroy()
def on_actions_button_clicked(self, widget): @@ -2199,12 +2199,11 @@
if gajim.config.get('use_speller') and HAS_GTK_SPELL and action == 'send': try: - spell1 = gtkspell.Spell(self.conversation_textview.tv) - spell2 = gtkspell.Spell(self.message_textview) lang = gajim.config.get('speller_language') - if lang: - spell1.set_language(lang) - spell2.set_language(lang) + if not lang: + lang = gajim.LANG + gtkspell.Spell(self.conversation_textview.tv, lang) + gtkspell.Spell(self.message_textview, lang) except gobject.GError, msg: AspellDictError(lang)
Modified: branches/gajim_0.12/src/disco.py =================================================================== --- branches/gajim_0.12/src/disco.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/disco.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -606,7 +606,8 @@
# self.browser._get_agent_address() would break when no browser. addr = get_agent_address(self.jid, self.node) - del gajim.interface.instances[self.account]['disco'][addr] + if addr in gajim.interface.instances[self.account]['disco']: + del gajim.interface.instances[self.account]['disco'][addr]
if self.browser: self.window.hide()
Modified: branches/gajim_0.12/src/features_window.py =================================================================== --- branches/gajim_0.12/src/features_window.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/features_window.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -33,10 +33,6 @@ from common import gajim from common import helpers
-import random -from tempfile import gettempdir -from subprocess import Popen - class FeaturesWindow: '''Class for features window'''
@@ -259,57 +255,8 @@ return sleepy.SUPPORTED
def latex_available(self): - '''check is latex is available and if it can create a picture.''' + return gajim.HAVE_LATEX
- exitcode = 0 - random.seed() - tmpfile = os.path.join(gettempdir(), "gajimtex_" + \ - random.randint(0,100).__str__()) - - # build latex string - texstr = '\documentclass[12pt]{article}\usepackage[dvips]{graphicx}' - texstr += '\usepackage{amsmath}\usepackage{amssymb}\pagestyle{empty}' - texstr += '\begin{document}\begin{large}\begin{gather*}test' - texstr += '\end{gather*}\end{large}\end{document}' - - file = open(os.path.join(tmpfile + ".tex"), "w+") - file.write(texstr) - file.flush() - file.close() - try: - if os.name == 'nt': - # CREATE_NO_WINDOW - p = Popen(['latex', '--interaction=nonstopmode', tmpfile + '.tex'], - creationflags=0x08000000, cwd=gettempdir()) - else: - p = Popen(['latex', '--interaction=nonstopmode', tmpfile + '.tex'], - cwd=gettempdir()) - exitcode = p.wait() - except Exception: - exitcode = 1 - if exitcode == 0: - try: - if os.name == 'nt': - # CREATE_NO_WINDOW - p = Popen(['dvipng', '-bg', 'white', '-T', 'tight', - tmpfile + '.dvi', '-o', tmpfile + '.png'], - creationflags=0x08000000, cwd=gettempdir()) - else: - p = Popen(['dvipng', '-bg', 'white', '-T', 'tight', - tmpfile + '.dvi', '-o', tmpfile + '.png'], cwd=gettempdir()) - exitcode = p.wait() - except Exception: - exitcode = 1 - extensions = ['.tex', '.log', '.aux', '.dvi', '.png'] - for ext in extensions: - try: - os.remove(tmpfile + ext) - except Exception: - pass - if exitcode == 0: - return True - return False - def pycrypto_available(self): from common import gajim return gajim.HAVE_PYCRYPTO
Modified: branches/gajim_0.12/src/gajim-remote.py =================================================================== --- branches/gajim_0.12/src/gajim-remote.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/gajim-remote.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding:utf-8 -*- ## src/gajim-remote.py ## @@ -29,6 +28,7 @@
import sys import locale +import urllib import signal signal.signal(signal.SIGINT, signal.SIG_DFL) # ^C exits the application
@@ -52,6 +52,8 @@ import dbus import dbus.service import dbus.glib + # test if dbus-x11 is installed + bus = dbus.SessionBus() except Exception: print str(exceptions.DbusNotSupported()) sys.exit(1) @@ -521,6 +523,10 @@ self.command = sys.argv[1] = 'open_chat' return (jid, action) = uri.split('?', 1) + try: + jid = urllib.unquote(jid) + except UnicodeDecodeError: + pass sys.argv[2] = jid if action == 'join': self.command = sys.argv[1] = 'join_room'
Property changes on: branches/gajim_0.12/src/gajim-remote.py ___________________________________________________________________ Deleted: svn:executable - *
Modified: branches/gajim_0.12/src/gajim.py =================================================================== --- branches/gajim_0.12/src/gajim.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/gajim.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding:utf-8 -*- ## src/gajim.py ## @@ -150,6 +149,27 @@ common.configpaths.gajimpaths.init_profile(profile) del profile
+if os.name == 'nt': + class MyStderr(object): + _file = None + _error = None + def write(self, text): + fname=os.path.join(common.configpaths.gajimpaths.root, + os.path.split(sys.executable)[1]+'.log') + if self._file is None and self._error is None: + try: + self._file = open(fname, 'a') + except Exception, details: + self._error = details + if self._file is not None: + self._file.write(text) + self._file.flush() + def flush(self): + if self._file is not None: + self._file.flush() + + sys.stderr = MyStderr() + # PyGTK2.10+ only throws a warning import warnings warnings.filterwarnings('error', module='gtk') @@ -503,10 +523,19 @@ self.complete(None)
def _ok(passphrase, checked, count): - if gajim.connections[account].test_gpg_passphrase(passphrase): + result = gajim.connections[account].test_gpg_passphrase(passphrase) + if result == 'ok': # passphrase is good self.complete(passphrase) return + elif result == 'expired': + dialogs.ErrorDialog(_('GPG key expired'), + _('Your GPG key has expied, you will be connected to %s without ' + 'OpenPGP.') % account) + # Don't try to connect with GPG + gajim.connections[account].continue_connect_info[2] = False + self.complete(None) + return
if count < 3: # ask again @@ -634,6 +663,12 @@ def handle_event_status(self, account, status): # OUR status #('STATUS', account, status) model = self.roster.status_combobox.get_model() + if status in ('offline', 'error'): + for name in self.instances[account]['online_dialog'].keys(): + # .keys() is needed to not have a dictionary length changed during + # iteration error + self.instances[account]['online_dialog'][name].destroy() + del self.instances[account]['online_dialog'][name] if status == 'offline': # sensitivity for this menuitem if gajim.get_number_of_connected_accounts() == 0: @@ -666,7 +701,8 @@ ctrl.parent_win.redraw_tab(ctrl)
self.roster.on_status_changed(account, status) - if account in self.show_vcard_when_connect: + if account in self.show_vcard_when_connect and status not in ('offline', + 'error'): self.edit_own_details(account) if self.remote_ctrl: self.remote_ctrl.raise_signal('AccountPresence', (status, account)) @@ -786,6 +822,14 @@ self.roster.draw_contact(contact1.jid, account) gobject.timeout_add_seconds(5, self.roster.remove_to_be_removed, contact1.jid, account) + + # unset custom status + if (old_show == 0 and new_show > 1) or (old_show > 1 and new_show == 0\ + and conn.connected > 1): + if account in self.status_sent_to_users and \ + jid in self.status_sent_to_users[account]: + del self.status_sent_to_users[account][jid] + contact1.show = array[1] contact1.status = status_message contact1.priority = priority @@ -962,10 +1006,26 @@
def handle_event_subscribe(self, account, array): #('SUBSCRIBE', account, (jid, text, user_nick)) user_nick is JEP-0172 - dialogs.SubscriptionRequestWindow(array[0], array[1], account, array[2]) if self.remote_ctrl: self.remote_ctrl.raise_signal('Subscribe', (account, array))
+ jid = array[0] + text = array[1] + nick = array[2] + if helpers.allow_popup_window(account) or not self.systray_enabled: + dialogs.SubscriptionRequestWindow(jid, text, account, nick) + return + + self.add_event(account, jid, 'subscription_request', (text, nick)) + + if helpers.allow_showing_notification(account): + path = os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', + 'subscription_request.png') + path = gtkgui_helpers.get_path_to_generic_or_avatar(path) + event_type = _('Subscription request') + notify.popup(event_type, jid, account, 'subscription_request', path, + event_type, jid) + def handle_event_subscribed(self, account, array): #('SUBSCRIBED', account, (jid, resource)) jid = array[0] @@ -995,7 +1055,20 @@ if self.remote_ctrl: self.remote_ctrl.raise_signal('Subscribed', (account, array))
+ def show_unsubscribed_dialog(self, account, contact): + def on_yes(is_checked, list_): + self.roster.on_req_usub(None, list_) + list_ = [(contact, account)] + dialogs.YesNoDialog( + _('Contact "%s" removed subscription from you') % contact.jid, + _('You will always see him or her as offline.\nDo you want to ' + 'remove him or her from your contact list?'), + on_response_yes=(on_yes, list_)) + # FIXME: Per RFC 3921, we can "deny" ack as well, but the GUI does + # not show deny + def handle_event_unsubscribed(self, account, jid): + #('UNSUBSCRIBED', account, jid) gajim.connections[account].ack_unsubscribed(jid) if self.remote_ctrl: self.remote_ctrl.raise_signal('Unsubscribed', (account, jid)) @@ -1003,15 +1076,20 @@ contact = gajim.contacts.get_first_contact_from_jid(account, jid) if not contact: return - def on_yes(is_checked, list_): - self.roster.on_req_usub(None, list_) - list_ = [(contact, account)] - dialogs.YesNoDialog( - _('Contact "%s" removed subscription from you') % jid, - _('You will always see him or her as offline.\nDo you want to remove him or her from your contact list?'), - on_response_yes=(on_yes, list_)) - # FIXME: Per RFC 3921, we can "deny" ack as well, but the GUI does not show deny
+ if helpers.allow_popup_window(account) or not self.systray_enabled: + self.show_unsubscribed_dialog(account, contact) + + self.add_event(account, jid, 'unsubscribed', contact) + + if helpers.allow_showing_notification(account): + path = os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', + 'unsubscribed.png') + path = gtkgui_helpers.get_path_to_generic_or_avatar(path) + event_type = _('Unsubscribed') + notify.popup(event_type, jid, account, 'unsubscribed', path, + event_type, jid) + def handle_event_agent_info_error(self, account, agent): #('AGENT_ERROR_INFO', account, (agent)) try: @@ -1260,6 +1338,8 @@ jids = array[0].split('/', 1) room_jid = jids[0]
+ msg = array[1] + gc_control = self.msg_win_mgr.get_gc_control(room_jid, account) if not gc_control and \ room_jid in self.minimized_controls[account]: @@ -1278,9 +1358,11 @@ # message from someone nick = jids[1]
- gc_control.on_message(nick, array[1], array[2], array[3], xhtml, array[5]) + gc_control.on_message(nick, msg, array[2], array[3], xhtml, array[5])
if self.remote_ctrl: + highlight = gc_control.needs_visual_notification(msg) + array += (highlight,) self.remote_ctrl.raise_signal('GCMessage', (account, array))
def handle_event_gc_subject(self, account, array): @@ -1475,6 +1557,20 @@ self.gpg_passphrase[keyid] = request request.add_callback(account, callback)
+ def handle_event_gpg_always_trust(self, account, callback): + #('GPG_ALWAYS_TRUST', account, callback) + def on_yes(checked): + if checked: + gajim.connections[account].gpg.always_trust = True + callback(True) + + def on_no(): + callback(False) + + dialogs.YesNoDialog(_('GPG key not trusted'), _('The GPG key used to ' + 'encrypt this chat is not trusted. Do you really want to encrypt this ' + 'message?'), checktext=_('Do _not ask me again'), + on_response_yes=on_yes, on_response_no=on_no) def handle_event_roster_info(self, account, array): #('ROSTER_INFO', account, (jid, name, sub, ask, groups)) jid = array[0] @@ -1499,7 +1595,7 @@ self.roster.add_contact(jid, account) else: # it is an existing contact that might has changed - re_draw = False + re_place = False # If contact has changed (sub, ask or group) update roster # Mind about observer status changes: # According to xep 0162, a contact is not an observer anymore when @@ -1507,8 +1603,7 @@ old_groups = contacts[0].groups if contacts[0].sub != sub or contacts[0].ask != ask\ or old_groups != groups: - re_draw = True - if re_draw: + re_place = True # c.get_shown_groups() has changed. Reflect that in roster_winodow self.roster.remove_contact(jid, account, force=True) for contact in contacts: @@ -1516,11 +1611,13 @@ contact.sub = sub contact.ask = ask contact.groups = groups or [] - if re_draw: + if re_place: self.roster.add_contact(jid, account) # Refilter and update old groups for group in old_groups: self.roster.draw_group(group, account) + else: + self.roster.draw_contact(jid, account)
if self.remote_ctrl: self.remote_ctrl.raise_signal('RosterInfo', (account, array)) @@ -1853,7 +1950,7 @@ self.instances[account]['privacy_lists'].privacy_lists_received(data)
def handle_event_privacy_list_received(self, account, data): - # ('PRIVACY_LISTS_RECEIVED', account, (name, rules)) + # ('PRIVACY_LIST_RECEIVED', account, (name, rules)) if account not in self.instances: return name = data[0] @@ -1865,10 +1962,13 @@ gajim.connections[account].blocked_contacts = [] gajim.connections[account].blocked_groups = [] gajim.connections[account].blocked_list = [] + gajim.connections[account].blocked_all = False for rule in rules: - if rule['type'] == 'jid' and rule['action'] == 'deny': + if not 'type' in rule: + gajim.connections[account].blocked_all = True + elif rule['type'] == 'jid' and rule['action'] == 'deny': gajim.connections[account].blocked_contacts.append(rule['value']) - if rule['type'] == 'group' and rule['action'] == 'deny': + elif rule['type'] == 'group' and rule['action'] == 'deny': gajim.connections[account].blocked_groups.append(rule['value']) gajim.connections[account].blocked_list.append(rule) #elif rule['type'] == "group" and action == "deny": @@ -1992,6 +2092,7 @@ server = gajim.config.get_per('accounts', account, 'hostname')
def on_ok(is_checked): + del self.instances[account]['online_dialog']['ssl_error'] if is_checked[0]: # Check if cert is already in file certs = '' @@ -2018,6 +2119,7 @@ gajim.connections[account].ssl_certificate_accepted()
def on_cancel(): + del self.instances[account]['online_dialog']['ssl_error'] gajim.connections[account].disconnect(on_purpose=True) self.handle_event_status(account, 'offline')
@@ -2028,27 +2130,36 @@ else: checktext1 = '' checktext2 = _('Ignore this error for this certificate.') - dialogs.ConfirmationDialogDubbleCheck(pritext, sectext, checktext1, + if 'ssl_error' in self.instances[account]['online_dialog']: + self.instances[account]['online_dialog']['ssl_error'].destroy() + self.instances[account]['online_dialog']['ssl_error'] = \ + dialogs.ConfirmationDialogDubbleCheck(pritext, sectext, checktext1, checktext2, on_response_ok=on_ok, on_response_cancel=on_cancel)
def handle_event_fingerprint_error(self, account, data): # ('FINGERPRINT_ERROR', account, (new_fingerprint,)) def on_yes(is_checked): + del self.instances[account]['online_dialog']['fingerprint_error'] gajim.config.set_per('accounts', account, 'ssl_fingerprint_sha1', data[0]) # Reset the ignored ssl errors gajim.config.set_per('accounts', account, 'ignore_ssl_errors', '') gajim.connections[account].ssl_certificate_accepted() def on_no(): + del self.instances[account]['online_dialog']['fingerprint_error'] gajim.connections[account].disconnect(on_purpose=True) self.handle_event_status(account, 'offline') pritext = _('SSL certificate error') - sectext = _('It seems the SSL certificate has changed or your connection ' - 'is being hacked.\nOld fingerprint: %(old)s\nNew fingerprint: %(new)s' - '\n\nDo you still want to connect and update the fingerprint of the ' - 'certificate?') % {'old': gajim.config.get_per('accounts', account, + sectext = _('It seems the SSL certificate of account %(account)s has ' + 'changed or your connection is being hacked.\nOld fingerprint: %(old)s' + '\nNew fingerprint: %(new)s\n\nDo you still want to connect and update' + ' the fingerprint of the certificate?') % {'account': account, + 'old': gajim.config.get_per('accounts', account, 'ssl_fingerprint_sha1'), 'new': data[0]} - dialog = dialogs.YesNoDialog(pritext, sectext, on_response_yes=on_yes, + if 'fingerprint_error' in self.instances[account]['online_dialog']: + self.instances[account]['online_dialog']['fingerprint_error'].destroy() + self.instances[account]['online_dialog']['fingerprint_error'] = \ + dialogs.YesNoDialog(pritext, sectext, on_response_yes=on_yes, on_response_no=on_no)
def handle_event_plain_connection(self, account, data): @@ -2058,11 +2169,15 @@ if not is_checked[0]: on_cancel() return + # On cancel call del self.instances, so don't call it another time + # before + del self.instances[account]['online_dialog']['plain_connection'] if is_checked[1]: gajim.config.set_per('accounts', account, 'warn_when_plaintext_connection', False) gajim.connections[account].connection_accepted(data[0], 'tcp') def on_cancel(): + del self.instances[account]['online_dialog']['plain_connection'] gajim.connections[account].disconnect(on_purpose=True) self.handle_event_status(account, 'offline') pritext = _('Insecure connection') @@ -2070,7 +2185,10 @@ 'connection. Are you sure you want to do that?') checktext1 = _('Yes, I really want to connect insecurely') checktext2 = _('Do _not ask me again') - dialog = dialogs.ConfirmationDialogDubbleCheck(pritext, sectext, + if 'plain_connection' in self.instances[account]['online_dialog']: + self.instances[account]['online_dialog']['plain_connection'].destroy() + self.instances[account]['online_dialog']['plain_connection'] = \ + dialogs.ConfirmationDialogDubbleCheck(pritext, sectext, checktext1, checktext2, on_response_ok=on_ok, on_response_cancel=on_cancel, is_modal=False)
@@ -2078,6 +2196,7 @@ # ('INSECURE_SSL_CONNECTION', account, (connection, connection_type)) server = gajim.config.get_per('accounts', account, 'hostname') def on_ok(is_checked): + del self.instances[account]['online_dialog']['insecure_ssl'] if not is_checked[0]: on_cancel() return @@ -2093,6 +2212,7 @@ return gajim.connections[account].connection_accepted(data[0], data[1]) def on_cancel(): + del self.instances[account]['online_dialog']['insecure_ssl'] gajim.connections[account].disconnect(on_purpose=True) self.handle_event_status(account, 'offline') pritext = _('Insecure connection') @@ -2100,7 +2220,10 @@ 'connection. You should install PyOpenSSL to prevent that. Are you sure you want to do that?') checktext1 = _('Yes, I really want to connect insecurely') checktext2 = _('Do _not ask me again') - dialog = dialogs.ConfirmationDialogDubbleCheck(pritext, sectext, + if 'insecure_ssl' in self.instances[account]['online_dialog']: + self.instances[account]['online_dialog']['insecure_ssl'].destroy() + self.instances[account]['online_dialog']['insecure_ssl'] = \ + dialogs.ConfirmationDialogDubbleCheck(pritext, sectext, checktext1, checktext2, on_response_ok=on_ok, on_response_cancel=on_cancel, is_modal=False)
@@ -2191,6 +2314,7 @@ self.handle_event_unique_room_id_unsupported, 'UNIQUE_ROOM_ID_SUPPORTED': self.handle_event_unique_room_id_supported, 'GPG_PASSWORD_REQUIRED': self.handle_event_gpg_password_required, + 'GPG_ALWAYS_TRUST': self.handle_event_gpg_always_trust, 'SSL_ERROR': self.handle_event_ssl_error, 'FINGERPRINT_ERROR': self.handle_event_fingerprint_error, 'PLAIN_CONNECTION': self.handle_event_plain_connection, @@ -2219,8 +2343,8 @@ show_in_roster = notify.get_show_in_roster(event_type, account, jid) show_in_systray = notify.get_show_in_systray(event_type, account, jid) event = gajim.events.create_event(type_, event_args, - show_in_roster = show_in_roster, - show_in_systray = show_in_systray) + show_in_roster=show_in_roster, + show_in_systray=show_in_systray) gajim.events.add_event(account, jid, event)
self.roster.show_title() @@ -2352,6 +2476,18 @@ data[1], data[3]) gajim.events.remove_events(account, jid, event) self.roster.draw_contact(jid, account) + elif type_ == 'subscription_request': + event = gajim.events.get_first_event(account, jid, type_) + data = event.parameters + dialogs.SubscriptionRequestWindow(jid, data[0], account, data[1]) + gajim.events.remove_events(account, jid, event) + self.roster.draw_contact(jid, account) + elif type_ == 'unsubscribed': + event = gajim.events.get_first_event(account, jid, type_) + contact = event.parameters + self.show_unsubscribed_dialog(account, contact) + gajim.events.remove_events(account, jid, event) + self.roster.draw_contact(jid, account) if w: w.set_active_tab(ctrl) w.window.window.focus() @@ -2802,18 +2938,18 @@ state = self.sleeper.getState() for account in gajim.connections: if account not in gajim.sleeper_state or \ - not gajim.sleeper_state[account]: + not gajim.sleeper_state[account]: continue if state == common.sleepy.STATE_AWAKE and \ - gajim.sleeper_state[account] in ('autoaway', 'autoxa'): + gajim.sleeper_state[account] in ('autoaway', 'autoxa'): # we go online self.roster.send_status(account, 'online', gajim.status_before_autoaway[account]) gajim.status_before_autoaway[account] = '' gajim.sleeper_state[account] = 'online' elif state == common.sleepy.STATE_AWAY and \ - gajim.sleeper_state[account] == 'online' and \ - gajim.config.get('autoaway'): + gajim.sleeper_state[account] == 'online' and \ + gajim.config.get('autoaway'): # we save out online status gajim.status_before_autoaway[account] = \ gajim.connections[account].status @@ -2830,10 +2966,9 @@ } self.roster.send_status(account, 'away', auto_message, auto=True) gajim.sleeper_state[account] = 'autoaway' - elif state == common.sleepy.STATE_XA and (\ - gajim.sleeper_state[account] == 'autoaway' or \ - gajim.sleeper_state[account] == 'online') and \ - gajim.config.get('autoxa'): + elif state == common.sleepy.STATE_XA and \ + gajim.sleeper_state[account] in ('online', 'autoaway', + 'autoaway-forced') and gajim.config.get('autoxa'): # we go extended away [we pass True to auto param] auto_message = gajim.config.get('autoxa_message') if not auto_message: @@ -3176,7 +3311,9 @@
for a in gajim.connections: self.instances[a] = {'infos': {}, 'disco': {}, 'gc_config': {}, - 'search': {}} + 'search': {}, 'online_dialog': {}} + # online_dialog contains all dialogs that have a meaning only when we + # are not disconnected self.minimized_controls[a] = {} gajim.contacts.add_account(a) gajim.groups[a] = {} @@ -3205,6 +3342,13 @@ if dbus_support.supported: def gnome_screensaver_ActiveChanged_cb(active): if not active: + for account in gajim.connections: + if gajim.sleeper_state[account] == 'autoaway-forced': + # We came back online ofter gnome-screensaver autoaway + self.roster.send_status(account, 'online', + gajim.status_before_autoaway[account]) + gajim.status_before_autoaway[account] = '' + gajim.sleeper_state[account] = 'online' return if not gajim.config.get('autoaway'): # Don't go auto away if user disabled the option @@ -3221,9 +3365,16 @@ auto_message = gajim.config.get('autoaway_message') if not auto_message: auto_message = gajim.connections[account].status + else: + auto_message = auto_message.replace('$S','%(status)s') + auto_message = auto_message.replace('$T','%(time)s') + auto_message = auto_message % { + 'status': gajim.status_before_autoaway[account], + 'time': gajim.config.get('autoxatime') + } self.roster.send_status(account, 'away', auto_message, auto=True) - gajim.sleeper_state[account] = 'autoaway' + gajim.sleeper_state[account] = 'autoaway-forced'
try: bus = dbus.SessionBus()
Property changes on: branches/gajim_0.12/src/gajim.py ___________________________________________________________________ Deleted: executable - 1 Deleted: svn:executable - *
Modified: branches/gajim_0.12/src/groupchat_control.py =================================================================== --- branches/gajim_0.12/src/groupchat_control.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/groupchat_control.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -1059,8 +1059,8 @@ color = gtkgui_helpers._get_fade_color(self.list_treeview, selected, focus) colorstring = "#%04x%04x%04x" % (color.red, color.green, color.blue) - name += '\n' '<span size="small" style="italic" foreground="%s">%s</span>'\ - % (colorstring, gobject.markup_escape_text(status)) + name += ('\n<span size="small" style="italic" foreground="%s">' + '%s</span>') % (colorstring, gobject.markup_escape_text(status))
model[iter][C_IMG] = image model[iter][C_TEXT] = name @@ -1774,7 +1774,8 @@ def shutdown(self, status='offline'): # destroy banner tooltip - bug #pygtk for that! self.subject_tooltip.destroy() - if gajim.gc_connected[self.account][self.room_jid]: + if self.room_jid in gajim.gc_connected[self.account] and \ + gajim.gc_connected[self.account][self.room_jid]: # Tell connection to note the date we disconnect to avoid duplicate # logs. We do it only when connected because if connection was lost # there may be new messages since disconnection.
Modified: branches/gajim_0.12/src/gtkgui_helpers.py =================================================================== --- branches/gajim_0.12/src/gtkgui_helpers.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/gtkgui_helpers.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -61,7 +61,7 @@ screen_w = gtk.gdk.screen_width() screen_h = gtk.gdk.screen_height()
-GLADE_DIR = os.path.join('..', 'data', 'glade') +GLADE_DIR = os.path.join(gajim.DATA_DIR, 'glade') def get_glade(file_name, root = None): file_path = os.path.join(GLADE_DIR, file_name) return gtk.glade.XML(file_path, root=root, domain=i18n.APP)
Modified: branches/gajim_0.12/src/history_manager.py =================================================================== --- branches/gajim_0.12/src/history_manager.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/history_manager.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding:utf-8 -*- ## src/history_manager.py ##
Property changes on: branches/gajim_0.12/src/history_manager.py ___________________________________________________________________ Deleted: svn:executable - *
Modified: branches/gajim_0.12/src/htmltextview.py =================================================================== --- branches/gajim_0.12/src/htmltextview.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/htmltextview.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -347,27 +347,28 @@ callback(frac, *args) return
- val = float(value[:-2]) - sign = cmp(val,0) - # validate length - val = sign*max(minl,min(abs(val*display_resolution),maxl)) + def get_val(): + val = float(value[:-2]) + sign = cmp(val,0) + # validate length + return sign*max(minl,min(abs(val*display_resolution),maxl)) if value.endswith('pt'): # points - callback(val*display_resolution, *args) + callback(get_val()*display_resolution, *args)
elif value.endswith('em'): # ems, the width of the element's font attrs = self._get_current_attributes() font_size = attrs.font.get_size() / pango.SCALE - callback(val*display_resolution*font_size, *args) + callback(get_val()*display_resolution*font_size, *args)
elif value.endswith('ex'): # x-height, ~ the height of the letter 'x' # FIXME: figure out how to calculate this correctly # for now 'em' size is used as approximation attrs = self._get_current_attributes() font_size = attrs.font.get_size() / pango.SCALE - callback(val*display_resolution*font_size, *args) + callback(get_val()*display_resolution*font_size, *args)
elif value.endswith('px'): # pixels - callback(val, *args) + callback(get_val(), *args)
else: try:
Modified: branches/gajim_0.12/src/message_window.py =================================================================== --- branches/gajim_0.12/src/message_window.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/message_window.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -493,7 +493,8 @@ bctrl = self.get_control(jid, ctrl.account) # keep last_message_time around unless this was our last control with # that jid - if not fctrl and not bctrl: + if not fctrl and not bctrl and \ + fjid in gajim.last_message_time[ctrl.account]: del gajim.last_message_time[ctrl.account][fjid]
# Disconnect tab DnD only if GTK version < 2.10 @@ -995,8 +996,11 @@
# Position and size window based on saved state and window mode if not self.one_window_opened(contact, acct, type_): - self._resize_window(win, acct, type_) - self._position_window(win, acct, type_) + if gajim.config.get('msgwin-max-state'): + win.window.maximize() + else: + self._resize_window(win, acct, type_) + self._position_window(win, acct, type_)
self._windows[win_key] = win return win @@ -1068,6 +1072,7 @@
def save_state(self, msg_win, width_adjust=0): # Save window size and position + max_win_key = 'msgwin-max-state' pos_x_key = 'msgwin-x-position' pos_y_key = 'msgwin-y-position' size_width_key = 'msgwin-width' @@ -1106,6 +1111,9 @@ gajim.config.set_per('accounts', acct, pos_y_key, y)
else: + win_maximized = msg_win.window.window.get_state() == \ + gtk.gdk.WINDOW_STATE_MAXIMIZED + gajim.config.set(max_win_key, win_maximized) width += width_adjust gajim.config.set(size_width_key, width) gajim.config.set(size_height_key, height)
Modified: branches/gajim_0.12/src/music_track_listener.py =================================================================== --- branches/gajim_0.12/src/music_track_listener.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/music_track_listener.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -98,6 +98,15 @@ 'NameOwnerChanged', 'org.freedesktop.DBus', arg0='net.sacredchao.QuodLibet')
+ ## Totem + ## patched by Lucky lucky1.data@gmail.com + ## used with Totem DBus plugin: + ## http://lucky.awardspace.co.uk/home/totem-plugins + bus.add_signal_receiver(self._totem_playing_started_cb, + 'playingStarted', 'org.gnome.Totem') + bus.add_signal_receiver(self._totem_playing_stopped_cb, + 'playingStopped', 'org.gnome.Totem') + def _player_name_owner_changed(self, name, old, new): if not new: self.emit('music-track-changed', None) @@ -196,6 +205,17 @@ info.duration = int(props.get('~#length', 0)) return info
+ def _totem_playing_started_cb(self, title, album, artist, duration): + self._last_playing_music = MusicTrackInfo() + self._last_playing_music.title = title + self._last_playing_music.album = album + self._last_playing_music.artist = artist + self._last_playing_music.duration = duration + self.emit('music-track-changed', self._last_playing_music) + + def _totem_playing_stopped_cb(self): + self.emit('music-track-changed', None) + def get_playing_track(self): '''Return a MusicTrackInfo for the currently playing song, or None if no song is playing'''
Modified: branches/gajim_0.12/src/network_manager_listener.py =================================================================== --- branches/gajim_0.12/src/network_manager_listener.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/network_manager_listener.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -25,17 +25,32 @@ from common import gajim
def device_now_active(self, *args): + '''For Network Manager 0.6''' for connection in gajim.connections.itervalues(): if gajim.config.get_per('accounts', connection.name, 'listen_to_network_manager') and connection.time_to_reconnect: connection._reconnect()
def device_no_longer_active(self, *args): + '''For Network Manager 0.6''' for connection in gajim.connections.itervalues(): if gajim.config.get_per('accounts', connection.name, 'listen_to_network_manager') and connection.connected > 1: connection._disconnectedReconnCB()
+def state_changed(state): + '''For Network Manager 0.7''' + if props.Get("org.freedesktop.NetworkManager", "State") == 3: + for connection in gajim.connections.itervalues(): + if gajim.config.get_per('accounts', connection.name, + 'listen_to_network_manager') and connection.time_to_reconnect: + connection._reconnect() + else: + for connection in gajim.connections.itervalues(): + if gajim.config.get_per('accounts', connection.name, + 'listen_to_network_manager') and connection.connected > 1: + connection._disconnectedReconnCB() + supported = False
if sys.platform == 'darwin': @@ -44,22 +59,36 @@ try: from common.dbus_support import system_bus
- bus = system_bus.SystemBus() + bus = system_bus.bus()
if 'org.freedesktop.NetworkManager' in bus.list_names(): + nm_object = bus.get_object('org.freedesktop.NetworkManager', + '/org/freedesktop/NetworkManager') + props = dbus.Interface(nm_object,"org.freedesktop.DBus.Properties") + bus.add_signal_receiver(state_changed, + 'StateChanged', + 'org.freedesktop.NetworkManager', + 'org.freedesktop.NetworkManager', + '/org/freedesktop/NetworkManager') supported = True - bus.add_signal_receiver(device_no_longer_active, - 'DeviceNoLongerActive', - 'org.freedesktop.NetworkManager', - 'org.freedesktop.NetworkManager', - '/org/freedesktop/NetworkManager')
- bus.add_signal_receiver(device_now_active, - 'DeviceNowActive', - 'org.freedesktop.NetworkManager', - 'org.freedesktop.NetworkManager', - '/org/freedesktop/NetworkManager') except Exception: - pass + try: + if 'org.freedesktop.NetworkManager' in bus.list_names(): + supported = True
+ bus.add_signal_receiver(device_no_longer_active, + 'DeviceNoLongerActive', + 'org.freedesktop.NetworkManager', + 'org.freedesktop.NetworkManager', + '/org/freedesktop/NetworkManager') + + bus.add_signal_receiver(device_now_active, + 'DeviceNowActive', + 'org.freedesktop.NetworkManager', + 'org.freedesktop.NetworkManager', + '/org/freedesktop/NetworkManager') + except Exception: + pass + # vim: se ts=3:
Modified: branches/gajim_0.12/src/notify.py =================================================================== --- branches/gajim_0.12/src/notify.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/notify.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -489,6 +489,10 @@ ntype = 'presence.status' elif event_type == _('Connection Failed'): ntype = 'connection.failed' + elif event_type == _('Subscription request'): + ntype = 'subscription.request' + elif event_type == _('Unsubscribed'): + ntype = 'unsubscribed' else: # default failsafe values self.path_to_image = os.path.abspath( @@ -589,6 +593,8 @@ def version_reply_handler(self, name, vendor, version, spec_version=None): if spec_version: version = spec_version + elif vendor == 'Xfce' and version == '0.1.0': + version = '0.9' version_list = version.split('.') self.version = [] while len(version_list):
Modified: branches/gajim_0.12/src/osx/Makefile.am =================================================================== --- branches/gajim_0.12/src/osx/Makefile.am 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/osx/Makefile.am 2009-03-10 11:27:24 UTC (rev 11146) @@ -10,7 +10,7 @@
if BUILD_IDLE_OSX idlelib_LTLIBRARIES = idle.la -idlelibdir = $(libdir)/gajim +idlelibdir = $(pkglibdir)
idle_la_LIBADD = $(CARBON_LIBS)
@@ -24,7 +24,7 @@
if BUILD_COCOA nsapplib_LTLIBRARIES = nsapp.la -nsapplibdir = $(libdir)/gajim +nsapplibdir = $(pkglibdir)
nsapp_la_LIBADD = $(COCOA_LIBS)
Modified: branches/gajim_0.12/src/osx/growl/Makefile.am =================================================================== --- branches/gajim_0.12/src/osx/growl/Makefile.am 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/osx/growl/Makefile.am 2009-03-10 11:27:24 UTC (rev 11146) @@ -6,7 +6,7 @@
if BUILD_CARBON _growllib_LTLIBRARIES = _growl.la -_growllibdir = $(libdir)/gajim +_growllibdir = $(pkglibdir)
_growl_la_LIBADD = $(CARBON_LIBS)
@@ -20,7 +20,7 @@
if BUILD_COCOA _growlImagelib_LTLIBRARIES = _growlImage.la -_growlImagelibdir = $(libdir)/gajim +_growlImagelibdir = $(pkglibdir)
_growlImage_la_LIBADD = $(COCOA_LIBS)
Modified: branches/gajim_0.12/src/osx/growl/_growl.c =================================================================== --- branches/gajim_0.12/src/osx/growl/_growl.c 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/osx/growl/_growl.c 2009-03-10 11:27:24 UTC (rev 11146) @@ -2,25 +2,6 @@ * Copyright 2004-2005 The Growl Project. * Created by Jeremy Rossi jeremy@jeremyrossi.com * Released under the BSD license. - * - * src/osx/growl/_growl.c - * - * Copyright (C) 2007 Yann Leboulanger <asterix AT lagaule.org> - * - * 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/. - * */
#include <Python.h>
Modified: branches/gajim_0.12/src/osx/growl/_growlImage.m =================================================================== --- branches/gajim_0.12/src/osx/growl/_growlImage.m 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/osx/growl/_growlImage.m 2009-03-10 11:27:24 UTC (rev 11146) @@ -1,24 +1,6 @@ /* * Copyright 2004 Mark Rowe bdash@users.sourceforge.net * Released under the BSD license. - * src/osx/growl/_growlImage.m - * - * Copyright (C) 2007 Yann Leboulanger <asterix AT lagaule.org> - * - * 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/. - * */
#include "Python.h"
Modified: branches/gajim_0.12/src/osx/nsapp.m =================================================================== --- branches/gajim_0.12/src/osx/nsapp.m 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/osx/nsapp.m 2009-03-10 11:27:24 UTC (rev 11146) @@ -1,24 +1,3 @@ -/* -## src/osx/nsapp.m -## -## Copyright (C) 2007 Yann Leboulanger <asterix AT lagaule.org> -## -## 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 "nsapp.h" #include <notify.h>
Modified: branches/gajim_0.12/src/osx/syncmenu/Makefile.am =================================================================== --- branches/gajim_0.12/src/osx/syncmenu/Makefile.am 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/osx/syncmenu/Makefile.am 2009-03-10 11:27:24 UTC (rev 11146) @@ -8,7 +8,7 @@
if BUILD_COCOA syncmenulib_LTLIBRARIES = syncmenu.la -syncmenulibdir = $(libdir)/gajim +syncmenulibdir = $(pkglibdir) syncmenu_la_SOURCES = sync-menu.c pysyncmenu.c syncmenu_la_LDFLAGS = -module -avoid-version -Xcompiler -isysroot -Xcompiler /Developer/SDKs/MacOSX10.4u.sdk -Xcompiler -arch -Xcompiler ppc -Xcompiler -arch -Xcompiler i386 $(GTKLDFLAGS) syncmenu_la_CFLAGS = -Xcompiler -isysroot -Xcompiler /Developer/SDKs/MacOSX10.4u.sdk -Xcompiler -arch -Xcompiler ppc -Xcompiler -arch -Xcompiler i386 $(GTKCFLAGS) -Wall -g $(INCLUDES)
Modified: branches/gajim_0.12/src/osx/syncmenu/pysyncmenu.c =================================================================== --- branches/gajim_0.12/src/osx/syncmenu/pysyncmenu.c 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/osx/syncmenu/pysyncmenu.c 2009-03-10 11:27:24 UTC (rev 11146) @@ -1,24 +1,3 @@ -/* -## src/osx/syncmenu/pysyncmenu.c -## -## Copyright (C) 2007 Yann Leboulanger <asterix AT lagaule.org> -## -## 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/. -## - */ - #include <errno.h> #include <string.h> #include <Python.h>
Modified: branches/gajim_0.12/src/remote_control.py =================================================================== --- branches/gajim_0.12/src/remote_control.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/remote_control.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -102,7 +102,10 @@
def raise_signal(self, signal, arg): if self.signal_object: - getattr(self.signal_object, signal)(get_dbus_struct(arg)) + try: + getattr(self.signal_object, signal)(get_dbus_struct(arg)) + except UnicodeDecodeError: + pass # ignore error when we fail to announce on dbus
class SignalObject(dbus.service.Object):
Modified: branches/gajim_0.12/src/roster_window.py =================================================================== --- branches/gajim_0.12/src/roster_window.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/roster_window.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -1003,9 +1003,9 @@ if gajim.config.get('show_tunes_in_roster') \ and ('artist' in gajim.connections[account].tune \ or 'title' in gajim.connections[account].tune): + path = os.path.join(gajim.DATA_DIR, 'emoticons', 'static', 'music.png') self.model[child_iter][C_TUNE_PIXBUF] = \ - gtk.gdk.pixbuf_new_from_file( - '../data/emoticons/static/music.png') + gtk.gdk.pixbuf_new_from_file(path) else: self.model[child_iter][C_TUNE_PIXBUF] = None
@@ -1022,7 +1022,7 @@ else: accounts = [account] text = gobject.markup_escape_text(group) - if group in gajim.connections[account].blocked_groups: + if helpers.group_is_blocked(account, group): text = '<span strikethrough="true">%s</span>' % text if gajim.config.get('show_contacts_number'): nbr_on, nbr_total = gajim.contacts.get_nb_online_total_contacts( @@ -1075,11 +1075,11 @@
# Strike name if blocked strike = False - if jid in gajim.connections[account].blocked_contacts: + if helpers.jid_is_blocked(account, jid): strike = True else: for group in contact.get_shown_groups(): - if group in gajim.connections[account].blocked_groups: + if helpers.group_is_blocked(account, group): strike = True break if strike: @@ -1266,8 +1266,8 @@ jid = jid.decode('utf-8') contact = gajim.contacts.get_contact(account, jid) if 'artist' in contact.tune or 'title' in contact.tune: - pixbuf = gtk.gdk.pixbuf_new_from_file( - '../data/emoticons/static/music.png') + path = os.path.join(gajim.DATA_DIR, 'emoticons', 'static', 'music.png') + pixbuf = gtk.gdk.pixbuf_new_from_file(path) else: pixbuf = None for child_iter in iters: @@ -1824,6 +1824,14 @@ data[1]) gajim.events.remove_events(account, jid, event) return True + elif event.type_ == 'subscription_request': + dialogs.SubscriptionRequestWindow(jid, data[0], account, data[1]) + gajim.events.remove_events(account, jid, event) + return True + elif event.type_ == 'unsubscribed': + gajim.interface.show_unsubscribed_dialog(account, data) + gajim.events.remove_events(account, jid, event) + return True return False
################################################################################ @@ -1952,7 +1960,7 @@ self.send_status_continue(account, status, txt, auto, to)
def send_status_continue(self, account, status, txt, auto, to): - if gajim.account_is_connected(account): + if gajim.account_is_connected(account) and not to: if status == 'online' and gajim.interface.sleeper.getState() != \ common.sleepy.STATE_UNKNOWN: gajim.sleeper_state[account] = 'online' @@ -2036,11 +2044,6 @@ if ctrl: ctrl.update_status_display(name, uf_show, status)
- # unset custom status - if account in gajim.interface.status_sent_to_users and \ - contact.jid in gajim.interface.status_sent_to_users[account]: - del gajim.interface.status_sent_to_users[account][contact.jid] - # Delete pep if needed #FIXME: py2.5only # keep_pep = any(c.show not in ('error', 'offline') for c in @@ -2089,15 +2092,20 @@ if sys.platform == 'darwin': self.make_menu(force=True)
- def get_status_message(self, show, on_response): + def get_status_message(self, show, on_response, always_ask=False): + ''' get the status message by: + 1/ looking in default status message + 2/ asking to user if needed depending on ask_on(ff)line_status and + always_ask + ''' if show in gajim.config.get_per('defaultstatusmsg'): if gajim.config.get_per('defaultstatusmsg', show, 'enabled'): on_response(gajim.config.get_per('defaultstatusmsg', show, 'message')) return - if (show == 'online' and not gajim.config.get('ask_online_status')) or \ - (show in ('offline', 'invisible') - and not gajim.config.get('ask_offline_status')): + if not always_ask and ((show == 'online' and not gajim.config.get( + 'ask_online_status')) or (show in ('offline', 'invisible') and not \ + gajim.config.get('ask_offline_status'))): on_response('') return
@@ -2831,6 +2839,7 @@ if jid in gajim.interface.minimized_controls[account]: ctrl = gajim.interface.minimized_controls[account][jid] ctrl.shutdown() + ctrl.got_disconnected() self.remove_groupchat(jid, account)
def on_send_single_message_menuitem_activate(self, widget, account, @@ -3126,17 +3135,20 @@ account = list_[0][1] pritext = _('Contact "%s" will be removed from your roster') % \ contact.get_shown_name() + sectext = _('You are about to remove "%(name)s" (%(jid)s) from your ' + 'roster.\n') % {'name': contact.get_shown_name(), + 'jid': contact.jid} if contact.sub == 'to': - dialogs.ConfirmationDialog(pritext, + dialogs.ConfirmationDialog(pritext, sectext + \ _('By removing this contact you also remove authorization ' 'resulting in him or her always seeing you as offline.'), on_response_ok = (on_ok2, list_)) elif _('Not in Roster') in contact.get_shown_groups(): # Contact is not in roster - dialogs.ConfirmationDialog(pritext, _('Do you want to continue?'), - on_response_ok = (on_ok2, list_)) + dialogs.ConfirmationDialog(pritext, sectext + \ + _('Do you want to continue?'), on_response_ok = (on_ok2, list_)) else: - dialogs.ConfirmationDialogCheck(pritext, + dialogs.ConfirmationDialogCheck(pritext, sectext + \ _('By removing this contact you also by default remove ' 'authorization resulting in him or her always seeing you as ' 'offline.'), @@ -3147,7 +3159,8 @@ pritext = _('Contacts will be removed from your roster') jids = '' for (contact, account) in list_: - jids += '\n ' + contact.get_shown_name() + ',' + jids += '\n ' + contact.get_shown_name() + ' (%s)' % contact.jid +\ + ',' sectext = _('By removing these contacts:%s\nyou also remove ' 'authorization resulting in them always seeing you as offline.') % \ jids @@ -3156,26 +3169,42 @@
def on_send_custom_status(self, widget, contact_list, show, group=None): '''send custom status''' + # contact_list has only one element except if group != None def on_response(message): if message is None: # None if user pressed Cancel return + account_list = [] for (contact, account) in contact_list: - our_jid = gajim.get_jid_from_account(account) - accounts = [] - if group and account not in accounts: + if account not in account_list: + account_list.append(account) + # 1. update status_sent_to_[groups|users] list + if group: + for account in account_list: if account not in gajim.interface.status_sent_to_groups: gajim.interface.status_sent_to_groups[account] = {} gajim.interface.status_sent_to_groups[account][group] = show - accounts.append(group) + else: + for (contact, account) in contact_list: + if account not in gajim.interface.status_sent_to_users: + gajim.interface.status_sent_to_users[account] = {} + gajim.interface.status_sent_to_users[account][contact.jid] = show + + # 2. update privacy lists if main status is invisible + for account in account_list: + if gajim.SHOW_LIST[gajim.connections[account].connected] == \ + 'invisible': + gajim.connections[account].set_invisible_rule() + + # 3. send directed presence + for (contact, account) in contact_list: + our_jid = gajim.get_jid_from_account(account) jid = contact.jid if jid == our_jid: jid += '/' + contact.resource self.send_status(account, show, message, to=jid) - if account not in gajim.interface.status_sent_to_users: - gajim.interface.status_sent_to_users[account] = {} - gajim.interface.status_sent_to_users[account][contact.jid] = show - dialogs.ChangeStatusMessageDialog(on_response, show)
+ self.get_status_message(show, on_response, always_ask=True) + def on_status_combobox_changed(self, widget): '''When we change our status via the combobox''' model = self.status_combobox.get_model() @@ -3518,6 +3547,15 @@ gajim.groups[account][group]['expand'] = True if account + group in self.collapsed_rows: self.collapsed_rows.remove(account + group) + for contact in gajim.contacts.iter_contacts(account): + jid = contact.jid + if group in contact.groups and gajim.contacts.is_big_brother( + account, jid, accounts) and account + group + jid \ + not in self.collapsed_rows: + titers = self._get_contact_iter(jid, account) + for titer in titers: + path = model.get_path(titer) + self.tree.expand_row(path, False) elif type_ == 'account': account = accounts[0] # There is only one cause we don't use merge if account in self.collapsed_rows: @@ -3534,6 +3572,10 @@ # Metacontact got toggled, update icon jid = model[titer][C_JID].decode('utf-8') account = model[titer][C_ACCOUNT].decode('utf-8') + contact = gajim.contacts.get_contact(account, jid) + for group in contact.groups: + if account + group + jid in self.collapsed_rows: + self.collapsed_rows.remove(account + group + jid) family = gajim.contacts.get_metacontacts_family(account, jid) nearby_family, bb_jid, bb_account = \ self._get_nearby_family_and_big_brother(family, account) @@ -3563,17 +3605,21 @@ for account in accounts: if group in gajim.groups[account]: # This account has this group gajim.groups[account][group]['expand'] = False - if not account + group in self.collapsed_rows: + if account + group not in self.collapsed_rows: self.collapsed_rows.append(account + group) elif type_ == 'account': account = accounts[0] # There is only one cause we don't use merge - if not account in self.collapsed_rows: + if account not in self.collapsed_rows: self.collapsed_rows.append(account) self.draw_account(account) elif type_ == 'contact': # Metacontact got toggled, update icon jid = model[titer][C_JID].decode('utf-8') account = model[titer][C_ACCOUNT].decode('utf-8') + contact = gajim.contacts.get_contact(account, jid) + for group in contact.groups: + if account + group + jid not in self.collapsed_rows: + self.collapsed_rows.append(account + group + jid) family = gajim.contacts.get_metacontacts_family(account, jid) nearby_family, bb_jid, bb_account = \ self._get_nearby_family_and_big_brother(family, account) @@ -5072,7 +5118,7 @@ send_custom_status_menuitem = gtk.ImageMenuItem( _('Send Cus_tom Status')) # add a special img for this menuitem - if group in gajim.connections[account].blocked_groups: + if helpers.group_is_blocked(account, group): send_custom_status_menuitem.set_image(gtkgui_helpers.load_icon( 'offline')) send_custom_status_menuitem.set_sensitive(False) @@ -5120,10 +5166,10 @@ is_blocked = False if self.regroup: for g_account in gajim.connections: - if group in gajim.connections[g_account].blocked_groups: + if helpers.group_is_blocked(g_account, group): is_blocked = True else: - if group in gajim.connections[account].blocked_groups: + if helpers.group_is_blocked(account, group): is_blocked = True
if is_blocked and gajim.connections[account].privacy_rules_supported: @@ -5329,11 +5375,11 @@
# send custom status icon blocked = False - if jid in gajim.connections[account].blocked_contacts: + if helpers.jid_is_blocked(account, jid): blocked = True else: for group in contact.get_shown_groups(): - if group in gajim.connections[account].blocked_groups: + if helpers.group_is_blocked(account, group): blocked = True break if gajim.get_transport_name_from_jid(jid, use_config_setting=False): @@ -5497,7 +5543,7 @@
if gajim.connections[account] and gajim.connections[account].\ privacy_rules_supported: - if jid in gajim.connections[account].blocked_contacts: + if helpers.jid_is_blocked(account, jid): block_menuitem.set_no_show_all(True) block_menuitem.hide() if gajim.get_transport_name_from_jid(jid, use_config_setting=False): @@ -5551,7 +5597,7 @@ privacy_rules_supported = False contact = gajim.contacts.get_contact_with_highest_priority(account, jid) - if jid not in gajim.connections[account].blocked_contacts: + if helpers.jid_is_blocked(account, jid): is_blocked = False list_.append((contact, account))
@@ -5653,7 +5699,7 @@ menu.append(item)
blocked = False - if jid in gajim.connections[account].blocked_contacts: + if helpers.jid_is_blocked(account, jid): blocked = True
# Send Custom Status
Modified: branches/gajim_0.12/src/secrets.py =================================================================== --- branches/gajim_0.12/src/secrets.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/secrets.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -41,10 +41,8 @@ raise exceptions.Cancelled
def save(self): - pickle.dumps(self) - f = open(secrets_filename, 'w') - f.write(pickle.dumps(self)) + pickle.dump(self, f) f.close()
def retained_secrets(self, account, bare_jid): @@ -99,7 +97,7 @@ f = open(filename, 'r')
try: - secrets = pickle.loads(f.read()) + secrets = pickle.load(f) except KeyError: f.close() secrets = Secrets(filename)
Modified: branches/gajim_0.12/src/session.py =================================================================== --- branches/gajim_0.12/src/session.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/session.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -184,8 +184,9 @@ if not msgtxt: # empty message text return
- if gajim.config.get('ignore_unknown_contacts') and \ - not gajim.contacts.get_contacts(self.conn.name, jid) and not pm: + if gajim.config.get_per('accounts', self.conn.name, + 'ignore_unknown_contacts') and not gajim.contacts.get_contacts( + self.conn.name, jid) and not pm: return
if not contact: @@ -295,12 +296,17 @@ self.conn.name, jid, user_nick)
if not self.control: - # if no control exists and message comes from highest prio, the new - # control shouldn't have a resource - if highest_contact and contact.resource == highest_contact.resource \ - and not jid == gajim.get_jid_from_account(self.conn.name): - fjid = jid - resource_for_chat = None + ctrl = gajim.interface.msg_win_mgr.get_control(fjid, self.conn.name) + if ctrl: + self.control = ctrl + self.control.set_session(self) + else: + # if no control exists and message comes from highest prio, the new + # control shouldn't have a resource + if highest_contact and contact.resource == highest_contact.resource\ + and not jid == gajim.get_jid_from_account(self.conn.name): + fjid = jid + resource_for_chat = None
# Do we have a queue? no_queue = len(gajim.events.get_events(self.conn.name, fjid)) == 0 @@ -318,7 +324,7 @@ typ = ''
if msg_type == 'error': - typ = 'status' + typ = 'error'
self.control.print_conversation(msg, typ, tim=tim, encrypted=encrypted, subject=subject, xhtml=xhtml)
Modified: branches/gajim_0.12/src/statusicon.py =================================================================== --- branches/gajim_0.12/src/statusicon.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/statusicon.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -64,10 +64,7 @@ self.unsubscribe_events()
def on_status_icon_left_clicked(self, widget): - if len(gajim.events.get_systray_events()) == 0: - self.on_left_click() - else: - self.on_middle_click() + self.on_left_click()
def set_img(self): '''apart from image, we also update tooltip text here'''
Modified: branches/gajim_0.12/src/systray.py =================================================================== --- branches/gajim_0.12/src/systray.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/systray.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -64,10 +64,6 @@ self.added_hide_menuitem = False self.img_tray = gtk.Image() self.status = 'offline' - self.double_click = False - self.double_click_id = None - self.double_click_time = gtk.settings_get_default().get_property( - 'gtk-double-click-time') self.xml = gtkgui_helpers.get_glade('systray_context_menu.glade') self.systray_context_menu = self.xml.get_widget('systray_context_menu') self.xml.signal_autoconnect(self) @@ -323,26 +319,25 @@ gajim.interface.roster.on_quit_request()
def on_left_click(self): - self.double_click_id = None - if self.double_click: - self.double_click = False - return win = gajim.interface.roster.window - # toggle visible/hidden for roster window - if win.get_property('visible') and (win.get_property('has-toplevel-focus') or \ - os.name == 'nt'): - # visible in ANY virtual desktop? + if len(gajim.events.get_systray_events()) == 0: + # No pending events, so toggle visible/hidden for roster window + if win.get_property('visible') and (win.get_property( + 'has-toplevel-focus')): + # visible in ANY virtual desktop?
- # we could be in another VD right now. eg vd2 - # and we want to show it in vd2 - if not gtkgui_helpers.possibly_move_window_in_current_desktop(win): - win.hide() # else we hide it from VD that was visible in + # we could be in another VD right now. eg vd2 + # and we want to show it in vd2 + if not gtkgui_helpers.possibly_move_window_in_current_desktop(win): + win.hide() # else we hide it from VD that was visible in + else: + # in Windows (perhaps other Window Managers too) minimize state + # is remembered, so make sure it's not minimized (iconified) + # because user wants to see roster + win.deiconify() + win.present() else: - # in Windows (perhaps other Window Managers too) minimize state - # is remembered, so make sure it's not minimized (iconified) - # because user wants to see roster - win.deiconify() - win.present() + self.handle_first_event()
def handle_first_event(self): account, jid, event = gajim.events.get_first_systray_event() @@ -351,27 +346,18 @@ def on_middle_click(self): '''middle click raises window to have complete focus (fe. get kbd events) but if already raised, it hides it''' - if gajim.events.get_nb_systray_events() == 0: - return - self.handle_first_event() + win = gajim.interface.roster.window + if win.is_active(): # is it fully raised? (eg does it receive kbd events?) + win.hide() + else: + win.present()
def on_clicked(self, widget, event): self.on_tray_leave_notify_event(widget, None) - if event.type == gtk.gdk._2BUTTON_PRESS: - if len(gajim.events.get_systray_events()) == 0: - return - self.double_click = True - self.on_middle_click() if event.type != gtk.gdk.BUTTON_PRESS: return if event.button == 1: # Left click - if len(gajim.events.get_systray_events()) == 0: - self.on_left_click() - else: - if self.double_click_id: - gobject.source_remove(self.double_click_id) - self.double_click_id = gobject.timeout_add( - self.double_click_time, self.on_left_click) + self.on_left_click() elif event.button == 2: # middle click self.on_middle_click() elif event.button == 3: # right click
Modified: branches/gajim_0.12/src/tooltips.py =================================================================== --- branches/gajim_0.12/src/tooltips.py 2009-03-06 22:18:04 UTC (rev 11145) +++ branches/gajim_0.12/src/tooltips.py 2009-03-10 11:27:24 UTC (rev 11146) @@ -427,8 +427,8 @@ name_markup = u'<span weight="bold">' + \ gobject.markup_escape_text(prim_contact.get_shown_name())\ + '</span>' - if self.account and prim_contact.jid in gajim.connections[ - self.account].blocked_contacts: + if self.account and helpers.jid_is_blocked(self.account, + prim_contact.jid): name_markup += _(' [blocked]') if self.account and \ self.account in gajim.interface.minimized_controls and \