Ignore:
Timestamp:
09/12/16 12:30:27 (7 years ago)
Author:
obi
Message:

update modulteconfig add hex view

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/moduleconfig.h

    r38729 r38741  
    9191                        clearscreen(channelslotlist);
    9292                        struct mainbouquet* mbouquet = screenmainbouquet();
    93 
     93                       
    9494                        mainbouquet2channelslot(mbouquet, slot);
    9595                        delmarkedscreennodes(channelslotlist, 1);
    9696                        createchannelslotlist(channelslotlist, listbox, slot);
    97 
     97                       
    9898                        drawscreen(channelslotlist, 0, 0);
    9999                }
     
    122122        }
    123123        return 0;
     124}
     125
     126void dw2hex(unsigned int num,char* buffer)
     127{
     128        for(unsigned int i=7,tmp;!(i&0x80000000);i--)
     129        {
     130                tmp = num&0xf;
     131                buffer[i]= (tmp<10)?(tmp+0x30):(tmp+0x37);
     132                num = num>>4;           
     133        }
     134        buffer[8]=0;
    124135}
    125136
     
    154165
    155166                                // show caid in hex
    156                                 int caid_int = 0;
    157                                 char* caid = ostrcat(ret[i].part, NULL, 0, 0);
    158                                 sscanf(caid, "%X", &caid_int);
    159                                 caid_int = strtol(caid , NULL, 16);
    160                                 free(caid), caid = NULL;
    161 
    162                                 char* caid_hex = malloc(50);
    163                                 if(caid_hex != NULL)
    164                                         sprintf(caid_hex, "%d", caid_int);
     167                                char* caid_hex = ostrcat(ret[i].part, NULL, 0, 0);
     168                                int caid_dec = atoi(ret[i].part);
     169                                sprintf(caid_hex, "%x", caid_dec);
    165170
    166171                                if(checkdoublecaid(dvbnode, ret[i].part) == 1)
     
    169174                                        if(caid_hex != NULL)
    170175                                        {
    171                                                 tmpstr = ostrcat(tmpstr, " (", 1, 0);
     176                                                tmpstr = ostrcat(tmpstr, " (0x", 1, 0);
    172177                                                tmpstr = ostrcat(tmpstr, caid_hex, 1, 0);
    173178                                                tmpstr = ostrcat(tmpstr, ") (", 1, 0);
     
    184189                                        if(caid_hex != NULL)
    185190                                        {
    186                                                 tmpstr = ostrcat(tmpstr, " (", 1, 0);
     191                                                tmpstr = ostrcat(tmpstr, " (0x", 1, 0);
    187192                                                tmpstr = ostrcat(tmpstr, caid_hex, 1, 0);
    188193                                                tmpstr = ostrcat(tmpstr, ")", 1, 0);
     
    194199                                free(tmpstr); tmpstr = NULL;
    195200
    196                                 addchoicebox(tmp, "0", _("used"));
    197                                 addchoicebox(tmp, "1", _("locked"));
     201                                addchoicebox(tmp, "0", _("activate"));
     202                                addchoicebox(tmp, "1", _("deactivate"));
    198203                                if(ostrstr(lockcaids, ret[i].part) != NULL)
    199204                                        setchoiceboxselection(tmp, "1");
     
    435440                rcret = waitrc(moduleconfig, 2000, 0);
    436441                tmp = listbox->select;
    437 
     442               
    438443                printf("listbox->select->text: %s\n",listbox->select->text);
    439444                printf("listbox->select->name: %s\n",listbox->select->name);
     
    513518                        drawscreen(moduleconfig, 0, 0);
    514519                }
    515 
     520               
    516521                if(rcret == RCTIMEOUT) goto start;
    517522        }
Note: See TracChangeset for help on using the changeset viewer.