[gnome-boxes] collection-view: Show Machine.status when available
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] collection-view: Show Machine.status when available
- Date: Sat, 29 Aug 2015 22:21:47 +0000 (UTC)
commit 495762d01c0ca89b19e0c4bd44f7fabffa67e39a
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Sat Aug 29 13:35:04 2015 +0100
collection-view: Show Machine.status when available
If Machine.status is non-null, show that in the second column of text
instead of Machine.info since former is now more important than latter.
https://bugzilla.gnome.org/show_bug.cgi?id=753888
src/collection-view.vala | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/collection-view.vala b/src/collection-view.vala
index 19a529d..5c7d7b7 100644
--- a/src/collection-view.vala
+++ b/src/collection-view.vala
@@ -147,7 +147,8 @@ private class Boxes.CollectionView: Gd.MainView, Boxes.ICollectionView, Boxes.UI
return;
}
- var iter = append (machine.name, machine.info, item);
+ var info = machine.status?? machine.info;
+ var iter = append (machine.name, info, item);
var thumbnail_id = machine.thumbnailer.notify["thumbnail"].connect (() => {
// apparently iter is stable after insertion/removal/sort
update_screenshot (iter);
@@ -169,6 +170,8 @@ private class Boxes.CollectionView: Gd.MainView, Boxes.ICollectionView, Boxes.UI
var info_id = machine.notify["info"].connect (on_machine_info_changed);
item.set_data<ulong> ("info_id", info_id);
+ var status_id = machine.notify["status"].connect (on_machine_info_changed);
+ item.set_data<ulong> ("status_id", status_id);
setup_activity (iter, machine);
var under_construct_id = machine.notify["under-construction"].connect (() => {
@@ -220,6 +223,8 @@ private class Boxes.CollectionView: Gd.MainView, Boxes.ICollectionView, Boxes.UI
var name_id = item.get_data<ulong> ("name_id");
item.disconnect (name_id);
+ var status_id = item.get_data<ulong> ("status_id");
+ item.disconnect (status_id);
var info_id = item.get_data<ulong> ("info_id");
item.disconnect (info_id);
var under_construct_id = item.get_data<ulong> ("under_construct_id");
@@ -433,7 +438,8 @@ private class Boxes.CollectionView: Gd.MainView, Boxes.ICollectionView, Boxes.UI
var iter = machine.get_data<Gtk.TreeIter?> ("iter");
return_if_fail (iter != null);
- store.set (iter, ModelColumns.INFO, machine.info);
+ var info = machine.status?? machine.info;
+ store.set (iter, ModelColumns.INFO, info);
queue_draw ();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]