[cheese] Made app crash early if the GTKBUilder UI files are not found



commit 0b27289c21cd2c122d4b8419838f351f0dc6c61b
Author: Yuvi Panda <yuvipanda gmail com>
Date:   Sat Aug 7 15:21:07 2010 +0530

    Made app crash early if the GTKBUilder UI files are not found

 src/cheese-preferences.vala |    9 ++++++++-
 src/cheese-window.vala      |    3 +--
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/cheese-preferences.vala b/src/cheese-preferences.vala
index 588342b..ef592d7 100644
--- a/src/cheese-preferences.vala
+++ b/src/cheese-preferences.vala
@@ -50,7 +50,14 @@ public class Cheese.PreferencesDialog : GLib.Object
     this.conf   = conf;
 
     Gtk.Builder builder = new Gtk.Builder ();
-    builder.add_from_file (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "cheese-prefs.ui"));
+	try
+	{
+		builder.add_from_file (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "cheese-prefs.ui"));
+	}
+	catch (Error err)
+	{
+		error ("Error: %s", err.message);
+	}
 
     this.dialog = (Gtk.Dialog)builder.get_object ("cheese_prefs_dialog");
 
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index e712f33..6a53978 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -839,8 +839,7 @@ public class Cheese.MainWindow : Gtk.Window
       clutter_builder.load_from_file (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "cheese-viewport.json"));
     }catch (Error err)
     {
-      warning ("Error: %s\n", err.message);
-      return;
+		error ("Error: %s", err.message);
     }
 
     main_vbox                         = (Gtk.VBox)gtk_builder.get_object ("mainbox_normal");



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