[gnome-boxes] app-window: Add 'current-item' prop
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] app-window: Add 'current-item' prop
- Date: Fri, 8 Aug 2014 16:21:33 +0000 (UTC)
commit 3926808f7c8bf913b905235effa6b5c99a1908b7
Author: Adrien Plazas <kekun plazas laposte net>
Date: Wed Jul 16 10:03:30 2014 +0200
app-window: Add 'current-item' prop
Prepares its move from App to AppWindow because each window may have a
different current item. Also makes App's current_item attribute a
property to bind them during the move.
This is needed to drop the use of AppWindow singleton and therefore to
make multiple windows possible.
https://bugzilla.gnome.org/show_bug.cgi?id=732098
src/app-window.vala | 2 ++
src/app.vala | 3 ++-
2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/app-window.vala b/src/app-window.vala
index 203aec0..b7a6951 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -9,6 +9,8 @@ private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
public UIState previous_ui_state { get; protected set; }
public UIState ui_state { get; protected set; }
+ public CollectionItem current_item { get; set; } // current object/vm manipulated
+
[CCode (notify = false)]
public bool fullscreened {
get { return WindowState.FULLSCREEN in get_window ().get_state (); }
diff --git a/src/app.vala b/src/app.vala
index 2b6d647..5e452ef 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -22,7 +22,7 @@ private class Boxes.App: Gtk.Application, Boxes.UI {
public UIState previous_ui_state { get; protected set; }
public UIState ui_state { get; protected set; }
- public CollectionItem current_item; // current object/vm manipulated
+ public CollectionItem current_item { get; set; } // current object/vm manipulated
public string? uri { get; set; }
public Collection collection;
public CollectionFilter filter;
@@ -166,6 +166,7 @@ private class Boxes.App: Gtk.Application, Boxes.UI {
window = new Boxes.AppWindow (this);
window.setup_ui ();
+ bind_property ("current-item", window, "current-item", BindingFlags.BIDIRECTIONAL);
set_state (UIState.COLLECTION);
window.present ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]