diff --git a/icons/kbd-layout.png b/icons/kbd-layout.png
new file mode 100644
index 0000000..7c7cc53
Binary files /dev/null and b/icons/kbd-layout.png differ
diff --git a/mainwindow.ui b/mainwindow.ui
index d861c9d..0d68207 100644
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -278,6 +278,7 @@
+
@@ -571,6 +572,18 @@
Kill selected VM
+
+
+
+ :/kbd-layout.png:/kbd-layout.png
+
+
+ Set keyboard layout
+
+
+ Set keyboard layout per VM
+
+
diff --git a/qubesmanager/main.py b/qubesmanager/main.py
index 6991ac7..3c2cbdd 100755
--- a/qubesmanager/main.py
+++ b/qubesmanager/main.py
@@ -659,6 +659,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
self.context_menu.addAction(self.action_appmenus)
self.context_menu.addAction(self.action_editfwrules)
self.context_menu.addAction(self.action_updatevm)
+ self.context_menu.addAction(self.action_set_keyboard_layout)
self.table_selection_changed()
@@ -959,6 +960,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
self.action_appmenus.setEnabled(not vm.is_netvm())
self.action_editfwrules.setEnabled(vm.is_networked() and not (vm.is_netvm() and not vm.is_proxyvm()))
self.action_updatevm.setEnabled(vm.is_updateable() or vm.qid == 0)
+ self.action_set_keyboard_layout.setEnabled(vm.qid != 0 and vm.last_running)
else:
self.action_settings.setEnabled(False)
self.action_removevm.setEnabled(False)
@@ -969,6 +971,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
self.action_appmenus.setEnabled(False)
self.action_editfwrules.setEnabled(False)
self.action_updatevm.setEnabled(False)
+ self.action_set_keyboard_layout.setEnabled(False)
@@ -1310,6 +1313,14 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
return
thread_monitor.set_finished()
+
+ @pyqtSlot(name='on_action_set_keyboard_layout_triggered')
+ def action_set_keyboard_layout_triggered(self):
+ print "change layout!"
+ vm = self.get_selected_vm()
+ subprocess.Popen( ['qvm-run', vm.name, 'qubes-change-keyboard-layout'])
+
+
@pyqtSlot(name='on_action_showallvms_triggered')
def action_showallvms_triggered(self):
self.show_inactive_vms = self.action_showallvms.isChecked()
diff --git a/resources.qrc b/resources.qrc
index bd4e676..75f0e6d 100644
--- a/resources.qrc
+++ b/resources.qrc
@@ -11,6 +11,7 @@
icons/on-icon/show-all-running.png
icons/mount.png
icons/log.png
+ icons/kbd-layout.png
icons/pencil.png
icons/redfirewall.png
icons/edit.png