Commit a98b6ce1 authored by Emmanuel Milou's avatar Emmanuel Milou

Status bar message displays the account type and alias

parent 5e0f83a6
......@@ -52,15 +52,26 @@ sflphone_notify_voice_mail (guint count)
g_sprintf(message, _("%d new voice mails"), count);
else
g_sprintf(message, _("%d new voice mail"), count);
status_bar_message(message);
status_bar_message_add(message, __MSG_VOICE_MAILS);
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
sflphone_quit ()
{
......@@ -98,6 +109,7 @@ sflphone_ringing(call_t * c )
c->state = CALL_STATE_RINGING;
update_call_tree(c);
update_menus();
status_bar_message_add(" Call Processing ..." , __MSG_CALLING);
}
void
......@@ -156,6 +168,7 @@ sflphone_fill_account_list()
}
toolbar_update_buttons();
}
gboolean
......@@ -196,7 +209,7 @@ sflphone_hang_up()
dbus_hang_up (selectedCall);
break;
case CALL_STATE_INCOMING:
status_tray_icon_blink();
status_tray_icon_blink( FALSE );
dbus_refuse (selectedCall);
break;
case CALL_STATE_TRANSFERT:
......@@ -222,7 +235,7 @@ sflphone_pick_up()
sflphone_place_call (selectedCall);
break;
case CALL_STATE_INCOMING:
status_tray_icon_blink();
status_tray_icon_blink( FALSE );
dbus_accept (selectedCall);
break;
case CALL_STATE_HOLD:
......@@ -303,6 +316,8 @@ sflphone_current( call_t * c )
c->state = CALL_STATE_CURRENT;
update_call_tree(c);
update_menus();
status_bar_message_remove(__MSG_CALLING);
status_bar_message_remove(__MSG_INCOMING_CALL);
}
void
......@@ -463,10 +478,12 @@ sflphone_keypad( guint keyval, gchar * key)
{
case 65293: /* ENTER */
case 65421: /* ENTER numpad */
status_tray_icon_blink( FALSE );
status_bar_display_account(c);
dbus_accept(c);
break;
case 65307: /* ESCAPE */
status_tray_icon_blink();
status_tray_icon_blink( FALSE );
dbus_refuse(c);
break;
}
......@@ -542,6 +559,7 @@ sflphone_keypad( guint keyval, gchar * key)
void
sflphone_place_call ( call_t * c )
{
status_bar_display_account(c);
if(c->state == CALL_STATE_DIALING)
{
account_t * account;
......
......@@ -30,6 +30,12 @@
#include <accountlist.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
* @brief General functions that change the state of the application.
* All of these functions are called when dbus signals are triggered. Exceptions
......
......@@ -54,8 +54,9 @@ incoming_call_cb (DBusGProxy *proxy,
c->from = g_strdup(from);
c->state = CALL_STATE_INCOMING;
status_tray_icon_blink();
status_tray_icon_blink( TRUE );
sflphone_incoming_call (c);
status_bar_message_add(_("Incoming Call ... ") , __MSG_INCOMING_CALL);
}
......@@ -364,6 +365,8 @@ dbus_accept (const call_t * c)
void
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;
org_sflphone_SFLphone_CallManager_refuse ( callManagerProxy, c->callID, &error);
if (error)
......
......@@ -265,8 +265,16 @@ main_window_callinfo(gboolean show, call_t* current)
}
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);
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
......@@ -117,7 +117,7 @@ show_status_icon()
}
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 @@
*/
void show_status_icon();
void status_icon_unminimize();
void status_tray_icon_blink();
void status_tray_icon_blink( gboolean active );
#endif
Markdown is supported
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