translate trigger strings

This commit is contained in:
Marco Martin 2013-08-27 15:54:05 +02:00
parent 8052ed8566
commit 8c252e6c17
2 changed files with 20 additions and 1 deletions

View File

@ -26,6 +26,20 @@ Item {
implicitWidth: childrenRect.width
implicitHeight: childrenRect.height
property var prettyStrings: {
"LeftButton": i18n("Left-Button"),
"RightButton": i18n("Right-Button"),
"MidButton": i18n("Middle-Button"),
"wheel:Vertical": i18n("Vertical-Scroll"),
"wheel:Horizontal": i18n("Horizontal-Scroll"),
"ShiftModifier": i18n("Shift"),
"ControlModifier": i18n("Ctrl"),
"AltModifier": i18n("Alt"),
"MetaModifier": i18n("Meta")
}
function saveConfig() {
configDialog.currentContainmentActionsModel.save();
}
@ -42,12 +56,13 @@ Item {
delegate: RowLayout {
width: root.width
MouseEventInputButton {
defaultText: model.action
defaultText: prettyStrings ? (prettyStrings[model.action.split(';')[1]] ? prettyStrings[model.action.split(';')[1]] + "+" : "") + prettyStrings[model.action.split(';')[0]] : ""
eventString: model.action
onEventStringChanged: {
configDialog.currentContainmentActionsModel.update(index, eventString, model.pluginName);
}
}
QtControls.ComboBox {
id: pluginsCombo
Layout.fillWidth: true
@ -100,4 +115,5 @@ Item {
}
}
}
}

View File

@ -19,6 +19,7 @@
import QtQuick 2.0
import QtQuick.Controls 1.0 as QtControls
import QtQuick.Layouts 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
QtControls.Button {
@ -28,6 +29,8 @@ QtControls.Button {
checkable: true
property string eventString
width: theme.defaultFont.mSize.width*15
onCheckedChanged: {
if (checked) {
text = i18n("Input Here");