[ease] [player] Hide the editor when playing (performance reasons)
- From: Nate Stedman <natesm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease] [player] Hide the editor when playing (performance reasons)
- Date: Sun, 25 Jul 2010 05:36:27 +0000 (UTC)
commit 1817109ab14d31bc6177a9f46dcd4e587f3714d7
Author: Nate Stedman <natesm gmail com>
Date: Sun Jul 25 01:35:59 2010 -0400
[player] Hide the editor when playing (performance reasons)
src/ease-editor-window.vala | 14 +++++++++++---
src/ease-player.vala | 5 ++++-
2 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/src/ease-editor-window.vala b/src/ease-editor-window.vala
index 7a2b3e9..66dedb6 100644
--- a/src/ease-editor-window.vala
+++ b/src/ease-editor-window.vala
@@ -198,10 +198,10 @@ public class Ease.EditorWindow : Gtk.Window
if (response == Gtk.ResponseType.NO) return false;
// otherwise, save and quit
- return !save_document(null);
+ var result = !save_document(null);
+ if (!result) Main.remove_window(this);
+ return result;
});
-
- hide.connect(() => Main.remove_window(this));
set_slide(0);
update_undo();
@@ -293,7 +293,15 @@ public class Ease.EditorWindow : Gtk.Window
[CCode (instance_pos = -1)]
public void play_handler(Gtk.Widget sender)
{
+ hide();
+
player = new Player(document);
+
+ player.complete.connect(() => {
+ player = null;
+ show();
+ present();
+ });
}
[CCode (instance_pos = -1)]
diff --git a/src/ease-player.vala b/src/ease-player.vala
index 48c7cb6..b1ac1cf 100644
--- a/src/ease-player.vala
+++ b/src/ease-player.vala
@@ -53,6 +53,8 @@ public class Ease.Player : GLib.Object
private Clutter.Rectangle shader_left;
private Clutter.Rectangle shader_right;
+ public signal void complete();
+
public Player(Document doc)
{
document = doc;
@@ -231,6 +233,7 @@ public class Ease.Player : GLib.Object
if (slide_index == document.slides.size) // slideshow complete
{
stage.hide_all();
+ complete();
return;
}
@@ -318,4 +321,4 @@ public class Ease.Player : GLib.Object
advance_alarm.start();
}
}
-}
\ No newline at end of file
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]