source: titan/titan/system_backup.h @ 33139

Last change on this file since 33139 was 30460, checked in by obi, 9 years ago

system_backup disable hardcoded title

File size: 2.2 KB
Line 
1#ifndef SYSTEM_BACKUP_H
2#define SYSTEM_BACKUP_H
3
4void screensystem_backup()
5{
6        int rcret = 0;
7        struct skin* backup = getscreen("system_backup");
8        struct skin* listbox = getscreennode(backup, "listbox");
9        struct skin *listfield = getscreennode(backup, "listfield");
10        struct skin* info = getscreennode(backup, "info");
11        struct skin* loading = getscreen("loading");
12        struct skin* tmp = NULL;
13        char* tmpstr = NULL, *infotext = NULL;
14
15        infotext = _("Backup to /tmp or /var/backup. If the free memory too small can a usb device will never use.\nThere must be a folder backup.");
16
17        changetext(info, infotext);
18//      changetitle(backup, _("Create Backup"));
19
20        addscreenrc(backup, listbox);
21
22//      if(checkbox("UFS912"))
23//              changeinput(listfield, "kernel\nfw\nroot\nfull");
24//      else
25//              changeinput(listfield, "kernel\nvar\nroot\nfull");
26
27        changeinput(listfield, "full");
28
29        drawscreen(backup, 0, 0);
30        tmp = listbox->select;
31
32        while(1)
33        {
34                addscreenrc(backup, tmp);
35                rcret = waitrc(backup, 0, 0);
36                tmp = listbox->select;
37               
38                if(rcret == getrcconfigint("rcexit", NULL)) break;
39                if(rcret == getrcconfigint("rcred", NULL))
40                {
41                        if(listbox->select != NULL && listbox->select->ret != NULL)
42                        {
43                                drawscreen(loading, 0, 0);
44                                status.sec = 0; //deaktivate spinner
45                                tmpstr = ostrcat(tmpstr, "backup.sh ", 1, 0);
46                                tmpstr = ostrcat(tmpstr, listbox->select->ret, 1, 0);
47
48                                if(file_exist("/var/swap"))
49                                {
50                                        if(!file_exist("/var/swap/logs"))
51                                                 mkdir("/var/swap/logs", 777);
52                               
53                                        if(file_exist("/etc/.beta") && file_exist("/var/swap/logs"))
54                                                tmpstr = ostrcat(tmpstr, " > /var/swap/logs/backup_debug.log 2>&1", 1, 0);             
55                                }
56                                else if(checkbox("ATEMIO510") != 1 && checkbox("UFS910") != 1 && checkbox("UFS922") != 1 && checkbox("ATEVIO700") != 1 && checkbox("ATEVIO7000") != 1 && checkbox("IPBOX91") != 1 && checkbox("IPBOX900") != 1 && checkbox("IPBOX910") != 1 && checkbox("IPBOX9000") != 1)
57                                {
58                                        if(!file_exist("/mnt/logs"))
59                                                 mkdir("/mnt/logs", 777);
60                               
61                                        if(file_exist("/etc/.beta") && file_exist("/mnt/logs"))
62                                                tmpstr = ostrcat(tmpstr, " > /mnt/logs/backup_debug.log 2>&1", 1, 0);
63                                }
64
65                                system(tmpstr);
66                                free(tmpstr); tmpstr = NULL;
67                                clearscreen(loading);
68                        }
69                }
70        }
71
72        infotext = NULL;
73        delownerrc(backup);
74        clearscreen(backup);
75}
76
77#endif
Note: See TracBrowser for help on using the repository browser.