summaryrefslogtreecommitdiff
path: root/virtManager/console.py
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2014-01-26 17:09:07 -0500
committerCole Robinson <crobinso@redhat.com>2014-01-26 17:09:07 -0500
commit20088ab8fb42ca9b9f3ae2637865b5d05eb82726 (patch)
treef0530d6005f7decef2d40732d76f988bd642b634 /virtManager/console.py
parentad363f97747f3295d3f89616ebab863672a4ed06 (diff)
downloadvirt-manager-20088ab8fb42ca9b9f3ae2637865b5d05eb82726.tar.gz
Move many shared UI functions to addhw static functions
Much of uihelpers is just simple stuff that's shared between addhw and details UI, so just make it staticmethods in addhw, which details already has a reference to.
Diffstat (limited to 'virtManager/console.py')
-rw-r--r--virtManager/console.py29
1 files changed, 27 insertions, 2 deletions
diff --git a/virtManager/console.py b/virtManager/console.py
index 6eae1211..597399f8 100644
--- a/virtManager/console.py
+++ b/virtManager/console.py
@@ -38,7 +38,6 @@ import signal
import socket
import threading
-import virtManager.uihelpers as uihelpers
from virtManager.autodrawer import AutoDrawer
from virtManager.baseclass import vmmGObjectUI, vmmGObject
from virtManager.serialcon import vmmSerialConsole
@@ -59,6 +58,7 @@ def has_property(obj, setting):
return True
+
class ConnectionInfo(object):
"""
Holds all the bits needed to make a connection to a graphical console
@@ -794,7 +794,7 @@ class vmmConsolePages(vmmGObjectUI):
self.send_key_button = None
self.fs_toolbar = None
self.fs_drawer = None
- self.keycombo_menu = uihelpers.build_keycombo_menu(self.send_key)
+ self.keycombo_menu = self.build_keycombo_menu(self.send_key)
self.init_fs_toolbar()
# Make viewer widget background always be black
@@ -822,6 +822,7 @@ class vmmConsolePages(vmmGObjectUI):
self.page_changed()
+
def is_visible(self):
if self.topwin:
return self.topwin.get_visible()
@@ -851,6 +852,30 @@ class vmmConsolePages(vmmGObjectUI):
# Initialization helpers #
##########################
+ @staticmethod
+ def build_keycombo_menu(cb):
+ # Shared with vmmDetails
+ menu = Gtk.Menu()
+
+ def make_item(name, combo):
+ item = Gtk.MenuItem.new_with_mnemonic(name)
+ item.connect("activate", cb, combo)
+
+ menu.add(item)
+
+ make_item("Ctrl+Alt+_Backspace", ["Control_L", "Alt_L", "BackSpace"])
+ make_item("Ctrl+Alt+_Delete", ["Control_L", "Alt_L", "Delete"])
+ menu.add(Gtk.SeparatorMenuItem())
+
+ for i in range(1, 13):
+ make_item("Ctrl+Alt+F_%d" % i, ["Control_L", "Alt_L", "F%d" % i])
+ menu.add(Gtk.SeparatorMenuItem())
+
+ make_item("_Printscreen", ["Print"])
+
+ menu.show_all()
+ return menu
+
def init_fs_toolbar(self):
scroll = self.widget("console-gfx-scroll")
pages = self.widget("console-pages")