Ignore:
Timestamp:
05/31/12 18:42:37 (12 years ago)
Author:
gost
Message:

[lcdpearl] zip code for weather forecast

Location:
titan/plugins/lcdpearl1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/lcdpearl1/lcd_weather.h

    r15624 r16169  
    225225        struct weather* node = NULL;
    226226       
    227         location = ostrcat(location, getconfig("lcd_pearl1_plugin_wetter_ort", NULL), 0, 0);
     227        location = ostrcat(location, getconfig("lcd_pearl1_plugin_wetterplz", NULL), 0, 0);
     228        location = ostrcat(location, "-", 1, 0);
     229        location = ostrcat(location, getconfig("lcd_pearl1_plugin_wetterland", NULL), 1, 0);
    228230
    229231        node = getweather(location);
  • titan/plugins/lcdpearl1/lcdpearl1.c

    r15624 r16169  
    405405        struct skin* allmenu = getscreennode(pearl1_main, "allmenu");
    406406        struct skin* wettervor = getscreennode(pearl1_main, "wettervor");
     407        struct skin* wettervorplz = getscreennode(pearl1_main, "wettervorplz");
     408        struct skin* wettervorland = getscreennode(pearl1_main, "wettervorland");
    407409        struct skin* b3 = getscreennode(pearl1_main, "b3");
    408410        struct skin* tmp = NULL;
     
    412414        int restart = 0;
    413415       
     416  if(getconfig("lcd_pearl1_plugin_wetter", NULL) == NULL || ostrcmp(getconfig("lcd_pearl1_plugin_wetter", NULL), "no")  == 0)
     417  {
     418        wettervorplz->hidden = YES;
     419        wettervorland->hidden = YES;
     420  }
     421   
    414422  addchoicebox(allmenu, "no", _("nein"));
    415423  addchoicebox(allmenu, "yes", _("ja"));
     
    419427  addchoicebox(wettervor, "yes", _("ja"));
    420428        setchoiceboxselection(wettervor, getconfig("lcd_pearl1_plugin_wetter", NULL));
     429       
     430        changemask(wettervorplz, "0000");
     431        if(getconfig("lcd_pearl1_plugin_wetterplz", NULL) == NULL)
     432                changeinput(wettervorplz, "10407");
     433        else
     434                changeinput(wettervorplz, getconfig("lcd_pearl1_plugin_wetterplz", NULL));
     435               
     436        changemask(wettervorland, "abcdefghijklmnopqrstuvwxyz");
     437        if(getconfig("lcd_pearl1_plugin_wetterland", NULL) == NULL)
     438                changeinput(wettervorland, "Germany");
     439        else
     440                changeinput(wettervorland, getconfig("lcd_pearl1_plugin_wetterland", NULL));
     441               
    421442       
    422443        if(LCD_Pearl1thread != NULL)
     
    435456                tmp = listbox->select;
    436457               
     458                if((rcret == getrcconfigint("rcleft", NULL) || rcret == getrcconfigint("rcright", NULL)) && listbox->select != NULL && ostrcmp(listbox->select->name, "wettervor") == 0)
     459                {
     460                        if(ostrcmp(wettervor->ret, "yes") == 0)
     461                        {
     462                                wettervorplz->hidden = NO;
     463                        wettervorland->hidden = NO;
     464                        } else {
     465                                wettervorplz->hidden = YES;
     466                        wettervorland->hidden = YES;
     467                }
     468                       
     469                        drawscreen(pearl1_main, 0);
     470                }
     471                                       
    437472                if(rcret == getrcconfigint("rcexit", NULL))
    438473                        break;
     
    441476                        addconfig("write_fb_to_png", allmenu->ret);
    442477                        addconfig("lcd_pearl1_plugin_wetter", wettervor->ret);
    443                         addconfig("lcd_pearl1_plugin_wetter_ort", "Berlin");
     478                        addconfig("lcd_pearl1_plugin_wetterplz", wettervorplz->ret);
     479                        addconfig("lcd_pearl1_plugin_wetterland", wettervorland->ret);
    444480                        restart = 1;
    445481                        break;
     
    476512                else {
    477513                        addconfig("lcd_pearl1_plugin_running", "yes");
    478                         LCD_Pearl1thread = addtimer(&LCD_Pearl1_thread, START, 10000, 1, NULL, NULL, NULL);
    479                         addtimer(&LCD_start_lcd4linux, START, 10000, 1, NULL, NULL, NULL);
    480                         sleep(1);
     514                        firststart = 1;
     515                        LCD_Pearl1_main();
     516                        //LCD_Pearl1thread = addtimer(&LCD_Pearl1_thread, START, 10000, 1, NULL, NULL, NULL);
     517                        //addtimer(&LCD_start_lcd4linux, START, 10000, 1, NULL, NULL, NULL);
     518                        //sleep(1);
    481519                }
    482520        }
Note: See TracChangeset for help on using the changeset viewer.