Remove .gitignore do nothing is ignored.
[synfig.git] / synfig-studio / trunk / src / gtkmm / splash.cpp
index c3d1c85..fe87f01 100644 (file)
@@ -7,7 +7,7 @@
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
 **     Copyright (c) 2007 Chris Moore
-**     Copyright 2008 Paul Wise
+**     Copyright (c) 2008 Paul Wise
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
@@ -171,6 +171,8 @@ Splash::Splash():
                imagepath+="share";
                imagepath+=ETL_DIRECTORY_SEPARATOR;
                imagepath+="pixmaps";
+               imagepath+=ETL_DIRECTORY_SEPARATOR;
+               imagepath+="synfigstudio";
        }
        imagepath+=ETL_DIRECTORY_SEPARATOR;
 
@@ -181,8 +183,12 @@ Splash::Splash():
        splash_image->set_padding(0,0);
 
        // Get the image size
-       int image_w = splash_image->get_pixbuf()->get_width();
-       int image_h = splash_image->get_pixbuf()->get_height();
+       int image_w = 350; int image_h = 0;
+       Glib::RefPtr<Gdk::Pixbuf> pixbuf = splash_image->get_pixbuf();
+       if( pixbuf ){
+               image_w = pixbuf->get_width();
+               image_h = pixbuf->get_height();
+       }
 
        // Create the progress bar
        progressbar = manage(new class Gtk::ProgressBar());
@@ -195,7 +201,7 @@ Splash::Splash():
 
        // Create the Gtk::Fixed container and put all of the widgets into it
        Gtk::Fixed* fixed = manage(new class Gtk::Fixed());
-       fixed->put(*splash_image, 0, 0);
+       if( pixbuf ) fixed->put(*splash_image, 0, 0);
        fixed->put(*progressbar, 0, image_h+24);
        fixed->put(*tasklabel, 0, image_h);
 
@@ -211,11 +217,15 @@ Splash::Splash():
        set_resizable(false);
        set_type_hint(Gdk::WINDOW_TYPE_HINT_SPLASHSCREEN);
        set_auto_startup_notification(false);
-       set_icon_from_file(imagepath+"synfig_icon."+IMAGE_EXT);
+       try {
+               set_icon_from_file(imagepath+"synfig_icon."+IMAGE_EXT);
+       } catch(...) {
+               synfig::warning("Unable to open "+imagepath+"synfig_icon."+IMAGE_EXT);
+       }
        add(*frame);
 
        // show everything off
-       splash_image->show();
+       if( pixbuf ) splash_image->show();
        fixed->show();
        frame->show();