ae026a575b
* Merged code with python-virtinst. virtinst is no longer public * Port from GTK2 to GTK3 (Daniel Berrange, Cole Robinson) * Port from gconf to gsettings * Port from autotools to python distutils * Remove virt-manager-tui * Remove HAL support * IPv6 and static route virtual network support (Gene Czarcinski) * virt-install: Add –cpu host-passthrough (Ken ICHIKAWA, Hu Tao) OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=129
192 lines
8.4 KiB
Diff
192 lines
8.4 KiB
Diff
Index: virt-manager-0.10.0/ui/vmm-manager.ui
|
|
===================================================================
|
|
--- virt-manager-0.10.0.orig/ui/vmm-manager.ui
|
|
+++ virt-manager-0.10.0/ui/vmm-manager.ui
|
|
@@ -258,7 +258,7 @@
|
|
<property name="can_focus">False</property>
|
|
<property name="show_arrow">False</property>
|
|
<child>
|
|
- <object class="GtkToolButton" id="vm-new">
|
|
+ <object class="GtkMenuToolButton" id="vm-new">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">False</property>
|
|
<property name="has_tooltip">True</property>
|
|
@@ -270,7 +270,6 @@
|
|
</object>
|
|
<packing>
|
|
<property name="expand">False</property>
|
|
- <property name="homogeneous">True</property>
|
|
</packing>
|
|
</child>
|
|
<child>
|
|
Index: virt-manager-0.10.0/virtManager/manager.py
|
|
===================================================================
|
|
--- virt-manager-0.10.0.orig/virtManager/manager.py
|
|
+++ virt-manager-0.10.0/virtManager/manager.py
|
|
@@ -85,6 +85,7 @@ class vmmManager(vmmGObjectUI):
|
|
"action-show-host": (GObject.SignalFlags.RUN_FIRST, None, [str]),
|
|
"action-show-preferences": (GObject.SignalFlags.RUN_FIRST, None, []),
|
|
"action-show-create": (GObject.SignalFlags.RUN_FIRST, None, [str]),
|
|
+ "action-show-create-vminstall": (GObject.SignalFlags.RUN_FIRST, None, [str]),
|
|
"action-suspend-domain": (GObject.SignalFlags.RUN_FIRST, None, [str, str]),
|
|
"action-resume-domain": (GObject.SignalFlags.RUN_FIRST, None, [str, str]),
|
|
"action-run-domain": (GObject.SignalFlags.RUN_FIRST, None, [str, str]),
|
|
@@ -281,7 +282,8 @@ class vmmManager(vmmGObjectUI):
|
|
self.config.is_vmlist_network_traffic_visible())
|
|
|
|
def init_toolbar(self):
|
|
- self.widget("vm-new").set_icon_name("vm_new")
|
|
+ uihelpers.build_new_button_menu(self.widget("vm-new"),
|
|
+ self.vminstall_new_vm)
|
|
self.widget("vm-open").set_icon_name("icon_console")
|
|
uihelpers.build_shutdown_button_menu(self.widget("vm-shutdown"),
|
|
self.poweroff_vm,
|
|
@@ -548,6 +550,9 @@ class vmmManager(vmmGObjectUI):
|
|
def new_vm(self, src_ignore=None):
|
|
self.emit("action-show-create", self.current_conn_uri())
|
|
|
|
+ def vminstall_new_vm(self, src_ignore=None):
|
|
+ self.emit("action-show-create-vminstall", self.current_conn_uri())
|
|
+
|
|
def show_about(self, src_ignore):
|
|
self.emit("action-show-about")
|
|
|
|
Index: virt-manager-0.10.0/virtManager/uihelpers.py
|
|
===================================================================
|
|
--- virt-manager-0.10.0.orig/virtManager/uihelpers.py
|
|
+++ virt-manager-0.10.0/virtManager/uihelpers.py
|
|
@@ -877,6 +877,24 @@ def mediadev_set_default_selection(widge
|
|
|
|
|
|
####################################################################
|
|
+# Build toolbar new button menu (manager and details toolbar) #
|
|
+####################################################################
|
|
+
|
|
+def build_new_button_menu(widget, vminstall_cb):
|
|
+ icon_name = util.running_config.get_new_icon_name()
|
|
+ widget.set_icon_name(icon_name)
|
|
+ menu = Gtk.Menu()
|
|
+ widget.set_menu(menu)
|
|
+
|
|
+ vminstallimg = Gtk.Image.new_from_icon_name(icon_name, Gtk.IconSize.MENU)
|
|
+
|
|
+ vminstall = Gtk.ImageMenuItem(_("_Vm-install"))
|
|
+ vminstall.set_image(vminstallimg)
|
|
+ vminstall.show()
|
|
+ vminstall.connect("activate", vminstall_cb)
|
|
+ menu.add(vminstall)
|
|
+
|
|
+####################################################################
|
|
# Build toolbar shutdown button menu (manager and details toolbar) #
|
|
####################################################################
|
|
|
|
Index: virt-manager-0.10.0/virtManager/config.py
|
|
===================================================================
|
|
--- virt-manager-0.10.0.orig/virtManager/config.py
|
|
+++ virt-manager-0.10.0/virtManager/config.py
|
|
@@ -192,6 +192,13 @@ class vmmConfig(object):
|
|
|
|
# General app wide helpers (gconf agnostic)
|
|
|
|
+ def get_new_icon_name(self):
|
|
+ theme = Gtk.IconTheme.get_default()
|
|
+ iconname = "vm_new"
|
|
+ if theme.has_icon(iconname):
|
|
+ return iconname
|
|
+ return "media-record"
|
|
+
|
|
def get_appname(self):
|
|
return self.appname
|
|
def get_appversion(self):
|
|
Index: virt-manager-0.10.0/virtManager/engine.py
|
|
===================================================================
|
|
--- virt-manager-0.10.0.orig/virtManager/engine.py
|
|
+++ virt-manager-0.10.0/virtManager/engine.py
|
|
@@ -27,6 +27,7 @@ from gi.repository import Gtk
|
|
import logging
|
|
import threading
|
|
import os
|
|
+import traceback
|
|
|
|
import libvirt
|
|
import virtinst
|
|
@@ -44,7 +45,6 @@ from virtManager.manager import vmmManag
|
|
from virtManager.migrate import vmmMigrateDialog
|
|
from virtManager.details import vmmDetails
|
|
from virtManager.asyncjob import vmmAsyncJob
|
|
-from virtManager.create import vmmCreate
|
|
from virtManager.host import vmmHost
|
|
from virtManager.error import vmmErrorDialog
|
|
from virtManager.systray import vmmSystray
|
|
@@ -89,6 +89,7 @@ class vmmEngine(vmmGObject):
|
|
self.windowCreate = None
|
|
self.windowManager = None
|
|
self.windowMigrate = None
|
|
+ self.remote_install = None
|
|
|
|
self.conns = {}
|
|
self.err = vmmErrorDialog()
|
|
@@ -663,6 +664,7 @@ class vmmEngine(vmmGObject):
|
|
obj.connect("action-show-vm", self._do_show_vm)
|
|
obj.connect("action-show-preferences", self._do_show_preferences)
|
|
obj.connect("action-show-create", self._do_show_create)
|
|
+ obj.connect("action-show-create-vminstall", self._do_show_create_vminstall)
|
|
obj.connect("action-show-about", self._do_show_about)
|
|
obj.connect("action-show-host", self._do_show_host)
|
|
obj.connect("action-show-connect", self._do_show_connect)
|
|
@@ -703,11 +705,49 @@ class vmmEngine(vmmGObject):
|
|
self.windowCreate = obj
|
|
return self.windowCreate
|
|
|
|
- def _do_show_create(self, src, uri):
|
|
- try:
|
|
- self._get_create_dialog().show(src.topwin, uri)
|
|
- except Exception, e:
|
|
- src.err.show_err(_("Error launching manager: %s") % str(e))
|
|
+ def _vmmcreate_closing(self,signal,key):
|
|
+ self.windowCreate = None
|
|
+
|
|
+ def _do_show_create_vminstall(self, src, uri):
|
|
+ self._do_show_create(src, uri, True)
|
|
+
|
|
+ def _do_show_create(self, src, uri, use_vminstall=False):
|
|
+ if uri is None:
|
|
+ uri = default_uri()
|
|
+ conn = self._lookup_conn(uri)
|
|
+ do_remote = conn.is_remote()
|
|
+ if self.windowCreate == None or do_remote != self.remote_install:
|
|
+ try:
|
|
+ if do_remote or not use_vminstall:
|
|
+ from virtManager.create import vmmCreate
|
|
+ create = vmmCreate(self)
|
|
+ create.connect("action-show-vm", self._do_show_vm)
|
|
+ create.connect("vmmcreate-closing", self._vmmcreate_closing)
|
|
+ self.remote_install = True
|
|
+ self.windowCreate = create
|
|
+ self.windowCreate.show(src.topwin, uri)
|
|
+ else:
|
|
+ from vminstall.gtk.interface import VMCreate as vmmCreate
|
|
+ create = vmmCreate(virtman=True,key=0)
|
|
+ create.connect("action-show-vm", self._do_show_vm)
|
|
+ create.connect("vmmcreate-closing", self._vmmcreate_closing)
|
|
+ self.remote_install = False
|
|
+ self.windowCreate = create
|
|
+ self.windowCreate.show(src.topwin)
|
|
+ except Exception, e:
|
|
+ src.err.show_err(_("Error launching manager: %s") % str(e),
|
|
+ "".join(traceback.format_exc()))
|
|
+ else:
|
|
+ if do_remote:
|
|
+ self.windowCreate.show(src.topwin, uri)
|
|
+ else:
|
|
+ message_box = Gtk.MessageDialog(None,
|
|
+ Gtk.DialogFlags.MODAL,
|
|
+ Gtk.MessageType.WARNING,
|
|
+ Gtk.ButtonsType.OK,
|
|
+ _("A new installation is already in progress.\n\nUse the YaST \"Create Virtual Machines\" utility for concurrent installations."))
|
|
+ message_box.run()
|
|
+ message_box.destroy()
|
|
|
|
def _do_show_migrate(self, src, uri, uuid):
|
|
try:
|