Commit Graph

38 Commits

Author SHA1 Message Date
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
20d5c1887a baseclass: Export GObject.SignalFlags.RUN_FIRST
Saves some typing and imports
2018-03-15 21:24:48 -04:00
Cole Robinson
3187078f10 config: Convert to singleton 2018-03-15 21:24:48 -04:00
Cole Robinson
b5b2433ad5 baseclass: Fix UI file loading on py3
We were passing in a unicode string object, but add_from_string
depends on knowing binary length. This caused signals to not
be registered which broke reopening the details window

Just switch to add_from_file to sidestep the issue
2017-12-20 16:04:36 -05: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
5c66c7010c baseclass: Document some functions
And drop a bit of redundant code that we haven't needed for a while
2017-07-19 10:35:19 -04:00
Cole Robinson
f551d7e55d Replace file() usage with open()
Same semantics, but the latter is needed for python3
2017-05-05 14:53:12 -04:00
Pavel Grunt
1f68cf2b01 Do not use deprecated gdk_cursor_new
It relies on the presence of X cursor fonts in the system. Use
recommended gdk_cursor_new_from_name and use cursor names that works
on different backends.

Deprecated since Gdk 3.16

https://bugzilla.redhat.com/show_bug.cgi?id=1442612
2017-05-03 13:38:23 -04:00
Cole Robinson
c0a3234633 baseclass: share wizard cursor setting code 2017-04-27 15:00:17 -04:00
Cole Robinson
7b0f916886 baseclass: Undo workaround for old pygobject
Basically reverting this commit:

    commit 1c8bf88db7
    Author: Cole Robinson <crobinso@redhat.com>
    Date:   Tue Jun 18 08:46:24 2013 -0400

    baseclass: Add unregister wrappers for idle and timeout

    If an idle handler raises an exception, it isn't unregistered and loops
    forever. This is a regression from previous pygobject and pygtk:

    https://bugzilla.gnome.org/show_bug.cgi?id=702552

    Work around this for now with our own wrappers.
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
c6da8fedb8 config: s/running_config/RUNNING_CONFIG/g 2015-11-02 16:09:47 -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
df32f9331d baseclass: Add helper for launching daemon thread
And use it in a few spots
2014-09-12 16:28:37 -04:00
Cole Robinson
a398d245cb Clean up pylint integration
- Drop no longer needed disable= bits
- Use string names for all skipped pylint messages
2014-04-02 19:00:24 -04:00
Cole Robinson
8562c3258e More pylint fixes 2014-03-22 11:21:19 -04:00
Cole Robinson
fa6fedd959 engine: Serialize connection autostart (bz 749750)
So polkit/openssh-askpass doesn't spam us
2014-02-01 10:44:45 -05:00
Cole Robinson
8bb9853ec8 Move shared cdrom media UI to mediacombo.py 2014-01-28 14:20:57 -05:00
Cole Robinson
745ec7cb96 create: Reinit netlist on each run
Will be easier to handle if we make the netlist react to connection
signals.
2014-01-28 13:59:31 -05:00
Giuseppe Scrivano
0df75c7603 headers: update "Red Hat, Inc." copyright for the year 2013
Ensure that any file touched by a @redhat.com author in 2013 has an
updated copyright header.

The files were updated using the build-aux/update-copyright gnulib
script and manually added where the copyright line wasn't present.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-28 17:22:26 +01:00
Cole Robinson
3629dabeb0 snapshots: new: Add default and escape action 2013-09-30 16:37:46 -04:00
Cole Robinson
5bf63759b6 console: Fix issues with spice and askpass (bz 811346)
Spice opens many FDs to handle different channels (display, usb, sound,
etc.). For remote SSH URIs, this means we launch multiple SSH proceses.
We do so by forking off the process, and when SSH has successfully
authenticated, the data starts flowing.

If using spice + remote SSH w/o SSH keys, you need to put your data
into ssh askpass. askpass wants to own the display for security reasons.

