Merged trunk

This commit is contained in:
Travis Shirk 2005-12-30 21:37:36 +00:00
parent a4477f88ee
commit a52596266c
15 changed files with 200 additions and 89 deletions

2
README
View File

@ -25,6 +25,8 @@ Optionally:
dnspython or pydns for SRV support; if you don't know what that is, you don't need it dnspython or pydns for SRV support; if you don't know what that is, you don't need it
gtkspell and aspell-LANG where lang is your locale eg. en, fr etc gtkspell and aspell-LANG where lang is your locale eg. en, fr etc
GnomePythonExtras 2.10 or above so you can avoid compiling trayicon and gtkspell GnomePythonExtras 2.10 or above so you can avoid compiling trayicon and gtkspell
notification-daemon (and D-Bus) to get cooler popups
D-Bus to have gajim-remote working
NOTE TO PACKAGERS: NOTE TO PACKAGERS:
Gajim is a GTK+ app and not a gnome one. Just do 'make' so you don't require gnomepythonextras Gajim is a GTK+ app and not a gnome one. Just do 'make' so you don't require gnomepythonextras

6
debian/changelog vendored
View File

@ -4,9 +4,9 @@ gajim (0.9.1-1) unstable; urgency=low
* Gajim now reconnects when connection is lost Closes: #329376 * Gajim now reconnects when connection is lost Closes: #329376
* Status-changer widget's behaviour has been improved Closes: #340499 * Status-changer widget's behaviour has been improved Closes: #340499
* Gajim now recommends python-dns Closes: #340492 * Gajim now recommends python-dns Closes: #340492
* new russion translation Closes: #337971 * new russian translation Closes: #337971
* Gajim now depends on python-pysqlite2, recommands python-dbus, and * Gajim now depends on python-pysqlite2, recommends python-dbus and
suggests python-gnome2 notification-daemon, and suggests python-gnome2
-- Yann Le Boulanger <asterix@lagaule.org> Fri, 27 Dec 2005 01:20:54 +0100 -- Yann Le Boulanger <asterix@lagaule.org> Fri, 27 Dec 2005 01:20:54 +0100

5
debian/control vendored
View File

@ -8,8 +8,9 @@ Standards-Version: 3.6.2
Package: gajim Package: gajim
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, python (>= 2.3), python-glade2 (>= 2.6.0), python-gtk2 (>= 2.6.0), python-pysqlite2 Depends: ${shlibs:Depends}, python (>= 2.3), python-glade2 (>= 2.6.0), python-gtk2 (>= 2.6.0), python-pysqlite2
Recommends: python-dns, python2.3-dbus | python2.4-dbus Recommends: python-dns, python2.4-dbus | python2.3-dbus, notification-daemon
Suggests: python-gnupginterface, python-gnome2 Suggests: python-gnupginterface, python-gnome2
Description: Jabber client written in PyGTK Description: Jabber client written in PyGTK
Gajim is a jabber client written in python, with a GTK frontend. It supports Gajim is a jabber client written in python, with a GTK frontend. It supports
tabbed chat, MUC, systray icon, TLS, GPG, SSL, multiple accounts, ... tabbed chat, MUC, systray icon, TLS, GPG, SSL, multiple accounts, avatars,
file transfert, transports, DBus.

View File

@ -1,6 +1,6 @@
[Setup] [Setup]
AppName=Gajim AppName=Gajim
AppVerName=Gajim version 0.9.1 AppVerName=Gajim version 0.10
DefaultDirName={pf}\Gajim DefaultDirName={pf}\Gajim
DefaultGroupName=Gajim DefaultGroupName=Gajim
UninstallDisplayIcon={app}\src\Gajim.exe UninstallDisplayIcon={app}\src\Gajim.exe

2
launch.bat Normal file
View File

@ -0,0 +1,2 @@
cd src
gajim.py

View File

