Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 41567057 authored by Jan Grulich's avatar Jan Grulich

Make some other texts translatable

Also share password field for both WEP and WPA security types
parent 48bcd220
......@@ -44,7 +44,7 @@ ColumnLayout {
Controls.ComboBox {
id: ipMethodComb
model: ["Automatic","Manual"]
model: [i18n("Automatic"), i18n("Manual")]
onCurrentIndexChanged: {
if (ipMethodComb.currentIndex == 0) {
ipmain.state = "Automatic"
......
/*
* Copyright 2017-2018 Martin Kacej <m.kacej@atlas.sk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.6
import QtQuick.Controls 2.2 as Controls
import QtQuick.Layouts 1.2 as Layouts
......@@ -11,7 +30,7 @@ Layouts.ColumnLayout {
property var enabledSave: false
width: parent.width
Column{
Column {
id: securitySectionHeader
width: parent.width
......@@ -29,39 +48,41 @@ Layouts.ColumnLayout {
id: securityCombobox
//anchors.bottomMargin: units.Gridunit
anchors.bottomMargin: 50
model: [i18n("None"), i18n("WEP Key"), i18n("Dynamic WEP"), i18n("WPA/WPA2 Personal"), i18n("WPA/WPA2 Enterprise")]
model: ListModel {
id: securityTypesModel
// FIXME just placeholder element to set "text" property as default
ListElement {
text: "placeholder"
}
Component.onCompleted: {
clear()
append({ "text": i18n("None"), "type": PlasmaNM.Enums.NoneSecurity })
append({ "text": i18n("WEP Key"), "type": PlasmaNM.Enums.StaticWep })
append({ "text": i18n("Dynamic WEP"), "type": PlasmaNM.Enums.DynamicWep })
append({ "text": i18n("WPA/WPA2 Personal"), "type": PlasmaNM.Enums.Wpa2Psk })
append({ "text": i18n("WPA/WPA2 Enterprise"), "type": PlasmaNM.Enums.Wpa2Eap })
securityCombobox.currentIndex = 0
}
}
}
Controls.Label {
anchors.bottomMargin: units.Gridunit
visible: !(securityCombobox.currentText == "None")
text: securityCombobox.currentText
}
}
Layouts.ColumnLayout {
id: wep
id: wepWpaSecurity
anchors.top: securitySectionHeader.bottom
width: parent.width
Column {
width: parent.width
visible: (securityCombobox.currentText === "WEP Key")
PasswordField {
width: parent.width
securityType: PlasmaNM.Enums.StaticWep
}
}
}
Layouts.ColumnLayout {
id: wpaPSK
width: parent.width
anchors.top: securitySectionHeader.bottom
Column {
width: parent.width
visible: (securityCombobox.currentText === "WPA/WPA2 Personal")
visible: securityCombobox.currentIndex == 1 || securityCombobox.currentIndex == 3
PasswordField {
id: wepWpaPasswordField
width: parent.width
securityType: PlasmaNM.Enums.Wpa2Psk
securityType: securityTypesModel.get(securityCombobox.currentIndex).type
}
}
}
......@@ -70,9 +91,9 @@ Layouts.ColumnLayout {
id: eap
anchors.top: securitySectionHeader.bottom
Column {
visible: (securityCombobox.currentText === "Dynamic WEP")
visible: securityCombobox.currentIndex == 2 || securityCombobox.currentIndex == 4
Controls.Label {
text:i18n("Authentication")
text: i18n("Authentication")
}
Controls.ComboBox {
id: authComboBox
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment