Updated folder icons; Improved saving

pull/7/head
parent 397787a554
commit 74696cddf8

@ -1 +1,48 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M1 1a1 1 0 00-1 1v11s-.014.459.23.947C.476 14.436 1.168 15 2 15h12s.459.014.947-.23C15.436 14.525 16 13.833 16 13V6H3v7H2V6s0-1 1-1h11v-.832A1 1 0 0013 3H8.414L6.707 1.293A1 1 0 006 1z" style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;white-space:normal;shape-padding:0;isolation:auto;mix-blend-mode:normal;solid-color:#000;solid-opacity:1" color="#000" font-weight="400" font-family="sans-serif" overflow="visible" fill="#2e3436" fill-rule="evenodd"/></svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="16"
height="16"
version="1.1"
id="svg4"
sodipodi:docname="folder-symbolic-green.svg"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="32"
inkscape:cx="2.09375"
inkscape:cy="5.84375"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<path
id="path2"
style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;text-transform:none;text-orientation:mixed;white-space:normal;shape-padding:0;display:inline;isolation:auto;mix-blend-mode:normal;solid-color:#000000;solid-opacity:1"
d="M 1 1 A 1 1 0 0 0 0 2 L 0 13 C 0 13 -0.013531006 13.459266 0.23046875 13.947266 C 0.4764685 14.436265 1.1680008 15 2 15 L 8.1484375 15 A 4.9792154 4.9792154 0 0 1 7.3964844 12.375 A 4.9792154 4.9792154 0 0 1 12.375 7.3964844 A 4.9792154 4.9792154 0 0 1 16 8.9628906 L 16 6 L 3 6 L 3 13 L 2 13 L 2 6 C 2 6 2.000001 5 3 5 L 14 5 L 14 4.1679688 A 1 1 0 0 0 13 3 L 8.4140625 3 L 6.7070312 1.2929688 A 1 1 0 0 0 6 1 L 1 1 z " />
<g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="Layer 1">
<path
id="path854"
class="success"
style="fill:#00ff00;stroke:none;stroke-width:0;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1"
d="M 15.979216,12.375 A 3.6042156,3.6042156 0 0 1 12.375,15.979216 3.6042156,3.6042156 0 0 1 8.7707831,12.375 3.6042156,3.6042156 0 0 1 12.375,8.7707837 3.6042156,3.6042156 0 0 1 15.979216,12.375 Z" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 834 B

After

Width:  |  Height:  |  Size: 2.4 KiB

@ -1 +1,48 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M1 1a1 1 0 00-1 1v11s-.014.459.23.947C.476 14.436 1.168 15 2 15h12s.459.014.947-.23C15.436 14.525 16 13.833 16 13V6H3v7H2V6s0-1 1-1h11v-.832A1 1 0 0013 3H8.414L6.707 1.293A1 1 0 006 1z" style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;white-space:normal;shape-padding:0;isolation:auto;mix-blend-mode:normal;solid-color:#000;solid-opacity:1" color="#000" font-weight="400" font-family="sans-serif" overflow="visible" fill="#2e3436" fill-rule="evenodd"/></svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="16"
height="16"
version="1.1"
id="svg4"
sodipodi:docname="folder-symbolic-red.svg"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="32"
inkscape:cx="2.09375"
inkscape:cy="5.84375"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
id="path2"
style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;text-transform:none;text-orientation:mixed;white-space:normal;shape-padding:0;display:inline;isolation:auto;mix-blend-mode:normal;solid-color:#000000;solid-opacity:1"
d="M 1 1 A 1 1 0 0 0 0 2 L 0 13 C 0 13 -0.013531006 13.459266 0.23046875 13.947266 C 0.4764685 14.436265 1.1680008 15 2 15 L 8.1484375 15 A 4.9792154 4.9792154 0 0 1 7.3964844 12.375 A 4.9792154 4.9792154 0 0 1 12.375 7.3964844 A 4.9792154 4.9792154 0 0 1 16 8.9628906 L 16 6 L 3 6 L 3 13 L 2 13 L 2 6 C 2 6 2.000001 5 3 5 L 14 5 L 14 4.1679688 A 1 1 0 0 0 13 3 L 8.4140625 3 L 6.7070312 1.2929688 A 1 1 0 0 0 6 1 L 1 1 z " />
<g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="Layer 1">
<path
id="path854"
class="error"
style="fill:#ff2a2a;stroke:none;stroke-width:0;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none"
d="M 15.979216,12.375 A 3.6042156,3.6042156 0 0 1 12.375,15.979216 3.6042156,3.6042156 0 0 1 8.7707831,12.375 3.6042156,3.6042156 0 0 1 12.375,8.7707837 3.6042156,3.6042156 0 0 1 15.979216,12.375 Z" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 834 B

After

Width:  |  Height:  |  Size: 2.4 KiB

