Commit Graph

54 Commits

Author SHA1 Message Date
Cole Robinson 388850f04e virtinst: Rename util to xmlutil
The only functions left in there are largely for xml handling, so
make it explicit
2019-06-07 18:21:24 -04:00
Cole Robinson 368c202f9b systray: Add connection open/close options 2018-10-07 20:16:55 -04:00
Cole Robinson 8a23cda0fe systray: Revive libappindicator usage
In the future, the only option for systray icons is going to
be statusnotifier/libappindicator. statusicon doesn't work on
wayland and gtk4 is dropping the APIs. KDE however is keeping
statusnotifier's around, and ubuntu is maintaining a gnome-shell
plugin to make them work

Revive support, but add a dbus check to make it smarter about
only using libappindicator when there's a listener present.
Better architect the code to separate the differences between
statusicon and libappindicator. Clean up the menu building
2018-10-07 19:52:20 -04:00
Daniel P. Berrangé 48e32b429d Fix copyright header to specify GPLv2 or later, not GPLv2 only.
The copyright headers in every file were chjanged in this previous commit

  commit b6dcee8eb7
  Author: Cole Robinson <crobinso@redhat.com>
  Date:   Tue Mar 20 15:00:02 2018 -0400

    Use consistent and minimal license header for every file

Where before this they said "

  "either version 2 of the License, or (at your option) any later version."

Now they just say

  "GNU GPLv2"

This fixes it to say "GNU GPLv2 or later" again.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-04 16:51:37 -04:00
Cole Robinson b6dcee8eb7 Use consistent and minimal license header for every file 2018-03-21 07:29: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 483a8de6c1 systray: Change window tracking a bit
We should only prevent app closing if the systray is actually embedded
2018-03-17 12:18:38 -04:00
Cole Robinson 9ec865e4c0 systray: Only create statusicon if showing
Since even if it's marked as not visible, it can cause some movement
on the gnome3 topbar with topicons extension
2018-03-17 11:42:12 -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 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 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 42e4cc33bf systray: Fix VM leak on conn close 2018-03-15 21:24:48 -04:00
Cole Robinson cfe633f964 systray: Drop appindicator support
Does anyone care about this anymore? Unity is gone, if the libs are
present on a gnome install it's always been funky (currently doesn't
display an icon on f27), libappindator seems largely dead upstream,
and traditional systray icons give very similar behavior.

Kill it and see if anyone complains
2018-03-15 21:24:48 -04:00
Radostin Stoyanov 978fb25ac7 Wrap keys(), values() in a list
In Python 3 dict.values() [1] , dict.keys() [2] and dict.items() [3]
return a view [4] of the dictionary’s values, keys and items.

In Python 2 these functions return a list. [5] [6] [7]

To resolve this we can convert the result of these function to a list.

[1] https://docs.python.org/3/library/stdtypes.html#dict.values
[2] https://docs.python.org/3/library/stdtypes.html#dict.keys
[3] https://docs.python.org/3/library/stdtypes.html#dict.items
[4] https://docs.python.org/3/library/stdtypes.html#dict-views
[5] https://docs.python.org/2/library/stdtypes.html#dict.items
[6] https://docs.python.org/2/library/stdtypes.html#dict.keys
[7] https://docs.python.org/2/library/stdtypes.html#dict.values
2018-02-06 18:49:17 -05:00
Radostin Stoyanov 73de828524 systray: Remove redundant variable assignment
The explicit assignment of "name" is unnecessary.
2017-10-27 10:10:08 +02:00
Radostin Stoyanov f41aafc721 Use enumerate instead of range and len 2017-10-20 13:18:31 -04:00
Cole Robinson 9617d1267d systray: Use APPLICATION_STATUS for appindicator
Not OTHER, as the reporter points out this shouldn't be used, and
causes issues on KDE

