[gnome-boxes/drop-system-importer: 25/26] Drop libvirt-system-importer



commit c73d5bbf0f339560df47a643cf77e8fc529b135e
Author: Felipe Borges <felipeborges gnome org>
Date:   Wed Apr 24 16:22:49 2019 +0200

    Drop libvirt-system-importer
    
    We don't want to import VMs from the libvirt system broker
    automatically. Instead we want to offer users a way to connect to
    it and manually import the domains they want.

 data/ui/wizard-source.ui         |  62 ---------------
 src/libvirt-system-importer.vala | 160 ---------------------------------------
 src/meson.build                  |   1 -
 src/wizard-source.vala           |  28 -------
 src/wizard.vala                  |  19 +----
 5 files changed, 1 insertion(+), 269 deletions(-)
---
diff --git a/data/ui/wizard-source.ui b/data/ui/wizard-source.ui
index 94c8a802..b76f749f 100644
--- a/data/ui/wizard-source.ui
+++ b/data/ui/wizard-source.ui
@@ -122,68 +122,6 @@
               </object>
             </child>
 
-            <child>
-              <object class="GtkButton" id="libvirt_sys_import_button">
-                <property name="visible">False</property>
-                <signal name="clicked" handler="on_libvirt_sys_import_button_clicked"/>
-                <style>
-                  <class name="boxes-menu-row"/>
-                </style>
-                <child>
-                  <object class="GtkBox">
-                    <property name="visible">True</property>
-                    <property name="margin-top">10</property>
-                    <property name="margin-bottom">10</property>
-                    <property name="margin-start">20</property>
-                    <property name="margin-end">20</property>
-                    <property name="spacing">20</property>
-                    <property name="orientation">horizontal</property>
-                    <child>
-                      <object class="GtkBox">
-                        <property name="visible">True</property>
-                        <property name="orientation">vertical</property>
-                        <property name="spacing">2</property>
-                        <child>
-                          <object class="GtkLabel" id="libvirt_sys_import_label">
-                            <property name="visible">True</property>
-                            <property name="halign">start</property>
-                            <property name="use-underline">True</property>
-                          </object>
-                        </child>
-                        <child>
-                          <object class="GtkLabel">
-                            <property name="visible">True</property>
-                            <property name="halign">start</property>
-                            <property name="label" translatable="yes">Connect to Libvirt brokers.</property>
-                            <property name="xalign">0</property>
-                            <property name="wrap">True</property>
-                            <property name="max-width-chars">50</property>
-                            <style>
-                              <class name="dim-label"/>
-                            </style>
-                          </object>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">True</property>
-                        <property name="fill">True</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="libvirt_sys_import_next_label">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">▶</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                      </packing>
-                    </child>
-                  </object>
-                </child>
-              </object>
-            </child>
-
             <child>
               <object class="GtkButton" id="select_file_button">
                 <property name="visible">True</property>