When all the channel requests start coming in, we were launching multiple
ssh processes one after another. This upset askpass and generally
caused havoc in the app.

Add some infrastructure to serialize launching ssh processes. We only
launch the next ssh process if spice/vnc have conclusively connected
or errored out the connection. This makes connection a bit slower
for the non-askpass ssh case (about 1.5 seconds), but will ignore
avoid this oft reported problem.
2013-09-06 19:36:09 -04:00
Cole Robinson
bbf51ee3cb baseclass: Build error object on demand
Should speed things up a tiny bit in the common case
2013-09-02 09:35:07 -04:00
Cole Robinson
e8531b1f40 Initial snapshot support
This adds initial UI for managing snapshots: list, run/revert, delete,
add, and redefining (for changing <description>) supported, but currently
only for internal snapshots. The UI is mostly in its final form except for
some bells and whistles.

The real remaining question is what do we want to advertise and support.
Internal (qcow2) snapshots are by far the simplest to manage, very
mature, and already have the semantics we want.

However most recent libvirt and qemu work has been to facilitate
external snapshots, which are more extensible and can be performed
live, and with qemu-ga coordination for extra safety. However
they make things much harder for virt-manager at the moment.

Until we have a plan, this work should be considered experimental
and not be relied upon.
2013-08-21 18:41:42 -04:00
Cole Robinson
7c55cfeb39 virtManager: Drop util, combine it with virtinst.util and uihelpers 2013-08-11 12:39:28 -04:00
Leonardo Garcia
40cff67836 virt-manager: Properly handle errors when --show-* options are used.
crobinso: Fix some pylint
2013-07-15 16:03:15 -04:00
Cole Robinson
1c8bf88db7 baseclass: Add unregister wrappers for idle and timeout
If an idle handler raises an exception, it isn't unregistered and loops
forever. This is a regression from previous pygobject and pygtk:

https://bugzilla.gnome.org/show_bug.cgi?id=702552

Work around this for now with our own wrappers.
2013-06-18 08:49:34 -04:00
Cole Robinson
b339295fb5 Sigh, fix previous commit. 2013-06-14 16:32:48 -04:00
Cole Robinson
ea9fadac78 config: Fix changing tick timeout on the fly 2013-06-14 16:22:33 -04:00
Cole Robinson
0f8ea6eaa6 baseclass: Clean up non-standard __init__
Only used by console.py, make it more explicit.
2013-06-08 19:25:36 -04:00
Cole Robinson
b15e51e73b baseclass: Privatize refcount debug helper 2013-04-25 12:07:57 -04:00
Cole Robinson
f6f55314cb Remove virt-manager-tui
Was originally added with hopes for being used in an ovirt related
product, but was more or less a code dump, and the author has been
allocated to other things. He confirmed it's okay to remove.

That, and it's currently broken, and we've had approximately 0 user
feedback since it was committed.
2013-04-18 16:12:03 -04:00
Cole Robinson
07e0c92b4b Remove a bunch of outdates FIXME/XXX comments 2013-04-17 09:32:00 -04:00
Cole Robinson
812899daf8 Remove HAL support
It is long since deprecated, and the UI has been able to accomodate
lack of interface API support for a while.
2013-04-15 19:51:46 -04:00
Cole Robinson
0d243983d0 Revive pep8 and clean up the code
autopep8 is pretty cool :)
2013-04-13 15:22:43 -04:00
Cole Robinson
9515a8575d Disable pylint warnings about gi.repository
Since pylint still can't handle the dynamic nature of gobject
introspection.
2013-04-12 08:27:45 -04:00
Cole Robinson
9d05583c26 Remove autotools, replace with distutils-extra
Despite being a known quantity, autotools is so overkill for our needs,
so let's drop it and replace it with a much simpler and easy to customize
system.
2013-04-03 18:20:51 -04:00