[gnome-boxes] app-window: Disconnect machine on collection page
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] app-window: Disconnect machine on collection page
- Date: Fri, 8 Aug 2014 16:21:53 +0000 (UTC)
commit 9fb944bde0ecc2e8910446e468ffd4e29eaf2930
Author: Adrien Plazas <kekun plazas laposte net>
Date: Wed Jul 16 10:22:29 2014 +0200
app-window: Disconnect machine on collection page
Moves the cancellation of the current machine's conection when the UI is
in collection state from App to AppWindow. As the 'current-item' property
is moving from App to AppWindow and as the UI state will too, the
cancellation should move. Also moves the setting of the current item's
state from App to AppWindow.
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 | 15 +++++++++++++++
src/app.vala | 17 -----------------
2 files changed, 15 insertions(+), 17 deletions(-)
---
diff --git a/src/app-window.vala b/src/app-window.vala
index 0d7b7b2..ead8e00 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -131,6 +131,18 @@ private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
fullscreened = false;
view.visible = true;
+ status_bind = null;
+ topbar.status = null;
+ if (current_item is Machine) {
+ var machine = current_item as Machine;
+ if (got_error_id != 0) {
+ machine.disconnect (got_error_id);
+ got_error_id = 0;
+ }
+
+ machine.connecting_cancellable.cancel (); // Cancel any in-progress connections
+ }
+
break;
case UIState.CREDS:
@@ -154,6 +166,9 @@ private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
warning ("Unhandled UI state %s".printf (ui_state.to_string ()));
break;
}
+
+ if (current_item != null)
+ current_item.set_state (ui_state);
}
public void show_properties () {
diff --git a/src/app.vala b/src/app.vala
index 62d87ad..3af12f4 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -401,23 +401,6 @@ private class Boxes.App: Gtk.Application, Boxes.UI {
private void ui_state_changed () {
window.set_state (ui_state);
-
- if (ui_state == UIState.COLLECTION) {
- status_bind = null;
- window.topbar.status = null;
- if (current_item is Machine) {
- var machine = current_item as Machine;
- if (got_error_id != 0) {
- machine.disconnect (got_error_id);
- got_error_id = 0;
- }
-
- machine.connecting_cancellable.cancel (); // Cancel any in-progress connections
- }
- }
-
- if (current_item != null)
- current_item.set_state (ui_state);
}
private void suspend_machines () {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]