Changeset View
Changeset View
Standalone View
Standalone View
applets/comic/package/contents/ui/configAdvanced.qml
Show All 11 Lines | |||||
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | import QtQuick 2.0 | 19 | import QtQuick 2.0 | ||
20 | import QtQuick.Controls 1.1 as Controls | 20 | import QtQuick.Controls 2.5 as Controls | ||
21 | import QtQuick.Layouts 1.1 as Layouts | 21 | import QtQuick.Layouts 1.1 as Layouts | ||
22 | 22 | | |||
23 | import org.kde.plasma.core 2.0 as PlasmaCore | 23 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
24 | import org.kde.kirigami 2.5 as Kirigami | ||||
24 | 25 | | |||
25 | 26 | | |||
26 | Layouts.ColumnLayout { | 27 | Kirigami.FormLayout { | ||
27 | id: root | 28 | id: root | ||
29 | anchors.left: parent.left | ||||
30 | anchors.right: parent.right | ||||
28 | 31 | | |||
29 | signal configurationChanged | 32 | signal configurationChanged | ||
30 | 33 | | |||
31 | function saveConfig() { | 34 | function saveConfig() { | ||
32 | plasmoid.nativeInterface.showErrorPicture = showErrorPicture.checked; | 35 | plasmoid.nativeInterface.showErrorPicture = showErrorPicture.checked; | ||
33 | plasmoid.nativeInterface.maxComicLimit = maxComicLimit.value; | 36 | plasmoid.nativeInterface.maxComicLimit = maxComicLimit.value; | ||
34 | 37 | | |||
35 | plasmoid.nativeInterface.saveConfig(); | 38 | plasmoid.nativeInterface.saveConfig(); | ||
36 | plasmoid.nativeInterface.configChanged(); | 39 | plasmoid.nativeInterface.configChanged(); | ||
37 | } | 40 | } | ||
38 | 41 | | |||
39 | Component.onCompleted: { | 42 | Component.onCompleted: { | ||
40 | showErrorPicture.checked = plasmoid.nativeInterface.showErrorPicture; | 43 | showErrorPicture.checked = plasmoid.nativeInterface.showErrorPicture; | ||
41 | maxComicLimit.value = plasmoid.nativeInterface.maxComicLimit; | 44 | maxComicLimit.value = plasmoid.nativeInterface.maxComicLimit; | ||
42 | } | 45 | } | ||
43 | 46 | | |||
44 | Controls.GroupBox { | | |||
45 | Layouts.Layout.fillWidth: true | | |||
46 | flat: true | | |||
47 | | ||||
48 | title: i18nc("@title:group", "Cache") | | |||
49 | | ||||
50 | Layouts.RowLayout { | 47 | Layouts.RowLayout { | ||
51 | Layouts.Layout.alignment: Qt.AlignRight | 48 | Kirigami.FormData.label: i18nc("@label:spinbox", "Comic cache:") | ||
52 | Controls.Label { | 49 | | ||
53 | text: i18nc("@label:spinbox", "Comic cache:") | | |||
54 | } | | |||
55 | Controls.SpinBox { | 50 | Controls.SpinBox { | ||
56 | id: maxComicLimit | 51 | id: maxComicLimit | ||
57 | Layouts.Layout.minimumWidth: units.gridUnit * 8 | | |||
58 | suffix: i18nc("@item:valuesuffix spacing to number + unit", " strips per comic") | | |||
59 | stepSize: 1 | 52 | stepSize: 1 | ||
60 | onValueChanged: root.configurationChanged(); | 53 | onValueChanged: root.configurationChanged(); | ||
61 | } | 54 | } | ||
55 | | ||||
56 | Controls.Label { | ||||
57 | text: i18ncp("@item:valuesuffix spacing to number + unit", "strip per comic", "strips per comic") | ||||
ngraham: The way you do this properly is as follows, with `i18ncp()`:
```
text: i18ncp("@item… | |||||
It's always the plural now, but I also realized we shouldn't be using singular if value is 1 because some Slavic languages use singular with 21, 31, etc. filipf: It's always the plural now, but I also realized we shouldn't be using singular if value is 1… | |||||
Yep, even if the quantity will always be more than one, it should always use an i18np(). for just that reason. :) ngraham: Yep, even if the quantity will always be more than one, it should always use an `i18np()`. for… | |||||
62 | } | 58 | } | ||
63 | } | 59 | } | ||
64 | Controls.GroupBox { | | |||
65 | Layouts.Layout.fillWidth: true | | |||
66 | flat: true | | |||
67 | | ||||
68 | title: i18nc("@title:group", "Error Handling") | | |||
69 | 60 | | |||
70 | Layouts.ColumnLayout { | | |||
71 | Controls.CheckBox { | 61 | Controls.CheckBox { | ||
72 | id: showErrorPicture | 62 | id: showErrorPicture | ||
73 | text: i18nc("@option:check", "Display error when getting comic failed") | 63 | text: i18nc("@option:check", "Display error when downloading comic fails") | ||
74 | onCheckedChanged: root.configurationChanged(); | 64 | onCheckedChanged: root.configurationChanged(); | ||
75 | } | 65 | } | ||
76 | } | 66 | } | ||
77 | } | | |||
78 | | ||||
79 | Item { | | |||
80 | Layouts.Layout.fillHeight: true | | |||
81 | } | | |||
82 | } | |
The way you do this properly is as follows, with i18ncp():