From d4d039ce39ce880275d7dcdab2acc9d23067c91d Mon Sep 17 00:00:00 2001 From: Thilo Kogge Date: Wed, 21 Dec 2022 23:44:31 +0100 Subject: [PATCH] fixes #82 added warning if the database is newer than this version of podqast can handle --- python/podcast/data_migration.py | 2 ++ qml/components/MigrationHandler.qml | 12 ++++++++---- qml/harbour-podqast.qml | 11 +++++++++++ translations/harbour-podqast-de.ts | 24 ++++++++++++------------ translations/harbour-podqast-es.ts | 24 ++++++++++++------------ translations/harbour-podqast-fr.ts | 24 ++++++++++++------------ translations/harbour-podqast-sv.ts | 24 ++++++++++++------------ translations/harbour-podqast-zh_CN.ts | 24 ++++++++++++------------ translations/harbour-podqast.ts | 24 ++++++++++++------------ 9 files changed, 93 insertions(+), 76 deletions(-) diff --git a/python/podcast/data_migration.py b/python/podcast/data_migration.py index 13de0da..82f37d8 100644 --- a/python/podcast/data_migration.py +++ b/python/podcast/data_migration.py @@ -41,6 +41,8 @@ def needs_migration(): if get_versionnumber() >= target_data_version: logger.info("Dataversion is fine (%d,%d).", get_versionnumber(), target_data_version) + if get_versionnumber() > target_data_version: + pyotherside.send("dbVersionHigherThanExpectedWarning") return False else: if app_is_pristine(): diff --git a/qml/components/MigrationHandler.qml b/qml/components/MigrationHandler.qml index b29b243..6850c28 100644 --- a/qml/components/MigrationHandler.qml +++ b/qml/components/MigrationHandler.qml @@ -10,6 +10,7 @@ Python { signal migrationStart(int section, int miglen) signal migrationProgress(int section, int migpos) signal migrationSections(int param_start_section, int param_target_section) + signal dbVersionHigherThanExpectedWarning property int progress_max: 1 property int progress_current: 1 @@ -29,14 +30,17 @@ Python { setHandler("migrationProgress", migrationProgress) setHandler("migrationDone", migrationDone) setHandler("migrationSections", migrationSections) + setHandler("dbVersionHigherThanExpectedWarning", + dbVersionHigherThanExpectedWarning) addImportPath(Qt.resolvedUrl('.')) importModule('MigrationHandler', function () { console.log("MigrationHandler is now imported") - call('MigrationHandler.needs_migration', [], function (is_needed) { - console.log("Migration is needed: " + is_needed) - migrationNeeded(is_needed) - }) + call('MigrationHandler.needs_migration', [], + function (is_needed, db_version_too_high) { + console.log("Migration is needed: " + is_needed) + migrationNeeded(is_needed) + }) }) } diff --git a/qml/harbour-podqast.qml b/qml/harbour-podqast.qml index 12424d7..2fad309 100644 --- a/qml/harbour-podqast.qml +++ b/qml/harbour-podqast.qml @@ -42,6 +42,8 @@ ApplicationWindow { pageStack.replace(Qt.resolvedUrl( "pages/DataMigration.qml")) } + + onDbVersionHigherThanExpectedWarning: dbVersiontooHighWarningNotification.publish() } cover: Qt.resolvedUrl("cover/CoverPage.qml") @@ -347,6 +349,15 @@ ApplicationWindow { } } + Notification { + id: dbVersiontooHighWarningNotification + category: "x-podqast-warnings" + appIcon: "/usr/share/harbour-podqast/images/q.png" + appName: "podQast" + summary: "Warning: your database is too new" + body: "You may encounter problems" + } + Notification { property string thepage: "Inbox" id: updatesNotification diff --git a/translations/harbour-podqast-de.ts b/translations/harbour-podqast-de.ts index c0e4996..95ba610 100644 --- a/translations/harbour-podqast-de.ts +++ b/translations/harbour-podqast-de.ts @@ -1051,50 +1051,50 @@ harbour-podqast - + New posts available Neue Beiträge verfügbar - + Click to view updates Klicken um Aktualisierungen anzusehen - + New Posts are available. Click to view. Neue Beiträge verfügbar. Klicke zum Betrachten. - - + + PodQast message PodQast-Nachricht - + New PodQast message Neue PodQast-Nachricht - + Podcasts imported Podcasts importiert - - + + Podcasts imported from OPML Podcasts vom OPML importiert - + Error Fehler - - + + Audio File not existing Audiodatei existiert nicht diff --git a/translations/harbour-podqast-es.ts b/translations/harbour-podqast-es.ts index c80c633..e57344e 100644 --- a/translations/harbour-podqast-es.ts +++ b/translations/harbour-podqast-es.ts @@ -1049,50 +1049,50 @@ harbour-podqast - + New posts available Nuevas publicaciones disponibles - + Click to view updates Haz clic para ver actualizaciones - + New Posts are available. Click to view. Hay nuevas publicaciones. Haz clic para verlas. - - + + PodQast message Mensaje de PodQast - + New PodQast message Nuevo mensaje de PodQast - + Podcasts imported podcasts importados - - + + Podcasts imported from OPML podcasts importados desde OPML - + Error Error - - + + Audio File not existing El archivo de audio no existe diff --git a/translations/harbour-podqast-fr.ts b/translations/harbour-podqast-fr.ts index 0f66804..b93c260 100644 --- a/translations/harbour-podqast-fr.ts +++ b/translations/harbour-podqast-fr.ts @@ -1052,50 +1052,50 @@ harbour-podqast - + New posts available Nouveaux articles disponibles - + Click to view updates Cliquez pour voir les mises à jour - + New Posts are available. Click to view. De nouveaux articles sont diponibles. Cliquez pour voir. - - + + PodQast message Message PodQast - + New PodQast message Nouveau message PodQast - + Podcasts imported Podcasts importés - - + + Podcasts imported from OPML Podcasts importés depuis OPML - + Error Erreur - - + + Audio File not existing Le fichier audio n'existe pas diff --git a/translations/harbour-podqast-sv.ts b/translations/harbour-podqast-sv.ts index 7b652c3..8a3c3b7 100644 --- a/translations/harbour-podqast-sv.ts +++ b/translations/harbour-podqast-sv.ts @@ -1051,50 +1051,50 @@ harbour-podqast - + New posts available Nya poster tillgängliga - + Click to view updates Tryck för att visa uppdateringar - + New Posts are available. Click to view. Det finns nya poster. Tryck för att visa. - - + + PodQast message PodQast-meddelande - + New PodQast message Nytt PodQast-meddelande - + Podcasts imported poddar importerade - - + + Podcasts imported from OPML poddar importerade från OPML - + Error Fel - - + + Audio File not existing Ljudfilen finns inte diff --git a/translations/harbour-podqast-zh_CN.ts b/translations/harbour-podqast-zh_CN.ts index 5b494c2..25d4af4 100644 --- a/translations/harbour-podqast-zh_CN.ts +++ b/translations/harbour-podqast-zh_CN.ts @@ -1049,50 +1049,50 @@ harbour-podqast - + New posts available 有可获取的新内容 - + Click to view updates 点击以查看更新 - + New Posts are available. Click to view. 有可用新内容,点击以查看。 - - + + PodQast message PodQast 消息 - + New PodQast message 新 PodQast 消息 - + Podcasts imported 播客已导入 - - + + Podcasts imported from OPML 已从 OPML 导入播客 - + Error 错误 - - + + Audio File not existing 音频文件不存在 diff --git a/translations/harbour-podqast.ts b/translations/harbour-podqast.ts index 90be444..65bb8d8 100644 --- a/translations/harbour-podqast.ts +++ b/translations/harbour-podqast.ts @@ -1051,50 +1051,50 @@ harbour-podqast - + New posts available New posts available - + Click to view updates Click to view updates - + New Posts are available. Click to view. New Posts are available. Click to view. - - + + PodQast message PodQast message - + New PodQast message New PodQast message - + Podcasts imported Podcasts imported - - + + Podcasts imported from OPML Podcasts imported from OPML - + Error Error - - + + Audio File not existing Audio File not existing -- GitLab