OBS User unknown 2007-02-19 22:39:46 +00:00 committed by Git OBS Bridge
parent 6922b79381
commit b4ca4878c4
12 changed files with 278 additions and 40 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:028b8b65781114b71df0c209c6dfc82fd29b4ddd94cc498cd8e279127ef786b4
size 368785
oid sha256:de1a282233ce0fb11e35a743604e3d0a81ab9a1a5c51786104e03f18d5f2e500
size 369701

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Tue Feb 13 12:53:38 MST 2007 - ccoffing@novell.com
- Update to latest hg; grabs mouse for better mouse tracking.
(#240387)
- Don't lose mouse grab on every keystroke
- Disable menubar & toolbar when pointer is in VM window, to avoid
key conflicts. (#240001)
- Fix syntax to avoid deprecation warnings (don't raise strings).
- YaST integration: default to managing on-box; detach from yast
control center.
-------------------------------------------------------------------
Mon Jan 29 09:15:26 MST 2007 - ccoffing@novell.com

View File

@ -24,7 +24,7 @@ License: GNU General Public License (GPL)
Group: System/Monitoring
Autoreqprov: yes
Version: 0.3.0
Release: 1
Release: 5
Summary: Virtual Machine Manager
Source0: virt-manager-0.3.0.tar.bz2
Source1: rhpl-exception.py
@ -43,6 +43,12 @@ ExclusiveArch: %ix86 x86_64
Patch0: virtman-desktop.diff
Patch1: virtman-install.diff
Patch2: virtman-type-register.diff
Patch3: virtman-deprecated-raise.diff
Patch5: virtman-console-keys.diff
Patch6: virtman-detach-yast.diff
Patch7: virtman-no-ungrab.diff
Patch8: virtman-limit-popup.diff
Patch9: virtman-error.diff
Requires: gconf2
%description
@ -62,6 +68,12 @@ Authors:
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%build
#automake
@ -129,7 +141,16 @@ fi
%dir %{_datadir}/dbus-1/services
%dir %{_datadir}/applications/YaST2
%changelog -n virt-manager
%changelog
* Tue Feb 13 2007 - ccoffing@novell.com
- Update to latest hg; grabs mouse for better mouse tracking.
(#240387)
- Don't lose mouse grab on every keystroke
- Disable menubar & toolbar when pointer is in VM window, to avoid
key conflicts. (#240001)
- Fix syntax to avoid deprecation warnings (don't raise strings).
- YaST integration: default to managing on-box; detach from yast
control center.
* Mon Jan 29 2007 - ccoffing@novell.com
- Fix desktop file. (#239275)
- Update to 0.3.0 (updated translations; no code changes)

64
virtman-console-keys.diff Normal file
View File

@ -0,0 +1,64 @@
Index: virt-manager-0.3.0/src/virtManager/console.py
===================================================================
--- virt-manager-0.3.0.orig/src/virtManager/console.py
+++ virt-manager-0.3.0/src/virtManager/console.py
@@ -45,6 +45,8 @@ class vmmConsole(gobject.GObject):
self.vm = vm
topwin = self.window.get_widget("vmm-console")
+ sens = (self.window.get_widget("menubar2"),
+ self.window.get_widget("console-toolbar"))
topwin.hide()
self.title = vm.get_name() + " " + topwin.get_title()
topwin.set_title(self.title)
@@ -52,9 +54,9 @@ class vmmConsole(gobject.GObject):
self.window.get_widget("control-shutdown").get_icon_widget().set_from_file(config.get_icon_dir() + "/icon_shutdown.png")
if self.config.get_console_keygrab() == 2:
- self.vncViewer = GRFBViewer(topwin, autograbkey=True)
+ self.vncViewer = GRFBViewer(topwin, sens, autograbkey=True)
else:
- self.vncViewer = GRFBViewer(topwin, autograbkey=False)
+ self.vncViewer = GRFBViewer(topwin, sens, autograbkey=False)
self.vncViewer.connect("pointer-grabbed", self.notify_grabbed)
self.vncViewer.connect("pointer-ungrabbed", self.notify_ungrabbed)
Index: virt-manager-0.3.0/src/vncViewer/vnc.py
===================================================================
--- virt-manager-0.3.0.orig/src/vncViewer/vnc.py
+++ virt-manager-0.3.0/src/vncViewer/vnc.py
@@ -179,7 +179,7 @@ class GRFBViewer(gtk.DrawingArea):
"keyboard-ungrabbed": (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, []),
}
- def __init__(self, topwin, autograbkey=False):
+ def __init__(self, topwin, sens, autograbkey=False):
gtk.DrawingArea.__init__(self)
self.fb = GRFBFrameBuffer(self)
@@ -189,6 +189,7 @@ class GRFBViewer(gtk.DrawingArea):
self.autograbkey = autograbkey
self.autograbptr = True
self.topwin = topwin
+ self.sens = sens
self.accel_groups = gtk.accel_groups_from_object(topwin)
self.preferred_encoding = (rfb.ENCODING_RAW, rfb.ENCODING_DESKTOP_RESIZE)
# Current impl of draw_solid is *far* too slow to be practical
@@ -445,6 +446,8 @@ class GRFBViewer(gtk.DrawingArea):
gtk.gdk.keyboard_grab(self.window, False, long(0))
for g in self.accel_groups:
self.topwin.remove_accel_group(g)
+ for w in self.sens:
+ w.set_sensitive(False)
self.grabbedKeyboard = True
self.emit("keyboard-grabbed")
@@ -452,6 +455,8 @@ class GRFBViewer(gtk.DrawingArea):
gtk.gdk.keyboard_ungrab()
for g in self.accel_groups:
self.topwin.add_accel_group(g)
+ for w in self.sens:
+ w.set_sensitive(True)
self.grabbedKeyboard = False
self.emit("keyboard-ungrabbed")

View File

@ -0,0 +1,25 @@
Index: virt-manager-0.3.0/src/virtManager/domain.py
===================================================================
--- virt-manager-0.3.0.orig/src/virtManager/domain.py
+++ virt-manager-0.3.0/src/virtManager/domain.py
@@ -371,7 +371,7 @@ class vmmDomain(gobject.GObject):
elif self.lastStatus == libvirt.VIR_DOMAIN_CRASHED:
return _("Crashed")
else:
- raise RuntimeError(_("Unknown status code"))
+ raise RuntimeError(_("Unknown status code: %s") % self.lastStatus)
def run_status_icon(self):
return self.config.get_vm_status_icon(self.status())
@@ -443,9 +443,9 @@ class vmmDomain(gobject.GObject):
devdst = child.prop("dev")
if srcpath == None:
- raise "missing source path"
+ raise RuntimeError("missing source path")
if devdst == None:
- raise "missing destination device"
+ raise RuntimeError("missing destination device")
devtype = node.prop("device")
if devtype == None:

View File

@ -1,20 +1,21 @@
Index: virt-manager-0.2.6/src/virt-manager.desktop.in
Index: virt-manager-0.3.0/src/virt-manager.desktop.in
===================================================================
--- virt-manager-0.2.6.orig/src/virt-manager.desktop.in
+++ virt-manager-0.2.6/src/virt-manager.desktop.in
@@ -1,9 +1,16 @@
--- virt-manager-0.3.0.orig/src/virt-manager.desktop.in
+++ virt-manager-0.3.0/src/virt-manager.desktop.in
@@ -1,9 +1,17 @@
[Desktop Entry]
+Version=1.0
Name=Virtual Machine Manager
Comment=The virtual machine management tool
-Icon=::ICONDIR::/::PACKAGE::-icon.svg
-Exec=::PACKAGE::
+Exec=/usr/bin/virt-manager
+Exec=/usr/bin/virt-manager -c xen
Type=Application
Terminal=false
Encoding=UTF-8
-Categories=System;
+Categories=Qt;X-SuSE-YaST;
+X-SuSE-YaST-Call=/usr/bin/virt-manager
+X-SuSE-YaST-Call=/usr/bin/virt-manager -- -c xen --yast
+X-SuSE-YaST-Group=Virtualization
+X-SuSE-YaST-Argument=
+X-SuSE-YaST-RootOnly=true
@ -22,10 +23,10 @@ Index: virt-manager-0.2.6/src/virt-manager.desktop.in
+X-SuSE-YaST-SortKey=
+Icon=yast-network
+X-SuSE-translate=true
Index: virt-manager-0.2.6/src/Makefile.am
Index: virt-manager-0.3.0/src/Makefile.am
===================================================================
--- virt-manager-0.2.6.orig/src/Makefile.am
+++ virt-manager-0.2.6/src/Makefile.am
--- virt-manager-0.3.0.orig/src/Makefile.am
+++ virt-manager-0.3.0/src/Makefile.am
@@ -14,7 +14,7 @@ libexec_SCRIPTS = $(PACKAGE)-launch
gladedir = $(pkgdatadir)
glade_DATA = $(PACKAGE).glade

50
virtman-detach-yast.diff Normal file
View File

@ -0,0 +1,50 @@
Index: virt-manager-0.3.0/src/virt-manager.py.in
===================================================================
--- virt-manager-0.3.0.orig/src/virt-manager.py.in
+++ virt-manager-0.3.0/src/virt-manager.py.in
@@ -148,6 +148,8 @@ def main():
optParser = OptionParser()
optParser.add_option("--profile", dest="profile", help="Generate runtime performance profile stats", metavar="FILE")
optParser.set_defaults(uuid=None)
+ optParser.add_option("-y", "--yast", dest="fork", action="store_true",
+ help="Allow yast parent to exit")
optParser.add_option("-c", "--connect", dest="uri",
help="Connect to hypervisor at URI", metavar="URI")
optParser.add_option("--no-dbus", action="store_true", dest="nodbus",
@@ -199,6 +201,23 @@ def main():
logging.warning("Could not connection to session bus, disabling DBus service " + \
str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1]))
+ if options.fork:
+ # Don't have to completely daemonize; just fork off and close
+ # stdin/stdout/stderr to let yast parent die happily.
+ pid = os.fork()
+ if pid == 0:
+ for fd in (0, 1, 2):
+ try:
+ os.close(fd)
+ except:
+ continue
+ os.open('/dev/null', os.O_RDWR)
+ if os.fork():
+ os._exit(0)
+ else:
+ os.waitpid(pid, 0)
+ os._exit(0)
+
# Finally start the app for real
show_engine(engine, options.show, options.uri, options.uuid)
if options.profile != None:
Index: virt-manager-0.3.0/src/virtManager/engine.py
===================================================================
--- virt-manager-0.3.0.orig/src/virtManager/engine.py
+++ virt-manager-0.3.0/src/virtManager/engine.py
@@ -229,7 +229,7 @@ class vmmEngine:
return self.connections[uri]["windowDetails"][uuid]
def show_manager(self, uri):
- con = self.get_connection(uri)
+ con = self.get_connection(uri, False)
if self.connections[uri]["windowManager"] == None:
manager = vmmManager(self.get_config(),

13
virtman-error.diff Normal file
View File

@ -0,0 +1,13 @@
Index: virt-manager-0.3.0/src/vncViewer/vnc.py
===================================================================
--- virt-manager-0.3.0.orig/src/vncViewer/vnc.py
+++ virt-manager-0.3.0/src/vncViewer/vnc.py
@@ -423,7 +423,7 @@ class GRFBViewer(gtk.DrawingArea):
def set_autograb_keyboard(self, grab):
self.autograbkey = grab
- if grab == False and grabbedKeyboard:
+ if grab == False and self.grabbedKeyboard:
self.ungrab_keyboard()

View File

@ -1,7 +1,7 @@
Index: virt-manager-0.2.6/src/virtManager/engine.py
Index: virt-manager-0.3.0/src/virtManager/engine.py
===================================================================
--- virt-manager-0.2.6.orig/src/virtManager/engine.py
+++ virt-manager-0.2.6/src/virtManager/engine.py
--- virt-manager-0.3.0.orig/src/virtManager/engine.py
+++ virt-manager-0.3.0/src/virtManager/engine.py
@@ -30,7 +30,7 @@ from virtManager.manager import vmmManag
from virtManager.details import vmmDetails
from virtManager.console import vmmConsole

31
virtman-limit-popup.diff Normal file
View File

@ -0,0 +1,31 @@
Index: virt-manager-0.3.0/src/virtManager/console.py
===================================================================
--- virt-manager-0.3.0.orig/src/virtManager/console.py
+++ virt-manager-0.3.0/src/virtManager/console.py
@@ -43,6 +43,7 @@ class vmmConsole(gobject.GObject):
self.window = gtk.glade.XML(config.get_glade_file(), "vmm-console", domain="virt-manager")
self.config = config
self.vm = vm
+ self.grab_notifications = 1
topwin = self.window.get_widget("vmm-console")
sens = (self.window.get_widget("menubar2"),
@@ -118,6 +119,10 @@ class vmmConsole(gobject.GObject):
def notify_grabbed(self, src):
topwin = self.window.get_widget("vmm-console")
+ topwin.set_title(_("Press Ctrl+Alt to release mouse.") + " " + self.title)
+ if not self.grab_notifications:
+ return
+ self.grab_notifications -= 1
try:
bus = dbus.SessionBus()
noteSvr = bus.get_object("org.freedesktop.Notifications", "/org/freedesktop/Notifications")
@@ -136,7 +141,6 @@ class vmmConsole(gobject.GObject):
5 * 1000);
except Exception, e:
pass
- topwin.set_title(_("Press Ctrl+Alt to release mouse.") + " " + self.title)
def notify_ungrabbed(self, src):
topwin = self.window.get_widget("vmm-console")

21
virtman-no-ungrab.diff Normal file
View File

@ -0,0 +1,21 @@
Index: virt-manager-0.3.0/src/vncViewer/vnc.py
===================================================================
--- virt-manager-0.3.0.orig/src/vncViewer/vnc.py
+++ virt-manager-0.3.0/src/vncViewer/vnc.py
@@ -482,11 +482,14 @@ class GRFBViewer(gtk.DrawingArea):
def key_press(self, win, event):
# Allow Ctrl+Alt+Esc to break the pointer grab
if self.will_autograb_pointer():
- if event.state & gtk.gdk.CONTROL_MASK and event.state & gtk.gdk.MOD1_MASK and gtk.gdk.pointer_is_grabbed():
+ if gtk.gdk.pointer_is_grabbed() and \
+ ((event.state & gtk.gdk.CONTROL_MASK and
+ (event.keyval == gtk.keysyms.Alt_L or event.keyval == gtk.keysyms.Alt_R)) or
+ (event.state & gtk.gdk.MOD1_MASK and
+ (event.keyval == gtk.keysyms.Control_L or event.keyval == gtk.keysyms.Control_R))):
self.ungrab_pointer()
return
- self.ungrab_pointer()
# Key handling in VNC is screwy. The event.keyval from GTK is
# interpreted relative to modifier state. This really messes
# up with VNC which has no concept of modifiers. If we interpret

View File

@ -1,62 +1,62 @@
Index: virt-manager-0.2.6/src/virtManager/connect.py
Index: virt-manager-0.3.0/src/virtManager/connect.py
===================================================================
--- virt-manager-0.2.6.orig/src/virtManager/connect.py
+++ virt-manager-0.2.6/src/virtManager/connect.py
--- virt-manager-0.3.0.orig/src/virtManager/connect.py
+++ virt-manager-0.3.0/src/virtManager/connect.py
@@ -102,4 +102,3 @@ class vmmConnect(gobject.GObject):
self.close()
self.emit("completed", uri, readOnly)
-gobject.type_register(vmmConnect)
Index: virt-manager-0.2.6/src/virtManager/connection.py
Index: virt-manager-0.3.0/src/virtManager/connection.py
===================================================================
--- virt-manager-0.2.6.orig/src/virtManager/connection.py
+++ virt-manager-0.2.6/src/virtManager/connection.py
--- virt-manager-0.3.0.orig/src/virtManager/connection.py
+++ virt-manager-0.3.0/src/virtManager/connection.py
@@ -242,5 +242,4 @@ class vmmConnection(gobject.GObject):
uuid.append('-')
return "".join(uuid)
-gobject.type_register(vmmConnection)
Index: virt-manager-0.2.6/src/virtManager/console.py
Index: virt-manager-0.3.0/src/virtManager/console.py
===================================================================
--- virt-manager-0.2.6.orig/src/virtManager/console.py
+++ virt-manager-0.2.6/src/virtManager/console.py
@@ -423,4 +423,3 @@ class vmmConsole(gobject.GObject):
--- virt-manager-0.3.0.orig/src/virtManager/console.py
+++ virt-manager-0.3.0/src/virtManager/console.py
@@ -454,4 +454,3 @@ class vmmConsole(gobject.GObject):
self.ignorePause = False
self.ignorePause = False
-gobject.type_register(vmmConsole)
Index: virt-manager-0.2.6/src/virtManager/details.py
Index: virt-manager-0.3.0/src/virtManager/details.py
===================================================================
--- virt-manager-0.2.6.orig/src/virtManager/details.py
+++ virt-manager-0.2.6/src/virtManager/details.py
--- virt-manager-0.3.0.orig/src/virtManager/details.py
+++ virt-manager-0.3.0/src/virtManager/details.py
@@ -466,4 +466,3 @@ class vmmDetails(gobject.GObject):
for d in netList:
netsModel.append(None, d)
-gobject.type_register(vmmDetails)
Index: virt-manager-0.2.6/src/virtManager/domain.py
Index: virt-manager-0.3.0/src/virtManager/domain.py
===================================================================
--- virt-manager-0.2.6.orig/src/virtManager/domain.py
+++ virt-manager-0.2.6/src/virtManager/domain.py
@@ -509,4 +509,3 @@ class vmmDomain(gobject.GObject):
--- virt-manager-0.3.0.orig/src/virtManager/domain.py
+++ virt-manager-0.3.0/src/virtManager/domain.py
@@ -510,4 +510,3 @@ class vmmDomain(gobject.GObject):
memory = int(memory)
self.vm.setMaxMemory(memory)
-gobject.type_register(vmmDomain)
Index: virt-manager-0.2.6/src/virtManager/manager.py
Index: virt-manager-0.3.0/src/virtManager/manager.py
===================================================================
--- virt-manager-0.2.6.orig/src/virtManager/manager.py
+++ virt-manager-0.2.6/src/virtManager/manager.py
--- virt-manager-0.3.0.orig/src/virtManager/manager.py
+++ virt-manager-0.3.0/src/virtManager/manager.py
@@ -597,4 +597,3 @@ class vmmManager(gobject.GObject):
data.reverse()
cell.set_property('data_array', data)
-gobject.type_register(vmmManager)
Index: virt-manager-0.2.6/src/vncViewer/vnc.py
Index: virt-manager-0.3.0/src/vncViewer/vnc.py
===================================================================
--- virt-manager-0.2.6.orig/src/vncViewer/vnc.py
+++ virt-manager-0.2.6/src/vncViewer/vnc.py
--- virt-manager-0.3.0.orig/src/vncViewer/vnc.py
+++ virt-manager-0.3.0/src/vncViewer/vnc.py
@@ -113,7 +113,6 @@ class GRFBFrameBuffer(rfb.RFBFrameBuffer
def move_cursor(self, x, y):
logging.error("Unsupported move_cursor operation requested")
@ -73,7 +73,7 @@ Index: virt-manager-0.2.6/src/vncViewer/vnc.py
class GRFBViewer(gtk.DrawingArea):
@@ -512,7 +510,6 @@ class GRFBViewer(gtk.DrawingArea):
@@ -579,7 +577,6 @@ class GRFBViewer(gtk.DrawingArea):
gc = self.window.new_gc()
self.window.draw_drawable(gc, self.fb.get_pixmap(), event.area.x, event.area.y, event.area.x, event.area.y, event.area.width, event.area.height)