Open blackadderkate opened 2 years ago
Created a Branch for this issue: legacy-version-for-older-qt-releases
Please make sure you use this branch for pulling code or testing on older versions.
I am struggling with finding an alternative for the onActionChosen routine. What that routine does is validate whether the user has filled in all the necessary fields when they click the OK button. If they have not, it will tell them what is wrong, and won't close the Dialog.
There doesn't seem to be any way of replicating this behaviour with earlier QML versions. There seems to be no way of preventing a dialog being closed when the Cancel or OK button is clicked. There also doesn't seem to be a way of disabling the OK button until they enter valid data in all the fields.
The only workaround I have seen suggested is to remove the Standard OK and Cancel buttons, and replace them with my own Buttons - but that means I lose all the automatic language translations, which is annoying.
Tried it but have problems to install from file. What I did:
Tried it but have problems to install from file. What I did:
* downloaded weather-widget-2.1.8.plasmoid * right klick on the desktop * selected "add widget" * fetch new widget * install from local file * selected previously downloaded weather-widget-2.1.8.plasmoid * ready But nothing happened. Is sure my fault but what did I wrong?
Difficult to say without more information. Please can you try the following:
1) check whether the Widget installed correctly:
2) If the folder exists, and the version number is correct (2.1.8), try the following:
3) If that works OK, check whether you can install the plasmoid on the Desktop or in the Panel.
4) if the folder does NOT exist, or the version number is incorrect:
Please let me know how you get on...
Thank you for the step-by-step instructions. Manual installation of plasmoids is out of my experience (so far).
Removed org.kde.weatherWidget-2 which contained the installation of 2.2.2
Did
plasmapkg2 -i weather-widget-2.1.8.plasmoid
to be sure that the downloaded plasmoid has been installed. Ended with success.
plasmoidviewer -a .
in ~/.local/share/plasma/plasmoids/org.kde.weatherWidget-2 ended with an error window:
"Fehler beim Laden der QML-Datei: file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/main.qml:24:1: Script file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/code/icons.js unavailable
file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/code/icons.js:200:5: Expected token `}'"
Translated: Error loading QML file: file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/main.qml:24:1: Script file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/code/icons.js unavailable file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/code/icons.js:200:5: Expected token `}'
user name replaced with xxxx for privacy reasons. Same error message as with 2.2.2, Update (plasmapkg2 -u) has the same result. I hope the error message helps to find the problem. Btw: /home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/code/icons.js exists.
I've had a quick look at that file, and I can't see anything obviously wrong. Unfortunately I am going out this evening, so I will have to try and fix the problem tomorrow...
There's no hurry. Meanwhile, if I want to know what the weather is like, I just look out the window. ;-)
OK, I've tried changing a couple of things in the code to see if I can figure out what the problem is... Please can you download this following patch, and apply it as follows:
and let me know whether that works or not.
Thanks...
After applying your patch:
patch icons.js /tmp/iconspatch.txt
patching file icons.js
(no error message)
And: cd ../..
...weatherWidget-2 > plasmoidviewer -a .
I get the error:
"Fehler beim Laden der QML-Datei: file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/main.qml:24:1: Script file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/code/icons.js unavailable
file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/code/icons.js:3:9: Expected token ;'"
Translated:
"Error loading QML file: file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/main.qml:24:1: Script file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/code/icons.js unavailable
file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/code/icons.js:3:9: Expected token ;'"
OK, please remove the old patch as follows:
Download this patch instead and apply it.
and please let met know what happens.
With this I got: "Fehler beim Laden der QML-Datei: file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/main.qml:103:28: Type FullRepresentation unavailable file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/FullRepresentation.qml:84:5: Type Meteogram unavailable file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/Meteogram.qml:18:1: module "QtQuick.Window" version 2.5 is not installed" Translation as before: "Error loading QML file..."
I have to admit that I did not have the old patch any longer. Thus it was impossible to revert the patch iconspatch.txt. To get the unpatched version I fetched icons.js from the development branch. Just to be sure that we are taking about the same file here the md5 checksums: d230b5c14dee5c8af70df8a811675c63 icons.js (unpatched from 2.1.8) 654d6c605f5f7a6d4f498ce2a230c870 icons.js (patched with iconspatch2.txt)
If the files are different please provide the patched icons.js, I know how to replace it. Sorry for the hassle.
You downloaded the correct file (I got the same MD5 sum) and the fact that the error is now different proves that the patch applied successfully. So we are making progress!
To get rid of the new error, can you please open /home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/Meteogram.qml in your favourite text editor (I use KATE), and change lines 18 and 19 to:
import QtQuick.Window 2.2
import QtQml.Models 2.2
and try running the applet again?
Thanks.
Not enough progress. ;-)
Error message:
"Error loading QML-Datei: file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/main.qml:115:5: Type MetNo unavailable
file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/providers/MetNo.qml:203:15: Expected token ;' file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/providers/MetNo.qml:204:15: Expected token
;'
file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/providers/MetNo.qml:205:15: Expected token ;' file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/providers/MetNo.qml:213:15: Expected token
;'
file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/providers/MetNo.qml:214:15: Expected token ;' file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/providers/MetNo.qml:215:19: Expected token
;'
file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/providers/MetNo.qml:215:44: Expected token )' file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/providers/MetNo.qml:215:49: Expected token
,'
"
diff Meteogram.qml Meteogram.qml-20220309
18,21c18,19
< /* import QtQuick.Window 2.5 */
< /* import QtQml.Models 2.5 */
< import QtQuick.Window 2.2
< import QtQml.Models 2.2
---
> import QtQuick.Window 2.5
> import QtQml.Models 2.5
Thanks for your patience...
I have a theory that the version of KDE/Qt you are running has stricter "rules" on some things than my version does - such as needing spaces around mathematical operators (= + - * /), which is why you are getting so many errors.
Just to test my theory, can you please try the following:
Download this latest patch Then in Konsole:
And please let me know if it makes any difference. If I'm right, I will be able to find most of the bugs without needing you to test every single time I make a change.
Your patch file did not fit to the unpached local file. I reworked the rejected patches by hand (from MetNo.qml.rej). I hope I did not skip a line of .rej... Errors are now:
file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/providers/MetNo.qml:203:15: Expected token `;'
file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/providers/MetNo.qml:204:15: Expected token `;'
file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/providers/MetNo.qml:205:15: Expected token `;'
file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/providers/MetNo.qml:213:15: Expected token `;'
file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/providers/MetNo.qml:214:15: Expected token `;'
file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/providers/MetNo.qml:215:19: Expected token `;'
file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/providers/MetNo.qml:215:47: Expected token `)'
file:///home/xxxx/.local/share/plasma/plasmoids/org.kde.weatherWidget-2/contents/ui/providers/MetNo.qml:215:52: Expected token `,'
Those errors are the same as before - so the problem wasn't what I thought it was.
I have just downloaded version 5.9.9 of Qt (which is very similar to the version of Qt used in Kubuntu 18.04LTS) and done some testing with the "qmllint" tool, and it looks as though the let command is not supported on your version of Qt.
I need to run qmllint on ALL the files in the project (in case there are other differences that will need to be fixed) - which might take me a while.
When I'm done I'll upload a new plasmoid file on here for you to test, and let you know...
Thanks a lot for your effort. I'd wish that I would be able to code in java script. That might make it easier to help you. If it was COBOL, I probably may be able to help. ;-)
I did COBOL at University back in the 80s - I've forgotten pretty much everything about it now though, although I seem to remember everything was written in uppercase...
As for the widget, I've done some more hacking - please try this release.
Download the plasmoid file, and install in konsole using plasmapkg2 -u /tmp/weather-widget-2.1.8.1.plasmoid Then test using plasmoidviewer as before:
Release 2.1.8.1 works! Thank you. Minor issue: Manual input of geo location does not work correctly. I tried to enter location from yr.no: Lat 28.08504, Lon -17.33385, Alt 15 Seems not to accept decimal point values. Managed to get the place by manually editin URL to lat=28.08504&lon=-17.33385&altitude=15 It's really a minor issue, anyway.
Excellent news! Now the testing really starts!
1) If you click the Help button the widget will tell you why you those values can't be saved.
One possibility is that I set the latitude and longitude input boxes to four decimal places.
Does it work if you put in less precise numbers - for example 28.085 & - 17.334? And did you remember to put in something in the location input box?
2) If you could test the Search facility, it would also be really helpful - does it detect your country properly? Does it load the database correctly? Does the filter work? Does it transfer the data if you select a location and click OK?
3) Is everything translated properly? Is all the text displayed correctly, or is some of it clipped?
4) Can you please check all the Configuration pages and settings work? Does the widget update if you change the temperature units to Fahrenheit or Kelvin? And do the meteogram units change?
If everything works the way it is supposed to, I'll be able to release it to the KDE store over the weekend...
Both errors are wrong. Longitude is negative, what is absolutely possible (western of Greenwich). The place name is "Valle Gran Rey, 15m"; absolutely correct and a lovely place, by the way. :-) I assume that decimal separation is dot not comma. Eg. "28.08504" not "28,08504"
A bit work has to be done prior to release. ;-)
Thanks for the prompt reply.
1) I will investigate this over the weekend. 2) Good news! 3) The database itself is English, but the GUI itself should be in German. I'll have to investigate this as well. 4) I don't think Configuration changes work properly in plasmoidviewer. Try actually adding the widget into the panel (or onto the desktop) and test it there (if you tend to Sleep or Hibernate your computer, you might need to logoff and back in again to force KDE to reload the widget).
3. I have installed German locale on my laptop using a "test" login, and the German translation works for me - see this screenshot:
I'm not entirely sure what is going on there - I shall try some Google searches and see what I can find out.
Just out of curiosity, does the following work if you try the following in Konsole:
As this works fine on my machine...
I have made major changes to the Latitude, Longitude, Altitude and Placename validation code:
Please download weather-widget-2.1.8.2.plasmoid and update as before using plasmapkg -u .
Ok...
See screen shot where I filled only the top line and location name.
Changing configuration (units) works now.
Fixed this now...
Phew - I couldn't find anything on Google, so I was getting a bit worried!
It was flagging your input as invalid because you are in a German locale, so you will need to change the decimal points in the Latitude and Longitude to commas... Please download this new version and give it a try. This version will automatically convert the commas into decimal points when it builds the URL (see below):
The way QML handles configuration variables is weird - but I think I know what I did wrong, and have removed the faulty code...
Thanks again for your help - I literally couldn't have done this without you...
Thank you for your awesome work.
A suggestion for future versions: There is a button (clickable field) "next location" in the upper right corner. What about the same for "previous location" in the upper left corner? It would help people with many configured locations.
Glad the widget is now working for you. Please give it a thorough test, and let me know if you find any other bugs - I will leave this bug open for a few more days for you to do this.
I have created a new issue for the Previous Location suggestion.
I'll continue testing. Thank you.
Do you plan to release the "previous location" enhancement also for the legacy version? I can find only 2.1.8 from about 9 days ago.
Do you plan to release the "previous location" enhancement also for the legacy version? I can find only 2.1.8 from about 9 days ago.
Yes I do.
It is not easy to juggle bug-fixes and new-releases on two different releases - I got a lot of bug reports from version 2.2.4 and I only have one pair of hands! When I have got the bugs out of version 2.2.4 I will add this feature to version 2.1.8. It shouldn't be too complicated...
No stress! Step by step, it works so far. The rest is elegancy. ;-)
Kubuntu 18.04 is now officially unsupported, so I think supporting that shouldn't be expected of you either. :slightly_smiling_face:
Thank you. The time I raised this issue (Mar 4, 2022), Ubuntu 18.04 has been supported. ;-) Meanwhile I moved 2 computers to Ubuntu 22.04 and 2 computers to Debian testing. On all 4 your weather-widget-2 works.
Issue can be closed now. :-)
Create a version of the Widget that works on older QT / Plasma versions, such as Kubuntu 18.04 LTS.
Issues:
Tooltips need changing back to the Rectangles used before in Meteograms.qml. Need to revert commit 9f8720d
onActionChosen is not a valid Signal in ConfigGeneral.qml. No fix yet.
Arrow functions are not supported in placesearch-helpers.js.