Commit 91fa93b5 authored by Pierre-Luc Beaudoin's avatar Pierre-Luc Beaudoin
Browse files

Voice mail noitification

parent 6205ef49
...@@ -31,6 +31,22 @@ ...@@ -31,6 +31,22 @@
#include <glib/gprintf.h> #include <glib/gprintf.h>
#include <stdlib.h> #include <stdlib.h>
void
sflphone_notify_voice_mail (guint count)
{
if(count > 0)
{
gchar * message = g_new0(gchar, 50);
g_sprintf(message, "%d new voice mail%s", count, (count > 1? "s" : ""));
status_bar_message(message);
g_free(message);
}
else
{
status_bar_message("");
}
}
gboolean gboolean
sflphone_quit () sflphone_quit ()
{ {
...@@ -52,7 +68,6 @@ sflphone_quit () ...@@ -52,7 +68,6 @@ sflphone_quit ()
return quit; return quit;
} }
void void
sflphone_hold(call_t * c ) sflphone_hold(call_t * c )
{ {
...@@ -70,7 +85,6 @@ sflphone_ringing(call_t * c ) ...@@ -70,7 +85,6 @@ sflphone_ringing(call_t * c )
update_menus(); update_menus();
} }
/** Internal to actions: Fill account list */ /** Internal to actions: Fill account list */
void void
sflphone_fill_account_list() sflphone_fill_account_list()
......
...@@ -50,7 +50,7 @@ void sflphone_hang_up (); ...@@ -50,7 +50,7 @@ void sflphone_hang_up ();
void sflphone_on_hold (); void sflphone_on_hold ();
void sflphone_off_hold (); void sflphone_off_hold ();
call_t * sflphone_new_call(); call_t * sflphone_new_call();
void sflphone_notify_voice_mail (guint count);
/** /**
* Accept / dial the current call * Accept / dial the current call
......
...@@ -121,6 +121,7 @@ update_buttons () ...@@ -121,6 +121,7 @@ update_buttons ()
case CALL_STATE_DIALING: case CALL_STATE_DIALING:
gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), TRUE);
gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE);
gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE);
break; break;
case CALL_STATE_CURRENT: case CALL_STATE_CURRENT:
gtk_widget_show( hangupButton ); gtk_widget_show( hangupButton );
......
...@@ -69,7 +69,7 @@ voice_mail_cb (DBusGProxy *proxy, ...@@ -69,7 +69,7 @@ voice_mail_cb (DBusGProxy *proxy,
void * foo ) void * foo )
{ {
g_print ("%d Voice mail waiting! \n",nb); g_print ("%d Voice mail waiting! \n",nb);
sflphone_notify_voice_mail (nb);
} }
static void static void
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <calllist.h> #include <calllist.h>
#include <calltree.h> #include <calltree.h>
#include <dialpad.h> #include <dialpad.h>
#include <mainwindow.h>
#include <menus.h> #include <menus.h>
#include <screen.h> #include <screen.h>
#include <sliders.h> #include <sliders.h>
...@@ -30,10 +31,11 @@ ...@@ -30,10 +31,11 @@
/** Local variables */ /** Local variables */
GtkAccelGroup * accelGroup = NULL; GtkAccelGroup * accelGroup = NULL;
GtkWidget * window = NULL; GtkWidget * window = NULL;
GtkWidget * subvbox = NULL; GtkWidget * subvbox = NULL;
GtkWidget * dialpad = NULL; GtkWidget * dialpad = NULL;
gboolean showDialpad = FALSE; // true if the dialpad have been showned GtkWidget * statusBar = NULL;
gboolean showDialpad = FALSE; // true if the dialpad have been showned
/** /**
...@@ -153,8 +155,8 @@ create_main_window () ...@@ -153,8 +155,8 @@ create_main_window ()
gtk_box_pack_start (GTK_BOX (subvbox), widget, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_box_pack_start (GTK_BOX (subvbox), widget, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/);
/* Status bar */ /* Status bar */
widget = gtk_statusbar_new(); statusBar = gtk_statusbar_new();
gtk_box_pack_start (GTK_BOX (vbox), gtk_statusbar_new(), FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_box_pack_start (GTK_BOX (vbox), statusBar, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/);
gtk_container_add (GTK_CONTAINER (window), vbox); gtk_container_add (GTK_CONTAINER (window), vbox);
/* make sure that everything, window and label, are visible */ /* make sure that everything, window and label, are visible */
...@@ -216,6 +218,12 @@ main_window_dialpad(gboolean show){ ...@@ -216,6 +218,12 @@ main_window_dialpad(gboolean show){
gtk_container_remove(GTK_CONTAINER (subvbox), dialpad); gtk_container_remove(GTK_CONTAINER (subvbox), dialpad);
} }
showDialpad = show; showDialpad = show;
}
void
status_bar_message(const gchar * message)
{
gtk_statusbar_push(GTK_STATUSBAR(statusBar), 0, message);
} }
...@@ -42,4 +42,7 @@ void main_window_error_message(gchar * markup); ...@@ -42,4 +42,7 @@ void main_window_error_message(gchar * markup);
void main_window_warning_message(gchar * markup); void main_window_warning_message(gchar * markup);
void main_window_warning_message(gchar * markup); void main_window_warning_message(gchar * markup);
void status_bar_message(const gchar * message);
#endif #endif
...@@ -63,6 +63,7 @@ void update_menus() ...@@ -63,6 +63,7 @@ void update_menus()
case CALL_STATE_DIALING: case CALL_STATE_DIALING:
gtk_widget_set_sensitive( GTK_WIDGET(pickUpMenu), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(pickUpMenu), TRUE);
gtk_widget_set_sensitive( GTK_WIDGET(hangUpMenu), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(hangUpMenu), TRUE);
gtk_widget_set_sensitive( GTK_WIDGET(newCallMenu),TRUE);
break; break;
case CALL_STATE_CURRENT: case CALL_STATE_CURRENT:
gtk_widget_set_sensitive( GTK_WIDGET(hangUpMenu), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(hangUpMenu), TRUE);
......
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