@ -95,6 +95,8 @@ class CellRendererImage(gtk.GenericCellRenderer):
pix = self.image.get_pixbuf() pix = self.image.get_pixbuf()
else: else:
return return
if draw_rect.x < 1:
return
window.draw_pixbuf(widget.style.black_gc, pix, window.draw_pixbuf(widget.style.black_gc, pix,
draw_rect.x - pix_rect.x, draw_rect.x - pix_rect.x,
draw_rect.y - pix_rect.y, draw_rect.y - pix_rect.y,

View File

@ -172,7 +172,8 @@ class Config:
'restored_messages_color': [opt_str, 'grey'], 'restored_messages_color': [opt_str, 'grey'],
'hide_avatar_of_transport': [opt_bool, False], 'hide_avatar_of_transport': [opt_bool, False],
'roster_window_skip_taskbar': [opt_bool, False], 'roster_window_skip_taskbar': [opt_bool, False],
# TODO: Need to decide Gajim default. methinks 'always' 'use_urgency_hint': [opt_bool, True, _('If True and installed GTK+ and PyGTK versions are at least 2.8, make the window flash (the default behaviour in most Window Managers) when holding pending events.')],
'notification_timeout': [opt_int, 5],
'one_message_window': [opt_str, 'never', 'one_message_window': [opt_str, 'never',
_('Controls the window where new messages are placed.\n\'always\' - All messages are sent to a single window.\n\'never\' - All messages get their own window.\n\'peracct\' - Messages for each account are sent to a specific window.\n\'pertype\' - Each message type (e.g., chats vs. groupchats) are sent to a specific window. Note, changing this option requires restarting Gajim before the changes will take effect')], _('Controls the window where new messages are placed.\n\'always\' - All messages are sent to a single window.\n\'never\' - All messages get their own window.\n\'peracct\' - Messages for each account are sent to a specific window.\n\'pertype\' - Each message type (e.g., chats vs. groupchats) are sent to a specific window. Note, changing this option requires restarting Gajim before the changes will take effect')],
} }

View File

@ -32,7 +32,7 @@ import config
interface = None # The actual interface (the gtk one for the moment) interface = None # The actual interface (the gtk one for the moment)
version = '0.9.1' version = '0.10'
config = config.Config() config = config.Config()
connections = {} connections = {}
verbose = False verbose = False

View File

@ -496,6 +496,18 @@ def get_global_show():
if connected > maxi: if connected > maxi:
maxi = connected maxi = connected
return gajim.SHOW_LIST[maxi] return gajim.SHOW_LIST[maxi]
def get_global_status():
maxi = 0
for account in gajim.connections:
if not gajim.config.get_per('accounts', account,
'sync_with_global_status'):
continue
connected = gajim.connections[account].connected
if connected > maxi:
maxi = connected
status = gajim.connections[account].status
return status
def get_icon_name_to_show(contact, account = None): def get_icon_name_to_show(contact, account = None):
'''Get the icon name to show in online, away, requested, ...''' '''Get the icon name to show in online, away, requested, ...'''

View File

@ -898,7 +898,8 @@ class PopupNotificationWindow:
xml.signal_autoconnect(self) xml.signal_autoconnect(self)
self.window.show_all() self.window.show_all()
gobject.timeout_add(5000, self.on_timeout) timeout = gajim.config.get('notification_timeout') * 1000 # make it ms
gobject.timeout_add(timeout, self.on_timeout)
def on_close_button_clicked(self, widget): def on_close_button_clicked(self, widget):
self.adjust_height_and_move_popup_notification_windows() self.adjust_height_and_move_popup_notification_windows()

View File

@ -196,7 +196,13 @@ class GajimRemote:
(_('account'), _(''), False) (_('account'), _(''), False)
] ]
], ],
'get_status_message': [
_('Returns current status message(the global one unless account is specified)'),
[
(_('account'), _(''), False)
]
],
} }
if self.argv_len < 2 or \ if self.argv_len < 2 or \
sys.argv[1] not in self.commands.keys(): # no args or bad args sys.argv[1] not in self.commands.keys(): # no args or bad args

