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

Voice mail noitification

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