|
|
|
|
@ -1,5 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "ubl-settings-manager.h"
|
|
|
|
|
|
|
|
|
|
config main_config;
|
|
|
|
|
@ -24,7 +22,7 @@ void config_init(){
|
|
|
|
|
main_config.sections=NULL;
|
|
|
|
|
main_config.SettingsSections=NULL;
|
|
|
|
|
main_config.double_click=0;
|
|
|
|
|
main_config.apps_icon_size=24;
|
|
|
|
|
main_config.apps_icon_size=56;
|
|
|
|
|
main_config.labelDensity=0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -34,7 +32,7 @@ void yon_config_update(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (!yon_window_config_get_parameter(settings_section,icon_size_parameter,&main_config.apps_icon_size,YON_TYPE_INT)){
|
|
|
|
|
main_config.apps_icon_size=24;
|
|
|
|
|
main_config.apps_icon_size=56;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
main_config.themes = g_hash_table_new(g_str_hash,g_str_equal);
|
|
|
|
|
@ -156,7 +154,7 @@ void yon_interface_update(main_window *widgets){
|
|
|
|
|
{
|
|
|
|
|
app_section *cur_section = yon_app_section_new();
|
|
|
|
|
cur_section->name = yon_char_new(_("Misc"));
|
|
|
|
|
cur_section->categories = yon_char_parsed_new(&cur_section->categories_size,"",NULL);
|
|
|
|
|
cur_section->categories = yon_char_parsed_new(&cur_section->categories_size,"X-UBL-SettingsManager;",NULL);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(main_config.sections,cur_section->name,cur_section);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -218,25 +216,36 @@ main_window *yon_main_window_setup(){
|
|
|
|
|
int main(int argc, char *argv[]){
|
|
|
|
|
setlocale(LC_ALL, "");
|
|
|
|
|
textdomain (LocaleName);
|
|
|
|
|
yon_ubl_connect_config((_template_config*)&main_config);
|
|
|
|
|
yon_ubl_window_init(TITLE_LABEL,TITLE_INFO_LABEL,LocaleName,CssPath,LocaleName,version_application,WIKI_LINK);
|
|
|
|
|
|
|
|
|
|
static struct option long_options[] = {
|
|
|
|
|
{"lock-settings", 0, 0, 'l'},
|
|
|
|
|
{"help", 0, 0, 'h'},
|
|
|
|
|
{"version", 0, 0, 'v'},
|
|
|
|
|
{"clear-config", 0,0, 'c'},
|
|
|
|
|
};
|
|
|
|
|
int socket_find;
|
|
|
|
|
int option_index=0;
|
|
|
|
|
for (int i=0;i<argc;i++){
|
|
|
|
|
socket_find=getopt_long(argc,argv,"lhv",long_options,&option_index);
|
|
|
|
|
if (socket_find=='l')
|
|
|
|
|
main_config.lock_settings=1;
|
|
|
|
|
if (socket_find=='h') {
|
|
|
|
|
printf("%s\n",HELP_LABEL(NULL));
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
if (socket_find=='v') {
|
|
|
|
|
printf("%s\n",VERSION_LABEL);
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
int argument = getopt_long(argc,argv,"lhvc",long_options,&option_index);
|
|
|
|
|
switch (argument){
|
|
|
|
|
case 'l':
|
|
|
|
|
main_config.lock_settings=1;
|
|
|
|
|
break;
|
|
|
|
|
case 'h':
|
|
|
|
|
printf("%s\n",HELP_LABEL(NULL));
|
|
|
|
|
exit(0);
|
|
|
|
|
break;
|
|
|
|
|
case 'v':
|
|
|
|
|
printf("%s\n",VERSION_LABEL);
|
|
|
|
|
exit(0);
|
|
|
|
|
break;
|
|
|
|
|
case 'c': char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",template_app_information.app_tech_name,"/",NULL);
|
|
|
|
|
struct passwd *user = getpwnam(yon_ubl_root_user_get());
|
|
|
|
|
if (chown(path,user->pw_uid,user->pw_gid)){};
|
|
|
|
|
if (system(remove_config_dir_command)){};
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gtk_init(&argc, &argv);
|
|
|
|
|
yon_main_window_setup();
|
|
|
|
|
|