|
|
|
@ -5,7 +5,7 @@ config main_config;
|
|
|
|
//functions
|
|
|
|
//functions
|
|
|
|
|
|
|
|
|
|
|
|
void on_save_done(main_window *, config_str output, int size){
|
|
|
|
void on_save_done(main_window *, config_str output, int size){
|
|
|
|
char *final_output = yon_char_parsed_to_string(output,size,"");
|
|
|
|
char *final_output = yon_char_parsed_to_string(output,size,"\n");
|
|
|
|
if (final_output){
|
|
|
|
if (final_output){
|
|
|
|
printf("%s\n",final_output);
|
|
|
|
printf("%s\n",final_output);
|
|
|
|
free(final_output);
|
|
|
|
free(final_output);
|
|
|
|
@ -24,7 +24,7 @@ void on_save_done(main_window *, config_str output, int size){
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
textdomain(LocaleName);
|
|
|
|
textdomain(LocaleName);
|
|
|
|
yon_config_set_ignore(REPOSITORY_parameter);
|
|
|
|
// yon_config_set_ignore(REPOSITORY_parameter);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -188,18 +188,42 @@ void on_toggle_button_toggled(GtkWidget *self, main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
yon_config_clean();
|
|
|
|
if (type!=YON_CONFIG_CUSTOM){
|
|
|
|
char *default_command = yon_char_unite(config_get_default_command,NULL);
|
|
|
|
yon_config_clean();
|
|
|
|
if (!yon_char_is_empty(default_command))
|
|
|
|
if (!yon_char_is_empty(config_get_default_command))
|
|
|
|
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
|
|
|
|
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
|
|
|
|
|
|
|
|
}
|
|
|
|
if (type==YON_CONFIG_GLOBAL){
|
|
|
|
if (type==YON_CONFIG_GLOBAL){
|
|
|
|
yon_config_load_config(type,config_get_global_command,NULL);
|
|
|
|
yon_config_load_config(type,config_get_command("global"),NULL);
|
|
|
|
} else if (type==YON_CONFIG_LOCAL){
|
|
|
|
} else if (type==YON_CONFIG_LOCAL){
|
|
|
|
yon_config_load_config(type,config_get_local_command,NULL);
|
|
|
|
yon_config_load_config(type,config_get_command("system"),NULL);
|
|
|
|
} else if (type==YON_CONFIG_CUSTOM){
|
|
|
|
} else if (type==YON_CONFIG_CUSTOM){
|
|
|
|
char *path=yon_custom_config_init(GTK_FILE_CHOOSER_ACTION_OPEN);
|
|
|
|
char *path="";
|
|
|
|
char *command = yon_config_get_custom_command(path);
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
yon_config_load_config(type,command,NULL);
|
|
|
|
GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,OPEN_LABEL,GTK_RESPONSE_ACCEPT,NULL);
|
|
|
|
|
|
|
|
textdomain(LocaleName);
|
|
|
|
|
|
|
|
gtk_window_set_icon_name(GTK_WINDOW(dialog),"com.ublinux.ubl-settings-services");
|
|
|
|
|
|
|
|
gtk_window_set_title(GTK_WINDOW(dialog),TITLE_LABEL);
|
|
|
|
|
|
|
|
GtkFileFilter *filter = gtk_file_filter_new();
|
|
|
|
|
|
|
|
gtk_file_filter_add_pattern(filter,"*.ini");
|
|
|
|
|
|
|
|
gtk_file_filter_set_name(filter, "*.ini");
|
|
|
|
|
|
|
|
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter);
|
|
|
|
|
|
|
|
gtk_widget_show(dialog);
|
|
|
|
|
|
|
|
int response = gtk_dialog_run(GTK_DIALOG(dialog));
|
|
|
|
|
|
|
|
if (response == GTK_RESPONSE_ACCEPT){
|
|
|
|
|
|
|
|
char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(file)){
|
|
|
|
|
|
|
|
path=file;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
yon_config_clean();
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(config_get_default_command))
|
|
|
|
|
|
|
|
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
|
|
|
|
|
|
|
|
char *command = config_get_command(path);
|
|
|
|
|
|
|
|
yon_config_load_config(type,command,NULL);
|
|
|
|
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yon_config_set_ignore(AUTOUPDATE_timestamp);
|
|
|
|
yon_config_set_ignore(AUTOUPDATE_timestamp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -241,8 +265,8 @@ void yon_interface_update(main_window *widgets){
|
|
|
|
char *repo_config = config(REPOSITORY_parameter);
|
|
|
|
char *repo_config = config(REPOSITORY_parameter);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RepositoriesRepoListConfigurationCheck),0);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RepositoriesRepoListConfigurationCheck),0);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RepositoriesDisableSystemReposCheck),0);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RepositoriesDisableSystemReposCheck),0);
|
|
|
|
if (!yon_char_is_empty(repo_config)){
|
|
|
|
|
|
|
|
config_str repos = yon_config_get_all_by_key(REPOSITORY_search,&size);
|
|
|
|
config_str repos = yon_config_get_all_by_key(REPOSITORY_search,&size);
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
char *current = yon_char_new(repos[i]);
|
|
|
|
char *current = yon_char_new(repos[i]);
|
|
|
|
char *key = yon_char_divide_search(current,"=",-1);
|
|
|
|
char *key = yon_char_divide_search(current,"=",-1);
|
|
|
|
@ -261,6 +285,8 @@ void yon_interface_update(main_window *widgets){
|
|
|
|
free(current);
|
|
|
|
free(current);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yon_char_parsed_free(repos,size);
|
|
|
|
yon_char_parsed_free(repos,size);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(repo_config)){
|
|
|
|
|
|
|
|
|
|
|
|
if (!strcmp(repo_config,"disable")){
|
|
|
|
if (!strcmp(repo_config,"disable")){
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RepositoriesRepoListConfigurationCheck),0);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RepositoriesRepoListConfigurationCheck),0);
|
|
|
|
} else if (!strcmp(repo_config,"enable")){
|
|
|
|
} else if (!strcmp(repo_config,"enable")){
|
|
|
|
@ -544,55 +570,48 @@ void on_web_user_check(GtkToggleButton *self, web_publication_add_window *window
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_save(GtkWidget *, main_window *){
|
|
|
|
void on_config_save(GtkWidget *, main_window *){
|
|
|
|
main_config.save_config=2;
|
|
|
|
main_config.save_config=YON_CONFIG_BOTH;
|
|
|
|
template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_BOTH,yon_config_get_custom_command("global"),NULL);
|
|
|
|
yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_command("global"),NULL);
|
|
|
|
if (window){};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_global_save(GtkWidget *, main_window *){
|
|
|
|
void on_config_local_save(GtkWidget *, main_window *){
|
|
|
|
main_config.save_config=0;
|
|
|
|
main_config.save_config=YON_CONFIG_LOCAL;
|
|
|
|
template_saving_window *window = yon_save_proceed("global",YON_CONFIG_GLOBAL,yon_config_get_custom_command("global"),NULL);
|
|
|
|
yon_save_proceed("system",YON_CONFIG_LOCAL,config_get_command("system"),NULL);
|
|
|
|
if (window){};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_local_save(GtkWidget *, main_window *){
|
|
|
|
void on_config_global_save(GtkWidget *, main_window *){
|
|
|
|
main_config.save_config=1;
|
|
|
|
main_config.save_config=YON_CONFIG_GLOBAL;
|
|
|
|
template_saving_window *window = yon_save_proceed("system",YON_CONFIG_LOCAL,yon_config_get_custom_command("system"),NULL);
|
|
|
|
yon_save_proceed("global",YON_CONFIG_GLOBAL,config_get_command("global"),NULL);
|
|
|
|
if (window){};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_custom_save(GtkWidget *, main_window *){
|
|
|
|
void on_config_custom_save(GtkWidget *, main_window *){
|
|
|
|
main_config.save_config=1;
|
|
|
|
main_config.save_config=YON_CONFIG_LOCAL;
|
|
|
|
template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_CUSTOM,yon_config_get_custom_command("system"),NULL);
|
|
|
|
template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_CUSTOM,config_get_command("system"),NULL);
|
|
|
|
if (window){};
|
|
|
|
if (window){};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_local_load(GtkWidget *, main_window *widgets){
|
|
|
|
void on_config_local_load(GtkWidget *,main_window *widgets){
|
|
|
|
yon_load_proceed(YON_CONFIG_LOCAL);
|
|
|
|
yon_load_proceed(YON_CONFIG_LOCAL);
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
yon_ubl_status_box_render(yon_char_get_localised_from_lib(LOCAL_LOAD_SUCCESS_LABEL),BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
yon_ubl_status_box_render(LOCAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
main_config.load_mode=YON_CONFIG_LOCAL;
|
|
|
|
textdomain(LocaleName);
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
main_config.load_mode=1;
|
|
|
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_global_load(GtkWidget *, main_window *widgets){
|
|
|
|
void on_config_global_load(GtkWidget *,main_window *widgets){
|
|
|
|
yon_load_proceed(YON_CONFIG_GLOBAL);
|
|
|
|
yon_load_proceed(YON_CONFIG_GLOBAL);
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
yon_ubl_status_box_render(yon_char_get_localised_from_lib(GLOBAL_LOAD_SUCCESS_LABEL),BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
yon_ubl_status_box_render(GLOBAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
main_config.load_mode=YON_CONFIG_GLOBAL;
|
|
|
|
textdomain(LocaleName);
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
main_config.load_mode=0;
|
|
|
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_custom_load(GtkWidget *,main_window *widgets){
|
|
|
|
void on_config_custom_load(GtkWidget *,main_window *widgets){
|
|
|
|
yon_load_proceed(YON_CONFIG_CUSTOM);
|
|
|
|
yon_load_proceed(YON_CONFIG_CUSTOM);
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
yon_ubl_status_box_render(yon_char_get_localised_from_lib(LOCAL_LOAD_SUCCESS_LABEL),BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
yon_ubl_status_box_render(GLOBAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
main_config.load_mode=YON_CONFIG_CUSTOM;
|
|
|
|
textdomain(LocaleName);
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
main_config.load_mode=3;
|
|
|
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_toggle_cell_toggled(GtkCellRenderer *self,char *path, main_window *widgets){
|
|
|
|
void on_toggle_cell_toggled(GtkCellRenderer *self,char *path, main_window *widgets){
|
|
|
|
@ -1908,6 +1927,20 @@ void on_column_resize(GtkTreeViewColumn *,GParamSpec *,main_window *widgets){
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_update_clicked(GtkWidget *, main_window *widgets){
|
|
|
|
|
|
|
|
switch(main_config.load_mode){
|
|
|
|
|
|
|
|
case YON_CONFIG_LOCAL:
|
|
|
|
|
|
|
|
on_config_local_load(NULL,widgets);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case YON_CONFIG_GLOBAL:
|
|
|
|
|
|
|
|
on_config_global_load(NULL,widgets);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case YON_CONFIG_CUSTOM:
|
|
|
|
|
|
|
|
on_config_custom_load(NULL,widgets);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_main_window_complete(main_window *widgets)
|
|
|
|
/**yon_main_window_complete(main_window *widgets)
|
|
|
|
* [EN]
|
|
|
|
* [EN]
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@ -2005,6 +2038,10 @@ void yon_main_window_complete(main_window *widgets){
|
|
|
|
g_signal_connect(G_OBJECT(widgets->UpdateIntervalDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->UpdateIntervalCombo);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->UpdateIntervalDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->UpdateIntervalCombo);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->UpdateIntervalDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->UpdateIntervalSpin);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->UpdateIntervalDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->UpdateIntervalSpin);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->UpdateIntervalDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->BootCheck);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->UpdateIntervalDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->BootCheck);
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->RepositoriesUpdateButton),"clicked",G_CALLBACK(on_update_clicked),widgets);
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->PublicationUpdateButton),"clicked",G_CALLBACK(on_update_clicked),widgets);
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->WebPublicationUpdateButton),"clicked",G_CALLBACK(on_update_clicked),widgets);
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MirrorUpdateButton),"clicked",G_CALLBACK(on_update_clicked),widgets);
|
|
|
|
// g_signal_connect(G_OBJECT(widgets->RepositoriesDisableSystemReposCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->RepositoriesTree);
|
|
|
|
// g_signal_connect(G_OBJECT(widgets->RepositoriesDisableSystemReposCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->RepositoriesTree);
|
|
|
|
|
|
|
|
|
|
|
|
GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(widgets->WebPublicationTree));
|
|
|
|
GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(widgets->WebPublicationTree));
|
|
|
|
|