Merge pull request 'devel' (#24) from devel into master

Reviewed-on: YanTheKaller/ubl-settings-manager#24
pull/9/head
commit d84af52fdc

@ -23,7 +23,6 @@ init:
version="$$(cat VERSION.md)"; \ version="$$(cat VERSION.md)"; \
version=$${version:8}; \ version=$${version:8}; \
search="s/string version_application.*"; \ search="s/string version_application.*"; \
echo $$search; \
replace="string version_application = \"$${version}\";"; \ replace="string version_application = \"$${version}\";"; \
sed -i -e "$$search/$$replace/gi" source/ubl-settings-manager.h; \ sed -i -e "$$search/$$replace/gi" source/ubl-settings-manager.h; \
echo "-- Build path: ${CMAKE_BUILD_DIR}" echo "-- Build path: ${CMAKE_BUILD_DIR}"
@ -84,9 +83,7 @@ uninstall:
done done
@$(RM) "/usr/bin/${PKGNAME}" @$(RM) "/usr/bin/${PKGNAME}"
@$(RM) "/usr/share/applications/${PKGNAME}.desktop" @$(RM) "/usr/share/applications/${PKGNAME}.desktop"
@$(RM) "/usr/share/icons/hicolor/scalable/apps/${PKGNAME}.png"
@$(RM) "/usr/share/icons/hicolor/scalable/apps/${PKGNAME}.svg" @$(RM) "/usr/share/icons/hicolor/scalable/apps/${PKGNAME}.svg"
@$(RM) "/usr/share/icons/hicolor/scalable/apps/ubl-settings-manager.svg"
@$(RM) "/usr/share/${PKGNAME}/ui/ublinux-logo.svg" @$(RM) "/usr/share/${PKGNAME}/ui/ublinux-logo.svg"
@$(RM) "/usr/share/${PKGNAME}/ui/${PKGNAME}.glade" @$(RM) "/usr/share/${PKGNAME}/ui/${PKGNAME}.glade"
@$(RM) "/usr/share/${PKGNAME}/css/${PKGNAME}.css" @$(RM) "/usr/share/${PKGNAME}/css/${PKGNAME}.css"
@ -95,7 +92,7 @@ uninstall:
@$(RM) -d "/usr/share/${PKGNAME}/css" @$(RM) -d "/usr/share/${PKGNAME}/css"
@$(RM) -d "/usr/share/${PKGNAME}/ui" @$(RM) -d "/usr/share/${PKGNAME}/ui"
@$(RM) -d "/usr/share/${PKGNAME}" @$(RM) -d "/usr/share/${PKGNAME}"
@$(RM) "/etc/ubconfig-main.conf" @$(RM) "/etc/xdg/${PKGNAME}/${PKGNAME}.conf"
@gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null @gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null
@update-desktop-database --quiet 2>/dev/null @update-desktop-database --quiet 2>/dev/null
@touch /usr/share/applications @touch /usr/share/applications
@ -124,8 +121,7 @@ install: check uninstall
@install -Dm644 -t /usr/share/${PKGNAME}/ui/ ${PKGNAME}.glade @install -Dm644 -t /usr/share/${PKGNAME}/ui/ ${PKGNAME}.glade
@install -Dm644 -t /usr/share/${PKGNAME}/css/ ${PKGNAME}.css @install -Dm644 -t /usr/share/${PKGNAME}/css/ ${PKGNAME}.css
@install -Dm644 -t /usr/share/${PKGNAME}/ui/ ublinux-logo.svg @install -Dm644 -t /usr/share/${PKGNAME}/ui/ ublinux-logo.svg
@install -Dm644 -t /etc/ ubconfig-main.conf @install -Dm766 -t /etc/xdg/${PKGNAME}/ ${PKGNAME}.conf
@chmod 766 /etc/ubconfig-main.conf
@install -Dm644 -t /usr/share/${PKGNAME}/ui/ ${PKGNAME}-banner.png @install -Dm644 -t /usr/share/${PKGNAME}/ui/ ${PKGNAME}-banner.png
@gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null @gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null
@update-desktop-database --quiet 2>/dev/null @update-desktop-database --quiet 2>/dev/null

@ -877,6 +877,7 @@ apps *find_apps(int *sizef){
tempapp.Pluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "Pluggable",NULL); tempapp.Pluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "Pluggable",NULL);
if (!tempapp.Pluggable) tempapp.Pluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "X-XfcePluggable",NULL); if (!tempapp.Pluggable) tempapp.Pluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "X-XfcePluggable",NULL);
if (tempapp.Pluggable) tempapp.DualPluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "X-UBLPluggable",NULL); if (tempapp.Pluggable) tempapp.DualPluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "X-UBLPluggable",NULL);
if (g_key_file_get_boolean(gfile,"Desktop Entry", "X-UBL-SettingsManager-Hidden",NULL)==1)
if (size==0){ if (size==0){
applist=(apps*)malloc(size+1*sizeof(apps)); applist=(apps*)malloc(size+1*sizeof(apps));
applist[0].Name=yon_char_new(tempapp.Name); applist[0].Name=yon_char_new(tempapp.Name);
@ -946,11 +947,7 @@ int check_categories(apps app, char *catstocheck){
int setup_config(){ int setup_config(){
FILE *file; FILE *file;
GError *err=NULL; GError *err=NULL;
main_config.sections=malloc(sizeof(dictionary)); main_config.sections=yon_dictionary_create_empty();
main_config.sections->data=NULL;
main_config.sections->next=NULL;
main_config.sections->prev=NULL;
main_config.sections->first=NULL;
GKeyFile *configfile = g_key_file_new(); GKeyFile *configfile = g_key_file_new();
char *pth=malloc(7+strlen(UserConfigPath)+strlen(getlogin())); char *pth=malloc(7+strlen(UserConfigPath)+strlen(getlogin()));
sprintf(pth,"%s%s%s","/home/",getlogin(),UserConfigPath); sprintf(pth,"%s%s%s","/home/",getlogin(),UserConfigPath);
@ -997,7 +994,7 @@ int setup_config(){
gsize length=0; gsize length=0;
char **a=g_key_file_get_keys(configfile,"sections",&length,NULL); char **a=g_key_file_get_keys(configfile,"sections",&length,NULL);
if (!a){yon_set_default_sections(&main_config.sections);} else { if (!a){yon_set_default_sections(main_config.sections);} else {
for (int i=0;i<length;i++){ for (int i=0;i<length;i++){
char *cats=g_key_file_get_string(configfile,"sections",a[i],NULL); char *cats=g_key_file_get_string(configfile,"sections",a[i],NULL);
main_config.sections=yon_section_new(main_config.sections,a[i], cats); main_config.sections=yon_section_new(main_config.sections,a[i], cats);
@ -1103,38 +1100,14 @@ char *yon_char_divide_search(char *source, char* dividepos, int delete_divider){
return cut; return cut;
} }
void yon_set_default_sections(dictionary **section){ void yon_set_default_sections(dictionary *section){
*section=malloc(sizeof(dictionary)); yon_section_new(section,"Personal","X-UBL-SettingsManager;X-UBL-PersonalSettings;");
IconSection *sec=malloc(sizeof(IconSection)); section=yon_dictionary_create_conneced(section);
sec->section="Personal"; yon_section_new(section,"Hardware","X-UBL-SettingsManager;X-UBL-HardwareSettings;");
sec->categories="X-UBL-SettingsManager;X-UBL-PersonalSettings;"; section=yon_dictionary_create_conneced(section);
(*section)->data=sec; yon_section_new(section,"System","X-UBL-SettingsManager;X-UBL-SystemSettings;");
(*section)->first=*section; section=yon_dictionary_create_conneced(section);
(*section)->next=malloc(sizeof(dictionary)); yon_section_new(section,"Misc","X-UBL-SettingsManager;X-UBL-MiscSettings;");
(*section)->next->prev=*section;
(*section)->next->first=(*section)->first;
*section=(*section)->next;
sec=malloc(sizeof(IconSection));
sec->section="Hardware";
sec->categories="X-UBL-SettingsManager;X-UBL-HardwareSettings;";
(*section)->data=sec;
(*section)->next=malloc(sizeof(dictionary));
(*section)->next->prev=*section;
(*section)->next->first=(*section)->first;
*section=(*section)->next;
sec=malloc(sizeof(IconSection));
sec->section="System";
sec->categories="X-UBL-SettingsManager;X-UBL-SystemSettings;";
(*section)->data=sec;
(*section)->next=malloc(sizeof(dictionary));
(*section)->next->prev=*section;
(*section)->next->first=(*section)->first;
*section=(*section)->next;
sec=malloc(sizeof(IconSection));
sec->section="Misc";
sec->categories="X-UBL-SettingsManager;";
(*section)->data=sec;
*section=(*section)->first;
} }
IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){
@ -1230,7 +1203,7 @@ void yon_check_path(char *path){
dictionary *yon_section_new(dictionary *section, char *section_name, char *categories){ dictionary *yon_section_new(dictionary *section, char *section_name, char *categories){
section->next=NULL; section->next=NULL;
IconSection *sct=malloc(sizeof(IconSection)); IconSection *sct=malloc(sizeof(IconSection));
dictionary *dict=malloc(sizeof(dictionary)); dictionary *dict=yon_dictionary_create_empty();//malloc(sizeof(dictionary));
sct->section=section_name; sct->section=section_name;
sct->categories=categories; sct->categories=categories;
dict->data=sct; dict->data=sct;

@ -7,8 +7,8 @@
#define GladePath "/usr/share/ubl-settings-manager/ui/ubl-settings-manager.glade" #define GladePath "/usr/share/ubl-settings-manager/ui/ubl-settings-manager.glade"
#define CssPath "/usr/share/ubl-settings-manager/css/ubl-settings-manager.css" #define CssPath "/usr/share/ubl-settings-manager/css/ubl-settings-manager.css"
#define GlobalConfigPath "/etc/ubconfig-main.conf" #define GlobalConfigPath "/etc/xdg/ubl-settings-manager/ubl-settings-manager.conf"
#define UserConfigPath "/.config/ubl-settings-manager/ubconfig-main.conf" #define UserConfigPath "/.config/ubl-settings-manager/ubl-settings-manager.conf"
#define AppIconPath "ubl-settings-manager" #define AppIconPath "ubl-settings-manager"
#define AppBannerPath "/usr/share/ubl-settings-manager/ui/ubl-settings-manager-banner.png" #define AppBannerPath "/usr/share/ubl-settings-manager/ui/ubl-settings-manager-banner.png"
#define DesktopPath "/usr/share/applications/" #define DesktopPath "/usr/share/applications/"
@ -202,7 +202,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them
char *yon_char_get_augumented(char *source, char *append); char *yon_char_get_augumented(char *source, char *append);
char *yon_cut(char *source, int size, int startpos); char *yon_cut(char *source, int size, int startpos);
int yon_set_sections(IconSection *section); int yon_set_sections(IconSection *section);
void yon_set_default_sections(dictionary **section); void yon_set_default_sections(dictionary *section);
char *yon_char_divide_search(char *source, char* dividepos, int delete_divider); char *yon_char_divide_search(char *source, char* dividepos, int delete_divider);
char *yon_char_divide(char *source, int dividepos); char *yon_char_divide(char *source, int dividepos);
dictionary *yon_section_new(dictionary *section, char *section_name, char *categories); dictionary *yon_section_new(dictionary *section, char *section_name, char *categories);

Loading…
Cancel
Save