Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
d15af8e
go away from English-only notation without translations in the timetable
idamir Jan 12, 2023
45bad80
FIx for issue #149
blackadderkate Jun 16, 2023
79162d2
Fix for issue # 145
blackadderkate Jun 16, 2023
1647be1
Switch to Sunrise 3.0 API
pstrejajo Jun 18, 2023
f3ddf4f
Merge pull request #151 from pstrejajo/sunrise-3.0
blackadderkate Jun 18, 2023
e9785a3
Merge branch 'master' of https://github.com/blackadderkate/weather-wi…
blackadderkate Jun 18, 2023
da2eef4
Revert "FIx for issue #149"
blackadderkate Jun 18, 2023
a0628b2
Update README.md
blackadderkate Sep 19, 2023
8a498de
WIP as of 21-12-2023
blackadderkate Dec 21, 2023
fd269d3
part two
blackadderkate Dec 27, 2023
f95e343
Part 2a
blackadderkate Dec 27, 2023
517931b
part 3
blackadderkate Jan 2, 2024
690fbc7
part 3
blackadderkate Jan 2, 2024
73c2750
Merge branch 'QT6' of https://github.com/blackadderkate/weather-widge…
Jan 3, 2024
67f2eea
part 4a
Jan 3, 2024
96ba238
Owm Dialog
Jan 3, 2024
87b6f32
Config pages (radio buttons broken), not tested
Jan 3, 2024
18dff84
Change build number.
Jan 5, 2024
1af5760
more metadata.json related fixes.
Jan 5, 2024
54d2109
Add minimum Plasma API version
RedSQL Jan 6, 2024
f990aa7
Merge pull request #159 from RedSQL/Plasma-Api-Fix
blackadderkate Jan 7, 2024
24b2808
Debugging files
Jan 7, 2024
b1f7981
Start fixing owm provider
Jan 7, 2024
9984f0f
More OWM fixes
Jan 8, 2024
49ece16
Prepare for Alpha Release
blackadderkate Jan 23, 2024
ac335c3
update package version
blackadderkate Jan 23, 2024
086a5b1
rainfall type errors
blackadderkate Jan 23, 2024
63b7832
ConfigUnits Radio Button fixes
Jan 27, 2024
3e42e16
Fix warning regarding weather icon
Jan 27, 2024
2ebd02d
Check XHR_ALLOW_FILE_READ=1for local DB reading
Jan 27, 2024
69244a1
Add back metadata.desktop
Jan 27, 2024
b470988
Fix MetNo not loading in certain timezones
blackadderkate Jan 28, 2024
695a66a
refresh / upload Debugging data for OWM
blackadderkate Jan 28, 2024
146c141
Openweathermap fixes
blackadderkate Jan 28, 2024
cd2f6cb
Cache and CreditLabel/ CreditLink fixes
blackadderkate Jan 28, 2024
7488310
Fix Up/Down buttons in ConfigGeneral
blackadderkate Jan 28, 2024
10f9508
another busyIndicator fix attempt
blackadderkate Jan 28, 2024
b01c3a9
MetNo Long Range data uses local timezone
blackadderkate Jan 28, 2024
d1585a8
Fix reloadData
blackadderkate Jan 28, 2024
09b6852
Better Fix for reloadData
blackadderkate Jan 28, 2024
733ba5c
Tweak Timezone-related features
blackadderkate Jan 29, 2024
48214f0
Font-related changes
blackadderkate Jan 29, 2024
3b7c827
Remove obsolete xmlCacheJson setting. Increase Default Font Size
blackadderkate Jan 29, 2024
5bbbcbf
Comment out debug logging code
blackadderkate Jan 29, 2024
529073a
Fix incorrect Sunrise/Sunset times
blackadderkate Jan 29, 2024
deb6f75
Extra OWM data for debugging purposes
blackadderkate Feb 5, 2024
de0437d
Move timezoneData.js to Code Folder
blackadderkate Feb 5, 2024
f14fd8c
Fixes for OWM
blackadderkate Feb 5, 2024
7f3b007
Tweak MetNo debugging data
blackadderkate Feb 5, 2024
39dcee3
Enable extra debugging OWM data
blackadderkate Feb 5, 2024
bbe1bd6
Missed a file in commit de0437d
blackadderkate Feb 5, 2024
43e0ee2
Enable extra debugging OWM data pt 2
blackadderkate Feb 5, 2024
a971874
Tweak CompactView
blackadderkate Feb 5, 2024
c8454f6
Merge branch 'QT6' of https://github.com/blackadderkate/weather-widge…
blackadderkate Feb 6, 2024
13b2f4b
Make meteogram rebuild last of all.
blackadderkate Feb 11, 2024
e34f7b1
Remove debug logging
blackadderkate Feb 11, 2024
cf828eb
Merge branch 'QT6' of https://github.com/blackadderkate/weather-widge…
blackadderkate Feb 12, 2024
10cefb6
Timezone fixes
blackadderkate Feb 12, 2024
f1f9f0f
Add scrollbars to tables
blackadderkate Feb 14, 2024
a8ce51e
Round Latitude and Longitude
blackadderkate Feb 14, 2024
a3c7c6c
Merge branch 'QT6' of https://github.com/blackadderkate/weather-widge…
blackadderkate Feb 14, 2024
64690ac
i18n updates (part 1)
blackadderkate Feb 18, 2024
eb06a5c
Even more Timezone bugfixes
blackadderkate Feb 29, 2024
d0cb64e
Yet another timezone fix attempt
blackadderkate Mar 2, 2024
6b77755
Bump version
blackadderkate Mar 2, 2024
f87b53f
Use the theme font colour for Long Range Weather
blackadderkate Mar 3, 2024
89c9f33
Make ConfigGeneral Tableviews dark theme aware
blackadderkate Mar 3, 2024
6cbe70c
Formatting - add spaces around equal signs
blackadderkate Mar 3, 2024
2cd11f5
Improve styling of Tableviews in Configuration page
blackadderkate Mar 4, 2024
f622d34
Update CMake config & metadata for KF6. See https://develop.kde.org/d…
Mar 8, 2024
f91d5b5
Add X-Plasma-NotificationAreaCategory to re-enable NotificationArea
Mar 8, 2024
8c57467
Make CMake configuration Plasma 6 compatible
RedSQL Mar 9, 2024
f7ff488
Do not attempt install if cmake fails
RedSQL Mar 9, 2024
dcad7ee
Merge pull request #166 from lainedfles/plasma6_fixes
blackadderkate Mar 10, 2024
5fe5f6f
Merge pull request #167 from RedSQL/cmake-fixups
blackadderkate Mar 10, 2024
da2ec31
Fix translation scripts due to obsolete metadata.desktop file deletion
blackadderkate Mar 10, 2024
8602a37
Bump Version Number
blackadderkate Mar 10, 2024
19d656e
Check properly if command failed
RedSQL Mar 10, 2024
8257021
Merge pull request #169 from RedSQL/dev-build-fixups
blackadderkate Mar 10, 2024
cdbe7f0
Pull compilation fixes from AUR into dev-build
RedSQL Mar 10, 2024
02381e4
Update plugin/CMakeLists.txt
Drommer Mar 11, 2024
40b33dc
Update plugin/backend.cpp
Drommer Mar 11, 2024
7e59c18
Update plugin/plasmoidplugin.cpp
Drommer Mar 11, 2024
f1f4f3b
Update plugin/qmldir
Drommer Mar 11, 2024
d68cc88
Update translations/CMakeLists.txt
Drommer Mar 11, 2024
f6247b9
Delete translations/po/CMakeLists.txt
Drommer Mar 11, 2024
9f47b55
Update CMakeLists.txt
Drommer Mar 11, 2024
78262f7
Update dev-build.sh
Drommer Mar 11, 2024
85b7403
Merge pull request #171 from RedSQL/galibozek-cmake-fixes
blackadderkate Mar 11, 2024
3184fc9
Merge branch 'QT6' into QT6
blackadderkate Mar 11, 2024
17e0206
Merge pull request #172 from Drommer/QT6
blackadderkate Mar 11, 2024
457baa2
Fix Scaling issues on High DPI screens
blackadderkate Mar 21, 2024
112e0c6
Merge branch 'QT6' of https://github.com/blackadderkate/weather-widge…
blackadderkate Mar 21, 2024
432c413
System Tray FullRepresentation Support
blackadderkate Mar 21, 2024
a61bb33
Prevent spurious QT interpreter warning
blackadderkate Mar 21, 2024
d7f9581
Disable DebugLogging in OWM provider
blackadderkate Mar 21, 2024
c039b44
Add Kirigami font textColor style to Compact Item
blackadderkate Mar 21, 2024
63ec66e
Fix Clipping issue on Places Table
blackadderkate Mar 25, 2024
98b0ed4
Remove DebugLogging lines
blackadderkate Mar 25, 2024
6127c89
Use kcmutils in Config Pages
blackadderkate Mar 25, 2024
6f7ea94
Set version to Release
blackadderkate Mar 25, 2024
0b16570
Restore accidentally deleted Kirigami import
blackadderkate Mar 25, 2024
1208665
Force widget refresh if currentPlace is deleted
blackadderkate Mar 25, 2024
69e2cdd
Merge branch 'QT6' of https://github.com/blackadderkate/weather-widge…
blackadderkate Mar 26, 2024
bc7e20f
Fix Prev / Next Location links in Meteogram
blackadderkate Mar 26, 2024
6c7053f
Yet Another CompactRepresentation layout fix
blackadderkate Mar 31, 2024
0045227
Patch debugging error in Last commit
blackadderkate Mar 31, 2024
103e9c5
Display actual plasmoid version in metadata.json
blackadderkate Apr 3, 2024
97a1c51
Remove un-needed debugging line
blackadderkate Apr 3, 2024
fc3dae6
Timezones ignoring DST
blackadderkate Apr 3, 2024
e85c377
FullRepresentation not popping up when in SystemTray
blackadderkate Apr 3, 2024
8b19fba
Rebuild and Refresh data when User changes Timezone Config setting
blackadderkate Apr 3, 2024
831ba32
Bump Widget Version
blackadderkate Apr 3, 2024
85f6a5e
Fix Single-Click behaviour in MetNo Search
blackadderkate Apr 3, 2024
b862222
Fix formatting issue
blackadderkate Apr 3, 2024
258a8f7
New layouts for non-tray.
evgeniy-harchenko Apr 6, 2024
8c7582a
Reduced too big interval between icon and text, added missing propert…
evgeniy-harchenko Apr 6, 2024
ce015e5
Fixed next day title alignment.
evgeniy-harchenko Apr 7, 2024
1269737
Fixed issue with system default font.
evgeniy-harchenko Apr 7, 2024
446474a
Added the ability to disable text about last update.
evgeniy-harchenko Apr 7, 2024
6d818e3
Added more space for temperature label.
evgeniy-harchenko Apr 7, 2024
3ebafed
Merge pull request #177 from evgeniy-harchenko/QT6
blackadderkate Apr 10, 2024
64ed93c
Merge branch 'QT6' of https://github.com/blackadderkate/weather-widge…
blackadderkate Apr 10, 2024
6f6af4e
Tweaks to commit 3ebafed
blackadderkate Apr 10, 2024
6dddf94
Minor tweaks to commit 3ebafed
blackadderkate Apr 10, 2024
8b81763
Additional fix for issue #176 - Elide lastReloadedNotifier
blackadderkate Apr 10, 2024
e92c287
Bump version
blackadderkate Apr 10, 2024
4393bee
Merge branch 'master' of github.com:idamir/weather-widget-2
idamir Dec 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
cmake_minimum_required(VERSION 3.14.0 FATAL_ERROR)
project(org.kde.weatherWidget-2)
project(plasma-weather-widget)

