|
|
|
|
@ -28,6 +28,21 @@ void on_save_done(main_window *, config_str output, int size){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_save_start(main_window *, char* path){
|
|
|
|
|
int size;
|
|
|
|
|
config_str parameters = yon_config_get_all_by_key(REPOSITORY_search,&size);
|
|
|
|
|
int status=1;
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
char *parameter_key = yon_char_divide_search(parameters[i],"=",-1);
|
|
|
|
|
if (yon_config_get_status(parameter_key)!=0){
|
|
|
|
|
status=0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (status){
|
|
|
|
|
if (system(yon_debug_output("%s\n",config_presave_clean_command(path)))){};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_toggle_button_toggled(GtkWidget *self, main_window *widgets){
|
|
|
|
|
if (self == widgets->AutoUpdateCheck){
|
|
|
|
|
|
|
|
|
|
@ -187,47 +202,6 @@ void on_toggle_button_toggled(GtkWidget *self, main_window *widgets){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
|
if (type!=YON_CONFIG_CUSTOM){
|
|
|
|
|
yon_config_clean();
|
|
|
|
|
if (!yon_char_is_empty(config_get_default_command))
|
|
|
|
|
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
|
|
|
|
|
}
|
|
|
|
|
if (type==YON_CONFIG_GLOBAL){
|
|
|
|
|
yon_config_load_config(type,config_get_command("global"),NULL);
|
|
|
|
|
} else if (type==YON_CONFIG_LOCAL){
|
|
|
|
|
yon_config_load_config(type,config_get_command("system"),NULL);
|
|
|
|
|
} else if (type==YON_CONFIG_CUSTOM){
|
|
|
|
|
char *path="";
|
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_interface_update(main_window *widgets){
|
|
|
|
|
gtk_list_store_clear(widgets->ReposList);
|
|
|
|
|
gtk_list_store_clear(widgets->MirrorList);
|
|
|
|
|
@ -560,59 +534,7 @@ char *on_save_repos(main_window *widgets){
|
|
|
|
|
return yon_char_parsed_to_string(parameters,param_size," ");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_web_user_check(GtkToggleButton *self, web_publication_add_window *window){
|
|
|
|
|
int status = gtk_toggle_button_get_active(self);
|
|
|
|
|
int status2 = gtk_combo_box_get_active(GTK_COMBO_BOX(window->UserPasswordCombo));
|
|
|
|
|
gtk_widget_set_sensitive(window->UsernameEntry,status);
|
|
|
|
|
gtk_widget_set_sensitive(window->UserPasswordCombo,status);
|
|
|
|
|
gtk_widget_set_sensitive(window->PasswordButton,status&&status2);
|
|
|
|
|
gtk_widget_set_sensitive(window->UserPasswordEntry,(status&&status2));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_save(GtkWidget *, main_window *){
|
|
|
|
|
main_config.save_config=YON_CONFIG_BOTH;
|
|
|
|
|
yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_command("global"),NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_local_save(GtkWidget *, main_window *){
|
|
|
|
|
main_config.save_config=YON_CONFIG_LOCAL;
|
|
|
|
|
yon_save_proceed("system",YON_CONFIG_LOCAL,config_get_command("system"),NULL);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_global_save(GtkWidget *, main_window *){
|
|
|
|
|
main_config.save_config=YON_CONFIG_GLOBAL;
|
|
|
|
|
yon_save_proceed("global",YON_CONFIG_GLOBAL,config_get_command("global"),NULL);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_custom_save(GtkWidget *, main_window *){
|
|
|
|
|
main_config.save_config=YON_CONFIG_LOCAL;
|
|
|
|
|
template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_CUSTOM,config_get_command("system"),NULL);
|
|
|
|
|
if (window){};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_local_load(GtkWidget *,main_window *widgets){
|
|
|
|
|
yon_load_proceed(YON_CONFIG_LOCAL);
|
|
|
|
|
yon_ubl_status_box_render(yon_char_get_localised_from_lib(LOCAL_LOAD_SUCCESS_LABEL),BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
main_config.load_mode=YON_CONFIG_LOCAL;
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_global_load(GtkWidget *,main_window *widgets){
|
|
|
|
|
yon_load_proceed(YON_CONFIG_GLOBAL);
|
|
|
|
|
yon_ubl_status_box_render(yon_char_get_localised_from_lib(GLOBAL_LOAD_SUCCESS_LABEL),BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
main_config.load_mode=YON_CONFIG_GLOBAL;
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_custom_load(GtkWidget *,main_window *widgets){
|
|
|
|
|
yon_load_proceed(YON_CONFIG_CUSTOM);
|
|
|
|
|
yon_ubl_status_box_render(yon_char_get_localised_from_lib(LOCAL_LOAD_SUCCESS_LABEL),BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
main_config.load_mode=YON_CONFIG_CUSTOM;
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_toggle_cell_toggled(GtkCellRenderer *self,char *path, main_window *widgets){
|
|
|
|
|
GtkListStore *target = NULL;
|
|
|
|
|
@ -689,36 +611,7 @@ void on_selection_changed(GtkWidget *self, main_window *widgets){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_web_publish_path_changed(GtkWidget *, web_publication_add_window *window){
|
|
|
|
|
gtk_list_store_clear(window->list);
|
|
|
|
|
char *path = (char*)gtk_entry_get_text(GTK_ENTRY(window->PathEntry));
|
|
|
|
|
if (yon_char_is_empty(path) || access(path,F_OK)) return;
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_dir_get_contents(path,&size);
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
struct stat path_stat;
|
|
|
|
|
char *cur_path = yon_char_unite(path,"/",parsed[i],NULL);
|
|
|
|
|
stat(cur_path, &path_stat);
|
|
|
|
|
if (S_ISDIR(path_stat.st_mode)&&strcmp(parsed[i],"pool")&&strcmp(parsed[i],"..")&&strcmp(parsed[i],".")){
|
|
|
|
|
gtk_list_store_append(window->list,&iter);
|
|
|
|
|
gtk_list_store_set(window->list,&iter,0,1,1,parsed[i],-1);
|
|
|
|
|
}
|
|
|
|
|
free(cur_path);
|
|
|
|
|
}
|
|
|
|
|
yon_char_parsed_free(parsed,size);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_web_publish_add(GtkWidget *,main_window *widgets){
|
|
|
|
|
gtk_tree_selection_unselect_all(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MirrorTree)));
|
|
|
|
|
web_publication_add_window *window = yon_web_publication_add_window_new();
|
|
|
|
|
yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),ADD_REPO_LABEL,icon_path,"web_publish_window");
|
|
|
|
|
|
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_web_publish_accept),dict);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_scrolled_window_size_allocate(GtkWidget *, GdkRectangle *allocation, repo_add_window *window){
|
|
|
|
|
if (allocation->height<100){
|
|
|
|
|
@ -742,17 +635,6 @@ void on_repo_add(GtkWidget *, main_window *widgets){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_mirror_add(GtkWidget *,main_window *widgets){
|
|
|
|
|
gtk_tree_selection_unselect_all(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MirrorTree)));
|
|
|
|
|
mirror_add_window *window = yon_mirror_add_window_new();
|
|
|
|
|
yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),ADD_REPO_LABEL,icon_path,"mirror_window");
|
|
|
|
|
|
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_mirror_accept),dict);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_password_encryption_changed(GtkComboBox *self, password_window *dialog){
|
|
|
|
|
int active = gtk_combo_box_get_active(self);
|
|
|
|
|
@ -797,22 +679,7 @@ void on_password_open(GtkWidget *, web_publication_add_window *window){
|
|
|
|
|
yon_gtk_window_setup(GTK_WINDOW(dialog->Window),GTK_WINDOW(window->Window),PASSWORD_INPUT_LABEL,icon_path,"password_window");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_web_publish_remove(GtkWidget *self,main_window *widgets){
|
|
|
|
|
dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
|
|
|
|
|
data->action_text=REMOVE_REPO_WARNING_LABEL;
|
|
|
|
|
data->function=(void(*)(void*,void*))on_web_publish_remove_accept;
|
|
|
|
|
data->data = widgets;
|
|
|
|
|
yon_confirmation_dialog_call(self,data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_mirror_remove(GtkWidget *self,main_window *widgets){
|
|
|
|
|
dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
|
|
|
|
|
data->action_text=REMOVE_REPO_WARNING_LABEL;
|
|
|
|
|
data->function=(void(*)(void*,void*))on_mirror_remove_accept;
|
|
|
|
|
data->data = widgets;
|
|
|
|
|
yon_confirmation_dialog_call(self,data);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_repo_remove(GtkWidget *self, main_window *widgets){
|
|
|
|
|
dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
|
|
|
|
|
@ -822,29 +689,7 @@ void on_repo_remove(GtkWidget *self, main_window *widgets){
|
|
|
|
|
yon_confirmation_dialog_call(self,data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_web_publish_remove_accept(GtkWidget *, main_window *widgets){
|
|
|
|
|
GtkTreeModel *model=NULL;
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->WebPublicationTree)),&model,&iter)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
char *full_name = NULL;
|
|
|
|
|
gtk_tree_model_get(model,&iter,8,&full_name,-1);
|
|
|
|
|
yon_config_remove_by_key(full_name);
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_mirror_remove_accept(GtkWidget *, main_window *widgets){
|
|
|
|
|
GtkTreeModel *model=NULL;
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MirrorTree)),&model,&iter)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
char *repo;
|
|
|
|
|
gtk_tree_model_get(model,&iter,0,&repo,-1);
|
|
|
|
|
yon_config_remove_by_key(REPOPUBLIC_CACHE_full(repo));
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_repositories_remove_accept(GtkWidget *, main_window *widgets){
|
|
|
|
|
GtkTreeModel *model=NULL;
|
|
|
|
|
@ -971,180 +816,6 @@ void on_repo_edit(GtkWidget *,main_window *widgets){
|
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_web_publish_edit(GtkWidget *,main_window *widgets){
|
|
|
|
|
web_publication_add_window *window = yon_web_publication_add_window_new();
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(window->HeadLabel),EDIT_WEB_LABEL);
|
|
|
|
|
yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),ADD_WEB_LABEL,icon_path,"web_publish_window");
|
|
|
|
|
|
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_web_publish_accept),dict);
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->WebPublicationTree)),NULL,&iter)){
|
|
|
|
|
char *storage;
|
|
|
|
|
char *repos;
|
|
|
|
|
char *full;
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(widgets->WebPublicationList),&iter,1,&storage,2,&repos,8,&full,-1);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->PathEntry),storage);
|
|
|
|
|
while(gtk_events_pending()) gtk_main_iteration();
|
|
|
|
|
if(!yon_char_is_empty(repos)){
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(repos,&size,"\n");
|
|
|
|
|
if (size){
|
|
|
|
|
GtkTreeIter itar;
|
|
|
|
|
for_iter(GTK_TREE_MODEL(window->list),&itar){
|
|
|
|
|
char *target;
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&itar,1,&target,-1);
|
|
|
|
|
if (yon_char_parsed_check_exist(parsed,size,target)==-1){
|
|
|
|
|
gtk_list_store_set(window->list,&itar,0,0,-1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
window->name = full;
|
|
|
|
|
char *parameter = config(full);
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(parameter,&size,":");
|
|
|
|
|
if (size){
|
|
|
|
|
if (!strcmp(parsed[0],"enable")||!strcmp(parsed[0],"yes")){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->EnablePublishCheck),1);
|
|
|
|
|
}
|
|
|
|
|
if (size>1&&!strcmp(parsed[1],"listing")){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->EnableWebFileBrowserCheck),1);
|
|
|
|
|
}
|
|
|
|
|
if (size>2&&!yon_char_is_empty(parsed[2])){
|
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->PortEntry),atol(parsed[2]));
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->PortCheck),1);
|
|
|
|
|
}
|
|
|
|
|
if (size>3&&!yon_char_is_empty(parsed[3])){
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->UsernameEntry),parsed[3]);
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->UsernameCheck),1);
|
|
|
|
|
}
|
|
|
|
|
if (size>5&&!yon_char_is_empty(parsed[4])&&!yon_char_is_empty(parsed[5])){
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(window->UserPasswordCombo),1);
|
|
|
|
|
if (!strcmp(parsed[4],"sha256")||!strcmp(parsed[4],"sha512")){
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(window->UserPasswordCombo),parsed[4]);
|
|
|
|
|
char *temp = yon_char_unite(parsed[4],"|",parsed[5],NULL);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->UserPasswordEntry),temp);
|
|
|
|
|
free(temp);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->UserPasswordEntry),parsed[4]);
|
|
|
|
|
if (size>5)
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(window->UserPasswordCombo),"");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_mirror_edit(GtkWidget *,main_window *widgets){
|
|
|
|
|
mirror_add_window *window = yon_mirror_add_window_new();
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(window->HeadLabel),EDIT_WEB_LABEL);
|
|
|
|
|
yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),ADD_WEB_LABEL,icon_path,"mirror_window");
|
|
|
|
|
|
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_mirror_accept),dict);
|
|
|
|
|
|
|
|
|
|
char *target;
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MirrorTree)),&model,&iter);
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(widgets->MirrorList),&iter,0,&target,-1);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->NameEntry),target);
|
|
|
|
|
window->name = target;
|
|
|
|
|
char *parameter = config(REPOPUBLIC_CACHE_full(target));
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(parameter,&size,",");
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
char *target = parsed[i];
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_mirror_path_add_path);
|
|
|
|
|
|
|
|
|
|
path_section *section = malloc(sizeof(path_section));
|
|
|
|
|
section->PathRemovalBox = yon_gtk_builder_get_widget(builder,"PathRemovalBox");
|
|
|
|
|
section->PathEditButton = yon_gtk_builder_get_widget(builder,"PathEditButton");
|
|
|
|
|
section->PathEntry = yon_gtk_builder_get_widget(builder,"PathEntry");
|
|
|
|
|
section->PathRemoveButton = yon_gtk_builder_get_widget(builder,"PathRemoveButton");
|
|
|
|
|
section->TypeCombo = yon_gtk_builder_get_widget(builder,"TypeCombo");
|
|
|
|
|
section->edits=0;
|
|
|
|
|
|
|
|
|
|
char *type = yon_char_divide_search(parsed[i],"@",-1);
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(section->TypeCombo),type);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(window->sections,(char*)target,section);
|
|
|
|
|
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(section->PathEntry),parsed[i]);
|
|
|
|
|
gtk_box_pack_start(GTK_BOX(window->PathBox),section->PathRemovalBox,0,0,0);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(gtk_builder_get_object(builder,"PathEditButton"),"clicked",G_CALLBACK(on_mirror_path_edit),window);
|
|
|
|
|
g_signal_connect(gtk_builder_get_object(builder,"PathRemoveButton"),"clicked",G_CALLBACK(on_mirror_path_removed),window);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_mirror_configure(GtkWidget *,main_window *widgets){
|
|
|
|
|
mirror_configure_window *window = yon_mirror_configure_window_new();
|
|
|
|
|
yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),ADD_REPO_LABEL,icon_path,"mirror_window");
|
|
|
|
|
|
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_mirror_configure_accept),dict);
|
|
|
|
|
|
|
|
|
|
char *port_str = config(REPOPUBLIC_CACHE_full("port"));
|
|
|
|
|
if (!yon_char_is_empty(port_str)){
|
|
|
|
|
double port = atof(port_str);
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->PortDefaultCheck),0);
|
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->PortSpin),port);
|
|
|
|
|
}
|
|
|
|
|
char *cache = config(REPOPUBLIC_CACHE_full("cache_dir"));
|
|
|
|
|
if (!yon_char_is_empty(cache)){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->CacheDefaultCheck),0);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->CacheEntry),cache);
|
|
|
|
|
}
|
|
|
|
|
char *inactivity = config(REPOPUBLIC_CACHE_full("purge_files_after"));
|
|
|
|
|
if (!yon_char_is_empty(inactivity)){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->InactivityDurationDefaultCheck),0);
|
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->InactivityDurationSpin),atof(inactivity));
|
|
|
|
|
}
|
|
|
|
|
char *timeout = config(REPOPUBLIC_CACHE_full("download_timeout"));
|
|
|
|
|
if (!yon_char_is_empty(timeout)){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->CacheTimeoutDefaultCheck),0);
|
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->CacheTimeoutSpin),atof(timeout));
|
|
|
|
|
}
|
|
|
|
|
char *proxy = config(REPOPUBLIC_CACHE_full("http_proxy"));
|
|
|
|
|
if (!yon_char_is_empty(proxy)){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->ProxyCheck),1);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->ProxyEntry),proxy);
|
|
|
|
|
}
|
|
|
|
|
char *agent = config(REPOPUBLIC_CACHE_full("user_agent"));
|
|
|
|
|
if (!yon_char_is_empty(agent)){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->AgentDefaultCheck),0);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->AgentEntry),agent);
|
|
|
|
|
}
|
|
|
|
|
char *cron = config(REPOPUBLIC_CACHE_full("prefetch.cron"));
|
|
|
|
|
if (!yon_char_is_empty(cron)){
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->CronEntry),cron);
|
|
|
|
|
}
|
|
|
|
|
char *delay = config(REPOPUBLIC_CACHE_full("prefetch.ttl_unaccessed_in_days"));
|
|
|
|
|
if (!yon_char_is_empty(delay)){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->UpdatesDelayDefaultCheck),0);
|
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->UpdatesDelaySpin),atof(delay));
|
|
|
|
|
}
|
|
|
|
|
char *request_delay = config(REPOPUBLIC_CACHE_full("prefetch.ttl_unupdated_in_days"));
|
|
|
|
|
if (!yon_char_is_empty(request_delay)){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->UpdatesRequestDelayDefaultCheck),0);
|
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(window->UpdatesRequestDelaySpin),atof(request_delay));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_repo_accept_clicked(GtkWidget *, dictionary *dict){
|
|
|
|
|
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
|
|
|
|
|
@ -1227,189 +898,7 @@ void on_repo_accept_clicked(GtkWidget *, dictionary *dict){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_web_publish_accept(GtkWidget *, dictionary *dict){
|
|
|
|
|
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
|
|
|
|
|
web_publication_add_window *window = yon_dictionary_get_data(dict->first->next,web_publication_add_window*);
|
|
|
|
|
|
|
|
|
|
int enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->EnablePublishCheck));
|
|
|
|
|
int port_enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->PortCheck));
|
|
|
|
|
char *port = yon_char_from_long(gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->PortEntry)));
|
|
|
|
|
int enable_browser = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->EnableWebFileBrowserCheck));
|
|
|
|
|
|
|
|
|
|
int username_check = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UsernameCheck));
|
|
|
|
|
char *username = (char*)gtk_entry_get_text(GTK_ENTRY(window->UsernameEntry));
|
|
|
|
|
char *user_password = yon_char_new((char*)gtk_entry_get_text(GTK_ENTRY(window->UserPasswordEntry)));
|
|
|
|
|
char *encryption = user_password[6]=='|'?yon_char_divide(user_password,6):NULL;
|
|
|
|
|
|
|
|
|
|
if (username_check&&yon_char_is_empty(username)){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->UsernameEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (strpbrk(username,"!@#%^&*\'")){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),ENTRY_RESTRICTED_SYMBOL_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->UsernameEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (username_check&&strpbrk(user_password,"!@#%^&*\'")){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PASSWORD_RESTRICTED_SYMBOL_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->UserPasswordEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// if (username_check&&encryption&&!yon_char_is_empty(encryption)&&(strlen(user_password)!=128&&strlen(user_password)!=64)){
|
|
|
|
|
|
|
|
|
|
// yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PASSWORD_RESTRICTED_SYMBOL_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
// yon_ubl_status_highlight_incorrect(window->UserPasswordEntry);
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
char *name = (char*)gtk_entry_get_text(GTK_ENTRY(window->PathEntry));
|
|
|
|
|
char *full_name = "";
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
int disabled=0;
|
|
|
|
|
int overall=0;
|
|
|
|
|
for_iter (GTK_TREE_MODEL(window->list),&iter){
|
|
|
|
|
overall++;
|
|
|
|
|
int chosen;
|
|
|
|
|
char *repos;
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,0,&chosen,1,&repos,-1);
|
|
|
|
|
if (chosen){
|
|
|
|
|
char *temp = yon_char_unite(full_name,yon_char_is_empty(full_name)?"":",",repos,NULL);
|
|
|
|
|
if (!yon_char_is_empty(full_name)) free(full_name);
|
|
|
|
|
full_name = temp;
|
|
|
|
|
} else {
|
|
|
|
|
disabled++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (overall==disabled) {
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),NO_SHARED_REPOS_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->PathEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
char *final_name = yon_char_is_empty(full_name)||!disabled ? name : yon_char_unite(name,":",full_name,NULL);
|
|
|
|
|
char *final = yon_char_unite(enabled?"enable":"disable",":",
|
|
|
|
|
enable_browser?"listing":"",":",
|
|
|
|
|
port_enabled?port:"",":",
|
|
|
|
|
username_check?username:"",":",
|
|
|
|
|
username_check?yon_char_is_empty(encryption)?user_password:encryption:"",":",
|
|
|
|
|
username_check?!yon_char_is_empty(user_password)&&!yon_char_is_empty(encryption)?user_password:"":"",
|
|
|
|
|
NULL);
|
|
|
|
|
if (!yon_char_is_empty(window->name)&&strcmp(final_name,window->name)){
|
|
|
|
|
yon_config_remove_by_key(REPOPUBLIC_WEB_full(window->name));
|
|
|
|
|
}
|
|
|
|
|
yon_config_register(REPOPUBLIC_WEB_full(final_name),REPOPUBLIC_WEB_command(final_name),final);
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
|
gtk_widget_destroy(window->Window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_mirror_accept(GtkWidget *,dictionary *dict){
|
|
|
|
|
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
|
|
|
|
|
mirror_add_window *window = yon_dictionary_get_data(dict->first->next,mirror_add_window*);
|
|
|
|
|
if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(window->NameEntry)))){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->NameEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!window->sections&&yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(window->TypeEntry)))) {
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->TypeEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
char *name = (char*)gtk_entry_get_text(GTK_ENTRY(window->NameEntry));
|
|
|
|
|
char *paths = "";
|
|
|
|
|
if (window->sections){
|
|
|
|
|
dictionary *dact = NULL;
|
|
|
|
|
for_dictionaries (dact, window->sections){
|
|
|
|
|
char *cur = yon_char_unite(gtk_combo_box_get_active_id(GTK_COMBO_BOX(((path_section*)dact->data)->TypeCombo)),"@",(char*)gtk_entry_get_text(GTK_ENTRY(((path_section*)dact->data)->PathEntry)),NULL);
|
|
|
|
|
char *temp = yon_char_unite(paths,!yon_char_is_empty(paths)?",":"",cur,NULL);
|
|
|
|
|
if (!yon_char_is_empty(paths)) free(paths);
|
|
|
|
|
paths = temp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
char *source_main = (char*)gtk_entry_get_text(GTK_ENTRY(window->TypeEntry));
|
|
|
|
|
if (!yon_char_is_empty(source_main)) {
|
|
|
|
|
char *type = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->TypeCombo));
|
|
|
|
|
source_main = yon_char_unite(type?type:"",type?"@":"",source_main,NULL);
|
|
|
|
|
char *temp = yon_char_unite(paths,!yon_char_is_empty(paths)?",":"",source_main,NULL);
|
|
|
|
|
if (!yon_char_is_empty(paths)) free(paths);
|
|
|
|
|
paths = temp;
|
|
|
|
|
}
|
|
|
|
|
if (!yon_char_is_empty(window->name)&&strcmp(name,window->name)){
|
|
|
|
|
yon_config_remove_by_key(REPOPUBLIC_CACHE_full(window->name));
|
|
|
|
|
}
|
|
|
|
|
yon_config_register(REPOPUBLIC_CACHE_full(name),REPOPUBLIC_CACHE_full_command(name),paths);
|
|
|
|
|
yon_interface_update(widgets);
|
|
|
|
|
gtk_widget_destroy(window->Window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_mirror_configure_accept(GtkWidget *, dictionary *dict){
|
|
|
|
|
// main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
|
|
|
|
|
mirror_configure_window *window = yon_dictionary_get_data(dict->first->next,mirror_configure_window*);
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->PortDefaultCheck))){
|
|
|
|
|
yon_config_remove_by_key(REPOPUBLIC_CACHE_full("port"));
|
|
|
|
|
} else {
|
|
|
|
|
long port = gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->PortSpin));
|
|
|
|
|
yon_config_register(REPOPUBLIC_CACHE_full("port"),REPOPUBLIC_CACHE_full_command("port"),yon_char_from_long(port));
|
|
|
|
|
}
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->CacheDefaultCheck))){
|
|
|
|
|
yon_config_remove_by_key(REPOPUBLIC_CACHE_full("cache_dir"));
|
|
|
|
|
} else {
|
|
|
|
|
char *cache_path = (char*)gtk_entry_get_text(GTK_ENTRY(window->CacheEntry));
|
|
|
|
|
if (!yon_char_is_empty(cache_path)){
|
|
|
|
|
yon_config_register(REPOPUBLIC_CACHE_full("cache_dir"),REPOPUBLIC_CACHE_full_command("cache_dir"),cache_path);
|
|
|
|
|
} else {
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->CacheEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->InactivityDurationDefaultCheck))){
|
|
|
|
|
yon_config_remove_by_key(REPOPUBLIC_CACHE_full("purge_files_after"));
|
|
|
|
|
} else {
|
|
|
|
|
long duration_inactivity = gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->InactivityDurationSpin));
|
|
|
|
|
char *duration_str = yon_char_from_long(duration_inactivity);
|
|
|
|
|
yon_config_register(REPOPUBLIC_CACHE_full("purge_files_after"),REPOPUBLIC_CACHE_full_command("purge_files_after"),duration_str);
|
|
|
|
|
}
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->CacheTimeoutDefaultCheck))){
|
|
|
|
|
yon_config_remove_by_key(REPOPUBLIC_CACHE_full("download_timeout"));
|
|
|
|
|
} else{
|
|
|
|
|
long duration_inactivity = gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->CacheTimeoutSpin));
|
|
|
|
|
char *duration_str = yon_char_from_long(duration_inactivity);
|
|
|
|
|
yon_config_register(REPOPUBLIC_CACHE_full("download_timeout"),REPOPUBLIC_CACHE_full_command("download_timeout"),duration_str);
|
|
|
|
|
}
|
|
|
|
|
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->ProxyCheck))){
|
|
|
|
|
yon_config_remove_by_key(REPOPUBLIC_CACHE_full("http_proxy"));
|
|
|
|
|
} else {
|
|
|
|
|
char *proxy = (char*)gtk_entry_get_text(GTK_ENTRY(window->ProxyEntry));
|
|
|
|
|
yon_config_register(REPOPUBLIC_CACHE_full("http_proxy"),REPOPUBLIC_CACHE_full_command("http_proxy"),proxy);
|
|
|
|
|
}
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->AgentDefaultCheck))){
|
|
|
|
|
yon_config_remove_by_key(REPOPUBLIC_CACHE_full("user_agent"));
|
|
|
|
|
} else {
|
|
|
|
|
char *agent = (char*)gtk_entry_get_text(GTK_ENTRY(window->AgentEntry));
|
|
|
|
|
yon_config_register(REPOPUBLIC_CACHE_full("user_agent"),REPOPUBLIC_CACHE_full_command("user_agent"),agent);
|
|
|
|
|
}
|
|
|
|
|
char *expression = (char*)gtk_entry_get_text(GTK_ENTRY(window->CronEntry));
|
|
|
|
|
if (!yon_char_is_empty(expression)){
|
|
|
|
|
yon_config_register(REPOPUBLIC_CACHE_full("prefetch.cron"),REPOPUBLIC_CACHE_full_command("prefetch.cron"),expression);
|
|
|
|
|
} else {
|
|
|
|
|
yon_config_remove_by_key(REPOPUBLIC_CACHE_full("prefetch.cron"));
|
|
|
|
|
}
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UpdatesDelayDefaultCheck))){
|
|
|
|
|
yon_config_remove_by_key(REPOPUBLIC_CACHE_full("prefetch.ttl_unaccessed_in_days"));
|
|
|
|
|
} else {
|
|
|
|
|
char *agent = yon_char_from_long(gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->UpdatesDelaySpin)));
|
|
|
|
|
yon_config_register(REPOPUBLIC_CACHE_full("prefetch.ttl_unaccessed_in_days"),REPOPUBLIC_CACHE_full_command("prefetch.ttl_unaccessed_in_days"),agent);
|
|
|
|
|
}
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UpdatesRequestDelayDefaultCheck))){
|
|
|
|
|
yon_config_remove_by_key(REPOPUBLIC_CACHE_full("prefetch.ttl_unupdated_in_days"));
|
|
|
|
|
} else {
|
|
|
|
|
char *agent = yon_char_from_long(gtk_spin_button_get_value(GTK_SPIN_BUTTON(window->UpdatesRequestDelaySpin)));
|
|
|
|
|
yon_config_register(REPOPUBLIC_CACHE_full("prefetch.ttl_unupdated_in_days"),REPOPUBLIC_CACHE_full_command("prefetch.ttl_unupdated_in_days"),agent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk_widget_destroy(window->Window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char *yon_password_unencrypted_password_get(password_window *window){
|
|
|
|
|
const char *password = gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry));
|
|
|
|
|
@ -1514,81 +1003,10 @@ void on_password_accept(GtkWidget *,dictionary *dict){
|
|
|
|
|
gtk_widget_destroy(window->Window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_mirror_path_removed(GtkWidget *self, mirror_add_window *window){
|
|
|
|
|
int found=0;
|
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
|
for_dictionaries(dict, window->sections){
|
|
|
|
|
if (self == ((path_section*)dict->data)->PathRemoveButton){
|
|
|
|
|
found =1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!found) return;
|
|
|
|
|
if (GTK_IS_WIDGET(((path_section*)dict->data)->PathRemovalBox)){
|
|
|
|
|
gtk_widget_destroy(((path_section*)dict->data)->PathRemovalBox);
|
|
|
|
|
window->sections = yon_dictionary_rip(dict);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_mirror_path_edit(GtkWidget *self,mirror_add_window *window){
|
|
|
|
|
int active = 0;
|
|
|
|
|
dictionary *cur = NULL;
|
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
|
for_dictionaries(dict, window->sections){
|
|
|
|
|
if (self == ((path_section*)dict->data)->PathEditButton){
|
|
|
|
|
|
|
|
|
|
cur = dict;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (((path_section*)dict->data)->edits) {
|
|
|
|
|
active = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!cur||active) return;
|
|
|
|
|
if (gtk_editable_get_editable(GTK_EDITABLE(((path_section*)dict->data)->PathEntry))){
|
|
|
|
|
((path_section*)dict->data)->edits=1;
|
|
|
|
|
gtk_editable_set_editable(GTK_EDITABLE(((path_section*)dict->data)->PathEntry),0);
|
|
|
|
|
gtk_widget_set_sensitive(((path_section*)dict->data)->TypeCombo,0);
|
|
|
|
|
GtkWidget *image = gtk_button_get_image(GTK_BUTTON(((path_section*)dict->data)->PathEditButton));
|
|
|
|
|
gtk_image_set_from_icon_name(GTK_IMAGE(image),edit_icon_name,GTK_ICON_SIZE_BUTTON);
|
|
|
|
|
} else {
|
|
|
|
|
((path_section*)dict->data)->edits=0;
|
|
|
|
|
gtk_widget_set_sensitive(((path_section*)dict->data)->TypeCombo,1);
|
|
|
|
|
gtk_editable_set_editable(GTK_EDITABLE(((path_section*)dict->data)->PathEntry),1);
|
|
|
|
|
GtkWidget *image = gtk_button_get_image(GTK_BUTTON(((path_section*)dict->data)->PathEditButton));
|
|
|
|
|
gtk_image_set_from_icon_name(GTK_IMAGE(image),accept_icon_name,GTK_ICON_SIZE_BUTTON);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_mirror_path_add(GtkWidget *, mirror_add_window *window){
|
|
|
|
|
const char *target = gtk_entry_get_text(GTK_ENTRY(window->TypeEntry));
|
|
|
|
|
if (yon_char_is_empty(target)){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->TypeEntry);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_mirror_path_add_path);
|
|
|
|
|
|
|
|
|
|
path_section *section = malloc(sizeof(path_section));
|
|
|
|
|
section->PathRemovalBox = yon_gtk_builder_get_widget(builder,"PathRemovalBox");
|
|
|
|
|
section->PathEditButton = yon_gtk_builder_get_widget(builder,"PathEditButton");
|
|
|
|
|
section->PathEntry = yon_gtk_builder_get_widget(builder,"PathEntry");
|
|
|
|
|
section->PathRemoveButton = yon_gtk_builder_get_widget(builder,"PathRemoveButton");
|
|
|
|
|
section->TypeCombo = yon_gtk_builder_get_widget(builder,"TypeCombo");
|
|
|
|
|
section->edits=0;
|
|
|
|
|
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(section->TypeCombo),gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->TypeCombo)));
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(window->sections,(char*)target,section);
|
|
|
|
|
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(section->PathEntry),target);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->TypeEntry),"");
|
|
|
|
|
gtk_box_pack_start(GTK_BOX(window->PathBox),section->PathRemovalBox,0,0,0);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(gtk_builder_get_object(builder,"PathEditButton"),"clicked",G_CALLBACK(on_mirror_path_edit),window);
|
|
|
|
|
g_signal_connect(gtk_builder_get_object(builder,"PathRemoveButton"),"clicked",G_CALLBACK(on_mirror_path_removed),window);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_repo_source_add(GtkWidget *, repo_add_window *window){
|
|
|
|
|
char *target = (char*)gtk_entry_get_text(GTK_ENTRY(window->RepoSourceEntry));
|
|
|
|
|
@ -1624,15 +1042,38 @@ void on_repo_source_add(GtkWidget *, repo_add_window *window){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_file_chooser_open(GtkWidget *, GtkEntry *target){
|
|
|
|
|
GtkWidget *dialog = gtk_file_chooser_dialog_new(TITLE_LABEL,GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(target))),GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,CANCEL_LABEL,GTK_RESPONSE_CANCEL,ACCEPT_LABEL,GTK_RESPONSE_ACCEPT,NULL);
|
|
|
|
|
int resp = gtk_dialog_run(GTK_DIALOG(dialog));
|
|
|
|
|
if (resp == GTK_RESPONSE_ACCEPT){
|
|
|
|
|
char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
|
|
|
|
|
filechooser_window *window = yon_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_OPEN);
|
|
|
|
|
if (yon_file_chooser_start(window)){
|
|
|
|
|
char *file = window->last_success_selection;
|
|
|
|
|
if (!yon_char_is_empty(file)){
|
|
|
|
|
gtk_entry_set_text(target,file);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
|
free(window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_repo_file_chooser_open(GtkWidget *, repo_add_window *window){
|
|
|
|
|
filechooser_window *fchwindow = NULL;
|
|
|
|
|
const char *source_type = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->RepoSourceCombo));
|
|
|
|
|
if (yon_char_is_empty(source_type)){
|
|
|
|
|
GtkFileFilter *filter = gtk_file_filter_new();
|
|
|
|
|
fchwindow = yon_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_OPEN);
|
|
|
|
|
gtk_file_filter_set_name(filter,"*ini");
|
|
|
|
|
gtk_file_filter_add_pattern(filter,"*ini");
|
|
|
|
|
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fchwindow->MainFileChooser),filter);
|
|
|
|
|
} else if (!strcmp(source_type,"file://")){
|
|
|
|
|
fchwindow = yon_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(fchwindow->ChooseFolderCheck),1);
|
|
|
|
|
} else return;
|
|
|
|
|
|
|
|
|
|
yon_gtk_window_setup(GTK_WINDOW(fchwindow->Window),GTK_WINDOW(window->Window),yon_char_get_localised_from_lib(CHOOSE_FILE_LABEL),icon_path,"file_chooser");
|
|
|
|
|
if (yon_file_chooser_start(fchwindow)){
|
|
|
|
|
char *file = fchwindow->last_success_selection;
|
|
|
|
|
if (!yon_char_is_empty(file)){
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->RepoSourceEntry),file);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
free(fchwindow);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_password_hash_sensitiveness(GtkWidget *,password_window *window){
|
|
|
|
|
@ -1720,6 +1161,7 @@ void on_sign_check_toggled(GtkToggleButton *self, repo_add_window *window){
|
|
|
|
|
|
|
|
|
|
void on_repo_source_changed(GtkComboBox *self, repo_add_window *window){
|
|
|
|
|
int active = gtk_combo_box_get_active(self);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->RepoSourceEntry),"");
|
|
|
|
|
if (active ==0 || active == 4){
|
|
|
|
|
gtk_widget_set_sensitive(window->RepoSourceButton,1);
|
|
|
|
|
} else {
|
|
|
|
|
@ -1759,7 +1201,7 @@ repo_add_window *yon_repo_add_window_new(){
|
|
|
|
|
|
|
|
|
|
window->sections = NULL;
|
|
|
|
|
window->name=NULL;
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RepoSourceButton),"clicked",G_CALLBACK(on_file_chooser_open),window->RepoSourceEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RepoSourceButton),"clicked",G_CALLBACK(on_repo_file_chooser_open),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->RepoSourceAddButton),"clicked",G_CALLBACK(on_repo_source_add),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UsageDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->UsageEnableInsallCheck);
|
|
|
|
|
@ -1777,135 +1219,7 @@ repo_add_window *yon_repo_add_window_new(){
|
|
|
|
|
return window;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
web_publication_add_window *yon_web_publication_add_window_new(){
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_web_publish_add_path);
|
|
|
|
|
web_publication_add_window *window = malloc(sizeof(web_publication_add_window));
|
|
|
|
|
window->Window = yon_gtk_builder_get_widget(builder,"MainWindow");
|
|
|
|
|
window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox");
|
|
|
|
|
window->EnablePublishCheck = yon_gtk_builder_get_widget(builder,"EnablePublishCheck");
|
|
|
|
|
window->PathEntry = yon_gtk_builder_get_widget(builder,"PathEntry");
|
|
|
|
|
window->PathButton = yon_gtk_builder_get_widget(builder,"PathButton");
|
|
|
|
|
window->RepositoriesTree = yon_gtk_builder_get_widget(builder,"RepositoriesTree");
|
|
|
|
|
window->PortCheck = yon_gtk_builder_get_widget(builder,"PortCheck");
|
|
|
|
|
window->PortEntry = yon_gtk_builder_get_widget(builder,"PortEntry");
|
|
|
|
|
window->EnableWebFileBrowserCheck = yon_gtk_builder_get_widget(builder,"EnableWebFileBrowserCheck");
|
|
|
|
|
window->UsernameCheck = yon_gtk_builder_get_widget(builder,"UsernameCheck");
|
|
|
|
|
window->UsernameEntry = yon_gtk_builder_get_widget(builder,"UsernameEntry");
|
|
|
|
|
window->UserPasswordCheck = yon_gtk_builder_get_widget(builder,"UserPasswordCheck");
|
|
|
|
|
window->UserPasswordCombo = yon_gtk_builder_get_widget(builder,"UserPasswordCombo");
|
|
|
|
|
window->UserPasswordEntry = yon_gtk_builder_get_widget(builder,"UserPasswordEntry");
|
|
|
|
|
window->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton");
|
|
|
|
|
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
|
|
|
|
|
window->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel");
|
|
|
|
|
window->PasswordButton = yon_gtk_builder_get_widget(builder,"PasswordButton");
|
|
|
|
|
window->list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1"));
|
|
|
|
|
window->SelectionCellRenderer = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"SelectionCellRenderer"));
|
|
|
|
|
|
|
|
|
|
yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(window->UserPasswordEntry));
|
|
|
|
|
window->name=NULL;
|
|
|
|
|
g_signal_connect(G_OBJECT(window->SelectionCellRenderer),"toggled",G_CALLBACK(on_cell_renderer_toggle_toggled),window->RepositoriesTree);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->PathButton),"clicked",G_CALLBACK(on_file_chooser_open),window->PathEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->PathEntry),"changed",G_CALLBACK(on_web_publish_path_changed),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->PasswordButton),"clicked",G_CALLBACK(on_password_open),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UsernameCheck),"toggled",G_CALLBACK(on_web_user_check),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->PortCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->PortEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UserPasswordCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box_inversed),window->PasswordButton);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UserPasswordCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box_inversed),window->UserPasswordEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->PortEntry),"insert-text",G_CALLBACK(yon_on_text_insert_only_digits),NULL);
|
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
|
|
|
|
|
return window;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mirror_configure_window *yon_mirror_configure_window_new(){
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_mirror_configure_path);
|
|
|
|
|
mirror_configure_window *window = malloc(sizeof(mirror_configure_window));
|
|
|
|
|
window->Window = yon_gtk_builder_get_widget(builder,"MainWindow");
|
|
|
|
|
window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox");
|
|
|
|
|
window->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton");
|
|
|
|
|
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
|
|
|
|
|
window->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel");
|
|
|
|
|
window->PortDefaultCheck = yon_gtk_builder_get_widget(builder,"PortDefaultCheck");
|
|
|
|
|
window->PortSpin = yon_gtk_builder_get_widget(builder,"PortSpin");
|
|
|
|
|
window->CacheDefaultCheck = yon_gtk_builder_get_widget(builder,"CacheDefaultCheck");
|
|
|
|
|
window->CacheEntry = yon_gtk_builder_get_widget(builder,"CacheEntry");
|
|
|
|
|
window->CacheButton = yon_gtk_builder_get_widget(builder,"CacheButton");
|
|
|
|
|
window->InactivityDurationDefaultCheck = yon_gtk_builder_get_widget(builder,"InactivityDurationDefaultCheck");
|
|
|
|
|
window->InactivityDurationSpin = yon_gtk_builder_get_widget(builder,"InactivityDurationSpin");
|
|
|
|
|
window->CacheTimeoutDefaultCheck = yon_gtk_builder_get_widget(builder,"CacheTimeoutDefaultCheck");
|
|
|
|
|
window->CacheTimeoutSpin = yon_gtk_builder_get_widget(builder,"CacheTimeoutSpin");
|
|
|
|
|
window->ProxyCheck = yon_gtk_builder_get_widget(builder,"ProxyCheck");
|
|
|
|
|
window->ProxyEntry = yon_gtk_builder_get_widget(builder,"ProxyEntry");
|
|
|
|
|
window->AgentDefaultCheck = yon_gtk_builder_get_widget(builder,"AgentDefaultCheck");
|
|
|
|
|
window->AgentEntry = yon_gtk_builder_get_widget(builder,"AgentEntry");
|
|
|
|
|
window->CronEntry = yon_gtk_builder_get_widget(builder,"CronEntry");
|
|
|
|
|
window->UpdatesDelayDefaultCheck = yon_gtk_builder_get_widget(builder,"UpdatesDelayDefaultCheck");
|
|
|
|
|
window->UpdatesDelaySpin = yon_gtk_builder_get_widget(builder,"UpdatesDelaySpin");
|
|
|
|
|
window->UpdatesRequestDelayDefaultCheck = yon_gtk_builder_get_widget(builder,"UpdatesRequestDelayDefaultCheck");
|
|
|
|
|
window->UpdatesRequestDelaySpin = yon_gtk_builder_get_widget(builder,"UpdatesRequestDelaySpin");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->PortDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->PortSpin);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->CacheDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->CacheEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->CacheDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->CacheButton);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->CacheButton),"clicked",G_CALLBACK(on_file_chooser_open),window->CacheEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->InactivityDurationDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->InactivityDurationSpin);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->CacheTimeoutDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->CacheTimeoutSpin);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->ProxyCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),window->ProxyEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AgentDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->AgentEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UpdatesDelayDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->UpdatesDelaySpin);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->UpdatesRequestDelayDefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->UpdatesRequestDelaySpin);
|
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
|
|
|
|
|
return window;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_mirror_type_changed(GtkComboBox *self, mirror_add_window *window){
|
|
|
|
|
int active = gtk_combo_box_get_active(self);
|
|
|
|
|
if (active == 0){
|
|
|
|
|
gtk_widget_set_sensitive(window->TypeButton,0);
|
|
|
|
|
gtk_entry_set_placeholder_text(GTK_ENTRY(window->TypeEntry),"http://repo.ublinux.ru/2405");
|
|
|
|
|
} else if (active == 1){
|
|
|
|
|
gtk_widget_set_sensitive(window->TypeButton,0);
|
|
|
|
|
gtk_entry_set_placeholder_text(GTK_ENTRY(window->TypeEntry),"http://proxy.localnet.ru:8080");
|
|
|
|
|
} else if (active == 2){
|
|
|
|
|
gtk_widget_set_sensitive(window->TypeButton,1);
|
|
|
|
|
gtk_entry_set_placeholder_text(GTK_ENTRY(window->TypeEntry),"/etc/pacman.d/reflector_mirrorlis");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mirror_add_window *yon_mirror_add_window_new(){
|
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_mirror_add_path);
|
|
|
|
|
mirror_add_window *window = malloc(sizeof(mirror_add_window));
|
|
|
|
|
window->Window = yon_gtk_builder_get_widget(builder,"MainWindow");
|
|
|
|
|
window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox");
|
|
|
|
|
window->NameEntry = yon_gtk_builder_get_widget(builder,"NameEntry");
|
|
|
|
|
window->TypeCombo = yon_gtk_builder_get_widget(builder,"TypeCombo");
|
|
|
|
|
window->TypeEntry = yon_gtk_builder_get_widget(builder,"TypeEntry");
|
|
|
|
|
window->TypeButton = yon_gtk_builder_get_widget(builder,"TypeButton");
|
|
|
|
|
window->AddButton = yon_gtk_builder_get_widget(builder,"AddButton");
|
|
|
|
|
window->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton");
|
|
|
|
|
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
|
|
|
|
|
window->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel");
|
|
|
|
|
window->PathBox = yon_gtk_builder_get_widget(builder,"PathBox");
|
|
|
|
|
yon_gtk_entry_block_symbols(GTK_ENTRY(window->NameEntry),"$");
|
|
|
|
|
yon_on_entry_set_allowed_symbols(GTK_ENTRY(window->TypeEntry),"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/1234567890!$.#-_()~$&;{}[]|<>^:?+\\,'*`%");
|
|
|
|
|
|
|
|
|
|
yon_on_entry_set_allowed_symbols(GTK_ENTRY(window->NameEntry),"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_$");
|
|
|
|
|
|
|
|
|
|
window->sections = NULL;
|
|
|
|
|
window->name=NULL;
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(window->TypeButton),"clicked",G_CALLBACK(on_file_chooser_open),window->TypeEntry);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->AddButton),"clicked",G_CALLBACK(on_mirror_path_add),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->TypeCombo),"changed",G_CALLBACK(on_mirror_type_changed),window);
|
|
|
|
|
gtk_widget_show(window->Window);
|
|
|
|
|
|
|
|
|
|
return window;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_cell_renderer_toggle_toggled(GtkWidget *, gchar* path, GtkWidget *table){
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
@ -2003,6 +1317,8 @@ void yon_main_window_complete(main_window *widgets){
|
|
|
|
|
widgets->MirrorList = GTK_LIST_STORE(gtk_builder_get_object(builder,"MirrorList"));
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->RepositoriesMoveUpButton),"clicked",G_CALLBACK(on_repo_move_up),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->RepositoriesMoveDownButton),"clicked",G_CALLBACK(on_repo_move_down),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->RepositoriesCreateButton),"clicked",G_CALLBACK(on_repo_add),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->WebPublicationAddButton),"clicked",G_CALLBACK(on_web_publish_add),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->MirrorAddButton),"clicked",G_CALLBACK(on_mirror_add),widgets);
|
|
|
|
|
@ -2122,10 +1438,11 @@ void yon_main_window_complete(main_window *widgets){
|
|
|
|
|
}
|
|
|
|
|
yon_root_button_setup((template_main_window*)widgets,main_config.launch_arguments,main_config.launch_size);
|
|
|
|
|
yon_save_window_set_postsave_function(on_save_done,widgets);
|
|
|
|
|
yon_save_window_set_presave_function(on_save_start,widgets);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]){
|
|
|
|
|
local=setlocale(LC_ALL, "");
|
|
|
|
|
setlocale(LC_ALL, "");
|
|
|
|
|
textdomain (LocaleName);
|
|
|
|
|
config_init();
|
|
|
|
|
|
|
|
|
|
|