@ -120,7 +120,8 @@ void on_save(){
char *add_flagged = NULL;
char *origin_flagged = NULL;
char *name_flagged = NULL;
GtkTreeIter iter, childIter;
char *packnames = "";
GtkTreeIter iter, childIter, *deleteIter;
int valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(main_config.tree_store),&iter);
for (;valid;valid=gtk_tree_model_iter_next(GTK_TREE_MODEL(main_config.tree_store),&iter)){
remove_flagged = NULL;
@ -131,33 +132,45 @@ void on_save(){
*(add) = 1;
char *old_name=NULL;
gtk_tree_model_get(GTK_TREE_MODEL(main_config.tree_store),&iter,1,&name_flagged,3,&origin_flagged,4,&repostatus,6,&old_name,7,&renamed,-1);
if (repostatus==-1) {
yon_window_config_erase_custom_parameter(yon_char_unite(origin_flagged,"/",name_flagged,NULL),"repos");
remove_command = yon_char_unite("rm -rdf ",origin_flagged,"/",name_flagged,NULL);
system (remove_command);
gtk_tree_store_remove(main_config.tree_store,&iter);
continue; }
else if (repostatus==1)
yon_window_config_add_custom_parameter(yon_char_unite(origin_flagged,"/",name_flagged,NULL),"repos",add,YON_TYPE_INT);
// if (!strstr(name_flagged,".db.tar.gz")) name_flagged = yon_char_append(name_flagged,".db.tar.gz");
remove_command = yon_char_unite(command," remove -d ", origin_flagged, " -r ", name_flagged, NULL);
add_command = yon_char_unite(command," add -d ", origin_flagged, " -r ", name_flagged, NULL);
int valid_child=gtk_tree_model_iter_children(GTK_TREE_MODEL(main_config.tree_store),&childIter,&iter);
add_command = yon_char_unite(command," add -d ", origin_flagged,"/",name_flagged, " -r ", name_flagged, NULL);
gboolean valid_child=gtk_tree_model_iter_children(GTK_TREE_MODEL(main_config.tree_store),&childIter,&iter);
for (;valid_child;valid_child=gtk_tree_model_iter_next(GTK_TREE_MODEL(main_config.tree_store),&childIter)){
int status = 0,deleted = 0;
char *path=NULL;
gtk_tree_model_get(GTK_TREE_MODEL(main_config.tree_store),&childIter,3,&path,4,&status,5,&deleted,-1);
char *name=NULL;
gtk_tree_model_get(GTK_TREE_MODEL(main_config.tree_store),&childIter,1,&name,3,&path,4,&status,5,&deleted,-1);
if (name)
packnames = yon_char_unite(packnames, strcmp(packnames,"")!=0 ? " " : "", name, NULL);
gtk_tree_store_set(main_config.tree_store,&childIter,4,0,5,0,-1);
if (status==-1) { remove_flagged = yon_char_unite(remove_flagged ? yon_char_append(remove_flagged,",") : " -p ",path,NULL); /*gtk_tree_store_remove(main_config.tree_store,&childIter);*/}
if (status==-1) { remove_flagged = yon_char_unite(remove_flagged ? yon_char_append(remove_flagged,",") : " -p ",path,NULL);}
else if (status == 1&&deleted==0) { add_flagged = yon_char_unite(add_flagged ? yon_char_append(add_flagged,",") : " -p ",path,NULL);gtk_tree_store_set(main_config.tree_store,&childIter,0,"com.ublinux.ubl-settings-repomanager.document-symbolic",-1); }
}
if (repostatus==1){
mkdir((origin_flagged = yon_char_unite(origin_flagged,"/",name_flagged,NULL)),0766);
yon_window_config_add_custom_parameter(yon_char_unite(origin_flagged,"/",name_flagged,NULL),"repos",packnames,YON_TYPE_STRING);
gtk_tree_store_set(main_config.tree_store,&iter,0,folder_no_edits,4,0,-1);
}
if (origin_flagged)
remove_command = remove_flagged ? yon_char_unite(remove_command,remove_flagged,NULL) : NULL;
add_command = add_flagged ? yon_char_unite(add_command, add_flagged,NULL) : add_command;
printf("%s\n%s\n",remove_command,add_command);
if (remove_command) system(remove_command);
if (add_command) system(add_command);
if (repostatus==-1) {
yon_window_config_erase_custom_parameter(yon_char_unite(origin_flagged,"/",name_flagged,NULL),"repos");
remove_command = yon_char_unite("rm -rdf ",origin_flagged,"/",name_flagged,NULL);
system (remove_command);
deleteIter = gtk_tree_iter_copy(&iter);
if (gtk_tree_model_iter_previous(GTK_TREE_MODEL(main_config.tree_store),&iter))
gtk_tree_store_remove(main_config.tree_store,deleteIter);
else {
gtk_tree_store_remove(main_config.tree_store,deleteIter);
return;
}
continue; }
}
}
@ -389,11 +402,29 @@ void yon_repo_remove_package(main_window *widgets){
}
void yon_repo_remove(main_window *widgets){
GtkTreeIter iter;
GtkTreeIter iter, childIter, *deletecopy;
GtkTreeModel *model = GTK_TREE_MODEL(main_config.tree_store);
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->RepoTree)),&model,&iter)){
if(gtk_tree_store_iter_depth(main_config.tree_store,&iter)==0){
gtk_tree_store_set(main_config.tree_store,&iter,4,-1,0,folder_deleted,-1);
int repostatus=0;
gtk_tree_model_get(GTK_TREE_MODEL(main_config.tree_store),&iter,4,&repostatus,-1);
if (repostatus ==0){
gtk_tree_store_set(main_config.tree_store,&iter,4,-1,0,folder_deleted,-1);
int valid=gtk_tree_model_iter_children(model,&childIter,&iter);
for (;valid;valid=gtk_tree_model_iter_next(model,&childIter)){
int status=0;
gtk_tree_model_get(model,&childIter,4,&status,-1);
if (status==1){
deletecopy = gtk_tree_iter_copy(&childIter);
gtk_tree_model_iter_previous(model,&childIter);
gtk_tree_store_remove(main_config.tree_store,deletecopy);
} else if (status == 0){
gtk_tree_store_set(main_config.tree_store,&childIter, 0,document_deleted,4,-1,5,1,-1);
}
}
} else if (repostatus == 1) {
gtk_tree_store_remove(main_config.tree_store,&iter);
}
}else yon_ubl_status_box_render(CHOOSE_REPO_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
} else yon_ubl_status_box_render(NOTHING_CHOSEN_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
}

Loading…
Cancel
Save