set(QT_MIN_VERSION "5.4.0")
set(KF5_MIN_VERSION "5.0.0")
set(QT_MAJOR_VERSION 6)
set(QT_MIN_VERSION "6.0.0")
set(KF6_MIN_VERSION "6.0.0")
set(PLASMA_MIN_VERSION "6.0.0")

find_package(ECM 0.0.11 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})

include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)

find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Quick)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Plasma)
find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Quick)
find_package(KF6 ${KF6_MIN_VERSION} REQUIRED)
find_package(Plasma ${PLASMA_MIN_VERSION} REQUIRED)
find_package(Plasma5Support ${PLASMA_MIN_VERSION} REQUIRED)

add_subdirectory(plugin)
add_subdirectory(translations)

plasma_install_package(package org.kde.weatherWidget-2)
plasma_install_package(package org.kde.weatherWidget-3)
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Quick update.
Apologies for not being very active on here recently - I've just got a new job and the training is very intense, so I haven't had time to spend on this recently. When my training finishes, I will have a lot more time free to spend on this widget!

## Apologies (again)
Laptop issues, Covid, and overtime meant I've not been able to do much development on this widget recently.
At some point the laptop will need to go away for repair, so it might go very quiet around here for a while...

## About this widget
This is an updated version of the "plasma-applet-weather-widget" by Kotelnik, but using the Met.No API instead of the Yr.No API which is no longer operational.
Expand Down
5 changes: 4 additions & 1 deletion create-plasmoid-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ popd
cd package


