|
|
|
|
@ -148,6 +148,21 @@ void on_save_window_parameter_switched(GtkCellRendererToggle *self, gchar *path,
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template_debug_window *template_debugger_window_new(){
|
|
|
|
|
template_debug_window *window = malloc(sizeof(template_debug_window));
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(ui_glade_path_debug);
|
|
|
|
|
window->Window=yon_gtk_builder_get_widget(builder,"Window");
|
|
|
|
|
window->HeaderTopic=yon_gtk_builder_get_widget(builder,"HeaderTopic");
|
|
|
|
|
window->HeaderImage=yon_gtk_builder_get_widget(builder,"HeaderImage");
|
|
|
|
|
window->StatusBox=yon_gtk_builder_get_widget(builder,"StatusBox");
|
|
|
|
|
window->Vte=yon_gtk_builder_get_widget(builder,"DebuggerTerminal");
|
|
|
|
|
gtk_window_set_title(GTK_WINDOW(window->Window),template_app_information.app_title);
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(window->HeaderTopic),template_app_information.app_title);
|
|
|
|
|
gtk_window_set_icon_name(GTK_WINDOW(window->Window),yon_char_append("com.ublinux.",template_app_information.app_tech_name));
|
|
|
|
|
gtk_image_set_from_pixbuf(GTK_IMAGE(window->HeaderImage),gtk_icon_theme_load_icon_for_scale(gtk_icon_theme_get_default(),yon_char_append("com.ublinux.",template_app_information.app_tech_name),32,1,GTK_ICON_LOOKUP_FORCE_SIZE,NULL));
|
|
|
|
|
return window;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_save_parameters(GtkWidget *self, template_saving_window *window){
|
|
|
|
|
char *append_command = yon_char_unite("ubconfig --target ",template_config->load_mode==1?"global":"system"," set ",NULL);
|
|
|
|
|
char *remove_command = yon_char_unite("ubconfig --target ",template_config->load_mode==1?"global":"system"," remove ",NULL);
|
|
|
|
|
@ -177,18 +192,28 @@ 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);
|
|
|
|
|
system(final_command);
|
|
|
|
|
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);
|
|
|
|
|
system(final_command);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -199,6 +224,34 @@ void on_save_parameters(GtkWidget *self, template_saving_window *window){
|
|
|
|
|
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 {
|
|
|
|
|
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);
|
|
|
|
|
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);
|
|
|
|
|
system(final_command);
|
|
|
|
|
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");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
|
if (window->type == YON_CONFIG_GLOBAL)
|
|
|
|
|
yon_ubl_status_box_render(GLOBAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
@ -625,12 +678,13 @@ int yon_ubl_setup_arguments(int argc, char *argv[],config_str *unfound_arguments
|
|
|
|
|
{"socket-id", 1, 0, 's'},
|
|
|
|
|
{"socket-ext-id", 1,0, 'e'},
|
|
|
|
|
{"socket-trd-id", 1,0, 't'},
|
|
|
|
|
{"clear-config", 0,0, 'c'},
|
|
|
|
|
{"clear-config", 0,0, 'c'},
|
|
|
|
|
{"debug", 0,0, 'd'},
|
|
|
|
|
{ NULL, 0, NULL, 0 }
|
|
|
|
|
};
|
|
|
|
|
config_str unregistered_arguments=NULL;
|
|
|
|
|
for (int i=1;i<argc;i++){
|
|
|
|
|
int argument=getopt_long(argc,argv,"hVvs:e:t:c",long_options,&option_index);
|
|
|
|
|
int argument=getopt_long(argc,argv,"hVvs:e:t:cd",long_options,&option_index);
|
|
|
|
|
switch(argument){
|
|
|
|
|
case 'h':
|
|
|
|
|
show_help=1;
|
|
|
|
|
@ -654,6 +708,8 @@ 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;
|
|
|
|
|
|