maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N9 / N950 (https://talk.maemo.org/forumdisplay.php?f=51)
-   -   [MOD] Enable Traffic/Automatic day-night in Drive & Traffic in Maps (https://talk.maemo.org/showthread.php?t=85353)

Arie 2012-07-10 20:20

Re: [MOD] How to enable Traffic in Drive for PR1.2/1.3
 
Quote:

Originally Posted by nieldk (Post 1235559)
Yes, it is evening here, also tried manual time setting

Button needs to be enabled in
/usr/lib/drive-qml/views/settings/mapModeSettingsPage.qml

Comments needs to be removed from
/usr/lib/drive-qml/models/MapSettingsModel.qml

Ah ok, so we're missing the plugin... Do you happen to have the lines for that?

I could change them and test them here too :)

nieldk 2012-07-10 20:25

Re: [MOD] How to enable Traffic in Drive for PR1.2/1.3
 
Quote:

Originally Posted by Arie (Post 1235560)
Ah ok, so we're missing the plugin... Do you happen to have the lines for that?

I could change them and test them here too :)

:) search for auto, Was doing the changes in phone terminal LOL so I need to reinstall the Application to give a full diff

There are only 2 lines in the first file /* + */ that encapsulated the button
And likewise in the second file, but 2 places

EDIT
In MapSettingsModel.qml

If you out comment function isNight at the button it seems to actually work

Arie 2012-07-10 20:38

Re: [MOD] How to enable Traffic in Drive for PR1.2/1.3
 
Quote:

Originally Posted by nieldk (Post 1235567)
:) search for auto, Was doing the changes in phone terminal LOL so I need to reinstall the Application to give a full diff

There are only 2 lines in the first file /* + */ that encapsulated the button
And likewise in the second file, but 2 places

I got it working :)

in /usr/lib/drive-qml/models/MapSettingsModel.qml

There is a line:

/*
if (newvalue === "auto") {
setNightMode(isNight());
}
else*/ {
setNightMode(newvalue === "night");

Should be changed to:

if (newvalue === "auto") {
setNightMode(isNight());
}
else {
setNightMode(newvalue === "night");

It will start up in night mode, then choose automatic, it will set itself up and run as it should :)

nieldk 2012-07-10 20:43

Re: [MOD] How to enable Traffic in Drive for PR1.2/1.3
 
Quote:

Originally Posted by Arie (Post 1235575)
I got it working :)

in /usr/lib/drive-qml/models/MapSettingsModel.qml

There is a line:

/*
if (newvalue === "auto") {
setNightMode(isNight());
}
else*/ {
setNightMode(newvalue === "night");

Should be changed to:

if (newvalue === "auto") {
setNightMode(isNight());
}
else {
setNightMode(newvalue === "night");

It will start up in night mode, then choose automatic, it will set itself up and run as it should :)

Don't forget to outcomment the function isNight at the end of that file :)

HtheB 2012-07-10 20:44

Re: [MOD] How to enable Traffic in Drive for PR1.2/1.3
 
Works great, thansk for this discover!

Maybe this can be add to N9 QTweak for people that doesn't have xterm experience at all

Arie 2012-07-10 20:46

Re: [MOD] How to enable Traffic in Drive for PR1.2/1.3
 
Quote:

Originally Posted by nieldk (Post 1235579)
Don't forget to outcomment the function isNight at the end of that file :)

console.log("Sunset:" + sunset);
console.log("Sunrise:" + sunrise);

var t = today.getHours() + today.getMinutes()/60;
console.log("NOW: "+t);
if (t >= sunrise && t < sunset) {
return false;
}
return true;
}

function onDayNightSwitch() {
console.log("onDayNightSwitch");
if (dayNightMode === "auto") {
console.log("Change map mode to: "+!nightMode);
setNightMode(isNight());
}
}

Are you referring to the bold?

Edit: and why?

nieldk 2012-07-10 20:49

Re: [MOD] How to enable Traffic in Drive for PR1.2/1.3
 
Quote:

Originally Posted by Arie (Post 1235583)
console.log("Sunset:" + sunset);
console.log("Sunrise:" + sunrise);

var t = today.getHours() + today.getMinutes()/60;
console.log("NOW: "+t);
if (t >= sunrise && t < sunset) {
return false;
}
return true;
}

function onDayNightSwitch() {
console.log("onDayNightSwitch");
if (dayNightMode === "auto") {
console.log("Change map mode to: "+!nightMode);
setNightMode(isNight());
}
}

Are you referring to the bold?

Edit: and why?

No, the entire function is commented out by embraced /* */

Arie 2012-07-10 20:50

Re: [MOD] How to enable Traffic in Drive for PR1.2/1.3
 
Quote:

Originally Posted by nieldk (Post 1235587)
No, the entire function is commented out by embraced /* */

Oh, nvm, that's not an issue, already done :)

Edit: for those that don't want to do the changes nieldk and I did (includes traffic changes in Drive and Auto mode for day/night:

http://talk.maemo.org/showpost.php?p...2&postcount=18

Follow that :)

nieldk 2012-07-10 20:56

Re: [MOD] How to enable Traffic in Drive for PR1.2/1.3
 
Quote:

Originally Posted by Arie (Post 1235589)
Oh, nvm, that's not an issue, already done :)

Edit: for those that don't want to do the changes nieldk and I did (includes traffic changes in Drive and Auto mode for day/night:

http://talk.maemo.org/showpost.php?p...2&postcount=18

Follow that :)

Thanks :)
That's good team work!

Arie 2012-07-10 21:00

Re: [MOD] How to enable Traffic in Drive for PR1.2/1.3
 
Quote:

Originally Posted by nieldk (Post 1235594)
Thanks :)
That's good team work!

Yes sir, I am always willing to help keep the Harmattan Community alive :)


All times are GMT. The time now is 07:24.

vBulletin® Version 3.8.8