Skip to content
Snippets Groups Projects
Commit a98b6ce1 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Status bar message displays the account type and alias

parent 5e0f83a6
Branches
Tags
No related merge requests found
...@@ -52,15 +52,26 @@ sflphone_notify_voice_mail (guint count) ...@@ -52,15 +52,26 @@ sflphone_notify_voice_mail (guint count)
g_sprintf(message, _("%d new voice mails"), count); g_sprintf(message, _("%d new voice mails"), count);
else else
g_sprintf(message, _("%d new voice mail"), count); g_sprintf(message, _("%d new voice mail"), count);
status_bar_message(message); status_bar_message_add(message, __MSG_VOICE_MAILS);
g_free(message); g_free(message);
} }
else
{
status_bar_message("");
} }
void
status_bar_display_account( call_t* c)
{
gchar* msg = malloc(100);
account_t* acc;
if(c->accountID != NULL)
acc = account_list_get_by_id(c->accountID);
else
acc = account_list_get_by_id( account_list_get_default());
sprintf( msg , "%s account: %s" , g_hash_table_lookup( acc->properties , ACCOUNT_TYPE) , g_hash_table_lookup( acc->properties , ACCOUNT_ALIAS));
status_bar_message_add( msg , __MSG_ACCOUNT_DEFAULT);
g_free(msg);
} }
gboolean gboolean
sflphone_quit () sflphone_quit ()
{ {
...@@ -98,6 +109,7 @@ sflphone_ringing(call_t * c ) ...@@ -98,6 +109,7 @@ sflphone_ringing(call_t * c )
c->state = CALL_STATE_RINGING; c->state = CALL_STATE_RINGING;
update_call_tree(c); update_call_tree(c);
update_menus(); update_menus();
status_bar_message_add(" Call Processing ..." , __MSG_CALLING);
} }
void void
...@@ -156,6 +168,7 @@ sflphone_fill_account_list() ...@@ -156,6 +168,7 @@ sflphone_fill_account_list()
} }
toolbar_update_buttons(); toolbar_update_buttons();
} }
gboolean gboolean
...@@ -196,7 +209,7 @@ sflphone_hang_up() ...@@ -196,7 +209,7 @@ sflphone_hang_up()
dbus_hang_up (selectedCall); dbus_hang_up (selectedCall);
break; break;
case CALL_STATE_INCOMING: case CALL_STATE_INCOMING:
status_tray_icon_blink(); status_tray_icon_blink( FALSE );
dbus_refuse (selectedCall); dbus_refuse (selectedCall);
break; break;
case CALL_STATE_TRANSFERT: case CALL_STATE_TRANSFERT:
...@@ -222,7 +235,7 @@ sflphone_pick_up() ...@@ -222,7 +235,7 @@ sflphone_pick_up()
sflphone_place_call (selectedCall); sflphone_place_call (selectedCall);
break; break;
case CALL_STATE_INCOMING: case CALL_STATE_INCOMING:
status_tray_icon_blink(); status_tray_icon_blink( FALSE );
dbus_accept (selectedCall); dbus_accept (selectedCall);
break; break;
case CALL_STATE_HOLD: case CALL_STATE_HOLD:
...@@ -303,6 +316,8 @@ sflphone_current( call_t * c ) ...@@ -303,6 +316,8 @@ sflphone_current( call_t * c )
c->state = CALL_STATE_CURRENT; c->state = CALL_STATE_CURRENT;
update_call_tree(c); update_call_tree(c);
update_menus(); update_menus();
status_bar_message_remove(__MSG_CALLING);
status_bar_message_remove(__MSG_INCOMING_CALL);
} }
void void
...@@ -463,10 +478,12 @@ sflphone_keypad( guint keyval, gchar * key) ...@@ -463,10 +478,12 @@ sflphone_keypad( guint keyval, gchar * key)
{ {
case 65293: /* ENTER */ case 65293: /* ENTER */
case 65421: /* ENTER numpad */ case 65421: /* ENTER numpad */
status_tray_icon_blink( FALSE );
status_bar_display_account(c);
dbus_accept(c); dbus_accept(c);
break; break;
case 65307: /* ESCAPE */ case 65307: /* ESCAPE */
status_tray_icon_blink(); status_tray_icon_blink( FALSE );
dbus_refuse(c); dbus_refuse(c);
break; break;
} }
...@@ -542,6 +559,7 @@ sflphone_keypad( guint keyval, gchar * key) ...@@ -542,6 +559,7 @@ sflphone_keypad( guint keyval, gchar * key)
void void
sflphone_place_call ( call_t * c ) sflphone_place_call ( call_t * c )
{ {
status_bar_display_account(c);
if(c->state == CALL_STATE_DIALING) if(c->state == CALL_STATE_DIALING)
{ {
account_t * account; account_t * account;
......
...@@ -30,6 +30,12 @@ ...@@ -30,6 +30,12 @@
#include <accountlist.h> #include <accountlist.h>
#include <codeclist.h> #include <codeclist.h>
#define __MSG_INCOMING_CALL 0
#define __MSG_CALLING 1
#define __MSG_VOICE_MAILS 2
#define __MSG_ACCOUNT_DEFAULT 3
/** @file actions.h /** @file actions.h
* @brief General functions that change the state of the application. * @brief General functions that change the state of the application.
* All of these functions are called when dbus signals are triggered. Exceptions * All of these functions are called when dbus signals are triggered. Exceptions
......
...@@ -54,8 +54,9 @@ incoming_call_cb (DBusGProxy *proxy, ...@@ -54,8 +54,9 @@ incoming_call_cb (DBusGProxy *proxy,
c->from = g_strdup(from); c->from = g_strdup(from);
c->state = CALL_STATE_INCOMING; c->state = CALL_STATE_INCOMING;
status_tray_icon_blink(); status_tray_icon_blink( TRUE );
sflphone_incoming_call (c); sflphone_incoming_call (c);
status_bar_message_add(_("Incoming Call ... ") , __MSG_INCOMING_CALL);
} }
...@@ -364,6 +365,8 @@ dbus_accept (const call_t * c) ...@@ -364,6 +365,8 @@ dbus_accept (const call_t * c)
void void
dbus_refuse (const call_t * c) dbus_refuse (const call_t * c)
{ {
// Remove the account message from the status bar stack
status_bar_message_remove( __MSG_ACCOUNT_DEFAULT );
GError *error = NULL; GError *error = NULL;
org_sflphone_SFLphone_CallManager_refuse ( callManagerProxy, c->callID, &error); org_sflphone_SFLphone_CallManager_refuse ( callManagerProxy, c->callID, &error);
if (error) if (error)
......
...@@ -265,8 +265,16 @@ main_window_callinfo(gboolean show, call_t* current) ...@@ -265,8 +265,16 @@ main_window_callinfo(gboolean show, call_t* current)
} }
void void
status_bar_message(const gchar * message) status_bar_message_add(const gchar * message, guint id)
{ {
gtk_statusbar_push(GTK_STATUSBAR(statusBar), 0, message); gtk_statusbar_push(GTK_STATUSBAR(statusBar), id, message);
} }
void
status_bar_message_remove(guint id)
{
gtk_statusbar_pop(GTK_STATUSBAR(statusBar), id);
}
...@@ -43,6 +43,7 @@ void main_window_warning_message(gchar * markup); ...@@ -43,6 +43,7 @@ void main_window_warning_message(gchar * markup);
void main_window_info_message(gchar * markup); void main_window_info_message(gchar * markup);
void status_bar_message(const gchar * message); void status_bar_message_add(const gchar * message , guint id);
void status_bar_message_remove(guint id);
#endif #endif
...@@ -117,7 +117,7 @@ show_status_icon() ...@@ -117,7 +117,7 @@ show_status_icon()
} }
void void
status_tray_icon_blink( ) status_tray_icon_blink( gboolean active )
{ {
gtk_status_icon_set_blinking( status , !gtk_status_icon_get_blinking( status ) ); gtk_status_icon_set_blinking( status , active );
} }
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
*/ */
void show_status_icon(); void show_status_icon();
void status_icon_unminimize(); void status_icon_unminimize();
void status_tray_icon_blink(); void status_tray_icon_blink( gboolean active );
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment