|
|
|
@ -145,8 +145,6 @@ void yon_logs_custom_save(main_window *widgets){
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(widgets->list),&iter,0,&name,1,&paths,2,&description,3,&standard,4,&standard_paths,-1);
|
|
|
|
|
if (paths){
|
|
|
|
|
if (standard!=1){
|
|
|
|
|
for (int i=0;i<standard_paths;i++)
|
|
|
|
|
free(yon_char_divide_search(paths,",",-1));
|
|
|
|
|
paths = yon_char_replace(paths,"\n",",");
|
|
|
|
|
final_strings = yon_char_unite(final_strings?yon_char_append(final_strings,"\n"):"",name?name:"",";",paths?paths:"",";",description?description:"",NULL);
|
|
|
|
|
}
|
|
|
|
@ -1897,10 +1895,12 @@ void on_log_save(GtkWidget *self, dictionary *dict){
|
|
|
|
|
yon_window_config_custom_window_set(GTK_WINDOW(window->MainWindow),"AddWindow");
|
|
|
|
|
} else {
|
|
|
|
|
yon_window_config_custom_window_set(GTK_WINDOW(window->MainWindow),"EditWindow");
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(widgets->list),&iter,3,&stat,-1);
|
|
|
|
|
gtk_list_store_set(widgets->list,&iter,3,stat==0?0:stat==1?2:2,-1);
|
|
|
|
|
char *nm;
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(widgets->list),&iter,0,&nm,3,&stat,-1);
|
|
|
|
|
stat = stat==0?0:stat==1?2:2;
|
|
|
|
|
gtk_list_store_set(widgets->list,&iter,3,stat,-1);
|
|
|
|
|
}
|
|
|
|
|
gtk_list_store_set(widgets->list,&iter,0,name,1,pathse,2,&desc ? desc : "",-1);
|
|
|
|
|
gtk_list_store_set(widgets->list,&iter,0,name,1,pathse,2,&desc ? desc : "",3,stat,-1);
|
|
|
|
|
} else {
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),WRITE_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->NameEntry);
|
|
|
|
@ -2116,9 +2116,25 @@ void on_log_remove(GtkWidget *self, main_window *widgets){
|
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widgets->list);
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->MainTree)),&model, &iter)){
|
|
|
|
|
int standard=0;
|
|
|
|
|
gtk_tree_model_get(model,&iter,3,&standard,-1);
|
|
|
|
|
if (standard==0)
|
|
|
|
|
gtk_list_store_remove(widgets->list,&iter);
|
|
|
|
|
if (standard==2){
|
|
|
|
|
int stay_paths=0;
|
|
|
|
|
char *paths;
|
|
|
|
|
gtk_tree_model_get(model,&iter,1,&paths,4,&stay_paths,-1);
|
|
|
|
|
char *stay;
|
|
|
|
|
for (int i=0;i<stay_paths;i++){
|
|
|
|
|
stay++;
|
|
|
|
|
stay = strstr(paths,"\n");
|
|
|
|
|
}
|
|
|
|
|
paths = yon_char_divide(paths,strlen(paths)-strlen(stay));
|
|
|
|
|
gtk_list_store_set(widgets->list,&iter,1,paths,3,1,-1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
yon_logs_custom_save(widgets);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Main window
|
|
|
|
|
|
|
|
|
@ -2144,7 +2160,7 @@ void on_main_window_tree_selection_changed(GtkWidget *self,main_window *widgets)
|
|
|
|
|
gboolean is_standard;
|
|
|
|
|
gtk_tree_model_get(model,&iter,3,&is_standard,-1);
|
|
|
|
|
gtk_widget_set_sensitive(widgets->AddButton,1);
|
|
|
|
|
if (!is_standard)
|
|
|
|
|
if (!is_standard||is_standard==2)
|
|
|
|
|
gtk_widget_set_sensitive(widgets->RemoveButton,1);
|
|
|
|
|
else
|
|
|
|
|
gtk_widget_set_sensitive(widgets->RemoveButton,0);
|
|
|
|
@ -2504,7 +2520,7 @@ main_window *setup_window(){
|
|
|
|
|
if (!found)
|
|
|
|
|
gtk_list_store_append(widgets->list,&iter);
|
|
|
|
|
cur_watcher[1] = yon_char_replace(cur_watcher[1],",","\n");
|
|
|
|
|
gtk_list_store_set(widgets->list,&iter,0,cur_watcher[0],1,cur_watcher[1],2,cur_watcher[2]?cur_watcher[2]:"",-1);
|
|
|
|
|
gtk_list_store_set(widgets->list,&iter,0,cur_watcher[0],1,cur_watcher[1],2,cur_watcher[2]?cur_watcher[2]:"",3,found ? 2 : 0,-1);
|
|
|
|
|
yon_char_parsed_free(cur_watcher,cur_size);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2519,7 +2535,6 @@ main_window *setup_window(){
|
|
|
|
|
// yon_window_config_add_custom_parameter(widgets->HeadInfoLabel,"head-text","label",YON_TYPE_STRING);
|
|
|
|
|
|
|
|
|
|
/* Signal connection | Присоединение сигналов */
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->Window), "destroy", G_CALLBACK(gtk_main_quit), NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->DocumentationMenuItem),"activate",G_CALLBACK(on_open_documentation_confirmation),WIKI_LINK);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->AboutMenuItem),"activate",G_CALLBACK(on_about),NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->InspectButton),"clicked",G_CALLBACK(on_inspector_open),widgets);
|
|
|
|
|