|
|
|
@ -1209,7 +1209,7 @@ void yon_config_load_update(main_window *widgets){
|
|
|
|
char *name = yon_char_new(storages[i]);
|
|
|
|
char *name = yon_char_new(storages[i]);
|
|
|
|
free(yon_char_divide(name,yon_char_find_last(name,'/')));
|
|
|
|
free(yon_char_divide(name,yon_char_find_last(name,'/')));
|
|
|
|
gtk_tree_store_append(widgets->RepoList,&iter,NULL);
|
|
|
|
gtk_tree_store_append(widgets->RepoList,&iter,NULL);
|
|
|
|
gtk_tree_store_set(widgets->RepoList,&iter,2,name,3,storages[i],-1);
|
|
|
|
gtk_tree_store_set(widgets->RepoList,&iter,1,folder_no_edits,2,name,3,storages[i],-1);
|
|
|
|
free(name);
|
|
|
|
free(name);
|
|
|
|
yon_window_config_get_parameter("storage_info",storages[i],&name,YON_TYPE_STRING);
|
|
|
|
yon_window_config_get_parameter("storage_info",storages[i],&name,YON_TYPE_STRING);
|
|
|
|
if (!yon_char_is_empty(name)){
|
|
|
|
if (!yon_char_is_empty(name)){
|
|
|
|
@ -1219,14 +1219,14 @@ void yon_config_load_update(main_window *widgets){
|
|
|
|
char *nm = yon_char_new(name_parsed[j]);
|
|
|
|
char *nm = yon_char_new(name_parsed[j]);
|
|
|
|
free(yon_char_divide(nm,yon_char_find_last(nm,'/')));
|
|
|
|
free(yon_char_divide(nm,yon_char_find_last(nm,'/')));
|
|
|
|
gtk_tree_store_append(widgets->RepoList,&itar,&iter);
|
|
|
|
gtk_tree_store_append(widgets->RepoList,&itar,&iter);
|
|
|
|
gtk_tree_store_set(widgets->RepoList,&itar,3,name_parsed[j],2,nm,-1);
|
|
|
|
gtk_tree_store_set(widgets->RepoList,&itar,1,document_no_edits,3,name_parsed[j],2,nm,-1);
|
|
|
|
int size;
|
|
|
|
int size;
|
|
|
|
config_str dirs = yon_file_list_dirs(name_parsed[j],&size);
|
|
|
|
config_str dirs = yon_file_list_dirs(name_parsed[j],&size);
|
|
|
|
for (int k=0;k<size;k++){
|
|
|
|
for (int k=0;k<size;k++){
|
|
|
|
if (strcmp(dirs[k],"pool")&&strcmp(dirs[k],nm)){
|
|
|
|
if (strcmp(dirs[k],"pool")&&strcmp(dirs[k],nm)){
|
|
|
|
char *arch_path = yon_char_unite(name_parsed[j],"/",dirs[k],NULL);
|
|
|
|
char *arch_path = yon_char_unite(name_parsed[j],"/",dirs[k],NULL);
|
|
|
|
gtk_tree_store_append(widgets->RepoList,&childiter,&itar);
|
|
|
|
gtk_tree_store_append(widgets->RepoList,&childiter,&itar);
|
|
|
|
gtk_tree_store_set(widgets->RepoList,&childiter,2,dirs[k],3,arch_path,-1);
|
|
|
|
gtk_tree_store_set(widgets->RepoList,&childiter,1,folder_no_edits,2,dirs[k],3,arch_path,-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(nm);
|
|
|
|
free(nm);
|
|
|
|
@ -1509,6 +1509,23 @@ void on_tree_view_activate(GtkWidget *self, GtkTreePath* path, GtkTreeViewColumn
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_repo_item_activate(GtkWidget *self, GtkTreePath *path, GtkTreeViewColumn *column, main_window *widgets){
|
|
|
|
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
|
|
|
GtkTreeSelection *tree_selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->ReposTree));
|
|
|
|
|
|
|
|
gtk_tree_selection_get_selected(tree_selection,&model,&iter);
|
|
|
|
|
|
|
|
if (gtk_tree_store_iter_depth(GTK_TREE_STORE(widgets->RepoList),&iter)<2){
|
|
|
|
|
|
|
|
char *path_id = gtk_tree_model_get_string_from_iter(model,&iter);
|
|
|
|
|
|
|
|
char *target_id = gtk_tree_path_to_string(path);
|
|
|
|
|
|
|
|
char *selection = yon_char_unite(path_id,":",target_id,NULL);
|
|
|
|
|
|
|
|
GtkTreePath *new_selection = gtk_tree_path_new_from_string(selection);
|
|
|
|
|
|
|
|
gtk_tree_view_expand_to_path(GTK_TREE_VIEW(widgets->ReposTree),new_selection);
|
|
|
|
|
|
|
|
gtk_tree_selection_select_path(tree_selection,new_selection);
|
|
|
|
|
|
|
|
// on_package_selection_changed(NULL,widgets);
|
|
|
|
|
|
|
|
g_signal_emit_by_name(G_OBJECT(widgets->ReposTree),"cursor-changed",widgets,G_TYPE_NONE,NULL);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
widgets = yon_remalloc(widgets,sizeof(main_window));
|
|
|
|
widgets = yon_remalloc(widgets,sizeof(main_window));
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_path);
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_path);
|
|
|
|
@ -1556,6 +1573,7 @@ main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
g_signal_connect(G_OBJECT(widgets->CloudButton),"clicked",G_CALLBACK(on_ubl_settings_update_launch),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->CloudButton),"clicked",G_CALLBACK(on_ubl_settings_update_launch),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->RepoFileTree),"cursor-changed",G_CALLBACK(on_package_selection_changed),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->RepoFileTree),"cursor-changed",G_CALLBACK(on_package_selection_changed),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->ReposTree),"row-activated",G_CALLBACK(on_tree_view_activate),widgets);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->ReposTree),"row-activated",G_CALLBACK(on_tree_view_activate),widgets);
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->RepoFileTree),"row-activated",G_CALLBACK(on_repo_item_activate),widgets);
|
|
|
|
yon_calendar_set_date_orientation(1);
|
|
|
|
yon_calendar_set_date_orientation(1);
|
|
|
|
gtk_window_set_title(GTK_WINDOW(widgets->Window),TITLE_LABEL);
|
|
|
|
gtk_window_set_title(GTK_WINDOW(widgets->Window),TITLE_LABEL);
|
|
|
|
|
|
|
|
|
|
|
|
|