Skip to content

Commit

Permalink
Merge pull request #1 from gpodder/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
fravaccaro authored Oct 30, 2019
2 parents 40d32c4 + ec7fc02 commit c23ee1b
Show file tree
Hide file tree
Showing 23 changed files with 1,292 additions and 180 deletions.
4 changes: 3 additions & 1 deletion gpodder-sailfish.pro
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ TRANSLATIONS += \
translations/harbour-org.gpodder.sailfish-es.ts \
translations/harbour-org.gpodder.sailfish-de.ts \
translations/harbour-org.gpodder.sailfish-bg.ts \
translations/harbour-org.gpodder.sailfish.ts \
translations/harbour-org.gpodder.sailfish-it.ts \
translations/harbour-org.gpodder.sailfish-zh_CN.ts \
translations/harbour-org.gpodder.sailfish.ts

TRANSLATION_SOURCES += /$$_PRO_FILE_PWD_/gpodder-ui-qml/common/

Expand Down
2 changes: 1 addition & 1 deletion gpodder-ui-qml
Submodule gpodder-ui-qml updated 3 files
+2 −0 common/GPodderPlayback.qml
+11 −1 main.py
+1 −1 makefile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion qml/AboutPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Page {
width: parent.width
wrapMode: Text.WordWrap
text: [
'© 2005-2014 '+ qsTr("Thomas Perl and the gPodder Team"),
'© 2005-2019 '+ qsTr("Thomas Perl and the gPodder Team"),
qsTr("License: ISC / GPLv3 or later"),
qsTr("Website: ") + 'http://gpodder.org/',
'',
Expand Down
15 changes: 14 additions & 1 deletion qml/CoverContainer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,20 @@ CoverBackground {
}

CoverAction {
iconSource: 'image://theme/icon-cover-refresh'
iconSource: 'image://theme/icon-cover-sync'
onTriggered: {
if (!py.refreshing) {
py.call('main.check_for_episodes');
}
}
}
}

CoverActionList {
enabled: player.episode == 0 && !player.isPlaying

CoverAction {
iconSource: 'image://theme/icon-cover-sync'
onTriggered: {
if (!py.refreshing) {
py.call('main.check_for_episodes');
Expand Down
2 changes: 1 addition & 1 deletion qml/DirectoryDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Dialog {

DialogHeader {
title: directory.provider
acceptText: 'Search'
acceptText: qsTr("Search")
}

TextField {
Expand Down
12 changes: 6 additions & 6 deletions qml/EpisodeItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ ListItem {
opacity: .5
}

onClicked: showMenu()
onClicked: openMenu()

menu: Component {
IconContextMenu {
Expand All @@ -83,7 +83,7 @@ ListItem {
icon.source: 'image://theme/icon-m-download'
visible: downloadState != Constants.state.downloaded
onClicked: {
episodeItem.hideMenu();
episodeItem.closeMenu();
py.call('main.download_episode', [id]);
}
}
Expand All @@ -97,7 +97,7 @@ ListItem {
player.jumpToQueueIndex(0);
}
});
episodeItem.hideMenu();
episodeItem.closeMenu();
}
}

Expand All @@ -106,7 +106,7 @@ ListItem {
icon.source: 'image://theme/icon-m-delete'
visible: downloadState != Constants.state.deleted
onClicked: {
episodeItem.hideMenu();
episodeItem.closeMenu();
var ctx = { py: py, id: id };
episodeItem.remorseAction(qsTr("Deleting"), function () {
ctx.py.call('main.delete_episode', [ctx.id]);
Expand All @@ -123,9 +123,9 @@ ListItem {

IconMenuItem {
text: qsTr("Shownotes")
icon.source: 'image://theme/icon-m-message'
icon.source: 'image://theme/icon-m-about'
onClicked: {
episodeItem.hideMenu();
episodeItem.closeMenu();
pgst.loadPage('EpisodeDetail.qml', {episode_id: id, title: title});
}
}
Expand Down
24 changes: 12 additions & 12 deletions qml/EpisodesPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ Page {
GPodderEpisodeListModelConnections {}

PullDownMenu {
MenuItem {
text: qsTr("Unsubscribe")
onClicked: {
remorse.execute("Unsubscribing", function() {
py.call('main.unsubscribe', [episodesPage.podcast_id]);
if (pageStack.currentPage == episodesPage) {
pageStack.pop();
}
})
}
}

MenuItem {
text: qsTr("Mark episodes as old")
onClicked: {
Expand All @@ -95,18 +107,6 @@ Page {
}
}

MenuItem {
text: qsTr("Unsubscribe")
onClicked: {
remorse.execute("Unsubscribing", function() {
py.call('main.unsubscribe', [episodesPage.podcast_id]);
if (pageStack.currentPage == episodesPage) {
pageStack.pop();
}
})
}
}

EpisodeListFilterItem { model: episodeListModel }
}

Expand Down
88 changes: 88 additions & 0 deletions qml/ImportOPML.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import Sailfish.Pickers 1.0

import 'common'

Dialog {
id: importOPML
allowedOrientations: Orientation.All

property string selectedFile: "None"
property string opmlAction: "Import"

canAccept: {
(opmlAction == 'Import' && selectedFile != "None") || (opmlAction == 'Export' && exportFile.text != '')
}
onAccepted: {
focus = false
if (opmlAction == 'Import') {
py.call('main.import_opml', [importOPML.selectedFile])
} else {
if(exportFile.text.charAt(0) != '/') {
exportFile.text = StandardPaths.home + '/' + exportFile.text
}

py.call('main.export_opml', [exportFile.text])
}
}

Column {
anchors.fill: parent

DialogHeader {
title: opmlAction == "Import" ? qsTr("Import OPML File") : qsTr('Export OPML File')
acceptText: opmlAction == "Import" ? qsTr("Import") : qsTr('Export')
}

ComboBox {
label: "OPML"

menu: ContextMenu {
MenuItem {
text: qsTr("Import")
onClicked: opmlAction = "Import"
}
MenuItem {
text: qsTr("Export")
onClicked: opmlAction = "Export"
}
}
}


ValueButton {
id: importFile
label: qsTr("Import File")
value: selectedFile
onClicked: pageStack.push(filePickerPage)
visible: opmlAction == "Import" ? true : false
}

TextField {
id: exportFile
label: 'Filename'
placeholderText: qsTr('Enter filname')
visible: opmlAction == 'Export' ? true : false

anchors {
left: parent.left
right: parent.right
}
EnterKey.enabled: text.length > 0
EnterKey.iconSource: "image://theme/icon-m-enter-close"
EnterKey.onClicked: importOPML.accept()
}
}

Component {
id: filePickerPage
FilePickerPage {
nameFilters: [ '*.opml' , '*.opml' ]
onSelectedContentPropertiesChanged: {
importOPML.selectedFile = selectedContentProperties.filePath
}
}
}
}

26 changes: 17 additions & 9 deletions qml/MprisPlayer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,22 @@ MprisPlayer {

serviceName: "gpodder"

property string title: streamTitle
property string artist
property string song

onTitleChanged: {
if (title != "") {
var metadata = mprisPlayer.metadata
metadata[Mpris.metadataToString(Mpris.Title)] = title
mprisPlayer.metadata = metadata
}
onArtistChanged: {
var metadata = mprisPlayer.metadata
metadata[Mpris.metadataToString(Mpris.Artist)] = artist // Podcast Title
mprisPlayer.metadata = metadata
}

onSongChanged: {
var metadata = mprisPlayer.metadata
metadata[Mpris.metadataToString(Mpris.Title)] = song // Episode Title
mprisPlayer.metadata = metadata
}


// Mpris2 Root Interface
identity: "Mpris gpodder-sailfish"

Expand All @@ -40,8 +46,10 @@ MprisPlayer {
else if (player.playbackState == MediaPlayer.PausedState) return Mpris.Paused
else return Mpris.Stopped
}

onPlaybackStatusChanged: {
title = player.episode_title
song = player.episode_title
artist = player.podcast_title
}

onPauseRequested: {
Expand All @@ -64,4 +72,4 @@ MprisPlayer {
player.seekAndSync(player.position - 1000 * 10)
}

}
}
Loading

0 comments on commit c23ee1b

Please sign in to comment.