From 116118279341b7f063937299e7ee9db032b663d6 Mon Sep 17 00:00:00 2001 From: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> Date: Mon, 17 Mar 2008 15:26:40 -0400 Subject: [PATCH] Client error handling - Notify if no audio codecs have been found at startup The client receives almost no warnings or errors notification. This should be improved If no audio codecs have been found, a window pops up and describe the error. Then the GTK kills the daemon and quits. --- sflphone-gtk/src/Makefile.am | 3 ++- sflphone-gtk/src/actions.c | 9 ++++++++- sflphone-gtk/src/mainwindow.h | 2 +- sflphone-gtk/src/menus.c | 3 --- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/sflphone-gtk/src/Makefile.am b/sflphone-gtk/src/Makefile.am index 9c2fc02c5f..eeaa1392ff 100644 --- a/sflphone-gtk/src/Makefile.am +++ b/sflphone-gtk/src/Makefile.am @@ -28,4 +28,5 @@ sflphone_gtk_LDADD = $(DEPS_LIBS) AM_CPPFLAGS = $(DEPS_CFLAGS) \ -DICONS_DIR=\""$(datadir)/sflphone"\" \ - -DICON_DIR=\""$(datadir)/pixmaps"\" + -DICON_DIR=\""$(datadir)/pixmaps"\" \ + -DCODECS_DIR=\""$(libdir)/sflphone/codecs"\" diff --git a/sflphone-gtk/src/actions.c b/sflphone-gtk/src/actions.c index 37dfea4751..0ec2ae1e8a 100644 --- a/sflphone-gtk/src/actions.c +++ b/sflphone-gtk/src/actions.c @@ -619,5 +619,12 @@ sflphone_fill_codec_list() codec_list_add(c); } } + if( codec_list_get_size() == 0) { + gchar* markup = malloc(1000); + sprintf(markup , "<b>Error: No audio codecs found.\n\n</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</b> directory in your home( <i>%s</i> )", CODECS_DIR , g_get_home_dir()); + main_window_error_message( markup ); + g_free( markup ); + dbus_unregister(getpid()); + exit(0); + } } - diff --git a/sflphone-gtk/src/mainwindow.h b/sflphone-gtk/src/mainwindow.h index a1ec85f86c..318f078d96 100644 --- a/sflphone-gtk/src/mainwindow.h +++ b/sflphone-gtk/src/mainwindow.h @@ -41,7 +41,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_info_message(gchar * markup); void status_bar_message(const gchar * message); diff --git a/sflphone-gtk/src/menus.c b/sflphone-gtk/src/menus.c index e95bb18e9f..6a9540ed00 100644 --- a/sflphone-gtk/src/menus.c +++ b/sflphone-gtk/src/menus.c @@ -106,11 +106,8 @@ help_about ( void * foo) "Julien Plissonneau Duquene <julien.plissonneau.duquene@savoirfairelinux.com>", "Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>", "Pierre-Luc Beaudoin <pierre-luc@squidy.info>", - "Imran Akbar", "Jean-Philippe Barrette-LaPierre", "Laurielle Lea", - "Mikael Magnusson", - "Sherry Yang", NULL}; gchar *artists[] = { "Pierre-Luc Beaudoin <pierre-luc@squidy.info>", -- GitLab