Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTravis Shirk <travis@pobox.com>2005-12-31 00:37:36 +0300
committerTravis Shirk <travis@pobox.com>2005-12-31 00:37:36 +0300
commita52596266cc7eb17fc40b3a830b80281001761b6 (patch)
treed681b67eaf9435f1005b5b6bb07a57a6a717eeb5 /src
parenta4477f88eed00a791154fbd59c7243ecca84530f (diff)
Merged trunk
Diffstat (limited to 'src')
-rw-r--r--src/cell_renderer_image.py2
-rw-r--r--src/common/config.py3
-rw-r--r--src/common/gajim.py2
-rw-r--r--src/common/helpers.py12
-rw-r--r--src/dialogs.py3
-rwxr-xr-xsrc/gajim-remote.py8
-rw-r--r--src/gtkgui.glade190
-rw-r--r--src/gtkgui_helpers.py3
-rw-r--r--src/notify.py3
-rw-r--r--src/remote_control.py16
10 files changed, 174 insertions, 68 deletions
diff --git a/src/cell_renderer_image.py b/src/cell_renderer_image.py
index 21e7a9c02..2af7fd551 100644
--- a/src/cell_renderer_image.py
+++ b/src/cell_renderer_image.py
@@ -95,6 +95,8 @@ class CellRendererImage(gtk.GenericCellRenderer):
pix = self.image.get_pixbuf()
else:
return
+ if draw_rect.x < 1:
+ return
window.draw_pixbuf(widget.style.black_gc, pix,
draw_rect.x - pix_rect.x,
draw_rect.y - pix_rect.y,
diff --git a/src/common/config.py b/src/common/config.py
index 84c88d11d..dd894819a 100644
--- a/src/common/config.py
+++ b/src/common/config.py
@@ -172,7 +172,8 @@ class Config:
'restored_messages_color': [opt_str, 'grey'],
'hide_avatar_of_transport': [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',
_('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')],
}
diff --git a/src/common/gajim.py b/src/common/gajim.py
index b8009fee8..3a57e3555 100644
--- a/src/common/gajim.py
+++ b/src/common/gajim.py
@@ -32,7 +32,7 @@ import config
interface = None # The actual interface (the gtk one for the moment)
-version = '0.9.1'
+version = '0.10'
config = config.Config()
connections = {}
verbose = False
diff --git a/src/common/helpers.py b/src/common/helpers.py
index eac8be05a..75fc10ef3 100644
--- a/src/common/helpers.py
+++ b/src/common/helpers.py
@@ -496,6 +496,18 @@ def get_global_show():
if connected > maxi:
maxi = connected
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):
'''Get the icon name to show in online, away, requested, ...'''
diff --git a/src/dialogs.py b/src/dialogs.py
index 282f412f9..46063b0e6 100644
--- a/src/dialogs.py
+++ b/src/dialogs.py
@@ -898,7 +898,8 @@ class PopupNotificationWindow:
xml.signal_autoconnect(self)
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):
self.adjust_height_and_move_popup_notification_windows()
diff --git a/src/gajim-remote.py b/src/gajim-remote.py
index 9dbe566d1..cc22e2ca7 100755
--- a/src/gajim-remote.py
+++ b/src/gajim-remote.py
@@ -196,7 +196,13 @@ class GajimRemote:
(_('account'), _(''), False)
]
],
-
+
+ 'get_status_message': [
+ _('Returns current status message(the global one unless account is specified)'),
+ [
+ (_('account'), _(''), False)
+ ]
+ ],
}
if self.argv_len < 2 or \
sys.argv[1] not in self.commands.keys(): # no args or bad args
diff --git a/src/gtkgui.glade b/src/gtkgui.glade
index b8776c1c3..d1d01feb3 100644
--- a/src/gtkgui.glade
+++ b/src/gtkgui.glade
@@ -9136,7 +9136,7 @@ Custom</property>
<widget class="GtkExpander" id="search_expander">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="expanded">True</property>
+ <property name="expanded">False</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"/>
@@ -12317,104 +12317,170 @@ Status message</property>
<signal name="destroy" handler="on_manage_emoticons_window_destroy" last_modification_time="Sun, 13 Nov 2005 14:52:28 GMT"/>
<child>
- <widget class="GtkHBox" id="hbox2948">
- <property name="border_width">6</property>
+ <widget class="GtkVBox" id="vbox">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkScrolledWindow" id="emoticons_scrolledwindow">
+ <widget class="GtkHBox" id="hbox">
<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>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
<child>
- <widget class="GtkTreeView" id="emoticons_treeview">
+ <widget class="GtkLabel" id="label">
<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"/>
+ <property name="label" translatable="yes">Emoticon set:</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="GtkComboBox" id="combobox">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">Animated
+Static</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</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="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
- <widget class="GtkVButtonBox" id="vbuttonbox4">
+ <widget class="GtkHBox" id="hbox">
+ <property name="border_width">6</property>
<property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
+ <property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkButton" id="button_new_emoticon">
+ <widget class="GtkScrolledWindow" id="emoticons_scrolledwindow">
<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>
+ <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="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"/>
+ <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="GtkButton" id="set_image_button">
+ <widget class="GtkVButtonBox" id="vbuttonbox">
<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>
+ <property name="layout_style">GTK_BUTTONBOX_START</property>
+ <property name="spacing">6</property>
- <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"/>
+ <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">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py
index 0df2aa43e..e2c3b7625 100644
--- a/src/gtkgui_helpers.py
+++ b/src/gtkgui_helpers.py
@@ -264,7 +264,8 @@ def parse_server_xml(path_to_file):
def set_unset_urgency_hint(window, unread_messages_no):
'''sets/unsets urgency hint in window argument
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:
window.props.urgency_hint = True
else:
diff --git a/src/notify.py b/src/notify.py
index 167586d91..5947af905 100644
--- a/src/notify.py
+++ b/src/notify.py
@@ -189,10 +189,11 @@ class DesktopNotification:
self.notif = dbus_support.get_notifications_interface()
if self.notif is None:
raise dbus.dbus_bindings.DBusException()
+ timeout = gajim.config.get('notification_timeout') # in seconds
self.id = self.notif.Notify(dbus.String(_('Gajim')),
dbus.String(path), dbus.UInt32(0), ntype, dbus.Byte(0),
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.pending[self.id] = self
diff --git a/src/remote_control.py b/src/remote_control.py
index d1ddcce0c..e6bb2a777 100644
--- a/src/remote_control.py
+++ b/src/remote_control.py
@@ -107,6 +107,7 @@ class SignalObject(DbusPrototype):
self.add_contact,
self.remove_contact,
self.get_status,
+ self.get_status_message,
])
def raise_signal(self, signal, arg):
@@ -137,6 +138,20 @@ class SignalObject(DbusPrototype):
# return show for the given account
index = gajim.connections[account].connected
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):
'''send_file(file_path, jid, account=None)
@@ -488,3 +503,4 @@ class SignalObject(DbusPrototype):
remove_contact = method(INTERFACE)(remove_contact)
add_contact = method(INTERFACE)(add_contact)
get_status = method(INTERFACE)(get_status)
+ get_status_message = method(INTERFACE)(get_status_message)