summaryrefslogtreecommitdiff
path: root/components/music/nautilus-music-view.c
diff options
context:
space:
mode:
authorAndy Hertzfeld <andy@src.gnome.org>2000-09-29 07:59:43 +0000
committerAndy Hertzfeld <andy@src.gnome.org>2000-09-29 07:59:43 +0000
commit8c687879d803f4048003a7d61b0a1fdbbea827ea (patch)
treec944668a89ba75d1f4e1db4070555def9e9128c2 /components/music/nautilus-music-view.c
parent72b9121ec10cdc8d169c746f2bbc215e0ca77a61 (diff)
downloadnautilus-8c687879d803f4048003a7d61b0a1fdbbea827ea.tar.gz
fixed bug 3271, music view doesn't check if sound hardware is present, by
fixed bug 3271, music view doesn't check if sound hardware is present, by seeing if we can successfully open the sound device. Still need to fix sound previewing similarily
Diffstat (limited to 'components/music/nautilus-music-view.c')
-rw-r--r--components/music/nautilus-music-view.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/components/music/nautilus-music-view.c b/components/music/nautilus-music-view.c
index 1506c2ed5..18147ddcd 100644
--- a/components/music/nautilus-music-view.c
+++ b/components/music/nautilus-music-view.c
@@ -40,6 +40,7 @@
#include <libnautilus-extensions/nautilus-background.h>
#include <libnautilus-extensions/nautilus-directory-background.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
+#include <libnautilus-extensions/nautilus-gdk-extensions.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
#include <libnautilus-extensions/nautilus-glib-extensions.h>
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
@@ -845,7 +846,11 @@ play_current_file (NautilusMusicView *music_view, gboolean from_start)
char *song_filename, *temp_str, *song_uri;
GnomeVFSResult result;
GnomeVFSFileInfo file_info;
-
+
+ if (!music_view->details->sound_enabled) {
+ return;
+ }
+
play_mode = get_play_status();
gtk_clist_select_row (GTK_CLIST(music_view->details->song_list), music_view->details->selected_index, 0);
@@ -1106,7 +1111,7 @@ add_play_controls (NautilusMusicView *music_view)
GtkWidget *table;
GtkWidget *box;
GtkWidget *vbox, *hbox2;
- GtkWidget *button;
+ GtkWidget *button, *label;
GtkTooltips *tooltips;
tooltips = gtk_tooltips_new();
@@ -1173,8 +1178,9 @@ add_play_controls (NautilusMusicView *music_view)
button = gtk_button_new ();
gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltips), button, _("Previous"), NULL);
gtk_container_add (GTK_CONTAINER(button), box);
-
gtk_signal_connect (GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(prev_button_callback), music_view);
+ gtk_widget_set_sensitive (button, music_view->details->sound_enabled);
+
gtk_table_attach (GTK_TABLE(table), button, 0, 1, 1, 2, 0, 0, 0, 0);
gtk_button_set_relief (GTK_BUTTON(button), GTK_RELIEF_NORMAL);
gtk_widget_show (button);
@@ -1186,6 +1192,7 @@ add_play_controls (NautilusMusicView *music_view)
gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltips), button, _("Play"), NULL);
gtk_button_set_relief (GTK_BUTTON(button), GTK_RELIEF_NORMAL);
gtk_container_add (GTK_CONTAINER(button), box);
+ gtk_widget_set_sensitive (button, music_view->details->sound_enabled);
gtk_signal_connect (GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(play_button_callback), music_view);
gtk_table_attach (GTK_TABLE(table), button, 1, 2, 1, 2, 0, 0, 0, 0);
@@ -1198,6 +1205,7 @@ add_play_controls (NautilusMusicView *music_view)
gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltips), button, _("Pause"), NULL);
gtk_button_set_relief (GTK_BUTTON(button), GTK_RELIEF_NORMAL);
gtk_container_add (GTK_CONTAINER(button), box);
+ gtk_widget_set_sensitive (button, music_view->details->sound_enabled);
gtk_signal_connect (GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(pause_button_callback), music_view);
gtk_table_attach (GTK_TABLE(table), button, 2, 3, 1, 2, 0, 0, 0, 0);
@@ -1210,6 +1218,7 @@ add_play_controls (NautilusMusicView *music_view)
gtk_tooltips_set_tip (GTK_TOOLTIPS(tooltips), button, _("Stop"), NULL);
gtk_button_set_relief (GTK_BUTTON(button), GTK_RELIEF_NORMAL);
gtk_container_add (GTK_CONTAINER(button), box);
+ gtk_widget_set_sensitive (button, music_view->details->sound_enabled);
gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(stop_button_callback), music_view);
gtk_table_attach (GTK_TABLE(table), button, 3, 4, 1, 2, 0, 0, 0, 0);
@@ -1222,11 +1231,22 @@ add_play_controls (NautilusMusicView *music_view)
gtk_tooltips_set_tip(GTK_TOOLTIPS(tooltips), button, _("Next"), NULL);
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NORMAL);
gtk_container_add(GTK_CONTAINER(button), box);
+ gtk_widget_set_sensitive (button, music_view->details->sound_enabled);
gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(next_button_callback), music_view);
gtk_table_attach (GTK_TABLE(table), button, 4, 5, 1, 2, 0, 0, 0, 0);
gtk_widget_show(button);
+ /* display the "cant play message if necessary */
+
+ if (!music_view->details->sound_enabled) {
+ label = nautilus_label_new (_("No sound hardware detected!"));
+ nautilus_label_set_font_size (NAUTILUS_LABEL (label), 12);
+ nautilus_label_set_text_color (NAUTILUS_LABEL (label), NAUTILUS_RGB_COLOR_RED);
+ gtk_widget_show (label);
+ gtk_table_attach (GTK_TABLE(table), label, 0, 5, 3, 4, 0, 0, 0, 0);
+ }
+
gtk_widget_show(table);
}