Commit Graph

98 Commits

Author SHA1 Message Date
Cole Robinson 97db1ac18a manager: Simplify row management a bit
Drop the self.rows dict, use more pygobject row[] convenience
helpers, add some helper properties for VM
2018-03-17 18:46:40 -04:00
Cole Robinson 7de9028221 manager: Fix some menu item sensitivity issues 2018-03-17 18:46:40 -04:00
Cole Robinson 3c1e0a8a12 virtManager/*: Give pylint hints about singleton classes
It can't seem to figure out that what 'cls' is in this context,
so make it explicit.
2018-03-17 18:46:39 -04:00
Cole Robinson dac860e8ce engine: Show modal startup errors if window open fails 2018-03-16 19:09:55 -04:00
Cole Robinson ee817c32ce s/connect_opt_out/connect_once/ for open-completed callback
Forgot about that helper function...
2018-03-16 18:05:52 -04:00
Cole Robinson dabbc8d5bd engine: Remove centralized conn.open handling
Move connection opening logic to each caller, since needs are
slightly different.
2018-03-15 21:24:48 -04:00
Cole Robinson cad809fe80 Make all dialogs clean up when vm/conn disappears
Moves all the window cleanup handling to each class and audit for
all --test-leak-debug errors and fix
2018-03-15 21:24:48 -04:00
Cole Robinson 1d17b98852 engine: Move most remaining window tracking to UI classes
Kind of a big mess but it was difficult to untangle piecemeal.
Basically this drops nearly all the centralized window tracking
in engine.py and moves it to each UI class. If manager.py wants
to open a details window it does it directly, and vmmDetails tracks
the window object list itself. This simplifies things and makes
the code easier to follow.

There's still some weirdness with vmmConnect and connection callbacks,
but future patches will break those apart.
2018-03-15 21:24:48 -04:00
Cole Robinson 92aea7c565 engine: Have windows increment/decrement windows directly 2018-03-15 21:24:48 -04:00
Cole Robinson 9fa9777f1c engine: Have windows call exit_app directly 2018-03-15 21:24:48 -04:00
Cole Robinson 58f872a205 clone: Convert to per-connection singleton-ish pattern
And convert the dialog VM handling to match other dialogs
2018-03-15 21:24:48 -04:00
Cole Robinson b94a9fdffb migrate: convert to singleton 2018-03-15 21:24:48 -04:00
Cole Robinson 65b512ae6f delete: Convert to singleton 2018-03-15 21:24:48 -04:00
Cole Robinson f088537798 engine: break out vmmConnectionManager
Have a separate class for tracking the connection list, and emitting
conn-added and conn-removed signals. It exists as a singleton instance
that UI classes can talk directly to
2018-03-15 21:24:48 -04:00
Cole Robinson befafe9dc7 engine: connect conn-added in UI classes
This creates a weird situation where we pass the engine to those
classes UI functions, but this is a step towards untangling that.

While here, get rid of the conn-added connect magic and add a
simpler way to access the connection list from the engine
2018-03-15 21:24:48 -04:00
Cole Robinson 6959a41ff2 connection: Drop vm-added emission on connect
We don't use this for most other signals and it's kind of unexpected
2018-03-15 21:24:48 -04:00
Cole Robinson 33def3c4af preferences: Convert to singleton 2018-03-15 21:24:48 -04:00
Cole Robinson b6a61818af about: Convert to singleton 2018-03-15 21:24:48 -04:00
Cole Robinson 717ff72684 engine: Move VM action callbacks to vmmenu.py
Call the callbacks directly rather than using signals. engine.py
has become a bit of a catchall for shared functionality and this
is a step towards disentangling it
2018-03-15 21:24:48 -04:00
Cole Robinson 4c7c45908f manager: Fix mem, disk, net stats graphs (bz 1543896)
python2/3 division compat messed this up

https://bugzilla.redhat.com/show_bug.cgi?id=1543896
2018-02-09 14:02:04 -05:00
Radostin Stoyanov 6712261510 Python 2/3 division compatability
In Python 2 the classic devision of integers returns an integer
but in Python 3 it might return float.

Example:
- Python 2:          - Python 3:
    >>> 9 / 4            >>> 9 / 4
    2                    2.25
    >>> 9 // 4           >>> 9 // 4
    2                    2
    >>> 9 / 4.0          >>> 9 / 4.0
    2.25                 2.25
    >>> 9 // 4.0         >>> 9 // 4.0
    2.0                  2.0

For more info see: https://www.python.org/dev/peps/pep-0238/
2018-01-27 15:30:17 -05:00
Cole Robinson 08049bfb0b manager: Add accessible names to conn context menu
Needed to differentiate identical menu items in the ui test suite
2018-01-09 17:58:55 -05:00
Cole Robinson d82022bd2c manager: Drop python2 only cmp() usage
Manually implement it
2017-10-21 19:41:33 -04:00
Chen Hanxiao b44aa0e3bb pycodestyle: fix all E131 warnings
Fix all E131:
     Continuation line unaligned for hanging indent

   Also remove ignore options of E131

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-08-26 20:03:21 +08:00
Chen Hanxiao c92aade081 pycodestyle: fix all E203 warnings
Fix all E203 whitespace before ':'
   Also remove E203 ignore option of pycodestyle

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-08-11 00:01:38 +08:00
Radostin Stoyanov b93cc3bbc9 pycodestyle: Do not use bare 'except:'
A bare 'except:' catches all exceptions [1], including SystemExit,
KeyboardInterrupt, and GeneratorExit (which is not an error and should
not normally be caught by user code). In situations where you need to
catch all “normal” errors, you can catch the base class for all normal
exceptions, Exception [2].

[1] https://docs.python.org/2/howto/doanddont.html#except
[2] https://docs.python.org/2/library/exceptions.html#Exception
2017-08-02 13:57:43 -04:00
Cole Robinson 62feeb02a8 Switch to python3 style 'except X as Y' notation
Which also works with python2.7
2017-05-05 14:52:11 -04:00
Cole Robinson 107aa2b134 manager: Fix window size tracking on wayland (bug 1375175)
The method we were using is a common implementation bug,
explained here: https://wiki.gnome.org/HowDoI/SaveWindowState

https://bugzilla.redhat.com/show_bug.cgi?id=1375175
2016-12-13 13:34:09 -05:00
Cole Robinson 0891fc9ee1 manager: Clean up new conn/vm handling 2016-05-20 11:44:18 -04:00
Cole Robinson c65e9d1e16 manager: fix --show-domain * manager conn populating
We need to register the conn internally before connecting
vm-added, otherwise the VMs don't end up in the UI
2016-05-20 11:44:18 -04:00
Cole Robinson 3aa941571a uiutil: Drop check for old pygobject row handling
Once upon a time it couldn't handle setting a row value to None,
but we've bumped the dep now
2016-05-17 17:49:56 -04:00
Cole Robinson f4dfb6de9d Fix recent pylint/pep8 output 2016-04-18 16:42:12 -04:00
Cole Robinson febe0abdd2 virt-manager: Drop manual dbusapi, use GtkApplication
So I was confused here and completely missed that GtkApplication is
meant to handle the common case of invoking actions in an existing
app instance. So drop the manual dbus server and use the simpler
Gtk support.

Fix a bunch of other errors in this area too
2015-12-06 15:41:49 -05:00
Pavel Hrdina fedf2e7b66 ui: improve pause/resume tooltip
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1238618

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-11-12 13:13:19 +01:00
Cole Robinson 3e049583cc details: Drop ignorePause variable; just block the signals 2015-11-10 18:30:31 -05:00
Cole Robinson bcc13dca31 virt-manager: Only save window dimensions on app exit (bz 1262561)
Rather than on every window change event which spams dconf and hits
the disk repeatedly. The new method is roughly what is suggested by
https://wiki.gnome.org/HowDoI/SaveWindowState

https://bugzilla.redhat.com/show_bug.cgi?id=1262561
2015-09-13 14:07:43 -04:00
Cole Robinson fdad3efe24 uiutil: streamline column vs rowidx parameter name 2015-05-19 18:29:45 -04:00
Cole Robinson a65c1f62ec conn: Audit get_$obj callers, drop KeyError handling
These functions don't throw KeyErrors anymore, so adjust callers that
were handling it
2015-05-07 12:26:10 -04:00
Cole Robinson fbf841151d conn/domain: Condense the internal stats APIs 2015-05-04 18:05:54 -04:00
Cole Robinson 3d2afbaf6f connection: Allow setting a custom 'pretty name' (bz 784701)
We've had multiple requests over the years for something similar. People
might have to connect to multiple IP addresses, or really large hostnames,
that become difficult to distinguish in the UI.

Add a field in the host details page that allows setting a custom name,
and store it in gsettings.
2015-04-11 13:39:25 -04:00
Cole Robinson 4781ad6cd6 connection: Simplify manager row 'pretty name' handling
Unify all the callers, and use some UI ellipsizing to handle
crazy long hostnames.

This drops the conn name collision prevention stuff which can be
useful when you have lots of similar connection names. But upcoming
patches will make it mostly redundant.
2015-04-11 12:57:32 -04:00
Cole Robinson a3f8d73a9c libvirtobject: Unify internal status APIs and signals
Drop config-changes vs. status-changed and just use one signal, since they
are largely the same code paths for all users.
2015-04-10 15:00:34 -04:00
Cole Robinson 01bf07ba11 libvirtobject: Unify status signals
Dispatch them all from the actual object and not proxied through
the connection. Use the same signal name for all objects with the same
signature.
2015-04-10 15:00:33 -04:00
Cole Robinson 606069b1f4 manager: Use case-insensitive sort for VM names (bz 1155227) 2015-03-26 19:13:29 -04:00
Cole Robinson cff08223ba util: Move uri_split to its own URISplit class
Does what uri_split did, but wraps it all up in an object that makes
handling the data easier, and makes it easy to extend.
2014-12-09 08:43:19 -05:00
Guido Günther 1726505fd6 s/gconf/gsettings/
GConf got replaced by GSettings but some methods kept the old name
2014-09-29 08:56:37 -04:00
Cole Robinson 226c4562d5 virtManager: Switch to relative imports 2014-09-12 16:28:38 -04:00
Cole Robinson bd5e57dbdc connection: Simplify state management 2014-09-12 16:28:37 -04:00
Cole Robinson b398a46e9b domain: Cache has_managed_save value
Otherwise we call it every time a domain row is selected, which makes
things choppy on remote connections.
2014-09-12 16:28:37 -04:00
Cole Robinson 7fcdd61920 manager: Expand logic to avoid colliding connection descriptions
And drop some unused code
2014-07-04 18:20:54 -04:00