VERSION="$( grep -i PluginInfo-Version ./metadata.desktop | cut -d'=' -f 2 )"
VERSION=$(cat ./metadata.json | jq -r '.KPlugin.Version')
# )
#
# ( grep \"Version\" ./metadata.json | cut -d':' -f 2 )"
echo $VERSION

zip -r "../buildWidget/weather-widget-$VERSION.plasmoid" * --exclude \.git\* --exclude *.bak
7 changes: 5 additions & 2 deletions dev-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ pushd ./build

cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DKDE_INSTALL_LIBDIR=lib -DKDE_INSTALL_USE_QT_SYS_PATHS=ON
make
sudo make install

if [ $? -eq 0 ]; then
sudo make install
else
echo "ERROR: One of the CMake commands failed. Installation will not proceed."
fi
popd
50 changes: 31 additions & 19 deletions package/contents/code/data-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ function getReloadedAgoMs(lastReloaded) {
}

function getPlasmoidStatus(lastReloaded, inTrayActiveTimeoutSec) {
dbgprint2("getPlasmoidStatus")
dbgprint("lastReloaded=" + lastReloaded)
dbgprint("inTrayActiveTimeoutSec=" + inTrayActiveTimeoutSec)
var reloadedAgoMs = getReloadedAgoMs(lastReloaded)
dbgprint("reloadedAgoMs=" + reloadedAgoMs)
if (reloadedAgoMs < inTrayActiveTimeoutSec * 1000) {
return PlasmaCore.Types.ActiveStatus
} else {
Expand Down Expand Up @@ -87,43 +91,51 @@ function fetchXmlFromInternet(getUrl, successCallback, failureCallback) {
}

function fetchJsonFromInternet(getUrl, successCallback, failureCallback) {
dbgprint2("fetchJsonFromInternet")
var xhr = new XMLHttpRequest()
xhr.onreadystatechange = function () {
if (xhr.readyState !== XMLHttpRequest.DONE) {
return
}
xhr.timeout = loadingData.loadingDataTimeoutMs;
dbgprint('GET url opening: ' + getUrl)
xhr.open('GET', getUrl)
xhr.setRequestHeader("User-Agent","Mozilla/5.0 (X11; Linux x86_64) Gecko/20100101 ")
dbgprint('GET url sending: ' + getUrl)
xhr.send()

if (xhr.status !== 200) {
dbgprint('ERROR - status: ' + xhr.status)
dbgprint('ERROR - responseText: ' + xhr.responseText)
failureCallback()
return
}
xhr.ontimeout = () => {
dbgprint('ERROR - timeout: ' + xhr.status)
failureCallback()
}

// success
xhr.onerror = (event) => {
dbgprint('ERROR - status: ' + xhr.status)
dbgprint('ERROR - responseText: ' + xhr.responseText)
failureCallback()
}

xhr.onload = (event) => {
dbgprint('status: ' + xhr.status)
// dbgprint('responseText: ' + xhr.responseText)
};

// success
xhr.onload = () => {
dbgprint('successfully loaded from the internet')
dbgprint('successfully of url-call: ' + getUrl)
// dbgprint('responseText: ' + xhr.responseText)
// dbgprint('responseText: ' + xhr.responseText)

var jsonString = xhr.responseText
if (!DataLoader.IsJsonString(jsonString)) {
if (!DataLoader.isJsonString(jsonString)) {
dbgprint('incoming jsonString is not valid: ' + jsonString)
return
}
dbgprint('incoming text seems to be valid')

successCallback(jsonString)
}
dbgprint('GET url opening: ' + getUrl)
xhr.open('GET', getUrl)
dbgprint('GET url sending: ' + getUrl)
xhr.send()

dbgprint('GET called for url: ' + getUrl)
return xhr
}

function IsJsonString(str) {
function isJsonString(str) {
try {
JSON.parse(str)
} catch (e) {
Expand Down
1 change: 0 additions & 1 deletion package/contents/code/db/timezoneData.js

This file was deleted.

2 changes: 2 additions & 0 deletions package/contents/code/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ var WeatherFont = {
}

function getIconCode(iconName, providerId, partOfDay) {
// dbgprint2("getIconCode")
// dbgprint("iconName:" + iconName + "\tproviderId:" + providerId + "\tpartOfDay:" + partOfDay)
var iconCodeParts = null
if (providerId === 'yrno') {
iconCodeParts = WeatherFont.iconNameByYrNoCode[iconName]
Expand Down
37 changes: 22 additions & 15 deletions package/contents/code/placesearch-helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.import "./db/timezoneData.js" as TZData
.import "./timezoneData.js" as TZData
var countries = Array(
{shortCode: "AD" , displayName: "Andorra"},
{shortCode: "AE" , displayName: "United Arab Emirates"},
Expand Down Expand Up @@ -270,27 +270,34 @@ function getDisplayName(shortCode) {
}
function updateListView(filter) {
filteredCSVData.clear()
for (var f = 0; f < myCSVData.rowCount(); f++) {
let lc = myCSVData.get(f).locationName.toLowerCase()
if (myCSVData.get(f).locationName.toLowerCase().indexOf(filter.toLowerCase()) === 0) {
filteredCSVData.append(myCSVData.get(f))
for (var f = 0; f < myCSVData.rowCount; f++) {
let lc = myCSVData.getRow(f).Location.toLowerCase()
if (myCSVData.getRow(f).Location.toLowerCase().indexOf(filter.toLowerCase()) === 0) {
filteredCSVData.appendRow(myCSVData.getRow(f))
}
}
dbgprint("filteredCSVData.rowCount=" + filteredCSVData.rowCount)
}
function loadCSVDatabase(countryName) {
dbgprint("Entered loadCSVDatabase")
dbgprint("QML_XHR_ALLOW_FILE_READ = 1 : " + env_QML_XHR_ALLOW_FILE_READ)
if (countryName.length === 0) {
return
}
myCSVData.clear()
let filename = Qt.resolvedUrl("./db/" + getshortCode(countryName) + ".csv")
var URL = ("http://weatherwidgetqt6.000webhostapp.com/" + getshortCode(countryName) + ".csv") // LIVE ONLY
if (env_QML_XHR_ALLOW_FILE_READ) {
URL = Qt.resolvedUrl("./db/" + getshortCode(countryName) + ".csv") // DEBUGGING ONLY
}
dbgprint("URL = " + URL)
var xhr = new XMLHttpRequest
xhr.open("GET", filename)
xhr.open("GET", URL)
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.DONE) {
var response = xhr.responseText
var tmpDB = response.split(/\r?\n/)
for (var i = 0; i < tmpDB.length - 1; i++) {
myCSVData.append(parseCSVLine(tmpDB[i]))
myCSVData.appendRow(parseCSVLine(tmpDB[i]))
}
updateListView(locationEdit.text)
}
Expand All @@ -301,15 +308,15 @@ function parseCSVLine(csvLine) {
function stripquotes(str) {
return str.replace(/['"]+/g, '')
}

// dbgprint(csvLine)
var items = csvLine.split(/\t/)
return ({
region: stripquotes((items[0])),
locationName: stripquotes(items[1]),
latitude: parseFloat(items[2]),
longitude: parseFloat(items[3]),
altitude: parseInt(items[4]),
Area: stripquotes((items[0])),
Location: stripquotes(items[1]),
Latitude: parseFloat(items[2]).toFixed(3),
Longitude: parseFloat(items[3]).toFixed(3),
Altitude: parseInt(items[4]),
timezoneId: parseInt(items[5]),
timezoneName: TZData.TZData[items[5]].displayName
Timezone: TZData.TZData[items[5]].displayName
})
}
Loading