[-]
[+]
|
Changed |
_service:tar_git:harbour-allthenews.spec
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/poetaster/allthenews.git</param>
<param name="branch">main</param>
- <param name="revision">0.2.0</param>
+ <param name="revision">0.3.0</param>
<param name="debian">N</param>
<param name="dumb">N</param>
</service>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-allthenews-0.3.0.tar.bz2/allthenews.pro
^
|
@@ -42,4 +42,3 @@
# following TRANSLATIONS line. And also do not forget to
# modify the localized app name in the the .desktop file.
TRANSLATIONS += translations/allthenews-de.ts
-
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-allthenews-0.3.0.tar.bz2/qml/pages/Database.qml
^
|
@@ -4,12 +4,12 @@
Item {
// reference to the database object
property var _db;
-
+ property bool debug: false
property variant record
function initDatabase() {
// initialize the database object
- console.log('initDatabase()')
+ if (debug) console.log('initDatabase()')
_db = Sql.LocalStorage.openDatabaseSync("NewsAPI", "1.0", "News API settings SQL database", 1000000);
_db.transaction( function(tx) {
// Create the database if it doesn't already exist
@@ -20,7 +20,7 @@
function storeData(keyname, value, textName) {
// stores data to _db
- console.log('storeData()', keyname, value, textName)
+ if (debug) console.log('storeData()', keyname, value, textName)
if(!_db) { return; }
_db.transaction( function(tx) {
var result = tx.executeSql('INSERT OR REPLACE INTO settings VALUES (?,?,?);', [keyname,value,textName]);
@@ -31,7 +31,7 @@
}
function getValue(keyname) {
- console.log('getValue()', keyname)
+ if (debug) console.log('getValue()', keyname)
var res
if(!_db) { return; }
_db.transaction( function(tx) {
@@ -44,7 +44,7 @@
}
function getName(keyname) {
- console.log('getName()', keyname)
+ if (debug) console.log('getName()', keyname)
var res
if(!_db) { return; }
_db.transaction( function(tx) {
@@ -56,6 +56,5 @@
})
return res
}
-
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-allthenews-0.3.0.tar.bz2/qml/pages/SearchPage.qml
^
|
@@ -3,7 +3,7 @@
Dialog {
property string searchString
-
+ property bool debug: false
QtObject {
id: internal
@@ -30,10 +30,12 @@
internal.history = '{"data": [{"searchText": ""}]}'
database.storeData("searchHistory", 0, internal.history)
}
- console.log(internal.history)
- console.log(JSON.stringify(internal.historyData))
+ if (debug) console.log(internal.history)
+ if (debug) console.log(JSON.stringify(internal.historyData))
+
internal.historyData = JSON.parse(internal.history)
- console.log(JSON.stringify(internal.historyData))
+
+ if (debug) console.log(JSON.stringify(internal.historyData))
for (var i in internal.historyData.data) {
historyModel.append(internal.historyData.data[i])
@@ -49,8 +51,8 @@
id: searchField
width: parent.width
- placeholderText: "Search news"
- label: "Search text"
+ placeholderText: qsTr("Search the news")
+ label: qsTr("Search text")
}
Separator { }
@@ -92,7 +94,7 @@
}
})
var store = JSON.stringify(internal.historyData)
- console.log(store)
+ if (debug) console.log(store)
database.storeData("searchHistory", internal.historyData.data.length, store)
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-allthenews-0.3.0.tar.bz2/qml/pages/Settings.qml
^
|
@@ -3,6 +3,7 @@
Dialog {
property var settings: ({})
+ property bool debug: false
Database {
id: database
}
@@ -56,7 +57,7 @@
}
//ar en cn de es fr he it nl no pt ru sv ud
SectionHeader {
- text: "Language"
+ text: qsTr("Language")
horizontalAlignment: Text.AlignLeft
}
ComboBox {
@@ -67,7 +68,7 @@
leftMargin: Theme.paddingMedium
}
- label: "Select language"
+ label: qsTr("Select language")
menu: ContextMenu {
MenuItem { text: "All" }
@@ -88,7 +89,7 @@
}
}
SectionHeader {
- text: "Country"
+ text: qsTr("Country")
horizontalAlignment: Text.AlignLeft
}
ComboBox {
@@ -99,7 +100,7 @@
leftMargin: Theme.paddingMedium
}
- label: "Select country"
+ label: qsTr("Select country")
//ar au br ca cn de es fr gb hk ie in is it nl no pk ru sa sv us za
menu: ContextMenu {
MenuItem { text: "All" }
@@ -126,11 +127,11 @@
MenuItem { text: "za" }
}
onCurrentIndexChanged: {
- console.log("Index", currentIndex)
+ if (debug) console.log("Index", currentIndex)
}
}
SectionHeader {
- text: "Category"
+ text: qsTr("Category")
horizontalAlignment: Text.AlignLeft
}
//business, entertainment, gaming, general, music, science-and-nature, sport, technology
@@ -142,7 +143,7 @@
leftMargin: Theme.paddingMedium
}
- label: "Select category"
+ label: qsTr("Select category")
menu: ContextMenu {
MenuItem { text: "All" }
@@ -163,9 +164,9 @@
if (result === DialogResult.Accepted) {
settings = {"language": lang.value, "country": country.value, "category": category.value, "apiKey": apiKey.text}
- console.log("language", lang.value, "country", country.value, "category", category.value, "apiKey", apiKey.text)
+ if (debug) console.log("language", lang.value, "country", country.value, "category", category.value, "apiKey", apiKey.text)
- console.log(apiKey.text)
+ if (debug) console.log(apiKey.text)
database.storeData("apiKey", apiKey.text, apiKey.text)
database.storeData("language", lang.currentIndex, lang.value)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-allthenews-0.3.0.tar.bz2/qml/pages/SourceFeed.qml
^
|
@@ -10,6 +10,7 @@
property string sourceTitle
property string search
property string url
+ property bool debug: false
Database {
id: database
@@ -33,6 +34,7 @@
if (parsed.status === "ok") {
for (var i in parsed.articles) {
feed.append(parsed.articles[i])
+ if (debug) console.debug(parsed.articles[i].author)
}
}
@@ -46,7 +48,7 @@
id: feedDelegate
ListItem {
//contentHeight: Theme.itemSizeMedium + sourceLogo.height + descriptionText.height
- height: Theme.itemSizeMedium + contentRow.height + feedTitle.height
+ height: Theme.itemSizeMedium + contentRow.height + feedTitle.height + metaRow.height
width: parent.width
Label {
@@ -66,19 +68,54 @@
}
Item {
- id: contentRow
+ id: metaRow
height: childrenRect.height
- width:parent.width
+ width:parent.width - (2 * Theme.paddingLarge)
anchors {
top: feedTitle.bottom
+ left: feedTitle.left
bottomMargin: Theme.paddingLarge
topMargin: Theme.paddingLarge
}
+ Label {
+ id: publishedAtField
+ width:parent.width / 2 - Theme.paddingLarge
+ anchors {
+ leftMargin : Theme.paddingMedium
+ }
+ text: publishedAt
+ font.pixelSize: Theme.fontSizeExtraSmall
+ }
+ }
+ Item {
+ id: contentRow
+ height: childrenRect.height
+ width:parent.width
+ anchors {
+ top: metaRow.bottom
+ bottomMargin: Theme.paddingSmall
+ topMargin: Theme.paddingSmall
+ }
+ Label {
+ id: authorField
+ width: (parent.width / 2) - Theme.paddingMedium
+ anchors {
+ top: parent.top
+ left:parent.left
+ leftMargin: Theme.paddingMedium
+ bottomMargin : Theme.paddingLarge
+ }
+ text: qsTr("By - ") + author
+ font.pixelSize: Theme.fontSizeExtraSmall
+ wrapMode: "WordWrap"
+ }
Text {
id: descriptionText
anchors {
+ top:authorField.bottom
left: parent.left
leftMargin: Theme.paddingMedium
+ topMargin : Theme.paddingLarge
//baseline: unreadCount.baseline
//baselineOffset: lineCount > 1 ? -implicitHeight/2 : -(height-implicitHeight)/2
@@ -89,7 +126,7 @@
wrapMode: "WordWrap"
color: Theme.primaryColor
font.family: Theme.fontFamily
- font.pointSize: Theme.fontSizeTiny
+ font.pixelSize: Theme.fontSizeSmall
}
Image {
id: sourceLogo
@@ -124,7 +161,7 @@
busyIndicator.running = true
busyIndicator.visible = true
var apiKey = database.getValue("apiKey")
- console.debug(database.getValue("apiKey"))
+ if (debug) console.debug(database.getValue("apiKey"))
url = "https://newsapi.org/v2/top-headlines?apiKey=" + apiKey + "&sources=" + source
Utils.sendHttpRequest("GET", url, fillData)
}
@@ -143,10 +180,11 @@
PullDownMenu {
MenuItem {
- text: "Refresh"
+ text: qsTr("Refresh")
onClicked: {
if (source) {
feed.clear()
+ var apiKey = database.getValue("apiKey")
url = "https://newsapi.org/v2/top-headlines?apiKey=" + apiKey + "&sources=" + source //+ "&apiKey=" + Utils.apiKey
Utils.sendHttpRequest("GET", url, fillData)
}
@@ -156,7 +194,7 @@
ViewPlaceholder {
enabled: feed.count == 0 && !busyIndicator.running
- text: "Nothing to show now"
+ text: qsTr("Nothing to show now")
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-allthenews-0.3.0.tar.bz2/qml/pages/SourcesPage.qml
^
|
@@ -4,6 +4,8 @@
import "Utils.js" as Utils
Page {
+ property bool debug: false
+
id: sourcesPage
Database {
@@ -89,7 +91,7 @@
}
function searchPage(value) {
- console.log(value)
+ if (debug) console.log(value)
app.feedTitle = value
// pageStack.pop()
pageStack.replace(Qt.resolvedUrl("SourceFeed.qml"), {search: value})
@@ -98,7 +100,7 @@
Component {
id: sourcesListDelegate
ListItem {
- contentHeight: Theme.itemSizeSmall + feedName.height + descriptionText.height
+ contentHeight: feedName.height + descriptionText.height
height: childrenRect.height
//Theme.itemSizeSmall + feedName.height + descriptionText.height
width: parent.width
@@ -130,9 +132,6 @@
font.pointSize: Theme.fontSizeTiny
horizontalAlignment: Text.AlignLeft
}
- Separator {
- }
-
onClicked: {
app.feedTitle = name
pageStack.push(Qt.resolvedUrl("SourceFeed.qml"), {source: id, sourceTitle: name})
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-allthenews-0.3.0.tar.bz2/translations/allthenews-de.ts
^
|
@@ -33,32 +33,93 @@
</message>
</context>
<context>
+ <name>SearchPage</name>
+ <message>
+ <location filename="../qml/pages/SearchPage.qml" line="54"/>
+ <source>Search the news</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/SearchPage.qml" line="55"/>
+ <source>Search text</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>Settings</name>
<message>
- <location filename="../qml/pages/Settings.qml" line="51"/>
+ <location filename="../qml/pages/Settings.qml" line="52"/>
<source>newsapi.org API key</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <location filename="../qml/pages/Settings.qml" line="60"/>
+ <source>Language</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Settings.qml" line="71"/>
+ <source>Select language</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Settings.qml" line="92"/>
+ <source>Country</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Settings.qml" line="103"/>
+ <source>Select country</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Settings.qml" line="134"/>
+ <source>Category</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Settings.qml" line="146"/>
+ <source>Select category</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>SourceFeed</name>
+ <message>
+ <location filename="../qml/pages/SourceFeed.qml" line="108"/>
+ <source>By - </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/SourceFeed.qml" line="183"/>
+ <source>Refresh</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/SourceFeed.qml" line="197"/>
+ <source>Nothing to show now</source>
+ <translation type="unfinished">Keine Ergebnisse</translation>
+ </message>
</context>
<context>
<name>SourcesPage</name>
<message>
- <location filename="../qml/pages/SourcesPage.qml" line="162"/>
+ <location filename="../qml/pages/SourcesPage.qml" line="161"/>
<source>About</source>
<translation type="unfinished">Über</translation>
</message>
<message>
- <location filename="../qml/pages/SourcesPage.qml" line="168"/>
+ <location filename="../qml/pages/SourcesPage.qml" line="167"/>
<source>Settings</source>
<translation type="unfinished">Einstellungen</translation>
</message>
<message>
- <location filename="../qml/pages/SourcesPage.qml" line="177"/>
+ <location filename="../qml/pages/SourcesPage.qml" line="176"/>
<source>Search news</source>
<translation type="unfinished">Suchen</translation>
</message>
<message>
- <location filename="../qml/pages/SourcesPage.qml" line="190"/>
+ <location filename="../qml/pages/SourcesPage.qml" line="189"/>
<source>Nothing to show now</source>
<translation type="unfinished">Keine Ergebnisse</translation>
</message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-allthenews-0.3.0.tar.bz2/translations/harbour-allthenews-de.ts
^
|
@@ -5,11 +5,11 @@
<name>About</name>
<message>
<source>Feed by</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Feed von</translation>
</message>
<message>
<source>News API can provide headlines from 70 worldwide source.</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">News Api liefert Nachrichten von 70 Anbieter weltweit.</translation>
</message>
<message>
<source>(c) poetaster, </source>
@@ -17,33 +17,33 @@
</message>
<message>
<source>Icon from</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Icon von</translation>
</message>
</context>
<context>
<name>CoverPage</name>
<message>
<source>My Cover</source>
- <translation>Mein Cover</translation>
+ <translation>Meine Cover</translation>
</message>
</context>
<context>
<name>SourcesPage</name>
<message>
<source>About</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Über</translation>
</message>
<message>
<source>Settings</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Einstellungen</translation>
</message>
<message>
<source>Search news</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Suchen</translation>
</message>
<message>
<source>Nothing to show now</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Nichts zum anzeigen bereit</translation>
</message>
</context>
</TS>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-allthenews-0.3.0.tar.bz2/translations/harbour-allthenews.ts
^
|
@@ -33,32 +33,93 @@
</message>
</context>
<context>
+ <name>SearchPage</name>
+ <message>
+ <location filename="../qml/pages/SearchPage.qml" line="54"/>
+ <source>Search the news</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/SearchPage.qml" line="55"/>
+ <source>Search text</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>Settings</name>
<message>
- <location filename="../qml/pages/Settings.qml" line="51"/>
+ <location filename="../qml/pages/Settings.qml" line="52"/>
<source>newsapi.org API key</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <location filename="../qml/pages/Settings.qml" line="60"/>
+ <source>Language</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Settings.qml" line="71"/>
+ <source>Select language</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Settings.qml" line="92"/>
+ <source>Country</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Settings.qml" line="103"/>
+ <source>Select country</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Settings.qml" line="134"/>
+ <source>Category</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Settings.qml" line="146"/>
+ <source>Select category</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>SourceFeed</name>
+ <message>
+ <location filename="../qml/pages/SourceFeed.qml" line="108"/>
+ <source>By - </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/SourceFeed.qml" line="183"/>
+ <source>Refresh</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/SourceFeed.qml" line="197"/>
+ <source>Nothing to show now</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>SourcesPage</name>
<message>
- <location filename="../qml/pages/SourcesPage.qml" line="162"/>
+ <location filename="../qml/pages/SourcesPage.qml" line="161"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/SourcesPage.qml" line="168"/>
+ <location filename="../qml/pages/SourcesPage.qml" line="167"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/SourcesPage.qml" line="177"/>
+ <location filename="../qml/pages/SourcesPage.qml" line="176"/>
<source>Search news</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/SourcesPage.qml" line="190"/>
+ <location filename="../qml/pages/SourcesPage.qml" line="189"/>
<source>Nothing to show now</source>
<translation type="unfinished"></translation>
</message>
|