From 3ce4f30ea3c2d1630567507778c3f16ed54ab9bc Mon Sep 17 00:00:00 2001 From: Markham Date: Sun, 22 May 2016 11:47:22 +0200 Subject: [PATCH] remove obsolete parameter for hide(); small fixes --- luawetterapp.cfg | 2 +- luawetterapp.lua | 31 +++++++++++---------- luawettericon.png => luawetterapp_hint.png | Bin 3 files changed, 18 insertions(+), 15 deletions(-) mode change 100755 => 100644 luawetterapp.lua rename luawettericon.png => luawetterapp_hint.png (100%) diff --git a/luawetterapp.cfg b/luawetterapp.cfg index 43777fd..ab225b4 100644 --- a/luawetterapp.cfg +++ b/luawetterapp.cfg @@ -1,4 +1,4 @@ name=Lua Wetter App desc=Aktuelles Wetter + 3 Tage Vorschau type=4 -hinticon=luawettericon \ No newline at end of file + diff --git a/luawetterapp.lua b/luawetterapp.lua old mode 100755 new mode 100644 index 054916f..e6d8cd7 --- a/luawetterapp.lua +++ b/luawetterapp.lua @@ -1,16 +1,21 @@ -- Lua Wetter App -- version 1.0 - 1.3 (c) by tischi -- version 1.4 by db2w-user --- version 1.5 Markham +-- version 1.6 Markham -- Lizenz: GPL 2 --- Stand: 2.11.2015 +-- Stand: 22.05.2016 +-- V1.6 -- remove obsolete parameter for hide() -- V1.5 -- improve luaweatherapp -- V1.4 -- add. apikey thx. GetAway -- apikey shamelessly stolen from the source code of the page http://openweathermap.org/current +local posix = require "posix" +local json = require "json" +local n = neutrino() + -- Inputmethode hier angeben -- 0 fuer SMS; 1 fuer Keyboard -KEYB=0; +KEYB=1; if KEYB == 1 then inputmeth="keyboardinput" @@ -25,8 +30,8 @@ function script_path() end --Variablen -caption = "Wetter - Suche" -pfad=script_path() .. "LuaWetterApp/" +headdesc = "Wetterapp Einstellungen" +pfad = script_path() .. "LuaWetterApp/" txtpfad = "/tmp/Lua_Wetter/" daten = txtpfad .. "luawetter.txt" datentxt = txtpfad .. "wetterdaten.txt" @@ -51,9 +56,7 @@ conf["txtfarbe"]="COL.MENUCONTENT_TEXT" hintfarbe=COL.MENUCONTENT textfarbe=COL.MENUCONTENT_TEXT -local posix = require "posix" -local json = require "json" -local n = neutrino() + tagname={} tagname["0"]="Sonntag" tagname["1"]="Montag" @@ -84,7 +87,7 @@ function printinfo(t) msg1, data1 = n:GetInput(500) until msg1 == RC['home'] or msg1 == RC['setup'] or msg1 == RC['ok'] or i == 12; -- 6 seconds - wh:hide{no_restore=true} + wh:hide() end --zuordnung Wochentage @@ -149,7 +152,7 @@ function loadConfig() config_error = false config:loadConfig(confFile) - conf["apikey"]= config:getString("apikey", "YOUR API KEY") + conf["apikey"]= config:getString("apikey", "1337beed73a13f60adbf71a486385104") conf["farbe"] = config:getString("farbe", "COL.MENUCONTENT") conf["land"] = config:getString("land", "de") conf["name"] = config:getString("name", "Stadt") @@ -193,7 +196,7 @@ function saveConfig() configChanged = 0 posix.sleep(1) - h:hide(); + h:hide() end end @@ -247,7 +250,7 @@ end --Wetterdaten verbergen function anzeigehide() for i=16,1,-1 do - anz[i]:hide{no_restore=true} + anz[i]:hide() end end @@ -293,7 +296,7 @@ anz[11]=ctext.new{parent=w, x=dx+362, y=yy-248, dx=250, dy=128, text=lines[16] . anz[14]=ctext.new{parent=w, x=dx+234, y=yy-120, dx=378, dy=50, text=lines[19], color_body=hintfarbe, color_text=textfarbe, font_text=FONT['MENU'], mode="ALIGN_CENTER" } anz[15]=ctext.new{parent=w, x=x+100, y=yy-50, dx=400, dy=20, text="www.openweathermap.org", color_body=0xFF, color_text=COL['WHITE'], font_text=FONT['MENU'], mode="ALIGN_CENTER" } -anz[16]=cpicture.new{parent=w, x=xx-310, y=yy-45 , dx=20, dy=10, image="menu", transparency=2, color_background=0xFF, mode="ALIGN_RIGHT"} +anz[16]=cpicture.new{parent=w, x=xx-310, y=yy-50 , dx=20, dy=10, image="menu", transparency=2, color_background=0xFF, mode="ALIGN_RIGHT"} anzeigepaint() @@ -354,7 +357,7 @@ end --Menüanzeigen function addMenue() - local m = menu.new{name=caption, icon=wettericon, has_shadow=true, mwidth=50} + local m = menu.new{name=headdesc, icon=wettericon, has_shadow=true, mwidth=50} m:addKey{directkey = RC["home"], id = "home", action = "handle_key"} m:addItem{type = "back"} m:addItem{type="separatorline"} diff --git a/luawettericon.png b/luawetterapp_hint.png similarity index 100% rename from luawettericon.png rename to luawetterapp_hint.png -- 2.39.5