View File

@ -9136,7 +9136,7 @@ Custom</property>
<widget class="GtkExpander" id="search_expander"> <widget class="GtkExpander" id="search_expander">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="expanded">True</property> <property name="expanded">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
<signal name="activate" handler="on_search_expander_activate" last_modification_time="Tue, 29 Nov 2005 13:43:41 GMT"/> <signal name="activate" handler="on_search_expander_activate" last_modification_time="Tue, 29 Nov 2005 13:43:41 GMT"/>
@ -12317,99 +12317,55 @@ Status message</property>
<signal name="destroy" handler="on_manage_emoticons_window_destroy" last_modification_time="Sun, 13 Nov 2005 14:52:28 GMT"/> <signal name="destroy" handler="on_manage_emoticons_window_destroy" last_modification_time="Sun, 13 Nov 2005 14:52:28 GMT"/>
<child> <child>
<widget class="GtkHBox" id="hbox2948"> <widget class="GtkVBox" id="vbox">
<property name="border_width">6</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<widget class="GtkScrolledWindow" id="emoticons_scrolledwindow"> <widget class="GtkHBox" id="hbox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="homogeneous">False</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="emoticons_treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
<property name="fixed_height_mode">False</property>
<property name="hover_selection">False</property>
<property name="hover_expand">False</property>
<signal name="key_press_event" handler="on_emoticons_treeview_key_press_event" last_modification_time="Wed, 06 Apr 2005 17:03:22 GMT"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkVButtonBox" id="vbuttonbox4">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_START</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<widget class="GtkButton" id="button_new_emoticon"> <widget class="GtkLabel" id="label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_default">True</property> <property name="label" translatable="yes">Emoticon set:</property>
<property name="can_focus">True</property> <property name="use_underline">False</property>
<property name="label">gtk-add</property> <property name="use_markup">False</property>
<property name="use_stock">True</property> <property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="relief">GTK_RELIEF_NORMAL</property> <property name="wrap">False</property>
<property name="focus_on_click">True</property> <property name="selectable">False</property>
<signal name="clicked" handler="on_button_new_emoticon_clicked" last_modification_time="Sun, 13 Feb 2005 14:30:54 GMT"/> <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> </widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child> </child>
<child> <child>
<widget class="GtkButton" id="button_remove_emoticon"> <widget class="GtkComboBox" id="combobox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_default">True</property> <property name="items" translatable="yes">Animated
<property name="can_focus">True</property> Static</property>
<property name="label">gtk-remove</property> <property name="add_tearoffs">False</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property> <property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_remove_emoticon_clicked" last_modification_time="Sun, 13 Feb 2005 14:31:17 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="set_image_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Set Image...</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_set_image_button_clicked" last_modification_time="Wed, 06 Apr 2005 13:55:38 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="close_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-close</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_close_button_clicked" last_modification_time="Wed, 06 Apr 2005 15:35:16 GMT"/>
</widget> </widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child> </child>
</widget> </widget>
<packing> <packing>
@ -12418,6 +12374,116 @@ Status message</property>
<property name="fill">True</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkHBox" id="hbox">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkScrolledWindow" id="emoticons_scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="emoticons_treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
<property name="fixed_height_mode">False</property>
<property name="hover_selection">False</property>
<property name="hover_expand">False</property>
<signal name="key_press_event" handler="on_emoticons_treeview_key_press_event" last_modification_time="Wed, 06 Apr 2005 17:03:22 GMT"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkVButtonBox" id="vbuttonbox">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_START</property>
<property name="spacing">6</property>
<child>
<widget class="GtkButton" id="button_new_emoticon">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-add</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_button_new_emoticon_clicked" last_modification_time="Sun, 13 Feb 2005 14:30:54 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="button_remove_emoticon">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-remove</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_button_remove_emoticon_clicked" last_modification_time="Sun, 13 Feb 2005 14:31:17 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="set_image_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Set Image...</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_set_image_button_clicked" last_modification_time="Wed, 06 Apr 2005 13:55:38 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="close_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-close</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_close_button_clicked" last_modification_time="Wed, 06 Apr 2005 15:35:16 GMT"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</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> </widget>
</child> </child>
</widget> </widget>

