[cheese] Split UI setup into UI Setup and camera setup. Shows Window as soon as UI is setup.
- From: Yuvaraj Pandian <yuvipanda src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese] Split UI setup into UI Setup and camera setup. Shows Window as soon as UI is setup.
- Date: Sat, 31 Jul 2010 08:08:40 +0000 (UTC)
commit 1a6c2a56d89a140d9d7ac0323e5f177a13515bab
Author: Yuvaraj Pandian T <yuvipanda gmail com>
Date: Sat Jul 31 13:37:07 2010 +0530
Split UI setup into UI Setup and camera setup. Shows Window as soon as UI is setup.
Slightly faster time-to-window-visible
src/cheese-main.vala | 2 +-
src/cheese-window.vala | 22 +++++++++++++---------
2 files changed, 14 insertions(+), 10 deletions(-)
---
diff --git a/src/cheese-main.vala b/src/cheese-main.vala
index 4772518..773b590 100644
--- a/src/cheese-main.vala
+++ b/src/cheese-main.vala
@@ -115,7 +115,7 @@ public class Cheese.Main
main_window.setup_ui ();
main_window.destroy.connect (Gtk.main_quit);
main_window.show_all ();
-
+ main_window.setup_camera ();
Gtk.main ();
return 0;
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index 7d7f495..f92fdf8 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -679,6 +679,7 @@ public class Cheese.MainWindow : Gtk.Window
}
current_effects_grid = effects_grids[number];
viewport_layout.add ((Clutter.Actor)current_effects_grid);
+ this.current_effects_grid.set_size (viewport.width, viewport.height);
for (int i = 0; i < effects_manager.effects.size - 1; i++)
{
@@ -699,7 +700,6 @@ public class Cheese.MainWindow : Gtk.Window
}
}
setup_effects_page_switch_sensitivity ();
- this.current_effects_grid.set_size (viewport.width, viewport.height);
}
private void setup_effects_page_switch_sensitivity ()
@@ -870,11 +870,6 @@ public class Cheese.MainWindow : Gtk.Window
viewport.add_actor (background_layer);
viewport_layout.set_layout_manager (viewport_layout_manager);
- camera = new Camera (video_preview,
- conf.gconf_prop_camera,
- conf.gconf_prop_x_resolution,
- conf.gconf_prop_y_resolution);
-
viewport.add_actor (viewport_layout);
viewport.allocation_changed.connect (on_stage_resize);
@@ -899,6 +894,18 @@ public class Cheese.MainWindow : Gtk.Window
* changed, do it manually */
if (!conf.gconf_prop_wide_mode) wide_mode_action.toggled ();
+
+ set_mode (MediaMode.PHOTO);
+ setup_effects_selector ();
+ }
+
+ public void setup_camera ()
+ {
+ camera = new Camera (video_preview,
+ conf.gconf_prop_camera,
+ conf.gconf_prop_x_resolution,
+ conf.gconf_prop_y_resolution);
+
try {
camera.setup (conf.gconf_prop_camera);
}
@@ -946,9 +953,6 @@ public class Cheese.MainWindow : Gtk.Window
return;
}
-
- set_mode (MediaMode.PHOTO);
- setup_effects_selector ();
camera.play ();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]