|
|
|
|
@ -113,6 +113,13 @@ void on_about(GtkWidget *self, char *version_application){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//functions
|
|
|
|
|
void (*save_success_function)(void*)=NULL;
|
|
|
|
|
void *save_success_argument=NULL;
|
|
|
|
|
|
|
|
|
|
void yon_save_window_set_postsave_function(void *function, void *data){
|
|
|
|
|
save_success_function=function;
|
|
|
|
|
save_success_argument=data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_save_window_parameter_switched(GtkCellRendererToggle *self, gchar *path, template_saving_window *window){
|
|
|
|
|
GtkTreeIter iter,itar;
|
|
|
|
|
@ -194,47 +201,51 @@ void on_save_parameters(GtkWidget *self, template_saving_window *window){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (debug_output==1){
|
|
|
|
|
template_debug_window *debug_window = template_debugger_window_new();
|
|
|
|
|
gtk_widget_show(debug_window->Window);
|
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
|
char *final_command_line = "";
|
|
|
|
|
if (final_remove){
|
|
|
|
|
for_dictionaries(dict,final_remove){
|
|
|
|
|
char *final_command = yon_char_unite(remove_command," ",dict->key," ",(char*)dict->data,NULL);
|
|
|
|
|
char *temp = yon_char_unite(final_command_line,!yon_char_is_empty(final_command_line)?";echo \'":"echo \'",final_command,"\';",final_command,NULL);
|
|
|
|
|
if (!yon_char_is_empty(final_command_line))
|
|
|
|
|
free(final_command_line);
|
|
|
|
|
final_command_line=temp;
|
|
|
|
|
free(final_command);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (final_append){
|
|
|
|
|
for_dictionaries(dict,final_append){
|
|
|
|
|
char *final_command = yon_char_unite(append_command," ",dict->key," ",(char*)dict->data,NULL);
|
|
|
|
|
char *temp = yon_char_unite(final_command_line,!yon_char_is_empty(final_command_line)?";echo \'":"echo \'",final_command,"\';",final_command,NULL);
|
|
|
|
|
if (!yon_char_is_empty(final_command_line))
|
|
|
|
|
free(final_command_line);
|
|
|
|
|
final_command_line=temp;
|
|
|
|
|
free(final_command);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (window->type==YON_CONFIG_BOTH) {
|
|
|
|
|
if (template_config->load_mode==1){
|
|
|
|
|
yon_config_save_registered("system");
|
|
|
|
|
} else if (template_config->load_mode==0){
|
|
|
|
|
yon_config_save_registered("global");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!yon_char_is_empty(final_command_line)){
|
|
|
|
|
yon_terminal_integrated_start(debug_window->Vte,final_command_line,NULL,NULL);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// if (debug_output==1){
|
|
|
|
|
// template_debug_window *debug_window = template_debugger_window_new();
|
|
|
|
|
// gtk_widget_show(debug_window->Window);
|
|
|
|
|
// dictionary *dict = NULL;
|
|
|
|
|
// char *final_command_line = "";
|
|
|
|
|
// if (final_remove){
|
|
|
|
|
// for_dictionaries(dict,final_remove){
|
|
|
|
|
// char *final_command = yon_char_unite(remove_command," ",dict->key," ",(char*)dict->data,NULL);
|
|
|
|
|
// char *temp = yon_char_unite(final_command_line,!yon_char_is_empty(final_command_line)?";echo \"":"echo \"",final_command,"\";",final_command,NULL);
|
|
|
|
|
// if (!yon_char_is_empty(final_command_line))
|
|
|
|
|
// free(final_command_line);
|
|
|
|
|
// final_command_line=temp;
|
|
|
|
|
// free(final_command);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (final_append){
|
|
|
|
|
// for_dictionaries(dict,final_append){
|
|
|
|
|
// char *final_command = yon_char_unite(append_command," ",dict->key," ",(char*)dict->data,NULL);
|
|
|
|
|
// char *temp = yon_char_unite(final_command_line,!yon_char_is_empty(final_command_line)?";echo \"":"echo \"",final_command,"\";",final_command,NULL);
|
|
|
|
|
// if (!yon_char_is_empty(final_command_line))
|
|
|
|
|
// free(final_command_line);
|
|
|
|
|
// final_command_line=temp;
|
|
|
|
|
// free(final_command);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (window->type==YON_CONFIG_BOTH) {
|
|
|
|
|
// if (template_config->load_mode==1){
|
|
|
|
|
// yon_config_save_registered("system");
|
|
|
|
|
// } else if (template_config->load_mode==0){
|
|
|
|
|
// yon_config_save_registered("global");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (!yon_char_is_empty(final_command_line)){
|
|
|
|
|
// if (debug_output)
|
|
|
|
|
// printf("%s\n",final_command_line);
|
|
|
|
|
// yon_terminal_integrated_start(debug_window->Vte,final_command_line,NULL,NULL);
|
|
|
|
|
// }
|
|
|
|
|
// } else
|
|
|
|
|
{
|
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
|
if (final_remove){
|
|
|
|
|
for_dictionaries(dict,final_remove){
|
|
|
|
|
char *final_command = yon_char_unite(remove_command," ",dict->key," ",(char*)dict->data,NULL);
|
|
|
|
|
system(final_command);
|
|
|
|
|
printf("%s\n",final_command);
|
|
|
|
|
free(final_command);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -242,6 +253,7 @@ void on_save_parameters(GtkWidget *self, template_saving_window *window){
|
|
|
|
|
for_dictionaries(dict,final_append){
|
|
|
|
|
char *final_command = yon_char_unite(append_command," ",dict->key," ",(char*)dict->data,NULL);
|
|
|
|
|
system(final_command);
|
|
|
|
|
printf("%s\n",final_command);
|
|
|
|
|
free(final_command);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -710,8 +722,6 @@ int yon_ubl_setup_arguments(int argc, char *argv[],config_str *unfound_arguments
|
|
|
|
|
break;
|
|
|
|
|
case 'c': if (system(remove_config_dir_command)){};
|
|
|
|
|
break;
|
|
|
|
|
case 'd': debug_output = 1;
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
template_config->lock_help=1;
|
|
|
|
|
break;
|
|
|
|
|
|