start of GUI stuff for VOIP
This commit is contained in:
parent
163b01e113
commit
12baddbdc3
7 changed files with 340 additions and 134 deletions
|
@ -1,49 +1,52 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
||||
<!--*- mode: xml -*-->
|
||||
<?xml version="1.0"?>
|
||||
<glade-interface>
|
||||
<!-- interface-requires gtk+ 2.16 -->
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<widget class="GtkMenu" id="chat_control_popup_menu">
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="add_to_roster_menuitem">
|
||||
<property name="label">_Add to Roster</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="label" translatable="yes">_Add to Roster</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">False</property>
|
||||
<signal name="activate" handler="_on_add_to_roster_menuitem_activate"/>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1372">
|
||||
<widget class="GtkImage" id="image3">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-add</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="send_file_menuitem">
|
||||
<property name="label">Send _File</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="label" translatable="yes">Send _File</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">False</property>
|
||||
<signal name="activate" handler="_on_send_file_menuitem_activate"/>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1371">
|
||||
<widget class="GtkImage" id="image4">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-save</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="convert_to_groupchat">
|
||||
<property name="label">Invite _Contacts</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="label" translatable="yes">Invite _Contacts</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">False</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="menu-item-image4">
|
||||
<widget class="GtkImage" id="image1">
|
||||
<property name="visible">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="stock">gtk-missing-image</property>
|
||||
<property name="stock">None</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -63,15 +66,22 @@
|
|||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="start_voip_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Start _Voice chat</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="_on_start_voip_menuitem_activate" last_modification_time="Tue, 03 Jan 2006 04:26:46 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="start_voip_menuitem">
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="label" translatable="yes">Start _Voice chat</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="_on_start_voip_menuitem_activate"/>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="stop_voip_menuitem">
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="label" translatable="yes">Stop _Voice chat</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="_on_stop_voip_menuitem_activate"/>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkCheckMenuItem" id="toggle_e2e_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
|
@ -88,22 +98,23 @@
|
|||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="information_menuitem">
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="label">gtk-info</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="history_menuitem">
|
||||
<property name="label">_History</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="label" translatable="yes">_History</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">False</property>
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1370">
|
||||
<widget class="GtkImage" id="image2">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-justify-fill</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
||||
<!--*- mode: xml -*-->
|
||||
<?xml version="1.0"?>
|
||||
<glade-interface>
|
||||
<!-- interface-requires gtk+ 2.14 -->
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<widget class="GtkWindow" id="message_window">
|
||||
<property name="default_width">480</property>
|
||||
<property name="default_height">440</property>
|
||||
|
@ -40,6 +40,7 @@
|
|||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -54,6 +55,9 @@
|
|||
<property name="label"><span weight="heavy" size="large">Contact name</span></property>
|
||||
<property name="use_markup">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
|
@ -71,14 +75,17 @@
|
|||
<widget class="GtkImage" id="mood_image">
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="stock">None</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImage" id="activity_image">
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="stock">None</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
|
@ -87,13 +94,23 @@
|
|||
<child>
|
||||
<widget class="GtkImage" id="tune_image">
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="pixbuf">../emoticons/static/music.png</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="pixbuf">../emoticons/static/music.png</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkImage" id="audio_image">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">None</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment3">
|
||||
<property name="width_request">11</property>
|
||||
|
@ -103,7 +120,7 @@
|
|||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">3</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -138,6 +155,7 @@
|
|||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -148,35 +166,40 @@
|
|||
<property name="height_request">60</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="border_width">3</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="hscrollbar_policy">automatic</property>
|
||||
<property name="vscrollbar_policy">automatic</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox1">
|
||||
<widget class="GtkHBox" id="hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<widget class="GtkButton" id="authentication_button">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="response_id">0</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="lock_image">
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="stock">gtk-dialog-authentication</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -184,9 +207,9 @@
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="vscrollbar_policy">never</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
|
@ -212,37 +235,40 @@
|
|||
<child>
|
||||
<widget class="GtkButton" id="emoticons_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip" translatable="yes">Show a list of emoticons (Alt+M)</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="response_id">0</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="emoticons_button_image">
|
||||
<property name="visible">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="stock">gtk-missing-image</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="formattings_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip" translatable="yes">Show a list of formattings</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="response_id">0</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image10">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-bold</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -268,14 +294,13 @@
|
|||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="tooltip" translatable="yes">Add this contact to roster (Ctrl+D)</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="relief">none</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image9">
|
||||
<property name="visible">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="stock">gtk-add</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -288,16 +313,17 @@
|
|||
<child>
|
||||
<widget class="GtkButton" id="send_file_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip" translatable="yes">Send a file (Ctrl+F)</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="response_id">0</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image3">
|
||||
<property name="visible">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="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -309,17 +335,18 @@
|
|||
<child>
|
||||
<widget class="GtkButton" id="convert_to_gc_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip" translatable="yes">Invite contacts to the conversation (Ctrl+G)</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="response_id">0</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="convert_to_gc_button_image">
|
||||
<property name="visible">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="stock">gtk-missing-image</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -331,17 +358,18 @@
|
|||
<child>
|
||||
<widget class="GtkButton" id="contact_information_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip" translatable="yes">Show the contact's profile (Ctrl+I)</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="response_id">0</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image2">
|
||||
<property name="visible">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="stock">gtk-info</property>
|
||||
<property name="icon_size">2</property>
|
||||
<property name="icon-size">2</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -353,17 +381,18 @@
|
|||
<child>
|
||||
<widget class="GtkButton" id="history_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip" translatable="yes">Browse the chat history (Ctrl+H)</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="response_id">0</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image5">
|
||||
<property name="visible">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="stock">gtk-justify-fill</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -385,17 +414,18 @@
|
|||
<child>
|
||||
<widget class="GtkButton" id="message_window_actions_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip" translatable="yes">Show a menu of advanced functions (Alt+A)</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="response_id">0</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image1">
|
||||
<property name="visible">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="stock">gtk-execute</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -420,7 +450,7 @@
|
|||
<widget class="GtkButton" id="send_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="receives_default">False</property>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment102">
|
||||
<property name="visible">True</property>
|
||||
|
@ -438,6 +468,7 @@
|
|||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -486,6 +517,7 @@
|
|||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -493,7 +525,7 @@
|
|||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_END</property>
|
||||
<property name="ellipsize">end</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
|
@ -505,14 +537,14 @@
|
|||
<property name="height_request">20</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="relief">none</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image1329">
|
||||
<property name="visible">True</property>
|
||||
<property name="ypad">6</property>
|
||||
<property name="stock">gtk-close</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -526,8 +558,8 @@
|
|||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">tab</property>
|
||||
<property name="tab_fill">False</property>
|
||||
<property name="type">tab</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -555,6 +587,7 @@
|
|||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -569,6 +602,9 @@
|
|||
<property name="label"><span weight="heavy" size="large">room jid</span></property>
|
||||
<property name="use_markup">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
|
@ -586,6 +622,7 @@
|
|||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -609,21 +646,24 @@
|
|||
<property name="height_request">60</property>
|
||||
<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="hscrollbar_policy">automatic</property>
|
||||
<property name="vscrollbar_policy">automatic</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="message_scrolledwindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="vscrollbar_policy">never</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
|
@ -634,6 +674,9 @@
|
|||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
|
@ -646,9 +689,9 @@
|
|||
<property name="width_request">100</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="vscrollbar_policy">automatic</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<widget class="GtkTreeView" id="list_treeview">
|
||||
<property name="visible">True</property>
|
||||
|
@ -677,41 +720,45 @@
|
|||
<child>
|
||||
<widget class="GtkButton" id="emoticons_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip" translatable="yes">Show a list of emoticons (Alt+M)</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="relief">none</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="emoticons_button_image">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-missing-image</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="formattings_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip" translatable="yes">Show a list of formattings</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="response_id">0</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image11">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-bold</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -733,16 +780,17 @@
|
|||
<child>
|
||||
<widget class="GtkButton" id="change_nick_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip" translatable="yes">Change your nickname (Ctrl+N)</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="relief">none</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image4">
|
||||
<property name="visible">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="stock">gtk-edit</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -755,16 +803,17 @@
|
|||
<child>
|
||||
<widget class="GtkButton" id="change_subject_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip" translatable="yes">Change the room's subject (Alt+T)</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="relief">none</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image6">
|
||||
<property name="visible">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="stock">gtk-properties</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -777,17 +826,18 @@
|
|||
<child>
|
||||
<widget class="GtkButton" id="bookmark_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="tooltip" translatable="yes">Bookmark this room (Ctrl+B)</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="relief">none</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image7">
|
||||
<property name="visible">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="stock">gtk-add</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -800,16 +850,17 @@
|
|||
<child>
|
||||
<widget class="GtkButton" id="history_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip" translatable="yes">Browse the chat history (Ctrl+H)</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="relief">none</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image8">
|
||||
<property name="visible">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="stock">gtk-justify-fill</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -832,11 +883,12 @@
|
|||
<child>
|
||||
<widget class="GtkButton" id="muc_window_actions_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip" translatable="yes">Show a menu of advanced functions (Alt+A)</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="response_id">0</property>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment104">
|
||||
<property name="visible">True</property>
|
||||
|
@ -846,7 +898,7 @@
|
|||
<widget class="GtkImage" id="image1344">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-execute</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -874,7 +926,7 @@
|
|||
<widget class="GtkButton" id="send_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="receives_default">False</property>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment105">
|
||||
<property name="visible">True</property>
|
||||
|
@ -892,6 +944,7 @@
|
|||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -944,6 +997,7 @@
|
|||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -963,14 +1017,14 @@
|
|||
<property name="height_request">20</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="relief">GTK_RELIEF_NONE</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="relief">none</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image1347">
|
||||
<property name="visible">True</property>
|
||||
<property name="ypad">6</property>
|
||||
<property name="stock">gtk-close</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="icon-size">1</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -984,9 +1038,9 @@
|
|||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">tab</property>
|
||||
<property name="position">1</property>
|
||||
<property name="tab_fill">False</property>
|
||||
<property name="type">tab</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
||||
<!--*- mode: xml -*-->
|
||||
<?xml version="1.0"?>
|
||||
<glade-interface>
|
||||
<!-- interface-requires gtk+ 2.14 -->
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<widget class="GtkMessageDialog" id="voip_call_received_messagedialog">
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="skip_taskbar_hint">True</property>
|
||||
<property name="has_separator">False</property>
|
||||
<property name="message_type">GTK_MESSAGE_QUESTION</property>
|
||||
<property name="buttons">GTK_BUTTONS_YES_NO</property>
|
||||
<property name="message_type">question</property>
|
||||
<property name="buttons">yes-no</property>
|
||||
<property name="text"><b><big>Incoming call</big></b></property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="secondary_text">%(contact)s wants to start a voice chat with you. Do you want to answer the call?</property>
|
||||
<signal name="close" handler="on_voip_call_received_messagedialog_close"/>
|
||||
<signal name="response" handler="on_voip_call_received_messagedialog_response"/>
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox2">
|
||||
<widget class="GtkVBox" id="dialog-vbox4">
|
||||
<property name="visible">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="spacing">2</property>
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area2">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area4">
|
||||
<property name="visible">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="layout_style">GTK_BUTTONBOX_END</property>
|
||||
<property name="layout_style">end</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">GTK_PACK_END</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
|
|
|
@ -1128,6 +1128,15 @@ class ChatControlBase(MessageControl):
|
|||
################################################################################
|
||||
class ChatControl(ChatControlBase):
|
||||
'''A control for standard 1-1 chat'''
|
||||
(
|
||||
AUDIO_STATE_NOT_AVAILABLE,
|
||||
AUDIO_STATE_AVAILABLE,
|
||||
AUDIO_STATE_CONNECTING,
|
||||
AUDIO_STATE_CONNECTION_RECEIVED,
|
||||
AUDIO_STATE_CONNECTED,
|
||||
AUDIO_STATE_ERROR
|
||||
) = range(6)
|
||||
|
||||
TYPE_ID = message_control.TYPE_CHAT
|
||||
old_msg_kind = None # last kind of the printed message
|
||||
CHAT_CMDS = ['clear', 'compact', 'help', 'me', 'ping', 'say']
|
||||
|
@ -1199,10 +1208,17 @@ class ChatControl(ChatControlBase):
|
|||
self._mood_image = self.xml.get_widget('mood_image')
|
||||
self._activity_image = self.xml.get_widget('activity_image')
|
||||
self._tune_image = self.xml.get_widget('tune_image')
|
||||
self._audio_image = self.xml.get_widget('audio_image')
|
||||
|
||||
self.update_mood()
|
||||
self.update_activity()
|
||||
self.update_tune()
|
||||
if gajim.capscache.is_supported(contact, NS_JINGLE_RTP_AUDIO):
|
||||
self.set_audio_state('available')
|
||||
else:
|
||||
self.set_audio_state('not_available')
|
||||
self.audio_sid = None
|
||||
|
||||
|
||||
# keep timeout id and window obj for possible big avatar
|
||||
# it is on enter-notify and leave-notify so no need to be
|
||||
|
@ -1434,6 +1450,45 @@ class ChatControl(ChatControlBase):
|
|||
else:
|
||||
self._tune_image.hide()
|
||||
|
||||
def update_audio(self):
|
||||
if self.audio_state == self.AUDIO_STATE_NOT_AVAILABLE:
|
||||
self._audio_image.hide()
|
||||
return
|
||||
elif self.audio_state == self.AUDIO_STATE_AVAILABLE:
|
||||
self._audio_image.set_from_stock(gtk.STOCK_APPLY, 1)
|
||||
elif self.audio_state == self.AUDIO_STATE_CONNECTING:
|
||||
self._audio_image.set_from_stock(gtk.STOCK_CONVERT, 1)
|
||||
elif self.audio_state == self.AUDIO_STATE_CONNECTION_RECEIVED:
|
||||
self._audio_image.set_from_stock(gtk.STOCK_NETWORK, 1)
|
||||
elif self.audio_state == self.AUDIO_STATE_CONNECTED:
|
||||
self._audio_image.set_from_stock(gtk.STOCK_CONNECT, 1)
|
||||
elif self.audio_state == self.AUDIO_STATE_ERROR:
|
||||
self._audio_image.set_from_stock(gtk.STOCK_DIALOG_WARNING, 1)
|
||||
self._audio_image.show()
|
||||
|
||||
def set_audio_state(self, state, sid=None, reason=None):
|
||||
str = 'Audio state : %s' % state
|
||||
if reason:
|
||||
str += ', reason: %s' % reason
|
||||
self.print_conversation(str, 'info')
|
||||
if state == 'not_available':
|
||||
self.audio_state = self.AUDIO_STATE_NOT_AVAILABLE
|
||||
self.audio_sid = None
|
||||
elif state == 'available':
|
||||
self.audio_state = self.AUDIO_STATE_AVAILABLE
|
||||
self.audio_sid = None
|
||||
elif state == 'connecting':
|
||||
self.audio_state = self.AUDIO_STATE_CONNECTING
|
||||
self.audio_sid = sid
|
||||
elif state == 'connection_received':
|
||||
self.audio_state = self.AUDIO_STATE_CONNECTION_RECEIVED
|
||||
self.audio_sid = sid
|
||||
elif state == 'connected':
|
||||
self.audio_state = self.AUDIO_STATE_CONNECTED
|
||||
elif state == 'error':
|
||||
self.audio_state = self.AUDIO_STATE_ERROR
|
||||
self.update_audio()
|
||||
|
||||
def on_avatar_eventbox_enter_notify_event(self, widget, event):
|
||||
'''
|
||||
we enter the eventbox area so we under conditions add a timeout
|
||||
|
@ -1635,7 +1690,16 @@ class ChatControl(ChatControlBase):
|
|||
banner_name_tooltip.set_tip(banner_name_label, label_tooltip)
|
||||
|
||||
def _on_start_voip_menuitem_activate(self, *things):
|
||||
gajim.connections[self.account].startVoIP(self.contact.jid+'/'+self.contact.resource)
|
||||
sid = gajim.connections[self.account].startVoIP(self.contact.get_full_jid(
|
||||
))
|
||||
self.set_audio_state('connecting', sid)
|
||||
|
||||
def _on_stop_voip_menuitem_activate(self, *things):
|
||||
session = gajim.connections[self.account].getJingleSession(
|
||||
self.contact.get_full_jid(), self.audio_sid)
|
||||
if session:
|
||||
session.end_session()
|
||||
self.set_audio_state('available')
|
||||
|
||||
def _toggle_gpg(self):
|
||||
if not self.gpg_is_active and not self.contact.keyID:
|
||||
|
@ -2100,6 +2164,7 @@ class ChatControl(ChatControlBase):
|
|||
history_menuitem = xml.get_widget('history_menuitem')
|
||||
toggle_gpg_menuitem = xml.get_widget('toggle_gpg_menuitem')
|
||||
start_voip_menuitem = xml.get_widget('start_voip_menuitem')
|
||||
stop_voip_menuitem = xml.get_widget('stop_voip_menuitem')
|
||||
toggle_e2e_menuitem = xml.get_widget('toggle_e2e_menuitem')
|
||||
send_file_menuitem = xml.get_widget('send_file_menuitem')
|
||||
information_menuitem = xml.get_widget('information_menuitem')
|
||||
|
@ -2170,10 +2235,15 @@ class ChatControl(ChatControlBase):
|
|||
send_file_menuitem.set_sensitive(False)
|
||||
|
||||
# check if it's possible to start jingle sessions
|
||||
if gajim.capscache.is_supported(contact, NS_JINGLE_RTP_AUDIO):
|
||||
if self.audio_state == self.AUDIO_STATE_NOT_AVAILABLE:
|
||||
start_voip_menuitem.show()
|
||||
start_voip_menuitem.set_sensitive(False)
|
||||
elif self.audio_state in (self.AUDIO_STATE_AVAILABLE,
|
||||
self.AUDIO_STATE_ERROR):
|
||||
start_voip_menuitem.show()
|
||||
start_voip_menuitem.set_sensitive(True)
|
||||
else:
|
||||
start_voip_menuitem.set_sensitive(False)
|
||||
stop_voip_menuitem.show()
|
||||
|
||||
# check if it's possible to convert to groupchat
|
||||
if gajim.capscache.is_supported(contact, NS_MUC):
|
||||
|
@ -2197,6 +2267,9 @@ class ChatControl(ChatControlBase):
|
|||
id = start_voip_menuitem.connect('activate',
|
||||
self._on_start_voip_menuitem_activate)
|
||||
self.handlers[id] = start_voip_menuitem
|
||||
id = stop_voip_menuitem.connect('activate',
|
||||
self._on_stop_voip_menuitem_activate)
|
||||
self.handlers[id] = stop_voip_menuitem
|
||||
id_ = toggle_e2e_menuitem.connect('activate',
|
||||
self._on_toggle_e2e_menuitem_activate)
|
||||
self.handlers[id_] = toggle_e2e_menuitem
|
||||
|
|
|
@ -76,7 +76,6 @@ class TransportType(object):
|
|||
|
||||
class Error(Exception): pass
|
||||
class WrongState(Error): pass
|
||||
class NoSuchSession(Error): pass
|
||||
|
||||
class OutOfOrder(Exception):
|
||||
''' Exception that should be raised when an action is received when in the wrong state. '''
|
||||
|
@ -389,6 +388,7 @@ class JingleSession(object):
|
|||
|
||||
def __sessionTerminateCB(self, stanza, jingle, error, action):
|
||||
self.connection.deleteJingle(self)
|
||||
self.connection.dispatch('JINGLE_DISCONNECTED', (self.peerjid, self.sid))
|
||||
|
||||
def __broadcastAllCB(self, stanza, jingle, error, action):
|
||||
''' Broadcast the stanza to all content handlers. '''
|
||||
|
@ -466,6 +466,9 @@ class JingleSession(object):
|
|||
def __contentRemove(self):
|
||||
assert self.state != JingleStates.ended
|
||||
|
||||
def content_negociated(self, media):
|
||||
self.connection.dispatch('JINGLE_CONNECTED', (self.peerjid, self.sid,
|
||||
media))
|
||||
|
||||
class JingleTransport(object):
|
||||
''' An abstraction of a transport in Jingle sessions. '''
|
||||
|
@ -668,10 +671,11 @@ class JingleRTPContent(JingleContent):
|
|||
elif name == 'farsight-component-state-changed':
|
||||
state = message.structure['state']
|
||||
print message.structure['component'], state
|
||||
if state==farsight.STREAM_STATE_READY:
|
||||
if state == farsight.STREAM_STATE_READY:
|
||||
self.negotiated = True
|
||||
#TODO: farsight.DIRECTION_BOTH only if senders='both'
|
||||
self.p2pstream.set_property('direction', farsight.DIRECTION_BOTH)
|
||||
self.session.content_negociated(self.media)
|
||||
#if not self.session.weinitiate: #FIXME: one more FIXME...
|
||||
# self.session.sendContentAccept(self.__content((xmpp.Node(
|
||||
# 'description', payload=self.iterCodecs()),)))
|
||||
|
@ -878,9 +882,10 @@ class ConnectionJingle(object):
|
|||
self.addJingle(jingle)
|
||||
jingle.addContent('voice', JingleVoIP(jingle))
|
||||
jingle.startSession()
|
||||
return jingle.sid
|
||||
|
||||
def getJingleSession(self, jid, sid):
|
||||
try:
|
||||
return self.__sessions[(jid, sid)]
|
||||
except KeyError:
|
||||
raise NoSuchSession
|
||||
return None
|
||||
|
|
|
@ -4443,15 +4443,16 @@ class GPGInfoWindow:
|
|||
class VoIPCallReceivedDialog(object):
|
||||
def __init__(self, account, contact_jid, sid):
|
||||
self.account = account
|
||||
self.jid = contact_jid
|
||||
self.fjid = contact_jid
|
||||
self.sid = sid
|
||||
|
||||
xml = gtkgui_helpers.get_glade('voip_call_received_dialog.glade')
|
||||
xml.signal_autoconnect(self)
|
||||
|
||||
contact = gajim.contacts.get_first_contact_from_jid(account, contact_jid)
|
||||
|
||||
jid = gajim.get_jid_without_resource(self.fjid)
|
||||
contact = gajim.contacts.get_first_contact_from_jid(account, jid)
|
||||
if contact and contact.name:
|
||||
contact_text = '%s (%s)' % (contact.name, contact_jid)
|
||||
contact_text = '%s (%s)' % (contact.name, jid)
|
||||
else:
|
||||
contact_text = contact_jid
|
||||
|
||||
|
@ -4463,12 +4464,29 @@ class VoIPCallReceivedDialog(object):
|
|||
dialog.show_all()
|
||||
|
||||
def on_voip_call_received_messagedialog_close(self, dialog):
|
||||
return self.on_voip_call_received_messagedialog_response(dialog, gtk.RESPONSE_NO)
|
||||
return self.on_voip_call_received_messagedialog_response(dialog,
|
||||
gtk.RESPONSE_NO)
|
||||
|
||||
def on_voip_call_received_messagedialog_response(self, dialog, response):
|
||||
# we've got response from user, either stop connecting or accept the call
|
||||
session = gajim.connections[self.account].getJingleSession(self.jid, self.sid)
|
||||
session = gajim.connections[self.account].getJingleSession(self.fjid,
|
||||
self.sid)
|
||||
if response==gtk.RESPONSE_YES:
|
||||
session.approveSession()
|
||||
jid = gajim.get_jid_without_resource(self.fjid)
|
||||
resource = gajim.get_resource_from_jid(self.fjid)
|
||||
ctrl = gajim.interface.msg_win_mgr.get_control(self.fjid, self.account)
|
||||
if not ctrl:
|
||||
ctrl = gajim.interface.msg_win_mgr.get_control(jid, self.account)
|
||||
if not ctrl:
|
||||
# open chat control
|
||||
contact = gajim.contacts.get_contact(self.account, jid, resource)
|
||||
if not contact:
|
||||
contact = gajim.contacts.get_contact(self.account, jid)
|
||||
if not contact:
|
||||
return
|
||||
ctrl = gajim.interface.new_chat(contact, self.account)
|
||||
ctrl.set_audio_state('connecting', self.sid)
|
||||
else: # response==gtk.RESPONSE_NO
|
||||
session.declineSession()
|
||||
|
||||
|
|
45
src/gajim.py
45
src/gajim.py
|
@ -2096,6 +2096,14 @@ class Interface:
|
|||
# unknown session type... it should be declined in common/jingle.py
|
||||
return
|
||||
|
||||
jid = gajim.get_jid_without_resource(peerjid)
|
||||
resource = gajim.get_resource_from_jid(peerjid)
|
||||
ctrl = self.msg_win_mgr.get_control(peerjid, account)
|
||||
if not ctrl:
|
||||
ctrl = self.msg_win_mgr.get_control(jid, account)
|
||||
if ctrl:
|
||||
ctrl.set_audio_state('connection_received', sid)
|
||||
|
||||
if helpers.allow_popup_window(account):
|
||||
dialogs.VoIPCallReceivedDialog(account, peerjid, sid)
|
||||
return
|
||||
|
@ -2113,6 +2121,40 @@ class Interface:
|
|||
notify.popup(event_type, peerjid, account, 'voip-incoming',
|
||||
path_to_image = path, title = event_type, text = txt)
|
||||
|
||||
def handle_event_jingle_connected(self, account, data):
|
||||
# ('JINGLE_CONNECTED', account, (peerjid, sid, media))
|
||||
peerjid, sid, media = data
|
||||
if media == 'audio':
|
||||
jid = gajim.get_jid_without_resource(peerjid)
|
||||
resource = gajim.get_resource_from_jid(peerjid)
|
||||
ctrl = self.msg_win_mgr.get_control(peerjid, account)
|
||||
if not ctrl:
|
||||
ctrl = self.msg_win_mgr.get_control(jid, account)
|
||||
if ctrl:
|
||||
ctrl.set_audio_state('connected', sid)
|
||||
|
||||
def handle_event_jingle_disconnected(self, account, data):
|
||||
# ('JINGLE_DISCONNECTED', account, (peerjid, sid))
|
||||
peerjid, sid = data
|
||||
jid = gajim.get_jid_without_resource(peerjid)
|
||||
resource = gajim.get_resource_from_jid(peerjid)
|
||||
ctrl = self.msg_win_mgr.get_control(peerjid, account)
|
||||
if not ctrl:
|
||||
ctrl = self.msg_win_mgr.get_control(jid, account)
|
||||
if ctrl:
|
||||
ctrl.set_audio_state('available', sid)
|
||||
|
||||
def handle_event_jingle_error(self, account, data):
|
||||
# ('JINGLE_ERROR', account, (peerjid, sid, reason))
|
||||
peerjid, sid, reason = data
|
||||
jid = gajim.get_jid_without_resource(peerjid)
|
||||
resource = gajim.get_resource_from_jid(peerjid)
|
||||
ctrl = self.msg_win_mgr.get_control(peerjid, account)
|
||||
if not ctrl:
|
||||
ctrl = self.msg_win_mgr.get_control(jid, account)
|
||||
if ctrl:
|
||||
ctrl.set_audio_state('error', reason=reason)
|
||||
|
||||
def handle_event_pep_config(self, account, data):
|
||||
# ('PEP_CONFIG', account, (node, form))
|
||||
if 'pep_services' in self.instances[account]:
|
||||
|
@ -2371,6 +2413,9 @@ class Interface:
|
|||
'PUBSUB_NODE_REMOVED': self.handle_event_pubsub_node_removed,
|
||||
'PUBSUB_NODE_NOT_REMOVED': self.handle_event_pubsub_node_not_removed,
|
||||
'JINGLE_INCOMING': self.handle_event_jingle_incoming,
|
||||
'JINGLE_CONNECTED': self.handle_event_jingle_connected,
|
||||
'JINGLE_DISCONNECTED': self.handle_event_jingle_disconnected,
|
||||
'JINGLE_ERROR': self.handle_event_jingle_error,
|
||||
}
|
||||
gajim.handlers = self.handlers
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue