Commit Graph

41 Commits

Author SHA1 Message Date
Cole Robinson
e741d9cab6 Clean up all pylint + pep8 violations 2013-04-03 18:13:25 -04:00
Daniel P. Berrange
3c3237b951 Convert to use GTK3 and GObject Introspection bindings
Switch over to use GObject introspection bindings for all python
modules related to GObject/GTK3/etc. It is not possible to mix
and match old pyggtk/pygobject manual bindings with new introspection
based bindings so it must be all changed in one go.

Imports like

    import gtk

Change to

    from gi.repository import Gtk

The vmmGObject class is changed to always inherit from GObject.GObject
There is no compelling reason to avoid a GObject dep for the
virt-manager TUI & it horribly messed up the code.

Signal declarations are changed from

  vmmChooseCD.signal_new(vmmChooseCD, "cdrom-chosen", [object, str])

To

     __gsignals__ = {
        "cdrom-chosen": (GObject.SignalFlags.RUN_FIRST, None, [object, str])
    }

which is required by new GObject bindings

Most of the rest of the change is simply dealing with renamed
constants / classes.

Alot of legacy compat code was removed - ie helpers which
check to see if certain GTK2 methods are available are no
longer required since we're mandating GTK3 only.

The event loop is replaced with LibvirtGLib's event loop.

Still todo

 - Rip out all DBus stuff & make vmmEngine class inherit GtkApplication
   which provides unique support & DBus method handling
 - Switch to use LibvirtGConfig & LibvirtGObject for libvirt interaction
 - Possibly switch to Python 3 too ?
 - Figure out why GNOME keyring is missing Introspection support

My suggestion is that the standalone GIT repo for virt-install
only live on as a support branch for legacy platforms.

A stable-0.9 branch of virt-manager can be kept for legacy PyGtk2
based virt-manager releases.

The virt-manager master branch should exclusively use GObject
inspection and ideally Python3 and contain both the virt-manager
and virt-install codebases in one since they are intimately
related to each other & using separate GIT repos has needlessly
complicated life for everyone.

crobinso:
    Some locking fixes
    Misc cleanups and dropping now-useless code
    Fix dbus usage
    Fix graph cell renderer regression
    Fix a couple tooltip issues
2013-04-03 18:13:24 -04:00
Martin Kletzander
b2a7c396de Make deleting storage files default with added prompt
This patch changes the default checkbox-state of "Delete all
associated storage" to be checked, but adds a prompt with a warning
for users to be sure they notice this change and they know what they
are doing (hopefully).

(crobinso: confirm even if no gconf schema available, cosmetic spacing
 fixup, add Martin to AUTHORS)
2012-12-04 18:36:16 -05:00
Cole Robinson
d01b28c740 Run close() before removing window signals in cleanup() 2012-07-08 20:56:36 -04:00
Cole Robinson
dc78c01edc asyncjob: Provide helper to get meter wrapper 2012-02-10 12:12:15 -05:00
Cole Robinson
103c2e0da1 Convert UI files from glade to gtkbuilder
Glade is long since deprecated, and the 'glade' tool in F15 and up doesn't
even handle glade format files!

This effectively drops support for running virt-manager on a RHEL5 host,
which has a GTK that is too old to support gtkbuilder.

The process here was:
- On RHEL6, open all glade files with glade3, use Edit->Preferences to
  change format to gtk builder. (the gtk-builder-convert tool
  produced all sorts of brokenness, and f16 glade3 can't even open
  old glade files).
- Open these new files in glade on f16 and resave (since glade is
  notorious for reformatting files over new versions, saves churn
  the first time someone goes to patch the UI using a modern glade)
2012-02-02 14:17:50 -05:00
Cole Robinson
f42f3afe42 Add some debugging on dialog open/close 2012-01-31 18:16:54 -05:00
Cole Robinson
1ff601138f Specify all logging string format args as function parameters
As warned about by pylint. Also clean up some pylint false positives
and a few scattered legit warnings.
2012-01-16 22:04:40 -05:00
Cole Robinson
db21a2a833 delete: Properly raise 'undefine' errors 2011-08-29 14:01:40 -04:00
Cole Robinson
8a51336152 manager: Properly show domain names with reserved XML characters 2011-08-29 12:11:43 -04:00
Cole Robinson
5f22897f94 baseclass: Centralize exception reporting
Also add some checks to make sure subclasses always specify a proper
cleanup method
2011-07-23 21:16:54 -04:00
Cole Robinson
099753d146 s/connection/conn/g in all internal APIs
For consistency and line reduction
2011-07-22 16:43:26 -04:00
Cole Robinson
a84d10cee8 Add a smaller helper for self.window.get_widget
Saves us from having crazy long lines in a few places, and less characters
to type!
2011-07-14 13:13:13 -04:00
Cole Robinson
efde9cb863 Register all gobject signals through vmmGObject baseclass
Allows us to remove gobject imports in various places which will help when
merging code with TUI.
2011-04-28 16:06:57 -04:00
Cole Robinson
2fa12ffa15 Move bind_escape_key_close helper to baseclass 2011-04-18 11:25:28 -04:00
Cole Robinson
3d8e6a9398 Set parent for all dialogs 2011-04-14 08:47:42 -04:00
Cole Robinson
f2781ee62a Properly cleanup all dialogs
On app close, all dialogs are properly cleaned up so there are no
dangling references and python can garbage collect.

