Commit 166dac9e authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #6860: refactor uimanager, also fixes #6865

More pervasive changes were just to fix "transfert" typo
parent b5637b1a
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
</arg> </arg>
</method> </method>
<method name="transfert" tp:name-for-bindings="transfert"> <method name="transfer" tp:name-for-bindings="transfer">
<tp:docstring> <tp:docstring>
Transfer a call to given phone number. Transfer a call to given phone number.
</tp:docstring> </tp:docstring>
......
...@@ -167,9 +167,9 @@ CallManager::unhold (const std::string& callID) ...@@ -167,9 +167,9 @@ CallManager::unhold (const std::string& callID)
} }
void void
CallManager::transfert (const std::string& callID, const std::string& to) CallManager::transfer (const std::string& callID, const std::string& to)
{ {
_debug ("CallManager::transfert received"); _debug ("CallManager::transfer received");
Manager::instance().transferCall (callID, to); Manager::instance().transferCall (callID, to);
} }
......
...@@ -80,7 +80,7 @@ class CallManager ...@@ -80,7 +80,7 @@ class CallManager
void hangUp (const std::string& callID); void hangUp (const std::string& callID);
void hold (const std::string& callID); void hold (const std::string& callID);
void unhold (const std::string& callID); void unhold (const std::string& callID);
void transfert (const std::string& callID, const std::string& to); void transfer (const std::string& callID, const std::string& to);
void attendedTransfer(const std::string& transferID, const std::string& targetID); void attendedTransfer(const std::string& transferID, const std::string& targetID);
std::map< std::string, std::string > getCallDetails (const std::string& callID); std::map< std::string, std::string > getCallDetails (const std::string& callID);
std::vector< std::string > getCallList (void); std::vector< std::string > getCallList (void);
......
...@@ -3,7 +3,7 @@ icondir = $(datadir)/pixmaps ...@@ -3,7 +3,7 @@ icondir = $(datadir)/pixmaps
icon_DATA = sflphone.svg icon_DATA = sflphone.svg
buttons_DATA = current.svg \ buttons_DATA = current.svg \
transfert.svg \ transfer.svg \
hold.svg \ hold.svg \
unhold.svg \ unhold.svg \
refuse.svg \ refuse.svg \
......
...@@ -416,7 +416,7 @@ sflphone_hang_up() ...@@ -416,7 +416,7 @@ sflphone_hang_up()
DEBUG ("from sflphone_hang_up : "); DEBUG ("from sflphone_hang_up : ");
stop_notification(); stop_notification();
break; break;
case CALL_STATE_TRANSFERT: case CALL_STATE_TRANSFER:
dbus_hang_up (selectedCall); dbus_hang_up (selectedCall);
call_remove_all_errors (selectedCall); call_remove_all_errors (selectedCall);
time (&selectedCall->_time_stop); time (&selectedCall->_time_stop);
...@@ -467,8 +467,8 @@ sflphone_pick_up() ...@@ -467,8 +467,8 @@ sflphone_pick_up()
dbus_accept (selectedCall); dbus_accept (selectedCall);
stop_notification(); stop_notification();
break; break;
case CALL_STATE_TRANSFERT: case CALL_STATE_TRANSFER:
dbus_transfert (selectedCall); dbus_transfer (selectedCall);
time (&selectedCall->_time_stop); time (&selectedCall->_time_stop);
calltree_remove_call(current_calls, selectedCall, NULL); calltree_remove_call(current_calls, selectedCall, NULL);
calllist_remove_call(current_calls, selectedCall->_callID); calllist_remove_call(current_calls, selectedCall->_callID);
...@@ -574,12 +574,12 @@ sflphone_record (callable_obj_t * c) ...@@ -574,12 +574,12 @@ sflphone_record (callable_obj_t * c)
} }
void void
sflphone_set_transfert() sflphone_set_transfer()
{ {
callable_obj_t * c = calltab_get_selected_call (current_calls); callable_obj_t * c = calltab_get_selected_call (current_calls);
if (c) { if (c) {
c->_state = CALL_STATE_TRANSFERT; c->_state = CALL_STATE_TRANSFER;
g_free(c->_trsft_to); g_free(c->_trsft_to);
c->_trsft_to = g_strdup (""); c->_trsft_to = g_strdup ("");
calltree_update_call (current_calls, c, NULL); calltree_update_call (current_calls, c, NULL);
...@@ -589,7 +589,7 @@ sflphone_set_transfert() ...@@ -589,7 +589,7 @@ sflphone_set_transfert()
} }
void void
sflphone_unset_transfert() sflphone_unset_transfer()
{ {
callable_obj_t * c = calltab_get_selected_call (current_calls); callable_obj_t * c = calltab_get_selected_call (current_calls);
...@@ -643,7 +643,7 @@ void ...@@ -643,7 +643,7 @@ void
process_dialing (callable_obj_t *c, guint keyval, gchar *key) process_dialing (callable_obj_t *c, guint keyval, gchar *key)
{ {
// We stop the tone // We stop the tone
if (!*c->_peer_number && c->_state != CALL_STATE_TRANSFERT) if (!*c->_peer_number && c->_state != CALL_STATE_TRANSFER)
dbus_start_tone (FALSE, 0); dbus_start_tone (FALSE, 0);
switch (keyval) { switch (keyval) {
...@@ -655,7 +655,7 @@ process_dialing (callable_obj_t *c, guint keyval, gchar *key) ...@@ -655,7 +655,7 @@ process_dialing (callable_obj_t *c, guint keyval, gchar *key)
sflphone_hang_up (); sflphone_hang_up ();
break; break;
case GDK_BackSpace: case GDK_BackSpace:
if (c->_state == CALL_STATE_TRANSFERT) { if (c->_state == CALL_STATE_TRANSFER) {
truncate_last_char(&c->_trsft_to); truncate_last_char(&c->_trsft_to);
calltree_update_call (current_calls, c, NULL); calltree_update_call (current_calls, c, NULL);
} else { } else {
...@@ -678,7 +678,7 @@ process_dialing (callable_obj_t *c, guint keyval, gchar *key) ...@@ -678,7 +678,7 @@ process_dialing (callable_obj_t *c, guint keyval, gchar *key)
if (keyval < 127 /* ascii */ || if (keyval < 127 /* ascii */ ||
(keyval >= GDK_Mode_switch && keyval <= GDK_KP_9) /* num keypad */) { (keyval >= GDK_Mode_switch && keyval <= GDK_KP_9) /* num keypad */) {
if (c->_state == CALL_STATE_TRANSFERT) { if (c->_state == CALL_STATE_TRANSFER) {
gchar *new_trsft = g_strconcat (c->_trsft_to, key, NULL); gchar *new_trsft = g_strconcat (c->_trsft_to, key, NULL);
g_free (c->_trsft_to); g_free (c->_trsft_to);
c->_trsft_to = new_trsft; c->_trsft_to = new_trsft;
...@@ -775,19 +775,19 @@ sflphone_keypad (guint keyval, gchar * key) ...@@ -775,19 +775,19 @@ sflphone_keypad (guint keyval, gchar * key)
} }
break; break;
case CALL_STATE_TRANSFERT: case CALL_STATE_TRANSFER:
switch (keyval) { switch (keyval) {
case GDK_Return: case GDK_Return:
case GDK_KP_Enter: case GDK_KP_Enter:
dbus_transfert (c); dbus_transfer (c);
time (&c->_time_stop); time (&c->_time_stop);
calltree_remove_call(current_calls, c, NULL); calltree_remove_call(current_calls, c, NULL);
break; break;
case GDK_Escape: case GDK_Escape:
sflphone_unset_transfert (); sflphone_unset_transfer ();
break; break;
default: // When a call is on transfert, typing new numbers will add it to c->_peer_number default: // When a call is on transfer, typing new numbers will add it to c->_peer_number
process_dialing (c, keyval, key); process_dialing (c, keyval, key);
break; break;
} }
......
...@@ -93,12 +93,12 @@ void sflphone_notify_voice_mail (const gchar* accountID , guint count); ...@@ -93,12 +93,12 @@ void sflphone_notify_voice_mail (const gchar* accountID , guint count);
* Prepare SFLphone to transfer a call and wait for the user to dial the number to transfer to * Prepare SFLphone to transfer a call and wait for the user to dial the number to transfer to
* Put the selected call in Transfer state * Put the selected call in Transfer state
*/ */
void sflphone_set_transfert(); void sflphone_set_transfer();
/** /**
* Cancel the transfer and puts back the selected call to Current state * Cancel the transfer and puts back the selected call to Current state
*/ */
void sflphone_unset_transfert(); void sflphone_unset_transfer();
/** /**
* Accept / dial the current call * Accept / dial the current call
......
...@@ -80,7 +80,7 @@ typedef enum { ...@@ -80,7 +80,7 @@ typedef enum {
CALL_STATE_HOLD, CALL_STATE_HOLD,
CALL_STATE_FAILURE, CALL_STATE_FAILURE,
CALL_STATE_BUSY, CALL_STATE_BUSY,
CALL_STATE_TRANSFERT, CALL_STATE_TRANSFER,
CALL_STATE_RECORD, CALL_STATE_RECORD,
} call_state_t; } call_state_t;
......
...@@ -721,21 +721,21 @@ select_audio_manager (void) ...@@ -721,21 +721,21 @@ select_audio_manager (void)
if (!must_show_alsa_conf() && !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (pulse))) { if (!must_show_alsa_conf() && !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (pulse))) {
dbus_set_audio_manager (ALSA_API_STR); dbus_set_audio_manager (ALSA_API_STR);
alsabox = alsa_box(); alsabox = alsa_box();
gtk_container_add (GTK_CONTAINER (alsa_conf) , alsabox); gtk_container_add (GTK_CONTAINER(alsa_conf), alsabox);
gtk_widget_show (alsa_conf); gtk_widget_show(alsa_conf);
gtk_widget_set_sensitive (GTK_WIDGET (alsa_conf), TRUE); gtk_widget_set_sensitive (alsa_conf, TRUE);
gtk_action_set_sensitive (GTK_ACTION (volumeToggle), TRUE); gtk_action_set_sensitive (volumeToggle_, TRUE);
} else if (must_show_alsa_conf() && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (pulse))) { } else if (must_show_alsa_conf() && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (pulse))) {
dbus_set_audio_manager (PULSEAUDIO_API_STR); dbus_set_audio_manager (PULSEAUDIO_API_STR);
gtk_container_remove (GTK_CONTAINER (alsa_conf) , alsabox); gtk_container_remove (GTK_CONTAINER (alsa_conf) , alsabox);
gtk_widget_hide (alsa_conf); gtk_widget_hide(alsa_conf);
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (volumeToggle))) { if (gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(volumeToggle_))) {
main_window_volume_controls (FALSE); main_window_volume_controls(FALSE);
eel_gconf_set_integer (SHOW_VOLUME_CONTROLS, FALSE); eel_gconf_set_integer(SHOW_VOLUME_CONTROLS, FALSE);
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (volumeToggle), FALSE); gtk_toggle_action_set_active(GTK_TOGGLE_ACTION (volumeToggle_), FALSE);
} }
gtk_action_set_sensitive (GTK_ACTION (volumeToggle), FALSE); gtk_action_set_sensitive(volumeToggle_, FALSE);
} }
} }
......
...@@ -692,7 +692,7 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) ...@@ -692,7 +692,7 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent)
gchar * description = NULL; gchar * description = NULL;
gchar * audio_codec = call_get_audio_codec (c); gchar * audio_codec = call_get_audio_codec (c);
if (c->_state == CALL_STATE_TRANSFERT) if (c->_state == CALL_STATE_TRANSFER)
description = calltree_display_call_info (c, DISPLAY_TYPE_CALL_TRANSFER, ""); description = calltree_display_call_info (c, DISPLAY_TYPE_CALL_TRANSFER, "");
else { else {
if (c->_sas && display_sas && c->_srtp_state == SRTP_STATE_ZRTP_SAS_UNCONFIRMED && !c->_zrtp_confirmed) if (c->_sas && display_sas && c->_srtp_state == SRTP_STATE_ZRTP_SAS_UNCONFIRMED && !c->_zrtp_confirmed)
...@@ -727,8 +727,8 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) ...@@ -727,8 +727,8 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent)
case CALL_STATE_BUSY: case CALL_STATE_BUSY:
pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/busy.svg", NULL); pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/busy.svg", NULL);
break; break;
case CALL_STATE_TRANSFERT: case CALL_STATE_TRANSFER:
pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/transfert.svg", NULL); pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/transfer.svg", NULL);
break; break;
case CALL_STATE_RECORD: case CALL_STATE_RECORD:
pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/icon_rec.svg", NULL); pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/icon_rec.svg", NULL);
...@@ -1294,27 +1294,26 @@ void calltree_display (calltab_t *tab) ...@@ -1294,27 +1294,26 @@ void calltree_display (calltab_t *tab)
DEBUG ("CallTree: Display main tab"); DEBUG ("CallTree: Display main tab");
if (active_calltree==contacts) if (active_calltree==contacts)
gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) contactButton, FALSE); gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) contactButton_, FALSE);
else else
gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) historyButton, FALSE); gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) historyButton_, FALSE);
} }
/* case 2: we want to display the history */ /* case 2: we want to display the history */
else if (tab == history) { else if (tab == history) {
DEBUG ("ConferenceList: Display history tab"); DEBUG ("ConferenceList: Display history tab");
if (active_calltree == contacts)
gtk_toggle_tool_button_set_active((GtkToggleToolButton*) contactButton_, FALSE);
if (active_calltree==contacts) gtk_toggle_tool_button_set_active((GtkToggleToolButton*) historyButton_, TRUE);
gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) contactButton, FALSE);
gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) historyButton, TRUE);
} }
else if (tab==contacts) { else if (tab==contacts) {
DEBUG ("CallTree: Display contact tab"); DEBUG ("CallTree: Display contact tab");
if (active_calltree==history) if (active_calltree == history)
gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) historyButton, FALSE); gtk_toggle_tool_button_set_active((GtkToggleToolButton*) historyButton_, FALSE);
gtk_toggle_tool_button_set_active ( (GtkToggleToolButton*) contactButton, TRUE); gtk_toggle_tool_button_set_active((GtkToggleToolButton*) contactButton_, TRUE);
set_focus_on_addressbook_searchbar(); set_focus_on_addressbook_searchbar();
} }
...@@ -1392,7 +1391,7 @@ static void drag_end_cb (GtkWidget * widget UNUSED, GdkDragContext * context UNU ...@@ -1392,7 +1391,7 @@ static void drag_end_cb (GtkWidget * widget UNUSED, GdkDragContext * context UNU
calltree_selected_call->_state == CALL_STATE_INVALID || calltree_selected_call->_state == CALL_STATE_INVALID ||
calltree_selected_call->_state == CALL_STATE_FAILURE || calltree_selected_call->_state == CALL_STATE_FAILURE ||
calltree_selected_call->_state == CALL_STATE_BUSY || calltree_selected_call->_state == CALL_STATE_BUSY ||
calltree_selected_call->_state == CALL_STATE_TRANSFERT) { calltree_selected_call->_state == CALL_STATE_TRANSFER) {
DEBUG ("CallTree: Selected an invalid call"); DEBUG ("CallTree: Selected an invalid call");
...@@ -1412,7 +1411,7 @@ static void drag_end_cb (GtkWidget * widget UNUSED, GdkDragContext * context UNU ...@@ -1412,7 +1411,7 @@ static void drag_end_cb (GtkWidget * widget UNUSED, GdkDragContext * context UNU
calltree_dragged_call->_state == CALL_STATE_INVALID || calltree_dragged_call->_state == CALL_STATE_INVALID ||
calltree_dragged_call->_state == CALL_STATE_FAILURE || calltree_dragged_call->_state == CALL_STATE_FAILURE ||
calltree_dragged_call->_state == CALL_STATE_BUSY || calltree_dragged_call->_state == CALL_STATE_BUSY ||
calltree_dragged_call->_state == CALL_STATE_TRANSFERT) { calltree_dragged_call->_state == CALL_STATE_TRANSFER) {
DEBUG ("CallTree: Dragged on an invalid call"); DEBUG ("CallTree: Dragged on an invalid call");
......
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
</arg> </arg>
</method> </method>
<method name="transfert" tp:name-for-bindings="transfert"> <method name="transfer" tp:name-for-bindings="transfer">
<tp:docstring> <tp:docstring>
Transfer a call to given phone number. Transfer a call to given phone number.
</tp:docstring> </tp:docstring>
......
...@@ -835,13 +835,13 @@ dbus_hang_up_conference (const conference_obj_t * c) ...@@ -835,13 +835,13 @@ dbus_hang_up_conference (const conference_obj_t * c)
} }
void void
dbus_transfert (const callable_obj_t * c) dbus_transfer (const callable_obj_t * c)
{ {
GError *error = NULL; GError *error = NULL;
org_sflphone_SFLphone_CallManager_transfert (callManagerProxy, c->_callID, c->_trsft_to, &error); org_sflphone_SFLphone_CallManager_transfer (callManagerProxy, c->_callID, c->_trsft_to, &error);
if (error) { if (error) {
ERROR ("Failed to call transfert() on CallManager: %s", error->message); ERROR ("Failed to call transfer() on CallManager: %s", error->message);
g_error_free (error); g_error_free (error);
} }
} }
......
...@@ -79,7 +79,7 @@ void dbus_hang_up (const callable_obj_t * c); ...@@ -79,7 +79,7 @@ void dbus_hang_up (const callable_obj_t * c);
* CallManager - Transfer a call * CallManager - Transfer a call
* @param c The call to transfer * @param c The call to transfer
*/ */
void dbus_transfert (const callable_obj_t * c); void dbus_transfer (const callable_obj_t * c);
/** /**
* CallManager - Perform an attended transfer on two calls * CallManager - Perform an attended transfer on two calls
......
...@@ -116,7 +116,7 @@ toggle_pick_up_hang_up_callback () ...@@ -116,7 +116,7 @@ toggle_pick_up_hang_up_callback ()
if (selectedCall) { if (selectedCall) {
switch (selectedCall->_state) { switch (selectedCall->_state) {
case CALL_STATE_INCOMING: case CALL_STATE_INCOMING:
case CALL_STATE_TRANSFERT: case CALL_STATE_TRANSFER:
sflphone_pick_up (); sflphone_pick_up ();
break; break;
case CALL_STATE_DIALING: case CALL_STATE_DIALING:
......
This diff is collapsed.
...@@ -35,11 +35,9 @@ ...@@ -35,11 +35,9 @@
G_BEGIN_DECLS G_BEGIN_DECLS
guint holdConnId; //The hold_menu signal connection ID GtkWidget *historyButton_;
GtkWidget *contactButton_;
GtkWidget *historyButton; GtkAction *volumeToggle_;
GtkWidget *contactButton;
GtkAction *volumeToggle;
GtkUIManager *uimanager_new (void); GtkUIManager *uimanager_new (void);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment