[gnome-boxes/wip/feborges/new-wizard-design: 4/8] wizard-source: Show either media_scrolled or downloads list
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/wip/feborges/new-wizard-design: 4/8] wizard-source: Show either media_scrolled or downloads list
- Date: Tue, 16 Jan 2018 15:11:02 +0000 (UTC)
commit 9044b82ef4a176d9be09e29e325bc3a102363f67
Author: Felipe Borges <felipeborges gnome org>
Date: Tue Jan 16 15:39:46 2018 +0100
wizard-source: Show either media_scrolled or downloads list
Fixes #42
If there are no medias discovered in the filesystem, present a
list of available downloads. Never show both at the same time.
data/ui/wizard-source.ui | 8 +++++---
src/wizard-source.vala | 14 ++++++++++----
2 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/data/ui/wizard-source.ui b/data/ui/wizard-source.ui
index 23e2d222..a38ee96d 100644
--- a/data/ui/wizard-source.ui
+++ b/data/ui/wizard-source.ui
@@ -88,12 +88,14 @@
</child>
<child>
- <object class="BoxesWizardScrolled" id="media_scrolled"/>
+ <object class="BoxesWizardScrolled" id="media_scrolled">
+ <property name="visible">True</property>
+ </object>
</child>
<child>
- <object class="GtkListBox" id="available_downloads_listbox">
- <property name="visible">True</property>
+ <object class="BoxesWizardScrolled" id="downloads_scrolled">
+ <property name="visible">False</property>
</object>
</child>
diff --git a/src/wizard-source.vala b/src/wizard-source.vala
index 15ef5f3d..e2d19e97 100644
--- a/src/wizard-source.vala
+++ b/src/wizard-source.vala
@@ -326,6 +326,8 @@ private void on_notify_estimated_load_progress () {
[GtkChild]
private Boxes.WizardScrolled media_scrolled;
[GtkChild]
+ private Boxes.WizardScrolled downloads_scrolled;
+ [GtkChild]
private Gtk.Box url_entry_vbox;
[GtkChild]
public Gtk.Entry url_entry;
@@ -336,8 +338,6 @@ private void on_notify_estimated_load_progress () {
[GtkChild]
private Gtk.Label libvirt_sys_import_label;
[GtkChild]
- private Gtk.ListBox available_downloads_listbox;
- [GtkChild]
private Gtk.Button install_rhel_button;
[GtkChild]
private Gtk.Image install_rhel_image;
@@ -349,6 +349,7 @@ private void on_notify_estimated_load_progress () {
private AppWindow window;
private Gtk.ListBox media_vbox;
+ private Gtk.ListBox downloads_vbox;
private Gtk.ListStore? media_urls_store;
@@ -429,6 +430,11 @@ private void on_notify_estimated_load_progress () {
});
draw_as_css_box (url_entry_vbox);
+ downloads_scrolled.setup (num_visible);
+ downloads_vbox = downloads_scrolled.vbox;
+
+ media_scrolled.bind_property ("visible", downloads_scrolled, "visible", BindingFlags.INVERT_BOOLEAN);
+
update_libvirt_sytem_entry_visibility.begin ();
add_media_entries.begin ();
@@ -452,8 +458,8 @@ public void setup_ui (AppWindow window) {
var os_db = media_manager.os_db;
var available_downloads_model = new GLib.ListStore (typeof (Osinfo.Os));
- available_downloads_listbox.bind_model (available_downloads_model, create_downloadable_entry);
- available_downloads_listbox.row_activated.connect (on_downloadable_entry_clicked);
+ downloads_vbox.bind_model (available_downloads_model, create_downloadable_entry);
+ downloads_vbox.row_activated.connect (on_downloadable_entry_clicked);
downloads_list.bind_model (available_downloads_model, create_downloadable_entry);
downloads_list.row_activated.connect (on_downloadable_entry_clicked);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]