While this isn't that important when the app shuts down, it ensures that
lifecycle changes while the app is running (vm start/stop/remove, conn
start/stop/remove) have the infrastructure to properly release resources.
2011-04-13 10:20:47 -04:00
Cole Robinson
4d4717d5e8 delete: Drop VM reference on close
Also, simplify the interface for launching
2011-04-11 16:16:31 -04:00
Cole Robinson
e0bc2563c7 error: Simplify basic show_err call
If no error details are specified, use the traceback from the most recent
exception. We were doing this in numerous callers anyways.
2011-04-06 11:22:03 -04:00
Cole Robinson
712981f256 delete: Fix bogus error report if storage delete succeeds 2011-03-24 12:59:40 -04:00
Cole Robinson
677f73fca7 Run pep8 with check-pylint, fix the fallout 2010-12-10 11:47:07 -05:00
Cole Robinson
d0d20148f7 asyncjob: Simplify error reporting 2010-12-10 09:57:42 -05:00
Cole Robinson
9e0a96bd8f util: Simplify dup_conn functions 2010-12-09 15:45:05 -05:00
Cole Robinson
5c45358adc Remove 'config' passing from remaining classes/functions 2010-12-09 14:06:00 -05:00
Cole Robinson
e78e2da3f5 Use the a base class for all libvirt object classes 2010-12-09 12:37:48 -05:00
Cole Robinson
0fd57daca1 pylint: Check for unused variables, fix fallout 2010-12-09 11:22:35 -05:00
Cole Robinson
2dd81900fa Have UI classes share a baseclass 2010-12-08 17:26:19 -05:00
Cole Robinson
1c3e7a1ea3 Remove some unneeded imports and old pylint workarounds 2010-11-30 15:01:02 -05:00
Cole Robinson
779dcdd824 Don't use old style __gobject_init__() 2010-11-30 14:40:49 -05:00
Cole Robinson
749b6cdc88 error: Simplify dialog init, remove a bunch of boilerplate 2010-11-30 14:33:21 -05:00
Cole Robinson
40d8fc3092 domain: Switch disk listing to return VirtualDisk objects 2010-09-03 14:10:04 -04:00
Cole Robinson
64765ec3d4 Use new VirtualDisk path_in_use_by helper 2010-03-03 17:48:22 -05:00
Cole Robinson
182eb4bcb6 Drop redundant calls to window.show() 2010-02-23 14:18:12 -05:00
Cole Robinson
352affbe3a Make 'Escape' key close dialogs
We should get this for free by using gtk Dialogs for our various UI pieces,
however the stock dialog is pretty restrictive WRT widget spacing, and
prevents us from make our nice blue header, so we are stuck with gtk.Windows
2009-12-14 16:45:55 -05:00
Cole Robinson
287ad90a90 Additional focus improvements 2009-12-14 16:48:35 -05:00
Cole Robinson
dc877783a5 domain: Don't set disk path to '-' if empty, let details do that. 2009-11-03 16:09:03 -05:00
Cole Robinson
86fdbecb87 Add specific icons for various wizards (some implemented, some not!) 2009-07-26 15:47:46 -04:00
Cole Robinson
93eca80e18 Fix error message typo. 2009-07-14 17:06:50 -04:00
Cole Robinson
329113afe3 Use dup_conn in delete dialog. 2009-04-03 14:15:22 -04:00
Cole Robinson
f9680aa8e0 Store errors in asyncjob instances.
This allows us to remove all the hackish global error reporting variables
whenever we run an async job.
2009-04-03 14:15:15 -04:00
Cole Robinson
c83113e79b Storage aware 'Delete VM' dialog. 2009-03-09 16:17:09 -04:00