Change per VM keyboard layout from manager.

This commit is contained in:
Agnieszka Kostrzewa 2012-04-24 17:48:10 +02:00
parent 2f81711fc2
commit c2179d9234
4 changed files with 25 additions and 0 deletions

BIN
icons/kbd-layout.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -278,6 +278,7 @@
<addaction name="action_editfwrules"/>
<addaction name="action_appmenus"/>
<addaction name="action_updatevm"/>
<addaction name="action_set_keyboard_layout"/>
<addaction name="separator"/>
<addaction name="action_global_settings"/>
<addaction name="action_backup"/>
@ -571,6 +572,18 @@
<string>Kill selected VM</string>
</property>
</action>
<action name="action_set_keyboard_layout">
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/kbd-layout.png</normaloff>:/kbd-layout.png</iconset>
</property>
<property name="text">
<string>Set keyboard layout</string>
</property>
<property name="toolTip">
<string>Set keyboard layout per VM</string>
</property>
</action>
</widget>
<resources>
<include location="resources.qrc"/>

View File

@ -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()

View File

@ -11,6 +11,7 @@
<file alias="show-all-running.png">icons/on-icon/show-all-running.png</file>
<file alias="mount.png">icons/mount.png</file>
<file alias="log.png">icons/log.png</file>
<file alias="kbd-layout.png">icons/kbd-layout.png</file>
<file alias="pencil.png">icons/pencil.png</file>
<file alias="redfirewall.png">icons/redfirewall.png</file>
<file alias="edit.png">icons/edit.png</file>