[cheese/capsrework] Use cheese-no-camera image when there is no device



commit 82bf018b47b94a039ee07d58c948509265186cf6
Author: Filippo Argiolas <filippo argiolas gmail com>
Date:   Mon Dec 14 19:55:33 2009 +0100

    Use cheese-no-camera image when there is no device
    
    Use cheese-no-camera if available, didn't add it to the tree yet since
    it still lacks licence and copyright data from the author.

 src/cheese-window.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/cheese-window.c b/src/cheese-window.c
index 95f72bb..9de0d62 100644
--- a/src/cheese-window.c
+++ b/src/cheese-window.c
@@ -197,9 +197,14 @@ cheese_window_load_pixbuf (GtkWidget *widget,
   GdkPixbuf *pixbuf;
 
   theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget));
-  //FIXME special case "no-webcam" and actually use the icon_name
-  pixbuf = gtk_icon_theme_load_icon (theme, "error",
-				     size, 0, error);
+  if (!gtk_icon_theme_has_icon (theme, icon_name)) {
+    pixbuf = gtk_icon_theme_load_icon (theme, "error",
+                                       size, 0, error);
+  }
+  else {
+    pixbuf = gtk_icon_theme_load_icon (theme, icon_name,
+                                       size, 0, error);
+  }
   return pixbuf;
 }
 
@@ -2126,8 +2131,10 @@ setup_camera (CheeseWindow *cheese_window)
   if (error != NULL)
   {
     if (error->code == CHEESE_CAMERA_ERROR_NO_DEVICE) {
+      gdk_threads_enter ();
       gtk_spinner_stop (GTK_SPINNER (cheese_window->throbber));
-      cheese_window_set_problem_page (cheese_window, "no-webcam");
+      cheese_window_set_problem_page (cheese_window, "cheese-no-camera");
+      gdk_threads_leave ();
       return;
     }
     GtkWidget *dialog;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]