2022-01-27 21:59:02 +00:00
/ * *
2022-03-05 16:49:35 +00:00
* LogarithmPlotter - 2 D plotter software to make BODE plots , sequences and distribution functions .
2022-01-27 21:59:02 +00:00
* Copyright ( C ) 2022 Ad5001
*
* This program 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 .
*
* This program 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 this program . If not , see < https: //www.gnu.org/licenses/>.
* /
import QtQuick 2.12
import QtQuick . Controls 2.12
2022-01-29 17:17:19 +00:00
/ * !
\ qmltype Changelog
\ inqmlmodule eu . ad5001 . LogarithmPlotter . Popup
\ brief Overlay used to display the current changelog to the user .
\ note The changelog is either fetched from https: //api.ad5001.eu/changelog/logarithmplotter/ or taken locally when a file named CHANGELOG.md exists within the main source code.
\ sa LogarithmPlotter , GreetScreen
* /
2022-01-27 21:59:02 +00:00
Popup {
id: changelogPopup
x: ( parent . width - width ) / 2
y: Math . max ( 20 , ( parent . height - height ) / 2 )
width: changelog . width + 40
height: Math . min ( parent . height - 40 , 500 )
modal: true
focus: true
closePolicy: Popup . CloseOnEscape | Popup . CloseOnPressOutside
2022-01-29 17:17:19 +00:00
/ * !
\ qmlproperty string Changelog: : changelogNeedsFetching
true when the changelog has yet to be loaded , set to false the moment it ' s loaded .
* /
2022-01-27 21:59:02 +00:00
property bool changelogNeedsFetching: true
onAboutToShow: if ( changelogNeedsFetching ) Helper . fetchChangelog ( )
Connections {
target: Helper
function onChangelogFetched ( chl ) {
changelogNeedsFetching = false ;
changelog . text = chl
}
}
ScrollView {
anchors.top: parent . top
anchors.topMargin: 10
anchors.left: parent . left
anchors.leftMargin: 10
anchors.bottom: doneBtn . top
anchors.bottomMargin: 10
clip: true
Label {
id: changelog
color: sysPalette . windowText
textFormat: TextEdit . MarkdownText
text: qsTr ( "Fetching changelog..." )
2022-01-31 20:39:51 +00:00
onLinkActivated: Qt . openUrlExternally ( link )
2022-01-27 21:59:02 +00:00
}
}
Button {
id: doneBtn
text: qsTr ( "Done" )
font.pixelSize: 18
anchors.bottom: parent . bottom
anchors.bottomMargin: 10
anchors.horizontalCenter: parent . horizontalCenter
onClicked: changelogPopup . close ( )
}
}