Fixed start without root

pull/207/head
parent ddc1d99e51
commit 96e677ba15

@ -891,6 +891,20 @@ void yon_main_window_create(main_window *widgets){
yon_window_config_setup(GTK_WINDOW(widgets->MainWindow)); yon_window_config_setup(GTK_WINDOW(widgets->MainWindow));
int fullscreen = 0;
char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL);
if (access(path,F_OK)){
fullscreen = 1;
g_thread_new("fullscreen",(GThreadFunc)yon_maximize,widgets);
}
yon_window_config_load(path);
yon_window_config_add_instant_parameter("fullscreen","window",&fullscreen,YON_TYPE_BOOLEAN);
yon_startup_language_init();
yon_locale_init();
yon_main_window_update_locale(widgets);
yon_gtk_window_setup(GTK_WINDOW(widgets->MainWindow),NULL,TITLE_LABEL,icon_path,NULL); yon_gtk_window_setup(GTK_WINDOW(widgets->MainWindow),NULL,TITLE_LABEL,icon_path,NULL);
gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(widgets->InstallerCountryFilter),(GtkTreeModelFilterVisibleFunc)on_country_filter,widgets,NULL); gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(widgets->InstallerCountryFilter),(GtkTreeModelFilterVisibleFunc)on_country_filter,widgets,NULL);
@ -1007,23 +1021,10 @@ main_window *yon_main_window_complete(){
memset(widgets,0,sizeof(main_window)); memset(widgets,0,sizeof(main_window));
yon_main_window_create(widgets); yon_main_window_create(widgets);
yon_startup_language_init();
yon_locale_init();
// yon_set_locales_list(widgets); // yon_set_locales_list(widgets);
// yon_main_window_update_locale(widgets); // yon_main_window_update_locale(widgets);
// // yon_window_config_custom_window_setup(GTK_WINDOW(widgets->MainWindow),"MainWindow"); // // yon_window_config_custom_window_setup(GTK_WINDOW(widgets->MainWindow),"MainWindow");
int fullscreen = 0;
char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL);
if (access(path,F_OK)){
fullscreen = 1;
g_thread_new("fullscreen",(GThreadFunc)yon_maximize,widgets);
}
yon_window_config_load(path);
yon_window_config_add_instant_parameter("fullscreen","window",&fullscreen,YON_TYPE_BOOLEAN);
yon_main_window_update_locale(widgets);
return widgets; return widgets;
} }
@ -1079,9 +1080,6 @@ int main(int argc, char *argv[]){
main_config.launch_arguments=yon_char_parsed_copy(argv,argc); main_config.launch_arguments=yon_char_parsed_copy(argv,argc);
main_config.launch_size=argc; main_config.launch_size=argc;
if (getuid()!=0){
yon_ubl_status_box_render(yon_char_get_localised_from_lib(ROOT_WARNING_LABEL),BACKGROUND_IMAGE_FAIL_TYPE);
}
gtk_main(); gtk_main();
return 0; return 0;
} }
Loading…
Cancel
Save