https://bugzilla.redhat.com/show_bug.cgi?id=1501173
2017-10-18 19:14:17 -04: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 f4dfb6de9d Fix recent pylint/pep8 output 2016-04-18 16:42:12 -04:00
Cole Robinson 71a52300ae systray: Log if we will use AppIndicator 2015-11-18 18:54:17 -05:00
Cole Robinson cbef4ad84b systray: Fix appindicator icon name (bz 1257949) 2015-11-18 18:48:30 -05:00
Cole Robinson a91137dbdd engine: Clean up some object lifecycle leaks
pygobject doesn't seem to choke on debug_leak_check anymore, so we
can use it to find object leaks. just doing a few for now since it's
generally not a big deal.
2015-09-20 15:30:00 -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
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 7fcdd61920 manager: Expand logic to avoid colliding connection descriptions
And drop some unused code
2014-07-04 18:20:54 -04:00
Cole Robinson aefd4c4824 connection: Use name instead of uuid for object keys
And clean up the API mess while we are at it. Treat the key as an opaque
value that users shouldn't depend on.

Besides the improved code clarity and API layout, this will help diagnose
'key error' issues, since we'll see an object name instead of UUID which
is hard to trace back.
2014-06-02 17:48:32 -04:00
Cole Robinson 196ff823b3 Fix warnings with latest pep8 2014-05-02 10:20:59 -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 99eaf059ae Fix deprecation warnings on F21/rawhide 2014-02-25 15:57:38 -05:00
Cole Robinson c5581c01d2 Move sharedui.py to vmmenu.py
Since that's all it contains now
2014-01-29 09:22:28 -05:00
Cole Robinson 708a2737cf Split uihelpers into sharedui and uiutil
Reserve uiutil for the little gtk helper functions, rest goes into shared
UI (which all should probably be factored into their own files but thats
a task for another day)
2014-01-26 18:15:50 -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 e91cc84770 uihelpers: Add VMActionMenu, share between manager and systray 2013-09-22 15:45:53 -04:00
Cole Robinson 268b462126 uihelpers: Add VMShutdownMenu class
And use it in all the places where we are duplicating a similar menu
2013-09-22 15:45:49 -04:00
Cole Robinson 9d87b0d342 Replace set_property("visible") with modern set_visible 2013-09-01 20:18:14 -04:00
Marc Deslauriers b9cb73ec47 Switch AppIndicator code to use GObject introspection. 2013-07-29 14:45:06 -04:00
Cole Robinson 2b3604ceeb systray: Fix pylint from appindicators 2013-06-14 11:03:48 -04:00
Eric Shattow f2c0a77e3e AppIndicator3 required with Gtk3 usage
$ ./virt-manager --debug
/usr/lib/python2.7/dist-packages/gi/overrides/GLib.py:53:
PyGIDeprecationWarning: threads_init longer needs to be called. See:
https://bugzilla.gnome.org/show_bug.cgi?id=686914
  PyGIDeprecationWarning)
2013-06-12 13:10:56,977 (cliutils:75): virt-manager startup
2013-06-12 13:10:56,978 (virt-manager:199): Launched as:
['./virt-manager', '--debug']
2013-06-12 13:10:56,978 (virt-manager:200): virt-manager version: 0.9.100
2013-06-12 13:10:56,978 (virt-manager:201): virtManager import:
<module 'virtManager' from
'/home/es/software/pubscm/virt-manager/virtManager/__init__.pyc'>
2013-06-12 13:10:57,167 (virt-manager:247): GTK version: 3.8.2
/usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning:
g_boxed_type_register_static: assertion 'g_type_from_name (name) == 0'
failed
  import gobject._gobject
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning:
specified class size for type 'PyGtkGenericCellRenderer' is smaller
than the parent type's 'GtkCellRenderer' class size
  from gtk import _gtk
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning:
g_type_get_qdata: assertion 'node != NULL' failed
  from gtk import _gtk
Segmentation fault (core dumped)
2013-06-14 09:09:08 -04:00
Cole Robinson 7e23244096 Port from gconf to gsettings
This unfortunately has a decent amount of fallout: add a wrapper class
in config.py that reduces much of the churn.

Another big piece is that gsettings can't accept arbitrary paths like
gconf would, everything needs to be described in the schema.

Also do a bunch more RPM spec modernizing
2013-04-18 12:43:16 -04:00
Cole Robinson 07e0c92b4b Remove a bunch of outdates FIXME/XXX comments 2013-04-17 09:32:00 -04:00