Philipp Hörist pushed to branch master at gajim / gajim

Commits:

4 changed files:

Changes:

  • gajim/chat_control.py
    ... ... @@ -264,17 +264,17 @@ class ChatControl(ChatControlBase):
    264 264
                 act.connect("activate", func)
    
    265 265
                 self.parent_win.window.add_action(act)
    
    266 266
     
    
    267
    -        act = Gio.SimpleAction.new_stateful(
    
    267
    +        self.audio_action = Gio.SimpleAction.new_stateful(
    
    268 268
                 'toggle-audio-' + self.control_id, None,
    
    269 269
                 GLib.Variant.new_boolean(False))
    
    270
    -        act.connect('change-state', self._on_audio)
    
    271
    -        self.parent_win.window.add_action(act)
    
    270
    +        self.audio_action.connect('change-state', self._on_audio)
    
    271
    +        self.parent_win.window.add_action(self.audio_action)
    
    272 272
     
    
    273
    -        act = Gio.SimpleAction.new_stateful(
    
    273
    +        self.video_action = Gio.SimpleAction.new_stateful(
    
    274 274
                 'toggle-video-' + self.control_id,
    
    275 275
                 None, GLib.Variant.new_boolean(False))
    
    276
    -        act.connect('change-state', self._on_video)
    
    277
    -        self.parent_win.window.add_action(act)
    
    276
    +        self.video_action.connect('change-state', self._on_video)
    
    277
    +        self.parent_win.window.add_action(self.video_action)
    
    278 278
     
    
    279 279
         def update_actions(self):
    
    280 280
             win = self.parent_win.window
    
    ... ... @@ -526,7 +526,8 @@ class ChatControl(ChatControlBase):
    526 526
             if state in ('connection_received', 'connecting'):
    
    527 527
                 setattr(self, jingle_type + '_sid', sid)
    
    528 528
     
    
    529
    -        getattr(self, '_' + jingle_type + '_button').set_active(jingle_state != self.JINGLE_STATE_NULL)
    
    529
    +        v = GLib.Variant.new_boolean(jingle_state != self.JINGLE_STATE_NULL)
    
    530
    +        getattr(self, jingle_type + '_action').change_state(v)
    
    530 531
     
    
    531 532
             getattr(self, 'update_' + jingle_type)()
    
    532 533
     
    
    ... ... @@ -724,7 +725,8 @@ class ChatControl(ChatControlBase):
    724 725
                 content = session.get_content(jingle_type)
    
    725 726
                 if content:
    
    726 727
                     session.remove_content(content.creator, content.name)
    
    727
    -        getattr(self, '_' + jingle_type + '_button').set_active(False)
    
    728
    +        v = GLib.Variant.new_boolean(False)
    
    729
    +        getattr(self, jingle_type + '_action').change_state(v)
    
    728 730
             getattr(self, 'update_' + jingle_type)()
    
    729 731
     
    
    730 732
         def on_jingle_button_toggled(self, state, jingle_type):
    
    ... ... @@ -768,9 +770,6 @@ class ChatControl(ChatControlBase):
    768 770
                 fixed.set_no_show_all(True)
    
    769 771
                 self.close_jingle_content(jingle_type)
    
    770 772
     
    
    771
    -        img = getattr(self, '_' + jingle_type + '_button').get_property('image')
    
    772
    -        img.set_from_file(path_to_img)
    
    773
    -
    
    774 773
         def set_lock_image(self):
    
    775 774
             loggable = self.session and self.session.is_loggable()
    
    776 775
     
    

  • gajim/common/jingle_rtp.py
    ... ... @@ -43,7 +43,7 @@ class JingleRTPContent(JingleContent):
    43 43
         def __init__(self, session, media, transport=None):
    
    44 44
             if transport is None:
    
    45 45
                 transport = JingleTransportICEUDP(None)
    
    46
    -        JingleContent.__init__(self, session, transport)
    
    46
    +        JingleContent.__init__(self, session, transport, None)
    
    47 47
             self.media = media
    
    48 48
             self._dtmf_running = False
    
    49 49
             self.farstream_media = {
    

  • gajim/common/jingle_session.py
    ... ... @@ -633,8 +633,7 @@ class JingleSession:
    633 633
                 if content_type:
    
    634 634
                     try:
    
    635 635
                         if transport:
    
    636
    -                        content = content_type(
    
    637
    -                            self, transport=transport, senders=senders)
    
    636
    +                        content = content_type(self, transport=transport)
    
    638 637
                             self.add_content(element['name'],
    
    639 638
                                              content, 'peer')
    
    640 639
                             contents.append(content)
    

  • gajim/gui_interface.py
    ... ... @@ -1238,7 +1238,7 @@ class Interface:
    1238 1238
             # TODO: conditional blocking if peer is not in roster
    
    1239 1239
     
    
    1240 1240
             account = obj.conn.name
    
    1241
    -        content_types = obj.contents.media
    
    1241
    +        content_types = [obj.contents.media]
    
    1242 1242
     
    
    1243 1243
             # check type of jingle session
    
    1244 1244
             if 'audio' in content_types or 'video' in content_types: