diff --git a/README.html b/README.html
index 8ddade813..740963f15 100644
--- a/README.html
+++ b/README.html
@@ -37,7 +37,7 @@ Gajim is a GTK+ app that loves GNOME. You can do 'make' so you don't require gno
gnome-python-desktop (for GnomeKeyring support)
notification-daemon or notify-python (and D-Bus) to get cooler popups
D-Bus running to have gajim-remote working. Some distributions split dbus-x11, which is needed for dbus to work with Gajim. Version >= 0.80 is required.
-python-dbus bindings (>=0.80)
+python-dbus bindings (>=0.81)
python-sexy to have clickable URLs in chat windows
python-kerberos to use GSSAPI authentification. Note: version1.1 or higher is required
diff --git a/data/glade/message_window.glade b/data/glade/message_window.glade
index 1532b5b3a..0e4a92643 100644
--- a/data/glade/message_window.glade
+++ b/data/glade/message_window.glade
@@ -1,6 +1,6 @@
-
+
480
@@ -18,136 +18,313 @@
True
3
+ vertical
1
-
+
True
- 3
- 3
-
+
True
+ vertical
-
+
True
+ 3
+ 3
-
+
True
- 5
- gtk-missing-image
-
-
- False
- False
- 5
- 0
-
-
-
-
- True
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- 5
-
+
True
- 0
- <span weight="heavy" size="large">Contact name</span>
- True
+
+
+ True
+ 5
+ gtk-missing-image
+
+
+ False
+ False
+ 5
+ 0
+
+
+
+
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ 5
+ vertical
+
+
+ True
+ 0
+ <span weight="heavy" size="large">Contact name</span>
+ True
+
+
+ 0
+
+
+
+
+
+
+
+ 1
+
+
+
+
+ True
+ 4
+
+
+ True
+ None
+ 1
+
+
+ 0
+
+
+
+
+ True
+ None
+ 1
+
+
+ 1
+
+
+
+
+ True
+ ../emoticons/static/music.png
+ 1
+
+
+ 2
+
+
+
+
+ True
+ None
+ 1
+
+
+ 3
+
+
+
+
+ True
+ None
+ 1
+
+
+ 4
+
+
+
+
+ 11
+ True
+
+
+
+
+
+ 5
+
+
+
+
+ False
+ False
+ 2
+
+
+
+
+ True
+ False
+
+
+ True
+ None
+
+
+
+
+ False
+ False
+ 3
+
+
-
- 0
-
+
+
+
+
+ False
+ False
+ 0
+
+
+
+
+ True
+ vertical
+
+
+ 60
+ True
+ 3
+ automatic
+ automatic
+ in
- 1
+ 0
-
+
True
- 4
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
-
+
+ True
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
True
- None
- 1
+ none
+ False
+
+
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ gtk-dialog-authentication
+ 1
+
+
+ False
0
-
- True
- None
- 1
-
-
- 1
-
-
-
-
- True
- ../emoticons/static/music.png
- 1
-
-
- 2
-
-
-
-
- True
- None
- 1
-
-
- 3
-
-
-
-
- True
- None
- 1
-
-
- 4
-
-
-
-
- 11
+
True
+ True
+ 3
+ never
+ never
+ in
- 5
+ 1
False
- False
+ 1
+
+
+
+
+ 1
+
+
+
+
+ True
+
+
+ True
+ True
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ True
+ Show a list of emoticons (Alt+M)
+ none
+ False
+
+
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ gtk-missing-image
+ 1
+
+
+
+
+ False
+ 0
+
+
+
+
+ True
+ True
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ True
+ Show a list of formattings
+ none
+ False
+
+
+ True
+ gtk-bold
+ 1
+
+
+
+
+ False
+ 1
+
+
+
+
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ vertical
+
+
+ False
2
-
- True
- False
+
+ True
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ True
+ True
+ Add this contact to roster (Ctrl+D)
+ none
-
+
True
- None
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ gtk-add
+ 1
@@ -157,129 +334,480 @@
3
-
-
-
-
-
-
- False
- False
- 0
-
-
-
-
- True
-
-
- 60
- True
- 3
- automatic
- automatic
- in
-
-
-
-
-
- 0
-
-
-
-
- True
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
-
-
- False
- False
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- True
- none
- False
-
+
+ True
+ True
+ True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- gtk-dialog-authentication
- 1
+ True
+ Send a file (Ctrl+F)
+ none
+ False
+
+
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ 1
+
+
+
+ False
+ 4
+
+
+
+
+ True
+ True
+ True
+ Toggle audio session
+ none
+
+
+ True
+ gtk-missing-image
+ 1
+
+
+
+
+ False
+ 5
+
+
+
+
+ True
+ True
+ True
+ Toggle video session
+ none
+
+
+ True
+ gtk-missing-image
+ 1
+
+
+
+
+ False
+ 6
+
+
+
+
+ True
+ True
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ True
+ Invite contacts to the conversation (Ctrl+G)
+ none
+ False
+
+
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ gtk-missing-image
+ 1
+
+
+
+
+ False
+ 7
+
+
+
+
+ True
+ True
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ True
+ Show the contact's profile (Ctrl+I)
+ none
+ False
+
+
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ gtk-info
+ 2
+
+
+
+
+ False
+ 8
+
+
+
+
+ True
+ True
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ True
+ Browse the chat history (Ctrl+H)
+ none
+ False
+
+
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ gtk-justify-fill
+ 1
+
+
+
+
+ False
+ 9
+
+
+
+
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ vertical
+
+
+ False
+ 10
+
+
+
+
+ True
+ True
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ True
+ Show a menu of advanced functions (Alt+D)
+ none
+ False
+
+
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+ gtk-execute
+ 1
+
+
+
+
+ False
+ 11
+
+
+
+
+ True
+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
+
+
+
+
+
+ 12
+
+
+
+
+ True
+ True
+ True
+
+
+ True
+ 0
+ 0
+
+
+ True
+ 2
+
+
+ True
+ gtk-jump-to
+
+
+ False
+ False
+ 0
+
+
+
+
+ True
+ _Send
+ True
+
+
+ False
+ False
+ 1
+
+
+
+
+
+
+
+
+ False
+ 13
+
False
- 0
-
-
-
-
- True
- True
- 3
- never
- never
- in
-
-
-
-
-
- 1
+ 2
- False
- 1
-
-
-
-
- 1
-
-
-
-
- True
-
-
- True
- False
- False
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- Show a list of emoticons (Alt+M)
- none
- False
-
-
- True
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- gtk-missing-image
- 1
-
-
-
-
- False
0
-
- True
- False
- False
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- Show a list of formattings
- none
- False
+
+ True
+ vertical
+ 6
-
+
True
- gtk-bold
- 1
+
+ 0
+
+
+
+
+ True
+ 4
+ 3
+ 6
+ 6
+
+
+ 1
+ True
+ True
+ True
+
+
+
+
+ 2
+ True
+ True
+ True
+
+
+ 1
+ 2
+
+
+
+
+ 3
+ True
+ True
+ True
+
+
+ 2
+ 3
+
+
+
+
+ 4
+ True
+ True
+ True
+
+
+ 1
+ 2
+
+
+
+
+ 5
+ True
+ True
+ True
+
+
+ 1
+ 2
+ 1
+ 2
+
+
+
+
+ 6
+ True
+ True
+ True
+
+
+ 2
+ 3
+ 1
+ 2
+
+
+
+
+ 7
+ True
+ True
+ True
+
+
+ 2
+ 3
+
+
+
+
+ 8
+ True
+ True
+ True
+
+
+ 1
+ 2
+ 2
+ 3
+
+
+
+
+ 9
+ True
+ True
+ True
+
+
+ 2
+ 3
+ 2
+ 3
+
+
+
+
+ *
+ True
+ True
+ True
+
+
+ 3
+ 4
+
+
+
+
+ 0
+ True
+ True
+ True
+
+
+ 1
+ 2
+ 3
+ 4
+
+
+
+
+ #
+ True
+ True
+ True
+
+
+ 2
+ 3
+ 3
+ 4
+
+
+
+
+ False
+ 1
+
+
+
+
+ True
+ 0
+ Sound volume:
+
+
+ False
+ 2
+
+
+
+
+ 110
+ True
+ True
+ 0 0 110 1 10 10
+ 0
+ bottom
+
+
+ False
+ 3
+
+
+
+
+ True
+ 0
+ Mic volume:
+
+
+ False
+ 4
+
+
+
+
+ True
+ True
+ 0 0 110 1 10 10
+ 0
+ bottom
+
+
+ False
+ 5
+
+
+
+
+ True
+
+
+ 6
+
@@ -287,264 +815,9 @@
1
-
-
- True
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
-
-
- False
- 2
-
-
-
-
- True
- True
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- True
- Add this contact to roster (Ctrl+D)
- none
-
-
- True
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- gtk-add
- 1
-
-
-
-
- False
- False
- 3
-
-
-
-
- True
- False
- False
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- Send a file (Ctrl+F)
- none
- False
-
-
- True
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- 1
-
-
-
-
- False
- 4
-
-
-
-
- True
- True
- Toggle audio session
- none
-
-
- True
- gtk-missing-image
- 1
-
-
-
-
- False
- 5
-
-
-
-
- True
- True
- Toggle video session
- none
-
-
- True
- gtk-missing-image
- 1
-
-
-
-
- False
- 6
-
-
-
-
- True
- False
- False
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- Invite contacts to the conversation (Ctrl+G)
- none
- False
-
-
- True
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- gtk-missing-image
- 1
-
-
-
-
- False
- 7
-
-
-
-
- True
- False
- False
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- Show the contact's profile (Ctrl+I)
- none
- False
-
-
- True
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- gtk-info
- 2
-
-
-
-
- False
- 8
-
-
-
-
- True
- False
- False
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- Browse the chat history (Ctrl+H)
- none
- False
-
-
- True
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- gtk-justify-fill
- 1
-
-
-
-
- False
- 9
-
-
-
-
- True
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
-
-
- False
- 10
-
-
-
-
- True
- False
- False
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- Show a menu of advanced functions (Alt+D)
- none
- False
-
-
- True
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- gtk-execute
- 1
-
-
-
-
- False
- 11
-
-
-
-
- True
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
-
-
-
-
-
- 12
-
-
-
-
- True
- True
- False
-
-
- True
- 0
- 0
-
-
- True
- 2
-
-
- True
- gtk-jump-to
-
-
- False
- False
- 0
-
-
-
-
- True
- _Send
- True
-
-
- False
- False
- 1
-
-
-
-
-
-
-
-
- False
- 13
-
-
- False
- 2
+ 0
@@ -614,6 +887,7 @@
True
3
+ vertical
True
@@ -643,6 +917,7 @@
True
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
5
+ vertical
True
@@ -683,10 +958,12 @@
0
True
+ vertical
6
True
+ vertical
6
diff --git a/src/chat_control.py b/src/chat_control.py
index 9bf83be5d..781d655fd 100644
--- a/src/chat_control.py
+++ b/src/chat_control.py
@@ -1375,6 +1375,21 @@ class ChatControl(ChatControlBase):
self.on_avatar_eventbox_button_press_event)
self.handlers[id_] = widget
+ for key in ('1', '2', '3', '4', '5', '6', '7', '8', '9', '*', '0', '#'):
+ widget = self.xml.get_widget(key + '_button')
+ id_ = widget.connect('pressed', self.on_num_button_pressed, key)
+ self.handlers[id_] = widget
+ id_ = widget.connect('released', self.on_num_button_released)
+ self.handlers[id_] = widget
+
+ widget = self.xml.get_widget('mic_hscale')
+ id_ = widget.connect('value_changed', self.on_mic_hscale_value_changed)
+ self.handlers[id_] = widget
+
+ widget = self.xml.get_widget('sound_hscale')
+ id_ = widget.connect('value_changed', self.on_sound_hscale_value_changed)
+ self.handlers[id_] = widget
+
if not session:
# Don't use previous session if we want to a specific resource
# and it's not the same
@@ -1505,27 +1520,35 @@ class ChatControl(ChatControlBase):
if jingle_type not in ('audio', 'video'):
return
banner_image = getattr(self, '_' + jingle_type + '_banner_image')
- if getattr(self, jingle_type + '_state') in (
- self.JINGLE_STATE_NOT_AVAILABLE, self.JINGLE_STATE_AVAILABLE):
+ state = getattr(self, jingle_type + '_state')
+ if state in (self.JINGLE_STATE_NOT_AVAILABLE,
+ self.JINGLE_STATE_AVAILABLE):
banner_image.hide()
else:
banner_image.show()
- if self.audio_state == self.JINGLE_STATE_CONNECTING:
+ if state == self.JINGLE_STATE_CONNECTING:
banner_image.set_from_stock(
gtk.STOCK_CONVERT, 1)
- elif self.audio_state == self.JINGLE_STATE_CONNECTION_RECEIVED:
+ elif state == self.JINGLE_STATE_CONNECTION_RECEIVED:
banner_image.set_from_stock(
gtk.STOCK_NETWORK, 1)
- elif self.audio_state == self.JINGLE_STATE_CONNECTED:
+ elif state == self.JINGLE_STATE_CONNECTED:
banner_image.set_from_stock(
gtk.STOCK_CONNECT, 1)
- elif self.audio_state == self.JINGLE_STATE_ERROR:
+ elif state == self.JINGLE_STATE_ERROR:
banner_image.set_from_stock(
gtk.STOCK_DIALOG_WARNING, 1)
self.update_toolbar()
def update_audio(self):
self._update_jingle('audio')
+ vbox = self.xml.get_widget('audio_vbox')
+ if self.audio_state == self.JINGLE_STATE_CONNECTED:
+ vbox.set_no_show_all(False)
+ vbox.show_all()
+ else:
+ vbox.set_no_show_all(True)
+ vbox.hide()
def update_video(self):
self._update_jingle('video')
@@ -1589,6 +1612,24 @@ class ChatControl(ChatControlBase):
def set_video_state(self, state, sid=None, reason=None):
self._set_jingle_state('video', state, sid=sid, reason=reason)
+ def _get_audio_content(self):
+ session = gajim.connections[self.account].get_jingle_session(
+ self.contact.get_full_jid(), self.audio_sid)
+ return session.get_content('audio')
+
+ def on_num_button_pressed(self, widget, num):
+ self._get_audio_content()._start_dtmf(num)
+
+ def on_num_button_released(self, released):
+ self._get_audio_content()._stop_dtmf()
+
+ def on_mic_hscale_value_changed(self, widget):
+ value = widget.get_value()
+ self._get_audio_content().set_mic_volume(value / 100)
+
+ def on_sound_hscale_value_changed(self, widget):
+ pass
+
def on_avatar_eventbox_enter_notify_event(self, widget, event):
"""
Enter the eventbox area so we under conditions add a timeout to show a
@@ -1790,7 +1831,7 @@ class ChatControl(ChatControlBase):
banner_name_label.set_tooltip_text(label_tooltip)
def on_jingle_button_toggled(self, widget, jingle_type):
- img_name = '%s_%s' % ({'audio': 'mic', 'video': 'cam'}[jingle_type],
+ img_name = 'gajim-%s_%s' % ({'audio': 'mic', 'video': 'cam'}[jingle_type],
{True: 'active', False: 'inactive'}[widget.get_active()])
path_to_img = gtkgui_helpers.get_icon_path(img_name)
diff --git a/src/common/connection.py b/src/common/connection.py
index 31e2b0ba4..0d370d8b8 100644
--- a/src/common/connection.py
+++ b/src/common/connection.py
@@ -578,8 +578,6 @@ class CommonConnection:
self.dispatch('STANZA_SENT', unicode(data))
def change_status(self, show, msg, auto=False):
- if not show in ['offline', 'online', 'chat', 'away', 'xa', 'dnd']:
- return -1
if not msg:
msg = ''
sign_msg = False
@@ -598,8 +596,9 @@ class CommonConnection:
self.USE_GPG = True
self.gpg = GnuPG.GnuPG(gajim.config.get('use_gpg_agent'))
self.connect_and_init(show, msg, sign_msg)
+ return
- elif show == 'offline':
+ if show == 'offline':
self.connected = 0
if self.connection:
p = common.xmpp.Presence(typ = 'unavailable')
@@ -612,14 +611,17 @@ class CommonConnection:
self.connection.start_disconnect()
else:
self._on_disconnected()
+ return
- elif show != 'offline' and self.connected > 0:
+ if show != 'offline' and self.connected > 0:
# dont'try to connect, when we are in state 'connecting'
if self.connected == 1:
return
if show == 'invisible':
self._change_to_invisible(msg)
return
+ if show not in ['offline', 'online', 'chat', 'away', 'xa', 'dnd']:
+ return -1
was_invisible = self.connected == gajim.SHOW_LIST.index('invisible')
self.connected = gajim.SHOW_LIST.index(show)
if was_invisible:
diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py
index e43ada275..18557e103 100644
--- a/src/common/connection_handlers.py
+++ b/src/common/connection_handlers.py
@@ -2714,6 +2714,8 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream,
if show == 'invisible':
self.send_invisible_presence(msg, signed, True)
return
+ if show not in ['offline', 'online', 'chat', 'away', 'xa', 'dnd']:
+ return
priority = gajim.get_priority(self.name, sshow)
our_jid = helpers.parse_jid(gajim.get_jid_from_account(self.name))
vcard = self.get_cached_vcard(our_jid)
diff --git a/src/common/jingle_content.py b/src/common/jingle_content.py
index ac7668c24..93fdf01b9 100644
--- a/src/common/jingle_content.py
+++ b/src/common/jingle_content.py
@@ -23,7 +23,7 @@ def get_jingle_content(node):
return contents[namespace](node)
-class FailedApplication(Exception):
+class JingleContentSetupException(Exception):
"""
Exception that should be raised when a content fails to setup.
"""
diff --git a/src/common/jingle_rtp.py b/src/common/jingle_rtp.py
index 70635e439..0b8d846f2 100644
--- a/src/common/jingle_rtp.py
+++ b/src/common/jingle_rtp.py
@@ -24,7 +24,7 @@ from glib import GError
import gajim
from jingle_transport import JingleTransportICEUDP
-from jingle_content import contents, JingleContent, FailedApplication
+from jingle_content import contents, JingleContent, JingleContentSetupException
class JingleRTPContent(JingleContent):
@@ -89,16 +89,17 @@ class JingleRTPContent(JingleContent):
and self.p2psession.get_property('codecs-ready'))
def make_bin_from_config(self, config_key, pipeline, text):
+ pipeline = pipeline % gajim.config.get(config_key)
try:
- bin = gst.parse_bin_from_description(pipeline
- % gajim.config.get(config_key), True)
+ bin = gst.parse_bin_from_description(pipeline, True)
return bin
except GError, error_str:
self.session.connection.dispatch('ERROR',
(_("%s configuration error") % text.capitalize(),
- _("Couldn't setup %s. Check your configuration.\n\nError was:\n%s")
- % (text, error_str)))
- raise FailedApplication
+ _("Couldn't setup %s. Check your configuration.\n\n"
+ "Pipeline was:\n%s\n\n"
+ "Error was:\n%s") % (text, pipeline, error_str)))
+ raise JingleContentSetupException
def add_remote_candidates(self, candidates):
JingleContent.add_remote_candidates(self, candidates)
@@ -257,6 +258,12 @@ class JingleAudio(JingleRTPContent):
JingleRTPContent.__init__(self, session, 'audio', transport)
self.setup_stream()
+ def set_mic_volume(self, vol):
+ """
+ vol must be between 0 ans 1
+ """
+ self.mic_volume.set_property('volume', vol)
+
def setup_stream(self):
JingleRTPContent.setup_stream(self)
@@ -281,7 +288,7 @@ class JingleAudio(JingleRTPContent):
'audioconvert ! %s', _("audio output"))
self.mic_volume = src_bin.get_by_name('gajim_vol')
- self.mic_volume.set_property('volume', 1)
+ self.set_mic_volume(0)
# link gst elements
self.pipeline.add(self.sink, src_bin)
@@ -315,7 +322,7 @@ class JingleVideo(JingleRTPContent):
#src_bin.link(caps)
self.sink = self.make_bin_from_config('video_output_device',
- '%s ! videoscale ! ffmpegcolorspace', _("video output"))
+ 'videoscale ! ffmpegcolorspace ! %s', _("video output"))
self.pipeline.add(self.sink)
src_bin.get_pad('src').link(self.p2psession.get_property('sink-pad'))
@@ -333,4 +340,4 @@ def get_content(desc):
contents[xmpp.NS_JINGLE_RTP] = get_content
-# vim: se ts=3:
\ No newline at end of file
+# vim: se ts=3:
diff --git a/src/common/jingle_session.py b/src/common/jingle_session.py
index 57c70b3eb..0c8f7e9dc 100644
--- a/src/common/jingle_session.py
+++ b/src/common/jingle_session.py
@@ -29,7 +29,7 @@ Handles Jingle sessions (XEP 0166)
import gajim #Get rid of that?
import xmpp
from jingle_transport import get_jingle_transport
-from jingle_content import get_jingle_content, FailedApplication
+from jingle_content import get_jingle_content, JingleContentSetupException
# FIXME: Move it to JingleSession.States?
class JingleStates(object):
@@ -492,7 +492,7 @@ class JingleSession(object):
else:
reasons.add('unsupported-transports')
contents_rejected.append((element['name'], 'peer'))
- except FailedApplication:
+ except JingleContentSetupException:
reasons.add('failed-application')
else:
contents_rejected.append((element['name'], 'peer'))
diff --git a/src/gajim.py b/src/gajim.py
index d0ed38f20..9468a971b 100644
--- a/src/gajim.py
+++ b/src/gajim.py
@@ -176,12 +176,12 @@ else:
elif sysname in ('FreeBSD', 'OpenBSD', 'NetBSD'):
libc.setproctitle('gajim')
- if gtk.pygtk_version < (2, 12, 0):
- pritext = _('Gajim needs PyGTK 2.12 or above')
- sectext = _('Gajim needs PyGTK 2.12 or above to run. Quiting...')
- elif gtk.gtk_version < (2, 12, 0):
- pritext = _('Gajim needs GTK 2.12 or above')
- sectext = _('Gajim needs GTK 2.12 or above to run. Quiting...')
+ if gtk.pygtk_version < (2, 16, 0):
+ pritext = _('Gajim needs PyGTK 2.16 or above')
+ sectext = _('Gajim needs PyGTK 2.16 or above to run. Quiting...')
+ elif gtk.gtk_version < (2, 16, 0):
+ pritext = _('Gajim needs GTK 2.16 or above')
+ sectext = _('Gajim needs GTK 2.16 or above to run. Quiting...')
try:
import gtk.glade # check if user has libglade (in pygtk and in gtk)
diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py
index 01ec5d605..e531a69c3 100644
--- a/src/gtkgui_helpers.py
+++ b/src/gtkgui_helpers.py
@@ -36,31 +36,11 @@ import pango
import os
import sys
-import vcard
-import dialogs
-
import logging
log = logging.getLogger('gajim.gtkgui_helpers')
-
-HAS_PYWIN32 = True
-if os.name == 'nt':
- try:
- import win32file
- import win32con
- import pywintypes
- except ImportError:
- HAS_PYWIN32 = False
-
from common import i18n
from common import gajim
-from common import helpers
-
-gtk.glade.bindtextdomain(i18n.APP, i18n.DIR)
-gtk.glade.textdomain(i18n.APP)
-
-screen_w = gtk.gdk.screen_width()
-screen_h = gtk.gdk.screen_height()
gtk_icon_theme = gtk.icon_theme_get_default()
gtk_icon_theme.append_search_path(gajim.ICONS_DIR)
@@ -82,6 +62,27 @@ def get_icon_path(icon_name, size=16):
except gobject.GError, e:
log.error("Unable to find icon %s: %s" % (icon_name, str(e)))
+import vcard
+import dialogs
+
+
+HAS_PYWIN32 = True
+if os.name == 'nt':
+ try:
+ import win32file
+ import win32con
+ import pywintypes
+ except ImportError:
+ HAS_PYWIN32 = False
+
+from common import helpers
+
+gtk.glade.bindtextdomain(i18n.APP, i18n.DIR)
+gtk.glade.textdomain(i18n.APP)
+
+screen_w = gtk.gdk.screen_width()
+screen_h = gtk.gdk.screen_height()
+
def add_image_to_menuitem(menuitem, icon_name):
img = gtk.Image()
path_img = get_icon_path(icon_name)