diff --git a/src/meson.build b/src/meson.build
index ec5b4950..56e9874e 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -102,7 +102,6 @@ vala_sources = [
   'vm-configurator.vala',
   'vm-creator.vala',
   'vm-importer.vala',
-  'libvirt-system-importer.vala',
   'libvirt-vm-cloner.vala',
   'libvirt-vm-importer.vala',
   'vnc-display.vala',
diff --git a/src/wizard-source.vala b/src/wizard-source.vala
index d008692f..33a29108 100644
--- a/src/wizard-source.vala
+++ b/src/wizard-source.vala
@@ -252,8 +252,6 @@ private void on_notify_estimated_load_progress () {
         set { url_entry.set_text (value); }
     }
     public InstallerMedia? install_media { get; private set; }
-    public LibvirtSystemImporter libvirt_sys_importer { get; private set; }
-    public bool libvirt_sys_import;
 
     public signal void activated (); // Emitted on user activating a source
 
@@ -270,10 +268,6 @@ private void on_notify_estimated_load_progress () {
     [GtkChild]
     private Gtk.Button select_file_button;
     [GtkChild]
-    private Gtk.Button libvirt_sys_import_button;
-    [GtkChild]
-    private Gtk.Label libvirt_sys_import_label;
-    [GtkChild]
     private Boxes.WizardWebView rhel_web_view;
 
     private AppWindow window;
@@ -351,7 +345,6 @@ private void on_notify_estimated_load_progress () {
 
         media_scrolled.bind_property ("visible", downloads_scrolled, "visible", BindingFlags.INVERT_BOOLEAN);
 
-        update_libvirt_sytem_entry_visibility.begin ();
         add_media_entries.begin ();
 
         // We manually add the custom download entries. Custom download entries
@@ -420,7 +413,6 @@ private void on_downloadable_entry_clicked (Gtk.ListBoxRow row) {
     public void cleanup () {
         filename = null;
         install_media = null;
-        libvirt_sys_import = false;
         selected = null;
         if(page != SourcePage.URL)
             uri = "";
@@ -481,18 +473,6 @@ private void add_media_entry (InstallerMedia media) {
         media_scrolled.show ();
     }
 
-    private async void update_libvirt_sytem_entry_visibility () {
-        try {
-            libvirt_sys_importer = yield new LibvirtSystemImporter ();
-        } catch (GLib.Error error) {
-            debug ("%s", error.message);
-
-            return;
-        }
-        libvirt_sys_import_label.label = libvirt_sys_importer.wizard_menu_label;
-        libvirt_sys_import_button.show_all ();
-    }
-
     [GtkCallback]
     private void on_select_file_button_clicked () {
         window.wizard_window.show_file_chooser ((uri) => {
@@ -505,14 +485,6 @@ private void on_select_file_button_clicked () {
         });
     }
 
-    [GtkCallback]
-    private void on_libvirt_sys_import_button_clicked () {
-        libvirt_sys_import = true;
-        activated ();
-
-        selected = libvirt_sys_import_button;
-    }
-
     private void on_media_selected (InstallerMedia media) {
         try {
             install_media = media_manager.create_installer_media_from_media (media);
diff --git a/src/wizard.vala b/src/wizard.vala
index 056d9a0b..632a11d9 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -275,7 +275,6 @@ private async bool create () {
             vm_creator.install_media.clean_up_preparation_cache ();
             vm_creator = null;
             wizard_source.uri = "";
-            wizard_source.libvirt_sys_import = false;
         } else if (source != null) {
             source.save ();
             App.app.add_collection_source.begin (source);
@@ -283,8 +282,6 @@ private async bool create () {
             if (machine is RemoteMachine) {
                 return true;
             }
-        } else if (wizard_source.libvirt_sys_import) {
-            wizard_source.libvirt_sys_importer.import.begin ();
         } else {
             return_val_if_reached (false); // Shouldn't arrive here with no source
         }
@@ -428,12 +425,6 @@ private async void prepare_media (InstallerMedia install_media, ActivityProgress
     }
 
     private bool prepare (ActivityProgress progress) {
-        if (wizard_source.libvirt_sys_import) {
-            prepare_cancellable.reset ();
-
-            return true;
-        }
-
         try {
             // Validate URI
             prepare_for_location (wizard_source.uri, wizard_source.filename, true);
@@ -479,7 +470,7 @@ private bool prepare (ActivityProgress progress) {
 
     private bool setup () {
         // there is no setup yet for direct source nor libvirt system imports
-        if (source != null || wizard_source.libvirt_sys_import)
+        if (source != null)
             return true;
 
         return_val_if_fail (vm_creator != null, false);
@@ -597,8 +588,6 @@ private async bool do_review_cancellable () {
             }
 
             nokvm_infobar.visible = (libvirt_machine.domain_config.get_virt_type () != 
GVirConfig.DomainVirtType.KVM);
-        } else if (wizard_source.libvirt_sys_import) {
-            review_label.set_text (wizard_source.libvirt_sys_importer.wizard_review_label);
         }
 
         if (libvirt_machine != null)
@@ -634,11 +623,6 @@ private bool skip_page (Boxes.WizardPage page) {
                 && vm_creator.install_media.live
                 && skip_review_for_live)
                     skip_to += 1;
-        } else if (wizard_source.libvirt_sys_import) {
-            if (page == Boxes.WizardPage.PREPARATION)
-                skip_to = forwards ? page + 2 : page - 1;
-            else if (page == Boxes.WizardPage.SETUP)
-                skip_to = forwards ? page + 1 : page - 2;
         }
 
         if (skip_to != page) {
@@ -735,7 +719,6 @@ private void ui_state_changed () {
             return;
 
         wizard_source.uri = "";
-        wizard_source.libvirt_sys_import = false;
         page = WizardPage.SOURCE;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]