Changed new config file creation method

pull/15/head
parent 6ea6619568
commit f2bfcfa5ba

@ -285,11 +285,11 @@ template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...){
if (!yon_char_is_empty(file)){
if (!strstr(file,".ini")) file = yon_char_append(file,".ini");
if (access(file,0)!=F_OK){
FILE *source_file = fopen("/lib/ublinux/templates/ublinux-data.ini","r");
FILE *dest_file = fopen(file,"w");
int ch;
while ((ch = fgetc(source_file)) != EOF) {
fputc(ch, dest_file);
char *command_creation = ubconfig_file_create(file);
system(command_creation);
if (access(file,0)!=F_OK){
yon_ubl_status_box_render(CUSTOM_CONFIG_CREATION_ERROR_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
return NULL;
}
}
}

@ -94,12 +94,15 @@
#define SAVE_MODE_RAM_HOME_LABEL _("Sandbox with profile saving")
#define SAVE_MODE_HDD_LABEL _("HDD sandbox")
#define SAVE_MODE_HDD_HOME_LABEL _("HDD sandbox with profile saving")
#define CUSTOM_CONFIG_CREATION_ERROR_LABEL _("New configuration file creation failed")
#endif
#define dull_parameter_get_command "ubconfig --source global get users PARAMETER"
#define SAVE_MODE_GET_COMMAND "ubconfig --raw --source system get [config] SYSTEMBOOT_STATEMODE"
#define ubconfig_file_create(target) yon_char_unite("ubconfig --target \"",target,"\" create",NULL)
typedef enum SAVE_MODE_TYPE {
SAVE_MODE_FULL,
SAVE_MODE_MODULE,

Loading…
Cancel
Save