summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2012-09-03 15:19:24 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2013-01-30 16:59:53 +0100
commitb76b27ce1999f7ed162aca45bf022587f290c1a1 (patch)
tree27c9b2e2dbd076023bcdddc5e6e0d0512d079014
parent12ac95843f6b418dca0330f556a67cc2b04492ff (diff)
ovirt: allow creating oVirt sources
We expect an ovirt:// URI scheme and turn that into an https:// URI. There is no support for asking the user for authentication credentials at the moment. https://bugzilla.gnome.org/show_bug.cgi?id=681747
-rw-r--r--src/app.vala4
-rw-r--r--src/wizard.vala6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/app.vala b/src/app.vala
index 2613a19..26ff8b7 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -186,6 +186,10 @@ private class Boxes.App: Boxes.UI {
check_module_kvm_loaded.begin ();
}
+ public bool has_broker_for_scheme (string scheme) {
+ return brokers.contains (scheme);
+ }
+
public delegate void CallReadyFunc ();
public void call_when_ready (CallReadyFunc func) {
if (is_ready)
diff --git a/src/wizard.vala b/src/wizard.vala
index 225bd6e..0f1038f 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -150,7 +150,7 @@ private class Boxes.Wizard: Boxes.UI {
try {
prepare_for_location (this.wizard_source.uri, true);
- if (source != null && source.source_type == "libvirt") {
+ if (source != null && App.app.has_broker_for_scheme (source.source_type)) {
text = _("Will add boxes for all systems available from this account.");
icon = "network-workgroup";
} else
@@ -259,6 +259,8 @@ private class Boxes.Wizard: Boxes.UI {
} else if (uri.scheme.has_prefix ("qemu")) {
// accept any qemu..:// uri
source.source_type = "libvirt";
+ } else if (App.app.has_broker_for_scheme (uri.scheme)) {
+ source.source_type = uri.scheme;
} else
throw new Boxes.Error.INVALID (_("Unsupported protocol '%s'").printf (uri.scheme));
}
@@ -419,7 +421,7 @@ private class Boxes.Wizard: Boxes.UI {
break;
}
- if (source.source_type == "libvirt") {
+ if (App.app.has_broker_for_scheme (source.source_type)) {
review_label.set_text (_("Will add boxes for all systems available from this account:"));
}
} else if (libvirt_machine != null) {