diff --git a/Makefile b/Makefile index 19ae30f6..960251ec 100644 --- a/Makefile +++ b/Makefile @@ -268,13 +268,13 @@ updates: install-go-mod-outdated doc: godoc -http=:6060 -release-notes: release-notes/bridge.html release-notes/import-export.html +release-notes: release-notes/bridge.html release-notes/ie.html release-notes/bridge.html: - ./utils/release_notes.sh Bridge + ./utils/release_notes.sh bridge -release-notes/import-export.html: - ./utils/release_notes.sh Import-Export +release-notes/ie.html: + ./utils/release_notes.sh ie .PHONY: gofiles # Following files are for the whole app so it makes sense to have them in bridge package. diff --git a/internal/app/bridge/bridge.go b/internal/app/bridge/bridge.go index 3961e60c..d155354d 100644 --- a/internal/app/bridge/bridge.go +++ b/internal/app/bridge/bridge.go @@ -147,6 +147,9 @@ func checkAndHandleUpdate(u types.Updater, f frontend.Frontend, autoUpdate bool) return } + // Update links in UI + f.SetVersion(version) + if !u.IsUpdateApplicable(version) { logrus.Debug("No need to update") return diff --git a/internal/app/ie/ie.go b/internal/app/ie/ie.go index f4cf4674..171f6629 100644 --- a/internal/app/ie/ie.go +++ b/internal/app/ie/ie.go @@ -95,6 +95,9 @@ func checkAndHandleUpdate(u types.Updater, f frontend.Frontend, autoUpdate bool) return } + // Update links in UI + f.SetVersion(version) + if !u.IsUpdateApplicable(version) { logrus.Debug("No need to update") return diff --git a/internal/frontend/cli-ie/frontend.go b/internal/frontend/cli-ie/frontend.go index 20f12a5b..3ee50e40 100644 --- a/internal/frontend/cli-ie/frontend.go +++ b/internal/frontend/cli-ie/frontend.go @@ -230,8 +230,6 @@ func (f *frontendCLI) NotifyManualUpdate(update updater.VersionInfo, canInstall // NOTE: Save the update somewhere so that it can be installed when user chooses "install now". } -func (f *frontendCLI) NotifySilentUpdateInstalled() { -} - -func (f *frontendCLI) NotifySilentUpdateError(err error) { -} +func (f *frontendCLI) SetVersion(version updater.VersionInfo) {} +func (f *frontendCLI) NotifySilentUpdateInstalled() {} +func (f *frontendCLI) NotifySilentUpdateError(err error) {} diff --git a/internal/frontend/cli/frontend.go b/internal/frontend/cli/frontend.go index d1f00d59..5e5cf2e5 100644 --- a/internal/frontend/cli/frontend.go +++ b/internal/frontend/cli/frontend.go @@ -257,8 +257,6 @@ func (f *frontendCLI) NotifyManualUpdate(update updater.VersionInfo, canInstall // NOTE: Save the update somewhere so that it can be installed when user chooses "install now". } -func (f *frontendCLI) NotifySilentUpdateInstalled() { -} - -func (f *frontendCLI) NotifySilentUpdateError(err error) { -} +func (f *frontendCLI) SetVersion(version updater.VersionInfo) {} +func (f *frontendCLI) NotifySilentUpdateInstalled() {} +func (f *frontendCLI) NotifySilentUpdateError(err error) {} diff --git a/internal/frontend/frontend.go b/internal/frontend/frontend.go index 3f3f3996..23511ea7 100644 --- a/internal/frontend/frontend.go +++ b/internal/frontend/frontend.go @@ -42,6 +42,7 @@ var ( type Frontend interface { Loop() error NotifyManualUpdate(update updater.VersionInfo, canInstall bool) + SetVersion(update updater.VersionInfo) NotifySilentUpdateInstalled() NotifySilentUpdateError(error) } diff --git a/internal/frontend/qml/BridgeUI/HelpView.qml b/internal/frontend/qml/BridgeUI/HelpView.qml index e854d568..c908cfff 100644 --- a/internal/frontend/qml/BridgeUI/HelpView.qml +++ b/internal/frontend/qml/BridgeUI/HelpView.qml @@ -135,9 +135,7 @@ Item { textColor : Style.main.textDisabled fontSize : Style.main.fontSize textUnderline : true - onClicked : { - Qt.openUrlExternally(go.updateReleaseNotesLink) - } + onClicked : gui.openReleaseNotes() } } } diff --git a/internal/frontend/qml/Gui.qml b/internal/frontend/qml/Gui.qml index a462ebbb..8f56dfc6 100644 --- a/internal/frontend/qml/Gui.qml +++ b/internal/frontend/qml/Gui.qml @@ -303,6 +303,13 @@ Item { winMain.bubbleNote.show() } + function openReleaseNotes(){ + if go.updateReleaseNotesLink == "" { + go.checkForUpdates() + } + Qt.openUrlExternally(go.updateReleaseNotesLink) + } + // On start Component.onCompleted : { // set messages for translations diff --git a/internal/frontend/qml/GuiIE.qml b/internal/frontend/qml/GuiIE.qml index 309be54e..5d91408a 100644 --- a/internal/frontend/qml/GuiIE.qml +++ b/internal/frontend/qml/GuiIE.qml @@ -405,6 +405,14 @@ Item { } */ + function openReleaseNotes(){ + if go.updateReleaseNotesLink == "" { + go.checkForUpdates() + } + Qt.openUrlExternally(go.updateReleaseNotesLink) + } + + property string areYouSureYouWantToQuit : qsTr("There are incomplete processes - some items are not yet transferred. Do you really want to stop and quit?") // On start Component.onCompleted : { diff --git a/internal/frontend/qml/ImportExportUI/HelpView.qml b/internal/frontend/qml/ImportExportUI/HelpView.qml index 6f06c2b5..bbbe076d 100644 --- a/internal/frontend/qml/ImportExportUI/HelpView.qml +++ b/internal/frontend/qml/ImportExportUI/HelpView.qml @@ -113,7 +113,7 @@ Item { MouseArea { anchors.fill: parent onClicked : { - go.openLicenseFile() + go.openLicenseFile() } cursorShape: Qt.PointingHandCursor } @@ -127,9 +127,7 @@ Item { font.underline: true MouseArea { anchors.fill: parent - onClicked : { - Qt.openUrlExternally(go.updateReleaseNotesLink) - } + onClicked : gui.openReleaseNotes() cursorShape: Qt.PointingHandCursor } } diff --git a/internal/frontend/qml/ProtonUI/InformationBar.qml b/internal/frontend/qml/ProtonUI/InformationBar.qml index 87271787..004117e2 100644 --- a/internal/frontend/qml/ProtonUI/InformationBar.qml +++ b/internal/frontend/qml/ProtonUI/InformationBar.qml @@ -62,7 +62,7 @@ Rectangle { id: message font.pointSize: root.fontSize * Style.pt } - + ClickIconText { id: linkText anchors.verticalCenter : message.verticalCenter @@ -107,31 +107,31 @@ Rectangle { onStateChanged : { switch (root.state) { case "internetCheck": - break; + break; case "noInternet" : - gui.warningFlags |= Style.warnInfoBar - retryInternet.start() - secLeft=checkInterval[iTry] - break; + gui.warningFlags |= Style.warnInfoBar + retryInternet.start() + secLeft=checkInterval[iTry] + break; case "oldVersion": - gui.warningFlags |= Style.warnInfoBar - break; + gui.warningFlags |= Style.warnInfoBar + break; case "forceUpdate": - gui.warningFlags |= Style.errorInfoBar - break; + gui.warningFlags |= Style.errorInfoBar + break; case "upToDate": - gui.warningFlags &= ~Style.warnInfoBar - iTry = 0 - secLeft=checkInterval[iTry] - break; + gui.warningFlags &= ~Style.warnInfoBar + iTry = 0 + secLeft=checkInterval[iTry] + break; case "updateRestart": - gui.warningFlags |= Style.warnInfoBar - break; + gui.warningFlags |= Style.warnInfoBar + break; case "updateError": - gui.warningFlags |= Style.errorInfoBar - break; + gui.warningFlags |= Style.errorInfoBar + break; default : - break; + break; } if (root.state!="noInternet") { @@ -248,9 +248,7 @@ Rectangle { target: linkText visible: true text: "(" + qsTr("view release notes", "display the release notes from the new version") + ")" - onClicked: { - Qt.openUrlExternally(go.updateReleaseNotesLink) - } + onClicked: gui.openReleaseNotes() } PropertyChanges { target: actionText diff --git a/internal/frontend/qt-ie/frontend.go b/internal/frontend/qt-ie/frontend.go index 2b97046c..94894f81 100644 --- a/internal/frontend/qt-ie/frontend.go +++ b/internal/frontend/qt-ie/frontend.go @@ -118,14 +118,18 @@ func (f *FrontendQt) Loop() (err error) { } func (f *FrontendQt) NotifyManualUpdate(update updater.VersionInfo, canInstall bool) { - f.Qml.SetUpdateVersion(update.Version.String()) - f.Qml.SetUpdateLandingPage(update.LandingPage) - f.Qml.SetUpdateReleaseNotesLink(update.ReleaseNotesPage) + f.SetVersion(update) f.Qml.SetUpdateCanInstall(canInstall) - f.updateInfo = update f.Qml.NotifyManualUpdate() } +func (f *FrontendQt) SetVersion(version updater.VersionInfo) { + f.Qml.SetUpdateVersion(version.Version.String()) + f.Qml.SetUpdateLandingPage(version.LandingPage) + f.Qml.SetUpdateReleaseNotesLink(version.ReleaseNotesPage) + f.updateInfo = version +} + func (f *FrontendQt) NotifySilentUpdateInstalled() { f.Qml.NotifySilentUpdateRestartNeeded() } @@ -428,6 +432,8 @@ func (f *FrontendQt) checkForUpdates() { return } + f.SetVersion(version) + if !f.updater.IsUpdateApplicable(version) { logrus.Debug("No need to update") return diff --git a/internal/frontend/qt-ie/frontend_nogui.go b/internal/frontend/qt-ie/frontend_nogui.go index ba1ecf2f..0397deba 100644 --- a/internal/frontend/qt-ie/frontend_nogui.go +++ b/internal/frontend/qt-ie/frontend_nogui.go @@ -47,6 +47,9 @@ func (s *FrontendHeadless) NotifyManualUpdate(update updater.VersionInfo, canIns // NOTE: Save the update somewhere so that it can be installed when user chooses "install now". } +func (s *FrontendHeadless) SetVersion(update updater.VersionInfo) { +} + func (s *FrontendHeadless) NotifySilentUpdateInstalled() { } diff --git a/internal/frontend/qt/frontend.go b/internal/frontend/qt/frontend.go index 358fdfba..5b6b5bbd 100644 --- a/internal/frontend/qt/frontend.go +++ b/internal/frontend/qt/frontend.go @@ -163,14 +163,18 @@ func (s *FrontendQt) Loop() (err error) { } func (s *FrontendQt) NotifyManualUpdate(update updater.VersionInfo, canInstall bool) { - s.Qml.SetUpdateVersion(update.Version.String()) - s.Qml.SetUpdateLandingPage(update.LandingPage) - s.Qml.SetUpdateReleaseNotesLink(update.ReleaseNotesPage) + s.SetVersion(update) s.Qml.SetUpdateCanInstall(canInstall) - s.updateInfo = update s.Qml.NotifyManualUpdate() } +func (s *FrontendQt) SetVersion(version updater.VersionInfo) { + s.Qml.SetUpdateVersion(version.Version.String()) + s.Qml.SetUpdateLandingPage(version.LandingPage) + s.Qml.SetUpdateReleaseNotesLink(version.ReleaseNotesPage) + s.updateInfo = version +} + func (s *FrontendQt) NotifySilentUpdateInstalled() { s.Qml.NotifySilentUpdateRestartNeeded() } @@ -420,6 +424,8 @@ func (s *FrontendQt) checkForUpdates() { return } + s.SetVersion(version) + if !s.updater.IsUpdateApplicable(version) { logrus.Debug("No need to update") return diff --git a/internal/frontend/qt/frontend_nogui.go b/internal/frontend/qt/frontend_nogui.go index 2cc3c452..93ea4549 100644 --- a/internal/frontend/qt/frontend_nogui.go +++ b/internal/frontend/qt/frontend_nogui.go @@ -48,6 +48,9 @@ func (s *FrontendHeadless) NotifyManualUpdate(update updater.VersionInfo, canIns // NOTE: Save the update somewhere so that it can be installed when user chooses "install now". } +func (s *FrontendHeadless) SetVersion(update updater.VersionInfo) { +} + func (s *FrontendHeadless) NotifySilentUpdateInstalled() { } diff --git a/release-notes/bugs-bridge.txt b/release-notes/bugs-bridge.txt deleted file mode 100644 index 157d05a8..00000000 --- a/release-notes/bugs-bridge.txt +++ /dev/null @@ -1,8 +0,0 @@ -• Message corruption - rare cases of overly long headers -• AppleMail crashes (related to timestamps) -• Sending messages from aliases in combined inbox mode -• Fedora font issues - -For more detailed summary of the changes see https://github.com/ProtonMail/proton-bridge/blob/master/Changelog.md - - diff --git a/release-notes/bugs-importexport.txt b/release-notes/bugs-importexport.txt deleted file mode 100644 index 06224d5c..00000000 --- a/release-notes/bugs-importexport.txt +++ /dev/null @@ -1 +0,0 @@ -• Installation issues on linux diff --git a/release-notes/import-export.md b/release-notes/ie.md similarity index 100% rename from release-notes/import-export.md rename to release-notes/ie.md diff --git a/release-notes/notes-bridge.txt b/release-notes/notes-bridge.txt deleted file mode 100644 index c05f209b..00000000 --- a/release-notes/notes-bridge.txt +++ /dev/null @@ -1,2 +0,0 @@ -• Improvements to message parsing -• Better error handling diff --git a/release-notes/notes-importexport.txt b/release-notes/notes-importexport.txt deleted file mode 100644 index b6f1840f..00000000 --- a/release-notes/notes-importexport.txt +++ /dev/null @@ -1,3 +0,0 @@ -• Allow an import of already encrypted messages (as cypher text) -• Cosmetic GUI changes -• Better error handling diff --git a/utils/enums.sh b/utils/enums.sh index ab97cc32..1d4cc700 100644 --- a/utils/enums.sh +++ b/utils/enums.sh @@ -1,22 +1,23 @@ -// Copyright (c) 2021 Proton Technologies AG -// -// This file is part of ProtonMail Bridge. -// -// ProtonMail Bridge is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// ProtonMail Bridge is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with ProtonMail Bridge. If not, see . - #!/bin/bash +# Copyright (c) 2021 Proton Technologies AG +# +# This file is part of ProtonMail Bridge. +# +# ProtonMail Bridge is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ProtonMail Bridge is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with ProtonMail Bridge. If not, see . + + # create QML JSON object from list of golang constants # run this script and output line stored in `out.qml` insert to `Gui.qml` diff --git a/utils/release_notes.sh b/utils/release_notes.sh index aa2aca2a..bc871488 100755 --- a/utils/release_notes.sh +++ b/utils/release_notes.sh @@ -1,37 +1,42 @@ -// Copyright (c) 2021 Proton Technologies AG -// -// This file is part of ProtonMail Bridge. -// -// ProtonMail Bridge is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// ProtonMail Bridge is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with ProtonMail Bridge. If not, see . - #!/bin/bash +# Copyright (c) 2021 Proton Technologies AG +# +# This file is part of ProtonMail Bridge. +# +# ProtonMail Bridge is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ProtonMail Bridge is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with ProtonMail Bridge. If not, see . + + # Generate HTML release notes # hosted at https://protonmail.com/download/{ie,bridge}/release_notes.html -# Load props -APP_NAME=$1 -if [ "$APP_NAME" == "" ]; then - APP_NAME="Bridge" +# Load props +APP_TYPE=$1 +if [ "$APP_TYPE" == "" ]; then + APP_TYPE="bridge" +fi + +APP_NAME="Bridge" +if [ "$APP_TYPE" == "ie" ]; then + APP_NAME="Import-Export app" fi -APP_TYPE=$(echo "$APP_NAME"|tr [A-Z] [a-z]) INFILE="release-notes/${APP_TYPE}.md" OUTFILE="release-notes/${APP_TYPE}.html" # Check dependencies -if ! which -s pandoc; then +if ! which pandoc; then echo "PANDOC NOT FOUND!\nPlease install pandoc in order to build release notes." exit 1 fi