Notices


Reply
Thread Tools
Markkyboy's Avatar
Posts: 320 | Thanked: 444 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#21
For anyone interested in the above, I have now released a patch on Openrepos
(see the heading above the windspeed value)
Attached Images
 
__________________
| Openrepos | T.J.C. |

Don't just sit there standing around, pick up a shovel and sweep up!
 

The Following 3 Users Say Thank You to Markkyboy For This Useful Post:
Markkyboy's Avatar
Posts: 320 | Thanked: 444 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#22
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!
__________________
| Openrepos | T.J.C. |

Don't just sit there standing around, pick up a shovel and sweep up!
 

The Following 2 Users Say Thank You to Markkyboy For This Useful Post:
Ancelad's Avatar
Posts: 1,471 | Thanked: 2,770 times | Joined on Jun 2012 @ Russia, 96
#23
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.
__________________
Twitter: @iAncelad
Try my SailfishOS theme for Nokia N9
 

The Following 4 Users Say Thank You to Ancelad For This Useful Post:
Markkyboy's Avatar
Posts: 320 | Thanked: 444 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#24
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.
__________________
| Openrepos | T.J.C. |

Don't just sit there standing around, pick up a shovel and sweep up!
 

The Following 2 Users Say Thank You to Markkyboy For This Useful Post:
Ancelad's Avatar
Posts: 1,471 | Thanked: 2,770 times | Joined on Jun 2012 @ Russia, 96
#25
Weather comes to lockscreen through eventsview in my case.
__________________
Twitter: @iAncelad
Try my SailfishOS theme for Nokia N9
 

The Following 3 Users Say Thank You to Ancelad For This Useful Post:
Markkyboy's Avatar
Posts: 320 | Thanked: 444 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#26
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!
__________________
| Openrepos | T.J.C. |

Don't just sit there standing around, pick up a shovel and sweep up!
 

The Following 2 Users Say Thank You to Markkyboy For This Useful Post:
Ancelad's Avatar
Posts: 1,471 | Thanked: 2,770 times | Joined on Jun 2012 @ Russia, 96
#27
Share your files and I will check.
__________________
Twitter: @iAncelad
Try my SailfishOS theme for Nokia N9
 

The Following 3 Users Say Thank You to Ancelad For This Useful Post:
Markkyboy's Avatar
Posts: 320 | Thanked: 444 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#28
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
__________________
| Openrepos | T.J.C. |

Don't just sit there standing around, pick up a shovel and sweep up!
 

The Following 2 Users Say Thank You to Markkyboy For This Useful Post:
Markkyboy's Avatar
Posts: 320 | Thanked: 444 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#29
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!
__________________
| Openrepos | T.J.C. |

Don't just sit there standing around, pick up a shovel and sweep up!
 

The Following 2 Users Say Thank You to Markkyboy For This Useful Post:
Ancelad's Avatar
Posts: 1,471 | Thanked: 2,770 times | Joined on Jun 2012 @ Russia, 96
#30
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...
__________________
Twitter: @iAncelad
Try my SailfishOS theme for Nokia N9
 

The Following 4 Users Say Thank You to Ancelad For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 17:47.