r3081 - trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src
abraxa at sita.openmoko.org
abraxa at sita.openmoko.org
Thu Oct 4 15:14:06 CEST 2007
Author: abraxa
Date: 2007-10-04 15:14:05 +0200 (Thu, 04 Oct 2007)
New Revision: 3081
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/guitools.c
trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/guitools.h
trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main.c
trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/playback.c
Log:
Make sure the error dialog is readable if gst-plugin-pulse is missing and exit gracefully afterwards
Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/guitools.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/guitools.c 2007-10-04 13:11:15 UTC (rev 3080)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/guitools.c 2007-10-04 13:14:05 UTC (rev 3081)
@@ -133,7 +133,7 @@
}
/**
- * Presents a simple modal error dialog to the user
+ * Presents a simple non-modal error dialog to the user
*/
void
error_dialog(gchar *message)
@@ -152,6 +152,25 @@
}
/**
+ * Presents a simple modal error dialog to the user
+ */
+void
+error_dialog_modal(gchar *message)
+{
+ GtkWidget *dialog;
+
+ dialog = gtk_message_dialog_new(0,
+ GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+ "%s", message);
+
+ // We don't want a title of "<unnamed>"
+ gtk_window_set_title(GTK_WINDOW(dialog), " ");
+
+ gtk_dialog_run(dialog);
+ gtk_widget_destroy(dialog);
+}
+
+/**
* Loads an image from disk and adds it to a given container, returning a reference to the image as well
*/
void
Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/guitools.h
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/guitools.h 2007-10-04 13:11:15 UTC (rev 3080)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/guitools.h 2007-10-04 13:14:05 UTC (rev 3081)
@@ -40,6 +40,7 @@
GtkWidget *button_create_with_image(gchar *image_name, GtkWidget **image, GCallback callback);
void error_dialog(gchar *message);
+void error_dialog_modal(gchar *message);
void container_add_image_with_ref(GtkContainer *container, gchar *image_name, GtkWidget **image);
void container_add_image(GtkContainer *container, gchar *image_name);
Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main.c 2007-10-04 13:11:15 UTC (rev 3080)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main.c 2007-10-04 13:14:05 UTC (rev 3081)
@@ -403,7 +403,7 @@
omp_session_init();
omp_config_init();
omp_window_create();
- omp_playback_init();
+ if (!omp_playback_init()) return EXIT_FAILURE;
omp_playlist_init();
omp_window_create_pages();
Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/playback.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/playback.c 2007-10-04 13:11:15 UTC (rev 3080)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/playback.c 2007-10-04 13:14:05 UTC (rev 3081)
@@ -110,7 +110,7 @@
if (!omp_gst_audiosink)
{
- error_dialog(_("Error: gstreamer failed to create the PulseAudio sink.\nPlease make sure gstreamer and its modules are properly installed (esp. gst-plugin-pulse)."));
+ error_dialog_modal(_("Error: gstreamer failed to create the PulseAudio sink.\nPlease make sure gstreamer and its modules are properly installed (esp. gst-plugin-pulse)."));
return FALSE;
}
@@ -120,7 +120,7 @@
if (!omp_gst_playbin)
{
- error_dialog(_("Error: gstreamer failed to initialize.\nPlease make sure gstreamer and its modules are properly installed (esp. gst-meta-audio)."));
+ error_dialog_modal(_("Error: gstreamer failed to initialize.\nPlease make sure gstreamer and its modules are properly installed (esp. gst-meta-audio)."));
return FALSE;
}
More information about the commitlog
mailing list