Comments removal; variable rename; custom config creation owner fix #57

Merged
asmeron merged 6 commits from YanTheKaller/libublsettingsui-gtk3:master into master 4 weeks ago

@ -78,6 +78,11 @@ build: depend prepare
uninstall:
@echo "Uninstall ..."
@for LANG in $$(find ./ -iname "*.po" -print | sed -En "s/.+_([[:alpha:]]+)\.po/\1/p" | sort -u); do \
# PATH_FILE_MO="${DESTDIR}${PREFIX}/share/locale/$${LANG}/LC_MESSAGES/${PKGNAME}.mo"; \
PATH_FILE_MO="${DESTDIR}/usr/share/locale/$${LANG}/LC_MESSAGES/${PKGNAME}.mo"; \
$(RM) "$${PATH_FILE_MO}"; \
done
@for FILE_PO in $(wildcard *.po); do \
LANG=$${FILE_PO##*_};LANG=$${LANG%.*}; \
FILE_MO=$${FILE_PO##*/}; FILE_MO="$${FILE_MO%_*.po}.mo"; \

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="111.30122mm"
height="111.3007mm"
viewBox="0 0 111.30122 111.3007"
version="1.1"
id="svg1"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
sodipodi:docname="com.ublinux.libublsettingsui-gtk3.toggled-symbolic.svg.svg"
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">
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="0.7349537"
inkscape:cx="149.66929"
inkscape:cy="245.5937"
inkscape:window-width="1920"
inkscape:window-height="1023"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs1" />
<g
inkscape:label="Слой 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-44.137874,-31.569132)">
<path
id="path1"
style="fill:#1a1a1a;stroke-width:0.264583"
d="m 99.788224,31.569132 a 55.650448,55.650448 0 0 0 -55.65035,55.65035 55.650448,55.650448 0 0 0 55.65035,55.650348 55.650448,55.650448 0 0 0 55.650866,-55.650348 55.650448,55.650448 0 0 0 -55.650866,-55.65035 z m 0,8.620146 A 47.030125,47.030125 0 0 1 146.81843,87.219482 47.030125,47.030125 0 0 1 99.788224,134.24969 47.030125,47.030125 0 0 1 52.758537,87.219482 47.030125,47.030125 0 0 1 99.788224,40.189278 Z" />
<circle
style="display:inline;fill:#1a1a1a;stroke-width:0.217619"
id="circle2"
cx="99.788406"
cy="87.219505"
r="45.772301" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="111.30122mm"
height="111.3007mm"
viewBox="0 0 111.30122 111.3007"
version="1.1"
id="svg1"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
sodipodi:docname="com.ublinux.libublsettingsui-gtk3.untoggled-symbolic.svg"
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">
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="0.7349537"
inkscape:cx="149.66929"
inkscape:cy="245.5937"
inkscape:window-width="1920"
inkscape:window-height="1023"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs1" />
<g
inkscape:label="Слой 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-44.137874,-31.569132)">
<path
id="path1"
style="fill:#1a1a1a;stroke-width:0.264583"
d="m 99.788224,31.569132 a 55.650448,55.650448 0 0 0 -55.65035,55.65035 55.650448,55.650448 0 0 0 55.65035,55.650348 55.650448,55.650448 0 0 0 55.650866,-55.650348 55.650448,55.650448 0 0 0 -55.650866,-55.65035 z m 0,8.620146 A 47.030125,47.030125 0 0 1 146.81843,87.219482 47.030125,47.030125 0 0 1 99.788224,134.24969 47.030125,47.030125 0 0 1 52.758537,87.219482 47.030125,47.030125 0 0 1 99.788224,40.189278 Z" />
<circle
style="display:none;fill:#1a1a1a;stroke-width:0.217619"
id="circle2"
cx="99.788406"
cy="87.219505"
r="45.772301" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@ -388,3 +388,7 @@ msgstr ""
#: source/libublsettingsui-gtk3.h:493
msgid "Access to file denied"
msgstr ""
#: source/libublsettingsui-gtk3.h:493
msgid "The configuration file contains incorrect parameters."
msgstr ""

@ -394,4 +394,7 @@ msgstr "Выход"
#: source/libublsettingsui-gtk3.h:493
msgid "Access to file denied"
msgstr "Отказано в доступе к файлу"
msgstr "Отказано в доступе к файлу"
msgid "The configuration file contains incorrect parameters."
msgstr "Файл конфигурации содержит некорректные параметры"

@ -384,8 +384,8 @@ void yon_save_window_compared_config_init_unfound(template_saving_window *window
int yon_config_parameter_prepare_elements(config_str target, int *size){
int success = 0;
for (int i=0;i<(*size);i++){
char *start_bracket_replaced_string = yon_char_replace(target[i],"[","[\"");
char *end_bracket_replaced_string = yon_char_replace(start_bracket_replaced_string,"]","\"]");
char *start_bracket_replaced_string = yon_char_replace(target[i],"[","[\'");
char *end_bracket_replaced_string = yon_char_replace(start_bracket_replaced_string,"]","\']");
target[i] = end_bracket_replaced_string;
}
return success;
@ -487,32 +487,21 @@ void yon_loaded_config_set_sections_from_sections_dictionary(struct loaded_confi
struct loaded_config *yon_config_get_compared(char *command){
if (command){
int size;
config_str config = yon_config_load(command,&size);
config_str config_p = yon_config_load(command,&size);
config_str temporary = NULL;
int temp_size=0;
if (config&&size>0){
if (config_p&&size>0){
for (int i=0;i<size;i++){
if (!yon_char_is_empty(config[i])&&strcmp(config[i],"(null)\n")){
yon_char_remove_last_symbol(config[i],'\n');
yon_char_parsed_add_or_create_if_exists(temporary,&temp_size,config[i]);
if (!yon_char_is_empty(config_p[i])&&strcmp(config_p[i],"(null)\n")){
yon_char_remove_last_symbol(config_p[i],'\n');
yon_char_parsed_add_or_create_if_exists(temporary,&temp_size,config_p[i]);
}
}
yon_char_parsed_free(config,size);
yon_char_parsed_free(config_p,size);
}
if (!temporary) return NULL;
struct loaded_config *loaded = yon_config_convert_parameter(temporary,temp_size);
// int parsed_size;
// config_str parsed_command = yon_char_parse(command,&parsed_size,";");
// dictionary *sections = NULL;
// for (int i=0;i<parsed_size;i++){
// int dull_size;
// yon_dictionary_add_or_create_if_exists_with_data(sections,yon_command_get_section(parsed_command[i]),yon_command_get_parameters(command,&dull_size));
// }
// yon_loaded_config_set_sections_from_sections_dictionary(loaded,sections);
// yon_dictionary_free_all(sections,free);
return loaded;
}
@ -539,7 +528,9 @@ char *yon_custom_config_init(GtkFileChooserAction type){
if (!strstr(file,".ini")) file = yon_char_append(file,".ini");
if (access(file,0)!=F_OK){
char *command_creation = ubconfig_file_create(file);
struct passwd *user = getpwnam(yon_ubl_root_user_get());
int a = system(command_creation);
chown(file,user->pw_uid,user->pw_gid);
free(command_creation);
if (access(file,0)!=F_OK){
yon_ubl_status_box_render(CUSTOM_CONFIG_CREATION_ERROR_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
@ -557,9 +548,9 @@ char *yon_custom_config_init(GtkFileChooserAction type){
}
/*
============
init section
============
===========================================================
init section
===========================================================
*/
void on_save_parameters(GtkWidget *self, template_saving_window *window){

@ -620,4 +620,5 @@ yon_password_window *yon_password_open(GtkEntry *target);
#define _INCORRECT_HASH_LABEL yon_char_get_localised_from_lib("Invalid hash")
#define _ENCRYPTION_DEFAULT_LABEL yon_char_get_localised_from_lib("Default (None)")
#define ACCESS_DENIED_LABEL(target) yon_char_unite(yon_char_get_localised_from_lib("Access to file denied"),": ", target,NULL)
#define CONFIG_INVALID_LABEL yon_char_get_localised_from_lib("The configuration file contains incorrect parameters.")
#endif
Loading…
Cancel
Save