diff --git a/qml/helpers/db.js b/qml/helpers/db.js index 19520ac..4a654d2 100644 --- a/qml/helpers/db.js +++ b/qml/helpers/db.js @@ -7,24 +7,28 @@ function settings_db_open() { return db; } -function checkforold() { +function dropTable() { + //tx.executeSql("DROP TABLE IF EXISTS old_channels"); db = settings_db_open(); - try { - db.transaction(function(tx) - { - var rs = tx.executeSql('SELECT * FROM channels'); - // console.log("OLD DATABSE TABLE EXISTS") - }); - } - catch(a) - { - // console.log("NO OLD DATABASE") - } + try { + db.transaction( + function(tx) { + tx.executeSql("DROP TABLE IF EXISTS settings"); + tx.executeSql("DROP TABLE IF EXISTS stations"); + tx.executeSql("DROP TABLE IF EXISTS countries"); + tx.executeSql("DROP TABLE IF EXISTS tags"); + } + ); } - + catch(a) + { + console.log("drop failed: "+a) + return false + } + init(); +} function init() { db = settings_db_open(); - //checkforold() try { db.transaction( function(tx) { diff --git a/qml/pages/AboutPage.qml b/qml/pages/AboutPage.qml index 6896cc2..3fd4096 100644 --- a/qml/pages/AboutPage.qml +++ b/qml/pages/AboutPage.qml @@ -1,5 +1,6 @@ import QtQuick 2.0 import Sailfish.Silica 1.0 + Page { Flickable { id: flick @@ -35,17 +36,6 @@ Page { horizontalCenter: parent.horizontalCenter } } - - Label { - width: parent.width-70 - font.pixelSize: Theme.fontSizeSmall - text: qsTr("AllRadio is an internet radio station player") - anchors.horizontalCenter: parent.horizontalCenter - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignHCenter - height: 200 - wrapMode: Text.WordWrap - } } } } diff --git a/qml/pages/AllRadio.qml b/qml/pages/AllRadio.qml index cea1f84..7612826 100644 --- a/qml/pages/AllRadio.qml +++ b/qml/pages/AllRadio.qml @@ -195,7 +195,7 @@ Page { radioPlayer._stationuuid = model.stationuuid radioPlayer.getStationFavorite(model.stationuuid) radioPlayer.playlistIndex = index - } + } else radioPlayer.resumeStream() } } } @@ -237,7 +237,7 @@ Page { radioPlayer._homepage = model.homepage radioPlayer._stationuuid = model.stationuuid radioPlayer.getStationFavorite(model.stationuuid) - } + } else radioPlayer.resumeStream() } } } @@ -303,7 +303,7 @@ Page { radioPlayer._homepage = model.homepage radioPlayer._stationuuid = model.stationuuid radioPlayer.getStationFavorite(model.stationuuid) - } + } else radioPlayer.resumeStream() } } } @@ -344,7 +344,7 @@ Page { radioPlayer._homepage = model.homepage radioPlayer._stationuuid = model.stationuuid radioPlayer.getStationFavorite(model.stationuuid) - } + } else radioPlayer.resumeStream() } } } @@ -381,7 +381,7 @@ Page { radioPlayer._homepage = model.homepage radioPlayer._stationuuid = model.stationuuid radioPlayer.getStationFavorite(model.stationuuid) - } + } else radioPlayer.resumeStream() } } } diff --git a/qml/pages/FavoritesPage.qml b/qml/pages/FavoritesPage.qml index 25ca13a..1bd08ee 100644 --- a/qml/pages/FavoritesPage.qml +++ b/qml/pages/FavoritesPage.qml @@ -104,7 +104,7 @@ Page { console.log("Index: "+index) - } + } else radioPlayer.resumeStream() } } function updateFav() { diff --git a/qml/pages/HistoryPage.qml b/qml/pages/HistoryPage.qml index 67c9191..30fba0e 100644 --- a/qml/pages/HistoryPage.qml +++ b/qml/pages/HistoryPage.qml @@ -53,7 +53,7 @@ Page { radioPlayer._favorite = model.favorite ? true : false radioPlayer.playlistIndex = favoriteView.currentIndex //pageStack.push("RadioPlayerPage.qml") - } + } else radioPlayer.resumeStream() } } function updateHist() { diff --git a/qml/pages/SearchStationsPage.qml b/qml/pages/SearchStationsPage.qml index 1d1350f..b11f7be 100644 --- a/qml/pages/SearchStationsPage.qml +++ b/qml/pages/SearchStationsPage.qml @@ -208,7 +208,7 @@ Page { //radioPlayer._favorite = model.favorite ? true : false radioPlayer.getStationFavorite(model.stationuuid) // pageStack.push("RadioPlayerPage.qml") - } + } else radioPlayer.resumeStream() } } } diff --git a/qml/pages/SettingsPage.qml b/qml/pages/SettingsPage.qml index dbc8920..fea8dcf 100644 --- a/qml/pages/SettingsPage.qml +++ b/qml/pages/SettingsPage.qml @@ -1,5 +1,7 @@ import QtQuick 2.0 import Sailfish.Silica 1.0 +import "../helpers/db.js" as Favorites + Page { Flickable { id: flick @@ -27,13 +29,27 @@ Page { Label { width: parent.width-70 font.pixelSize: Theme.fontSizeSmall - text: qsTr("Working on it.....") + text: qsTr("Working on more settings.....") anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignHCenter height: 200 wrapMode: Text.WordWrap } + Label { + width: parent.width-70 + font.pixelSize: Theme.fontSizeLarge + text: qsTr("WARNING! THis is for debugging or corrupt database. Only delete db if it is not working!!!") + anchors.horizontalCenter: parent.horizontalCenter + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignHCenter + wrapMode: Text.WordWrap + } + Button { + text: qsTr("Delete DB") + onClicked: Favorites.dropTable() + anchors.horizontalCenter: parent.horizontalCenter + } } } } diff --git a/translations/harbour-allradio-de.ts b/translations/harbour-allradio-de.ts index a4b9886..d17871c 100644 --- a/translations/harbour-allradio-de.ts +++ b/translations/harbour-allradio-de.ts @@ -3,10 +3,6 @@ AboutPage - - AllRadio is an internet radio station player - - License: GPLv2 @@ -1138,7 +1134,15 @@ SettingsPage - Working on it..... + WARNING! THis is for debugging or corrupt database. Only delete db if it is not working!!! + + + + Working on more settings..... + + + + Delete DB diff --git a/translations/harbour-allradio.ts b/translations/harbour-allradio.ts index 24901e3..e773522 100644 --- a/translations/harbour-allradio.ts +++ b/translations/harbour-allradio.ts @@ -3,10 +3,6 @@ AboutPage - - AllRadio is an internet radio station player - AllRadio är en internet radio spelare - License: GPLv2 Licens: GPLv2 @@ -1138,7 +1134,15 @@ SettingsPage - Working on it..... + WARNING! THis is for debugging or corrupt database. Only delete db if it is not working!!! + + + + Working on more settings..... + + + + Delete DB