Commit Graph

25 Commits

Author SHA1 Message Date
Cole Robinson
28af0f02f6 console: Clarify some error labels and debug messages
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-21 11:03:23 -05:00
Cole Robinson
bd4ca8a55e console: Add _cb suffix to viewer callback function names
And use _src for the first parameter name, which appeases pylint
but is more descriptive

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-21 11:03:23 -05:00
Cole Robinson
8bb64ad5af console: Don't block console reconnect for non-error
https://listman.redhat.com/archives/virt-tools-list/2022-January/msg00012.html

On xen, a guest reboot will trigger a non-error viewer-disconnected
signal, but we treat it like an error, which makes it difficult to
reconnect to the VM console.

If there's no error message raised, treat the disconnect like a
non-error cases.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-21 11:03:23 -05:00
Cole Robinson
aaabb44ac7 details: console: drop hardcoding background color as black
Submitted in https://github.com/virt-manager/virt-manager/pull/241

I couldn't get this code to change the output, tested with VNC and
spice-gtk on Fedora 34 gnome-shell x11 and XFCE. Maybe it's something
theme related. But either way this doesn't seem to be useful for the
default case anyways, so let's drop it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-07-31 16:27:15 -04:00
Cole Robinson
a53f35e425 viewers: Absorb resizeguest support check
This let's us move the gtkvnc import back
to be solely in viewers.py

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-05-22 14:56:10 -04:00
Daniel P. Berrangé
499739cee3 details: enable resizing of displays with new GtkVnc
The 1.2.0 release of GtkVnc introduces support for remote desktop
resize. This is also supported in QEMU >= 6.0.0 when using virtio-gpu.

This introduces support for resize without forcing a new min version of
GtkVnc by just checking for existance of the new API. We don't attempt
to check if the current QEMU instance supports resize, as we gracefully
degrade - the guest simply won't resize and will be rendered as before.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-19 16:30:00 -04:00
Pavel Hrdina
cf93e2dbff console: fix error with old pygobject
The code doesn't work as expected. From python documentation:

    x and y

is the same as

    x if not x or y

so in the code if for some reasone `dev` is None the value stored in
`sensitive` will be None as well.

No the code itself works with pygobject >= 3.31.3 where they allowed
None as a valid boolean value, but with older versions it will fail
with this error message:

    TypeError: Argument 1 does not allow None as a value

Resolves: https://github.com/virt-manager/virt-manager/issues/226

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2021-02-05 12:15:46 +01:00
Cole Robinson
e58cc956b5 vmwindow: vm state-changed update flow changes
* Don't process events when the window isn't showing
* Only update console/details if that tab is actually selected.
    Otherwise in some corner cases we can connect to the VM console
    while on the details page

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-21 09:06:18 -04:00
Cole Robinson
c0c704e1fa console: Move _change_title behavior to vmwindow
This is where it conceptually belongs

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-21 09:06:18 -04:00
Cole Robinson
78cd8c90ea console: Rework default page flow a bit
Move the VM status and viewer open checks into the default page
path as well, otherwise opening the details dialog for an offline
VM attempts to connect to the inactive VM console and logs backtraces

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 11:34:06 -04:00
Cole Robinson
ac8591192f console: Add option to disable autoconnect
As part of making virt-manager cooperate better with external viewers,
add an option to disable console autoconnect. When opening a VM window
for a running VM, you'll see a 'Connect to console' button in place
of the spice/vnc viewer. Click that and things proceed like normal.

This is useful to prevent virt-manager from disconnecting a virt-viewer
instance that's already attached to a VM

https://bugzilla.redhat.com/show_bug.cgi?id=1793876

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-09 19:59:31 -04:00
Cole Robinson
43512302f7 vmwindow: Cleanup the interaction with vmmConsolePages
- Add ui/console.ui for console-pages and below
- Add move auth and graphics unavailable pages to a new subnotebook
- Move all the menubar handling up into vmwindow
- Clarify the control flow as much as I can come up with

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-09 19:37:11 -04:00
Cole Robinson
aafb874c85 viewers: Enable window modifiers when viewer doesn't have keyboard
Right now this is tied to widget focus, which is too strong. This
changes it so that say clicking on the window title or toolbar then
allows the user to use Alt+F to trigger the File menu for example.
This roughly matches how virt-viewer works

https://bugzilla.redhat.com/show_bug.cgi?id=1824480

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-09 11:25:50 -04:00
Cole Robinson
33a61f7f30 prefs: Remove 'Force console accels' option
This is very obscure and definitely not in line with our DESIGN.md
nowadays

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-09 09:15:53 -04:00
Cole Robinson
b88e755a52 console: Text console submenu improvements
* Move all the menu building to its own class, for clarity
* Rename the menu 'Consoles' since it contains graphical choice as well
* Strip out the VM console duplicate if it exists
* Simplify the code a bit

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-09 08:49:12 -04:00
Cole Robinson
c36f232370 uitests: Finish console.py and viewers.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-30 10:34:44 -04:00
Cole Robinson
940bd3873e console: Replace auth-rejected with auth-error signal
Should be similar here. auth-rejected is hard to trigger anyways

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 16:17:45 -04:00
Cole Robinson
64e3ff1d08 uitests: console/keyring/viewer coverage work
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 13:23:34 -04:00
Cole Robinson
301892f6b9 serialcon: Modernize code style
* Privatize a bunch of stuff
* Make public API explicit
* Add a few minor public APIs to avoid accessing internal state

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 12:37:12 -04:00
Cole Robinson
e9c937691d uitests: Finish serialcon.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 12:37:12 -04:00
Cole Robinson
f06cc11546 config: Move more password handling to keyring.py
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-28 08:47:20 -04:00
Pino Toscano
8872e1e962 i18n: show localized accelerators in Send key menu
Turn the menu labels into GTK accelerator strings, so we can parse them
to convert them into a proper user representation.

There is a small behaviour change: the menu items do not have mnemonics
anymore by default.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:24:14 -04:00
Pino Toscano
71f034d6b6 i18n: fix string puzzles in error messages
Do not split the error messages and the error details, but rather use a
single string with proper placeholders. This avoids string puzzles.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Florian Ludwig
ae19d6d6ec fix resizing of spice clients with guest resizing enabled
Fixes 1414718
2019-11-12 11:46:35 -05:00
Cole Robinson
16a608c37b virtManager: move vmwindow components to virtManager/details 2019-06-17 00:12:32 -04:00