Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/cheese-window.vala b/src/cheese-window.vala
- index c9fa2c2..42614fb 100644
- --- a/src/cheese-window.vala
- +++ b/src/cheese-window.vala
- @@ -92,6 +92,7 @@ public class Cheese.MainWindow : Gtk.Window
- private Gtk.Action effects_page_prev_action;
- private Gtk.Action effects_page_next_action;
- private Gtk.Action share_action;
- + private Gtk.Action preferences_action;
- private Gtk.ActionGroup main_actions;
- private bool is_fullscreen;
- @@ -102,6 +103,7 @@ public class Cheese.MainWindow : Gtk.Window
- private bool is_camera_actions_sensitive;
- private bool action_cancelled;
- private bool is_command_line_startup;
- + private bool is_first_device = true;
- private Gtk.Button[] buttons;
- @@ -180,6 +182,7 @@ public class Cheese.MainWindow : Gtk.Window
- {
- if (event.button == 3)
- thumbnail_popup.popup (null, thumb_view, null, event.button, event.time);
- + share_action.set_sensitive (true);
- }
- else
- if (event.type == Gdk.EventType.2BUTTON_PRESS)
- @@ -1339,7 +1342,9 @@ public class Cheese.MainWindow : Gtk.Window
- "save_as",
- "move_to_trash",
- "delete",
- - "move_all_to_trash"};
- + "move_all_to_trash",
- + "wide_mode",
- + "fullscreen"};
- /* Gross hack because Vala's `in` operator doesn't really work */
- bool flag;
- @@ -1465,6 +1470,7 @@ public class Cheese.MainWindow : Gtk.Window
- effects_page_next_action = gtk_builder.get_object ("effects_page_next") as Gtk.Action;
- effects_page_prev_action = gtk_builder.get_object ("effects_page_prev") as Gtk.Action;
- share_action = gtk_builder.get_object ("share") as Gtk.Action;
- + preferences_action = gtk_builder.get_object ("preferences") as Gtk.Action;
- shareable_media = new Cheese.ShareableMedia (this);
- main_actions.pre_activate.connect(on_action_pre_activated);
- @@ -1577,6 +1583,7 @@ public class Cheese.MainWindow : Gtk.Window
- device,
- settings.get_int ("photo-x-resolution"),
- settings.get_int ("photo-y-resolution"));
- +
- try {
- camera.setup (device);
- }
- @@ -1588,6 +1595,9 @@ public class Cheese.MainWindow : Gtk.Window
- error_layer.show ();
- toggle_camera_actions_sensitivities (false);
- +
- + camera.notify["num-camera-devices"].connect(add_first_hotplug_device);
- +
- return;
- }
- @@ -1611,6 +1621,22 @@ public class Cheese.MainWindow : Gtk.Window
- camera.play ();
- }
- + private void add_first_hotplug_device ()
- + {
- + if (is_first_device) {
- + setup_camera (null);
- + video_preview.show ();
- + error_layer.hide ();
- +
- + toggle_camera_actions_sensitivities (true);
- + preferences_action.set_sensitive (true);
- + set_mode (MediaMode.PHOTO);
- + enable_mode_change ();
- +
- + is_first_device = false;
- + }
- + }
- +
- /**
- * Setup the thumbview thumbnail monitors.
- */
Add Comment
Please, Sign In to add comment