Changeset 18379


Ignore:
Timestamp:
10/29/12 19:26:30 (11 years ago)
Author:
nit
Message:

[titan] update filemanager

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/filemanager/filemanager.h

    r18377 r18379  
    1414        struct skin* filelist2 = getscreennode(filemanager2, "filelist");
    1515        char* file1 = NULL, *cmd = NULL, *tmpstr = NULL;
     16        struct skin* tmpfilelist = filelist1;
    1617
    1718        filelist1->aktline = 0;
     
    2324        filelist2->aktline = 0;
    2425        filelist2->aktpage = 0;
    25         changemask(filelist2, "");
     26        changemask(filelist2, "*");
    2627        changeinput(filelist2, "/");
    2728        changetext(filelistpath2, filelist2->input);
     
    4142        drawscreen(filemanager2, 0, 0);
    4243        addscreenrc(filemanager1, filelist1);
     44        delrc(getrcconfigint("rcff", NULL), filemanager1, filelist1);
     45        delrc(getrcconfigint("rcfr", NULL), filemanager1, filelist1);
    4346
    4447        while(1)
    4548        {
    4649                if(aktfilelist == 0)
     50                {
    4751                        rcret = waitrc(filemanager1, 0, 0);
     52                        tmpfilelist = filelist1;
     53                }
    4854                else
     55                {
    4956                        rcret = waitrc(filemanager2, 0, 0);
     57                        tmpfilelist = filelist2;
     58                }
    5059               
    5160                if(rcret == getrcconfigint("rcexit", NULL)) break;
    52                
     61
    5362                if(status.security == 1)
    5463                {
    55                         if((rcret == getrcconfigint("rcgreen", NULL) || rcret == getrcconfigint("rcyellow", NULL))&& filelist1->select != NULL && ostrcmp(filelist1->select->text, "..") != 0) //copy - move
    56                         {
    57                                 file1 = createpath(filelistpath1->text, filelist1->select->text);
     64                        if((rcret == getrcconfigint("rcgreen", NULL) || rcret == getrcconfigint("rcyellow", NULL)) && tmpfilelist->select != NULL && ostrcmp(tmpfilelist->select->text, "..") != 0) //copy - move
     65                        {
     66                                if(aktfilelist == 0)
     67                                        file1 = createpath(filelistpath1->text, filelist1->select->text);
     68                                else
     69                                        file1 = createpath(filelistpath2->text, filelist2->select->text);
     70
    5871                                if(file1 != NULL)
    5972                                {
     
    7689                                        tmpstr = ostrcat(tmpstr, _("To"), 1, 0);
    7790                                        tmpstr = ostrcat(tmpstr, ": ", 1, 0);
    78                                         tmpstr = ostrcat(tmpstr, filelistpath2->text, 1, 0);
     91                                        if(aktfilelist == 0)
     92                                                tmpstr = ostrcat(tmpstr, filelistpath2->text, 1, 0);
     93                                        else
     94                                                tmpstr = ostrcat(tmpstr, filelistpath1->text, 1, 0);
    7995                                        ret = textbox(_("Message"), tmpstr, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 300, 0, 0);
    8096                                        free(tmpstr); tmpstr = NULL;
     
    8399                                        cmd = ostrcat(cmd, file1, 1, 0);
    84100                                        cmd = ostrcat(cmd, "\" \"", 1, 0);
    85                                         cmd = ostrcat(cmd, filelistpath2->text, 1, 0);
     101                                        if(aktfilelist == 0)
     102                                                cmd = ostrcat(cmd, filelistpath2->text, 1, 0);
     103                                        else
     104                                                cmd = ostrcat(cmd, filelistpath1->text, 1, 0);
    86105                                        cmd = ostrcat(cmd, "\"", 1, 0);
    87106                                        if(ret == 1) system(cmd);
     
    102121                        }
    103122                       
    104                         if(rcret == getrcconfigint("rcred", NULL) && filelist1->select != NULL && ostrcmp(filelist1->select->text, "..") != 0) //delete
    105                         {
    106                                 file1 = createpath(filelistpath1->text, filelist1->select->text);
     123                        if(rcret == getrcconfigint("rcred", NULL) && tmpfilelist->select != NULL && ostrcmp(tmpfilelist->select->text, "..") != 0) //delete
     124                        {
     125                                if(aktfilelist == 0)
     126                                        file1 = createpath(filelistpath1->text, filelist1->select->text);
     127                                else
     128                                        file1 = createpath(filelistpath2->text, filelist2->select->text);
    107129                                if(file1 != NULL)
    108130                                {
     
    134156                        }
    135157               
    136                         if(rcret == getrcconfigint("rcblue", NULL) && filelist1->select != NULL && ostrcmp(filelist1->select->text, "..") != 0) //view
    137                         {
    138                                 file1 = createpath(filelistpath1->text, filelist1->select->text);
     158                        if(rcret == getrcconfigint("rcblue", NULL) && tmpfilelist->select != NULL && ostrcmp(tmpfilelist->select->text, "..") != 0) //view
     159                        {
     160                                if(aktfilelist == 0)
     161                                        file1 = createpath(filelistpath1->text, filelist1->select->text);
     162                                else
     163                                        file1 = createpath(filelistpath2->text, filelist2->select->text);
    139164                                tmpstr = readfiletomem(file1, 0);
    140165                                if(tmpstr != NULL)
     
    161186                                delownerrc(filemanager2);
    162187                                addscreenrc(filemanager2, filelist2);
     188                                delrc(getrcconfigint("rcff", NULL), filemanager2, filelist2);
     189                                delrc(getrcconfigint("rcfr", NULL), filemanager2, filelist2);
    163190                                filelistpath1->bgcol = 0;
    164191                                filelistpath2->bgcol = convertcol("markcol");
     
    170197                                delownerrc(filemanager2);
    171198                                addscreenrc(filemanager1, filelist1);
     199                                delrc(getrcconfigint("rcff", NULL), filemanager1, filelist1);
     200                                delrc(getrcconfigint("rcfr", NULL), filemanager1, filelist1);
    172201                                filelistpath1->bgcol = convertcol("markcol");
    173202                                filelistpath2->bgcol = 0;
Note: See TracChangeset for help on using the changeset viewer.