Skip to content

Commit

Permalink
Merge pull request #194 from Keeper-of-the-Keys/rearrange-settings
Browse files Browse the repository at this point in the history
Rearrange settings
  • Loading branch information
Keeper-of-the-Keys authored Jun 25, 2024
2 parents b917495 + b376fbd commit 7f287ec
Show file tree
Hide file tree
Showing 10 changed files with 290 additions and 236 deletions.
123 changes: 66 additions & 57 deletions qml/SettingsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,28 @@ Page {
title: qsTr("Settings")
}

SectionHeader {
text: qsTr("YouTube")
horizontalAlignment: Text.AlignHCenter
ValueButton {
id: downloads_folder_picker
anchors.horizontalCenter: parent.horizontalCenter
label: qsTr("Downloads directory")
onClicked: pageStack.push(folderPickerPage)
}

TextField {
id: youtube_api_key_v3
label: qsTr("API Key (v3)")
placeholderText: label
width: parent.width
inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
EnterKey.iconSource: (text.length > 0) ? "image://theme/icon-m-enter-accept" : "image://theme/icon-m-enter-close"
EnterKey.onClicked: focus = false
TextSwitch {
id: nomedia_toggle
text: qsTr("Prevent tracker scanning")
description: qsTr("Set a .nomedia file in the Downloads folder to prevent gpodder media showing up in the gallery/mediaplayer.")
onCheckedChanged: py.call('main.toggle_path_nomedia', [downloads_folder_picker.value, nomedia_toggle.checked]);
}

Component {
id: folderPickerPage
FolderPickerPage {
dialogTitle: qsTr("Download to")
onSelectedPathChanged: {
py.setConfig('fs.downloads', selectedPath);
}
}
}

SectionHeader {
Expand All @@ -115,70 +124,70 @@ Page {
stepSize: 100
}

SectionHeader {
text: qsTr("Playback Speed")
horizontalAlignment: Text.AlignHCenter
}

Slider {
id: speed_increment
label: qsTr("Speed increments")
label: qsTr("Increments")
valueText: value
width: parent.width
minimumValue: speed_increment.stepSize
maximumValue: 1.00
stepSize: 0.05
}

TextField {
id: speed_min
label: qsTr("Playback speed - lower limit")
placeholderText: label
Row {
width: parent.width
inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhFormattedNumbersOnly
EnterKey.iconSource: (text.length > 0) ? "image://theme/icon-m-enter-accept" : "image://theme/icon-m-enter-close"
EnterKey.onClicked: focus = false
validator: DoubleValidator {
bottom: speed_increment.value
decimals: 2
notation: DoubleValidator.StandardNotation
top: parseFloat(speed_max.text) - speed_increment.stepSize

TextField {
id: speed_min
label: qsTr("Lower limit")
placeholderText: label
width: parent.width / 2
inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhFormattedNumbersOnly
EnterKey.iconSource: (text.length > 0) ? "image://theme/icon-m-enter-accept" : "image://theme/icon-m-enter-close"
EnterKey.onClicked: focus = false
validator: DoubleValidator {
bottom: speed_increment.value
decimals: 2
notation: DoubleValidator.StandardNotation
top: parseFloat(speed_max.text) - speed_increment.stepSize
}
}

TextField {
id: speed_max
label: qsTr("Upper limit")
placeholderText: label
width: parent.width / 2
inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhFormattedNumbersOnly
EnterKey.iconSource: (text.length > 0) ? "image://theme/icon-m-enter-accept" : "image://theme/icon-m-enter-close"
EnterKey.onClicked: focus = false
validator: DoubleValidator {
bottom: parseFloat(speed_min.text) + speed_increment.stepSize
decimals: 2
notation: DoubleValidator.StandardNotation
top: 5
}
}
}

SectionHeader {
text: qsTr("YouTube")
horizontalAlignment: Text.AlignHCenter
}

TextField {
id: speed_max
label: qsTr("Playback speed - upper limit")
id: youtube_api_key_v3
label: qsTr("API Key (v3)")
placeholderText: label
width: parent.width
inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhFormattedNumbersOnly
inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
EnterKey.iconSource: (text.length > 0) ? "image://theme/icon-m-enter-accept" : "image://theme/icon-m-enter-close"
EnterKey.onClicked: focus = false
validator: DoubleValidator {
bottom: parseFloat(speed_min.text) + speed_increment.stepSize
decimals: 2
notation: DoubleValidator.StandardNotation
top: 5
}
}

ValueButton {
id: downloads_folder_picker
anchors.horizontalCenter: parent.horizontalCenter
label: qsTr("Downloads directory")
onClicked: pageStack.push(folderPickerPage)
}

TextSwitch {
id: nomedia_toggle
text: qsTr("Prevent tracker scanning")
description: qsTr("Set a .nomedia file in the Downloads folder to prevent gpodder media showing up in the gallery/mediaplayer.")
onCheckedChanged: py.call('main.toggle_path_nomedia', [downloads_folder_picker.value, nomedia_toggle.checked]);
}

Component {
id: folderPickerPage
FolderPickerPage {
dialogTitle: qsTr("Download to")
onSelectedPathChanged: {
py.setConfig('fs.downloads', selectedPath);
}
}
}
}
}
Expand Down
45 changes: 25 additions & 20 deletions translations/harbour-org.gpodder.sailfish-bg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,57 +518,62 @@
<translation>Настройки</translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="89"/>
<location filename="../qml/SettingsPage.qml" line="128"/>
<source>Playback Speed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="147"/>
<source>Lower limit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="163"/>
<source>Upper limit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="179"/>
<source>YouTube</source>
<translation>YouTube</translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="95"/>
<location filename="../qml/SettingsPage.qml" line="185"/>
<source>API Key (v3)</source>
<translation>API ключ (v3)</translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="104"/>
<location filename="../qml/SettingsPage.qml" line="113"/>
<source>Limits</source>
<translation>Ограничения</translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="110"/>
<location filename="../qml/SettingsPage.qml" line="119"/>
<source>Maximum episodes per feed</source>
<translation>Максимален брой епизоди за RSS емисия</translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="120"/>
<source>Speed increments</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="130"/>
<source>Playback speed - lower limit</source>
<location filename="../qml/SettingsPage.qml" line="134"/>
<source>Increments</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="146"/>
<source>Playback speed - upper limit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="163"/>
<location filename="../qml/SettingsPage.qml" line="91"/>
<source>Downloads directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="169"/>
<location filename="../qml/SettingsPage.qml" line="97"/>
<source>Prevent tracker scanning</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="170"/>
<location filename="../qml/SettingsPage.qml" line="98"/>
<source>Set a .nomedia file in the Downloads folder to prevent gpodder media showing up in the gallery/mediaplayer.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="177"/>
<location filename="../qml/SettingsPage.qml" line="105"/>
<source>Download to</source>
<translation type="unfinished"></translation>
</message>
Expand Down
45 changes: 25 additions & 20 deletions translations/harbour-org.gpodder.sailfish-de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,57 +517,62 @@
<translation>Einstellungen</translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="89"/>
<location filename="../qml/SettingsPage.qml" line="128"/>
<source>Playback Speed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="147"/>
<source>Lower limit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="163"/>
<source>Upper limit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="179"/>
<source>YouTube</source>
<translation>YouTube</translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="95"/>
<location filename="../qml/SettingsPage.qml" line="185"/>
<source>API Key (v3)</source>
<translation>API Schlüssel (v3)</translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="104"/>
<location filename="../qml/SettingsPage.qml" line="113"/>
<source>Limits</source>
<translation>Grenzen</translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="110"/>
<location filename="../qml/SettingsPage.qml" line="119"/>
<source>Maximum episodes per feed</source>
<translation>Maximale Anzahl Episoden pro Feed</translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="120"/>
<source>Speed increments</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="130"/>
<source>Playback speed - lower limit</source>
<location filename="../qml/SettingsPage.qml" line="134"/>
<source>Increments</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="146"/>
<source>Playback speed - upper limit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="163"/>
<location filename="../qml/SettingsPage.qml" line="91"/>
<source>Downloads directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="169"/>
<location filename="../qml/SettingsPage.qml" line="97"/>
<source>Prevent tracker scanning</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="170"/>
<location filename="../qml/SettingsPage.qml" line="98"/>
<source>Set a .nomedia file in the Downloads folder to prevent gpodder media showing up in the gallery/mediaplayer.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="177"/>
<location filename="../qml/SettingsPage.qml" line="105"/>
<source>Download to</source>
<translation type="unfinished"></translation>
</message>
Expand Down
Loading

0 comments on commit 7f287ec

Please sign in to comment.