View File

@ -264,7 +264,8 @@ def parse_server_xml(path_to_file):
def set_unset_urgency_hint(window, unread_messages_no): def set_unset_urgency_hint(window, unread_messages_no):
'''sets/unsets urgency hint in window argument '''sets/unsets urgency hint in window argument
depending if we have unread messages or not''' depending if we have unread messages or not'''
if gtk.gtk_version >= (2, 8, 0) and gtk.pygtk_version >= (2, 8, 0): if gtk.gtk_version >= (2, 8, 0) and gtk.pygtk_version >= (2, 8, 0) and \
gajim.config.get('use_urgency_hint'):
if unread_messages_no > 0: if unread_messages_no > 0:
window.props.urgency_hint = True window.props.urgency_hint = True
else: else:

View File

@ -189,10 +189,11 @@ class DesktopNotification:
self.notif = dbus_support.get_notifications_interface() self.notif = dbus_support.get_notifications_interface()
if self.notif is None: if self.notif is None:
raise dbus.dbus_bindings.DBusException() raise dbus.dbus_bindings.DBusException()
timeout = gajim.config.get('notification_timeout') # in seconds
self.id = self.notif.Notify(dbus.String(_('Gajim')), self.id = self.notif.Notify(dbus.String(_('Gajim')),
dbus.String(path), dbus.UInt32(0), ntype, dbus.Byte(0), dbus.String(path), dbus.UInt32(0), ntype, dbus.Byte(0),
dbus.String(event_type), dbus.String(txt), dbus.String(event_type), dbus.String(txt),
[dbus.String(path)], {'default':0}, [''], True, dbus.UInt32(5)) [dbus.String(path)], {'default': 0}, [''], True, dbus.UInt32(timeout))
notification_response_manager.attach_to_interface() notification_response_manager.attach_to_interface()
notification_response_manager.pending[self.id] = self notification_response_manager.pending[self.id] = self

View File

@ -107,6 +107,7 @@ class SignalObject(DbusPrototype):
self.add_contact, self.add_contact,
self.remove_contact, self.remove_contact,
self.get_status, self.get_status,
self.get_status_message,
]) ])
def raise_signal(self, signal, arg): def raise_signal(self, signal, arg):
@ -137,6 +138,20 @@ class SignalObject(DbusPrototype):
# return show for the given account # return show for the given account
index = gajim.connections[account].connected index = gajim.connections[account].connected
return STATUS_LIST[index] return STATUS_LIST[index]
def get_status_message(self, *args):
'''get_status(account = None)
returns status which is the global one
unless account is given'''
account = self._get_real_arguments(args, 1)[0]
accounts = gajim.contacts.keys()
if not account:
# If user did not ask for account, returns the global status
return str(helpers.get_global_status())
# return show for the given account
status = gajim.connections[account].status
return str(status)
def send_file(self, *args): def send_file(self, *args):
'''send_file(file_path, jid, account=None) '''send_file(file_path, jid, account=None)
@ -488,3 +503,4 @@ class SignalObject(DbusPrototype):
remove_contact = method(INTERFACE)(remove_contact) remove_contact = method(INTERFACE)(remove_contact)
add_contact = method(INTERFACE)(add_contact) add_contact = method(INTERFACE)(add_contact)
get_status = method(INTERFACE)(get_status) get_status = method(INTERFACE)(get_status)
get_status_message = method(INTERFACE)(get_status_message)