Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Wind speed and direction on lockscreen

    Reply
    Page 3 of 5 | Prev |   1     2   3   4     5   | Next
    Markkyboy | # 21 | 2018-04-14, 15:21 | Report

    For anyone interested in the above, I have now released a patch on Openrepos
    (see the heading above the windspeed value)

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Images
     
    The Following 3 Users Say Thank You to Markkyboy For This Useful Post:
    Amboss, Jordi, karlos devel

     
    Markkyboy | # 22 | 2018-08-24, 16:52 | Report

    Hi all,

    as many of us know, by adding a few lines of code to Clock.qml in /usr/share/lipstick-jolla-home-qt5/lockscreen and importing WeatherBanner.qml to lockscreen directory, we can produce and customise the Weather Banner, simple enough that I managed to do this without help....cool, or so I thought.

    I would like to do the same with 'Wind Direction'. So by applying the same logic as above, I thought it would be a piece of cake to get Wind Direction to show on the lockscreen, but.......no. I have been playing with this for some time and still no cigar.

    This is the code for WeatherBanner in Clock.qml;

    WeatherBanner {
    id: weatherBanner
    anchors {
    top: month.bottom
    topMargin: Theme.paddingMedium
    horizontalCenter: parent.horizontalCenter
    }
    }

    and so, this is the code for WindDirection in Clock.qml;

    WindDirection {
    id: windDirection
    anchors {
    top: weatherBanner.bottom
    topMargin: Theme.paddingLarge*2
    horizontalCenter: parent.horizontalCenter
    }
    }

    Behind the scenes and situated in lockscreen folder along with Clock.qml are WeatherBanner.qml (customised) and WeatherDirection.qml. Rather than just having an import statement for WeatherBanner I needed to customise my banner, so that's why I made a copy of the original WeatherBanner.qml and placed it in the lockscreen folder. I also tried various import statements for WindDirection but all/some/none makes no difference, what am I missing here?

    Time to ask the experts among us for their wealth of knowledge, so guys and girls, if you have any idea how I can make Wind Direction show on the lockscreen, like we have done with Weather Banner, i'd really appreciate it, I feel like I'm so close to making it work....buuuuuuuuuut, it's not happening!

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to Markkyboy For This Useful Post:
    Amboss, mosen

     
    Ancelad | # 23 | 2018-08-25, 06:56 | Report

    Explore the latest Lockscreen Analog Clock, which uses own WeatherBannerMod.qml (obviously it is modified WeatherBanner.qml)

    Code:
    WeatherLoader {
          id: weatherLoader
          visible: lipstickSettings.lowPowerMode
          width: lockScreen.width
          height: width/2
          scale: rotated ? analogclockSettingsLandscape.sneakScale/100 : analogclockSettings.sneakScale/100
          source: "/usr/lib/qt5/qml/Sailfish/WeatherBannerMod.qml" //here is modified file 
          active: true
          anchors {
                top: parent.top
                topMargin: rotated ? analogclockSettingsLandscape.weathertopmargin : analogclockSettings.weathertopmargin
                horizontalCenter: parent.horizontalCenter
          }		
    }
    and do diff between
    Code:
    --- /dev/null
    +++ /usr/lib/qt5/qml/Sailfish/WeatherBannerMod.qml (YOUR_FILE)
    or put the whole file directly.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 4 Users Say Thank You to Ancelad For This Useful Post:
    Amboss, Jordi, Markkyboy, mosen

     
    Markkyboy | # 24 | 2018-08-25, 11:47 | Report

    I've had a good play, adding/removing/editing various aspects of each file that should be required. I even removed it all and started again. No amount of 'playing' helped.

    I wonder exactly how WeatherBanner is linked to homescreen, I know it is not just via import statements, but what else, how does WeatherBanner appear on lockscreen/Clock.qml when WindDirection doesn't. I'm truly baffled. I'd like to think I understand most of what I'm doing with 'hacking' qml files. I will keep playing though, as I have done for months on and off

    Thanks for your input Ancelad.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to Markkyboy For This Useful Post:
    Amboss, mosen

     
    Ancelad | # 25 | 2018-08-25, 12:02 | Report

    Weather comes to lockscreen through eventsview in my case.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to Ancelad For This Useful Post:
    Amboss, Jordi, mosen

     
    Markkyboy | # 26 | 2018-08-25, 12:52 | Report

    Originally Posted by Ancelad View Post
    Weather comes to lockscreen through eventsview in my case.
    Originally, so did mine. But I don't use 'import "../eventsview/weather" statement, because I wanted to customise how WeatherBanner looks on lockscreen and I couldn't achieve it using eventsview methods.

    I've had a look already in EventsView for clues, I noticed a few import statements, tried adding them individually, but still no joy. But, you are right, the original method of getting weatherbanner onto lockscreen is through eventsview. Best I get fiddling then!

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to Markkyboy For This Useful Post:
    Amboss, mosen

     
    Ancelad | # 27 | 2018-08-25, 13:45 | Report

    Share your files and I will check.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to Ancelad For This Useful Post:
    Amboss, Jordi, mosen

     
    Markkyboy | # 28 | 2018-08-25, 13:50 | Report

    The basis is my wind direction text patch on openrepos, install that. then, either move its contents to lipstick-jolla-home-qt5 as a qml file and add an entry for windDirection in Clock.qml

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to Markkyboy For This Useful Post:
    Amboss, mosen

     
    Markkyboy | # 29 | 2018-08-25, 13:56 | Report

    I added this to lipstick-jolla-home-qt5/lockscreen/Clock.qml;

    Code:
    WindDirection {
                    id: windDirection
                    anchors {
                        top: weatherBanner.bottom
                        topMargin: Theme.paddingLarge*2
                        horizontalCenter: parent.horizontalCenter
                    }
                    text: windDirection.text
            }
    Then create WindDirection.qml in the same folder as Clock.qml and enter the following contents;

    Code:
        import QtQuick 2.2
            import Sailfish.Silica 1.0
            import Sailfish.Weather 1.0
    
            Label {
                id: windDirection
                text: {
                    if      (model.windDirection==0)   'N'
                    else if (model.windDirection==45)  'NE'
                    else if (model.windDirection==90)  'E'
                    else if (model.windDirection==135) 'SE'
                    else if (model.windDirection==180) 'S'
                    else if (model.windDirection==225) 'SW'
                    else if (model.windDirection==270) 'W'
                    else if (model.windDirection==315) 'NW'
                }
        }
    I've tried various import statements for both files but none seems to help, the 'why' is what's bugging me!

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to Markkyboy For This Useful Post:
    Amboss, mosen

     
    Ancelad | # 30 | 2018-08-25, 20:21 | Report

    Hmmm... Dirty trick, but seems working...

    Add into /usr/lib/qt5/qml/Sailfish/Weather/WeatherDetailsHeader.qml

    Code:
    import org.nemomobile.configuration 1.0
    and

    Code:
    ConfigurationGroup {
         id: windDirection
         path: "/custom_path_you_want"
         property int value: windDirectionIcon.rotation
    }
    And now you can read this value from Clock.qml by adding

    Code:
    import org.nemomobile.configuration 1.0
    and

    Code:
    ConfigurationGroup {
         id: windDirection
         path: "/custom_path_you_want"
         property int value: 0
    }
    and finally

    Code:
    Text {
            id: wind
            text: windDirection.value 
    }
    It will show values from 0 with stepsize 45... And now you can define texts according values...

    I'm not sure if it will work dynamically but it should...

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 4 Users Say Thank You to Ancelad For This Useful Post:
    Amboss, imaginaryenemy, Jordi, peterleinchen

     
    Page 3 of 5 | Prev |   1     2   3   4     5   | Next
vBulletin® Version 3.8.8
Normal Logout