Changeset 38281


Ignore:
Timestamp:
08/23/16 00:44:19 (7 years ago)
Author:
obi
Message:

skinadjust add style funktion we can use another skinconfig.blue / skinconfig.red

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/skinadjust.h

    r36762 r38281  
    5656        struct skin* infobar_sel = getscreennode(skinadjust, "infobar_sel");
    5757        struct skin* infobar2_sel = getscreennode(skinadjust, "infobar2_sel");
     58
     59        struct skin* filelist = getscreennode(skinadjust, "filelist");
     60        struct skin* skinstyle_sel = getscreennode(skinadjust, "skinstyle_sel");
     61        struct skin* node = NULL;
     62
    5863//      struct skin* pic1 = getscreennode(skinadjust, "pic1");
    5964//      struct skin* pic2 = getscreennode(skinadjust, "pic2");
     
    123128                addchoicebox(infobar2_sel, "infobar2_v3","v3");
    124129        setchoiceboxselection(infobar2_sel, getskinconfig("infobar2_selection", NULL));
     130
     131        if(file_exist(getconfig("skinpath", NULL)))
     132        {
     133                delmarkedscreennodes(skinadjust, FILELISTDELMARK);
     134                changeinput(filelist, getconfig("skinpath", NULL));
     135                changemask(filelist, "*");
     136                createfilelist(skinadjust, filelist, 0);
     137               
     138                node = filelist;
     139                while(node != NULL)
     140                {
     141                        if(node->del == FILELISTDELMARK && node->text != NULL && ostrcmp(node->text, "..") != 0)
     142                        {
     143                                if(!ostrncmp("skinconfig.", node->text, 11))
     144                                {
     145                                        tmpstr = string_replace("skinconfig.", "", node->text, 0);
     146                                        addchoicebox(skinstyle_sel, node->text, tmpstr);
     147                                        free(tmpstr), tmpstr = NULL;
     148                                }
     149                        }
     150                        node = node->next;
     151                }
     152                setchoiceboxselection(skinstyle_sel, getconfig("skinstyle", NULL));
     153        }
    125154
    126155        addchoicebox(showrecfreesize, "0", _("No"));
     
    774803                if(rcret == getrcconfigint("rcok", NULL))
    775804                {
     805                        char* oldskinstyle_sel = getconfig("skinstyle", NULL);
     806                        addconfigscreencheck("skinstyle", skinstyle_sel, "0");
     807                        if(ostrcmp(oldskinstyle_sel,getconfig("skinstyle", NULL)) != 0)
     808                        {
     809                                writeconfigtmp();
     810
     811                                char* cmd = NULL;
     812                                cmd = ostrcat(cmd, "cp -a ", 1, 0);
     813                                cmd = ostrcat(cmd, getconfig("skinpath", NULL), 1, 0);
     814                                cmd = ostrcat(cmd, "/", 1, 0);
     815                                cmd = ostrcat(cmd, skinstyle_sel->ret, 1, 0);
     816                                cmd = ostrcat(cmd, " ", 1, 0); 
     817                                cmd = ostrcat(cmd, getconfig("skinconfig", NULL), 1, 0);
     818                                printf("cmd: %s\n", cmd);       
     819                                system(cmd);
     820                                free(cmd); cmd = NULL;
     821
     822                                textbox(_("Message"), _("Titan will be restarted!"), _("OK"), getrcconfigint("rcok", NULL), NULL, 0, NULL, 0, NULL, 0, 600, 200, 0, 0);
     823                                oshutdown(3, 0);
     824                        }
     825                       
    776826                        int oldfontsizeadjust = getskinconfigint("fontsizeadjust", NULL);
    777827                        addskinconfigscreencheck("fontsizeadjust", fontsizeadjust, "0");
     
    800850
    801851                        writeskinconfigtmp();
     852
    802853                        if(reboot == 1)
    803854                        {
Note: See TracChangeset for help on using the changeset viewer.