diff --git a/source/ubl-settings-services.c b/source/ubl-settings-services.c index 84645ae..aaeb0df 100644 --- a/source/ubl-settings-services.c +++ b/source/ubl-settings-services.c @@ -74,7 +74,7 @@ void on_config_local_load(GtkWidget *,main_window *widgets){ yon_load_proceed(YON_CONFIG_LOCAL); yon_ubl_status_box_render(LIST_LOAD_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); g_thread_new("update",(GThreadFunc)yon_interface_update,widgets); - main_config.load_mode=1; + main_config.load_mode=YON_CONFIG_LOCAL; } } @@ -84,7 +84,7 @@ void on_config_global_load(GtkWidget *,main_window *widgets){ yon_load_proceed(YON_CONFIG_GLOBAL); yon_ubl_status_box_render(LIST_LOAD_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); g_thread_new("update",(GThreadFunc)yon_interface_update,widgets); - main_config.load_mode=0; + main_config.load_mode=YON_CONFIG_GLOBAL; } } @@ -94,7 +94,7 @@ void on_config_custom_load(GtkWidget *,main_window *widgets){ textdomain(template_ui_LocaleName); yon_ubl_status_box_render(GLOBAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); textdomain(LocaleName); - main_config.load_mode=3; + main_config.load_mode=YON_CONFIG_CUSTOM; g_thread_new("update",(GThreadFunc)yon_interface_update,widgets); } @@ -1157,6 +1157,11 @@ gboolean yon_interface_list_models_disconnect(main_window *widgets){ gtk_list_store_clear(widgets->UserList); gtk_list_store_clear(widgets->ConfigList); gtk_list_store_clear(widgets->TimersList); + gtk_spinner_start(GTK_SPINNER(widgets->SystemLoadingSpinner)); + gtk_spinner_start(GTK_SPINNER(widgets->UserLoadingSpinner)); + gtk_spinner_start(GTK_SPINNER(widgets->ConfigLoadingSpinner)); + gtk_spinner_start(GTK_SPINNER(widgets->SessionsLoadingSpinner)); + gtk_spinner_start(GTK_SPINNER(widgets->TimersLoadingSpinner)); g_signal_handlers_block_by_func(G_OBJECT(widgets->UserFiltersCombo),G_CALLBACK(on_filter_changed),widgets); g_signal_handlers_block_by_func(G_OBJECT(widgets->UserSearchEntry),G_CALLBACK(on_filter_changed),widgets); @@ -1178,6 +1183,11 @@ gboolean yon_interface_list_models_connect(main_window *widgets){ gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->UserUnitsTree),GTK_TREE_MODEL(widgets->UserSort)); gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->ConfigMainTree),GTK_TREE_MODEL(widgets->ConfigList)); gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->TimersMainTree),GTK_TREE_MODEL(widgets->TimersList)); + gtk_spinner_stop(GTK_SPINNER(widgets->SystemLoadingSpinner)); + gtk_spinner_stop(GTK_SPINNER(widgets->UserLoadingSpinner)); + gtk_spinner_stop(GTK_SPINNER(widgets->ConfigLoadingSpinner)); + gtk_spinner_stop(GTK_SPINNER(widgets->SessionsLoadingSpinner)); + gtk_spinner_stop(GTK_SPINNER(widgets->TimersLoadingSpinner)); g_signal_handlers_unblock_by_func(G_OBJECT(widgets->UserFiltersCombo),G_CALLBACK(on_filter_changed),widgets); g_signal_handlers_unblock_by_func(G_OBJECT(widgets->UserSearchEntry),G_CALLBACK(on_filter_changed),widgets); @@ -1344,7 +1354,7 @@ gboolean yon_interface_update_finish(main_window *widgets){ } } main_config.update_thread_active=0; - char *final = yon_char_unite(yon_char_get_localised_from_lib(SUCCESS_LABEL),". ",main_config.load_mode==0?yon_char_get_localised_from_lib(GLOBAL_LOAD_SUCCESS_LABEL):yon_char_get_localised_from_lib(LOCAL_LOAD_SUCCESS_LABEL),NULL); + char *final = yon_char_unite(yon_char_get_localised_from_lib(SUCCESS_LABEL),". ",main_config.load_mode==YON_CONFIG_GLOBAL?yon_char_get_localised_from_lib(GLOBAL_LOAD_SUCCESS_LABEL):yon_char_get_localised_from_lib(LOCAL_LOAD_SUCCESS_LABEL),NULL); yon_ubl_status_box_render(final,BACKGROUND_IMAGE_SUCCESS_TYPE); free(final); return G_SOURCE_REMOVE; @@ -1716,7 +1726,7 @@ void config_init(){ main_config.lock_load_global=0; main_config.lock_save_global=0; main_config.lock_save_local=0; - main_config.load_mode=1; + main_config.load_mode=YON_CONFIG_LOCAL; main_config.update_thread_active=0; main_config.launch_arguments=NULL; main_config.launch_size=0; @@ -1902,6 +1912,17 @@ void yon_main_window_complete(main_window *widgets){ widgets->SystemUnitsTree=yon_gtk_builder_get_widget(builder,"SystemUnitsTree"); widgets->MainNotebook=yon_gtk_builder_get_widget(builder,"MainNotebook"); + widgets->SystemLoadingOverlay=yon_gtk_builder_get_widget(builder,"SystemLoadingOverlay"); + widgets->SystemLoadingSpinner=yon_gtk_builder_get_widget(builder,"SystemLoadingSpinner"); + widgets->UserLoadingOverlay=yon_gtk_builder_get_widget(builder,"UserLoadingOverlay"); + widgets->UserLoadingSpinner=yon_gtk_builder_get_widget(builder,"UserLoadingSpinner"); + widgets->ConfigLoadingOverlay=yon_gtk_builder_get_widget(builder,"ConfigLoadingOverlay"); + widgets->ConfigLoadingSpinner=yon_gtk_builder_get_widget(builder,"ConfigLoadingSpinner"); + widgets->SessionsLoadingOverlay=yon_gtk_builder_get_widget(builder,"SessionsLoadingOverlay"); + widgets->SessionsLoadingSpinner=yon_gtk_builder_get_widget(builder,"SessionsLoadingSpinner"); + widgets->TimersLoadingOverlay=yon_gtk_builder_get_widget(builder,"TiemrsLoadingOverlay"); + widgets->TimersLoadingSpinner=yon_gtk_builder_get_widget(builder,"TimersLoadingSpinner"); + widgets->TooltipBox=yon_gtk_builder_get_widget(builder,"TooltipBox"); widgets->NameLabel=yon_gtk_builder_get_widget(builder,"NameLabel"); widgets->DescriptionLabel=yon_gtk_builder_get_widget(builder,"DescriptionLabel"); @@ -2100,6 +2121,11 @@ void yon_main_window_complete(main_window *widgets){ gtk_widget_set_sensitive(widgets->SystemUpdateButton,0); gtk_widget_set_sensitive(widgets->SystemPrevButton,0); } + gtk_overlay_add_overlay(GTK_OVERLAY(widgets->SystemLoadingOverlay),widgets->SystemLoadingSpinner); + gtk_overlay_add_overlay(GTK_OVERLAY(widgets->UserLoadingOverlay),widgets->UserLoadingSpinner); + gtk_overlay_add_overlay(GTK_OVERLAY(widgets->ConfigLoadingOverlay),widgets->ConfigLoadingSpinner); + gtk_overlay_add_overlay(GTK_OVERLAY(widgets->SessionsLoadingOverlay),widgets->SessionsLoadingSpinner); + gtk_overlay_add_overlay(GTK_OVERLAY(widgets->TimersLoadingOverlay),widgets->TimersLoadingSpinner); yon_gtk_tree_view_minimal_fixed_size_set_full(GTK_TREE_VIEW(widgets->UserUnitsTree)); yon_gtk_tree_view_minimal_fixed_size_set_full(GTK_TREE_VIEW(widgets->SystemUnitsTree)); yon_gtk_tree_view_minimal_fixed_size_set_full(GTK_TREE_VIEW(widgets->ConfigMainTree)); diff --git a/source/ubl-settings-services.h b/source/ubl-settings-services.h index 940ecb9..71b730e 100644 --- a/source/ubl-settings-services.h +++ b/source/ubl-settings-services.h @@ -241,6 +241,16 @@ typedef struct { rmb_menu_window *SystemMenu; GtkWidget *SystemServiceLabel; GtkWidget *SystemDescriptionLabel; + GtkWidget *SystemLoadingOverlay; + GtkWidget *SystemLoadingSpinner; + GtkWidget *UserLoadingOverlay; + GtkWidget *UserLoadingSpinner; + GtkWidget *ConfigLoadingOverlay; + GtkWidget *ConfigLoadingSpinner; + GtkWidget *SessionsLoadingOverlay; + GtkWidget *SessionsLoadingSpinner; + GtkWidget *TimersLoadingOverlay; + GtkWidget *TimersLoadingSpinner; GtkWidget *UserSearchEntry; GtkWidget *UserFiltersCombo; diff --git a/ubl-settings-services.glade b/ubl-settings-services.glade index 01455f3..c9c9ebf 100644 --- a/ubl-settings-services.glade +++ b/ubl-settings-services.glade @@ -1,5 +1,5 @@ - + @@ -13,6 +13,14 @@ + + True + False + + + True + False + @@ -69,6 +77,10 @@ SystemFilter + + True + False + @@ -85,6 +97,10 @@ + + True + False + True False @@ -371,6 +387,10 @@ UserFilter + + True + False + True False @@ -907,180 +927,183 @@ 0 in - + True False - vertical - - - True - True - liststore1 - vertical - - - - - - fixed - Configure in configuration - - - - - fixed - Configure in system - - - - - autosize - Service - True - - - - - False - True - 0 - - - + True - True - never + False + vertical - + True True - SystemList - 5 - both - 12 - - - + liststore1 + vertical - True fixed - 20 - Autostart - True - 0 - - - - 0 - - + Configure in configuration - True fixed - 20 - Autostop - True - 1 - - - - 1 - - + Configure in system - True - fixed - 20 - Block + autosize + Service True - 2 - - - - 2 - - + + + False + True + 0 + + + + + True + True + never - - True - fixed - 20 - Autostart - True - 3 + + True + True + SystemList + 5 + both + 12 - - - 3 - + + True + fixed + 20 + Autostart + True + 0 + + + + 0 + + + - - - - - True - fixed - 20 - Launched - True - 4 - - - 4 - + + True + fixed + 20 + Autostop + True + 1 + + + + 1 + + + - - - - - True - 10 - 20 - Unit - True - 5 - - - 11 - + + True + fixed + 20 + Block + True + 2 + + + + 2 + + + - - - - - True - fixed - 20 - - True - 6 - - - 5 - + + True + fixed + 20 + Autostart + True + 3 + + + + 3 + + + + + + + True + fixed + 20 + Launched + True + 4 + + + + 4 + + + + + + + True + 10 + 20 + Unit + True + 5 + + + + 11 + + + + + + + True + fixed + 20 + + True + 6 + + + + 5 + + + + + True + True + 1 + - True - True - 1 + -1 @@ -1528,177 +1551,180 @@ 0.019999999552965164 in - + True False - vertical - - - True - True - liststore1 - - - - - - Configure in configuration - - - - - Configure in system - - - - - Service - True - - - - - False - True - 0 - - - + True - True - never + False + vertical - + True True - UserList - 5 - both - 12 - - - + liststore1 - True - fixed - 20 - Autostart - True - 0 - - - - 0 - - + Configure in configuration - True - fixed - 20 - Autostop - True - 1 - - - - 1 - - + Configure in system - True - fixed - 20 - Block + Service True - 2 - - - - 2 - - + + + False + True + 0 + + + + + True + True + never - - True - fixed - 20 - Autostart - True + + True + True + UserList + 5 + both + 12 - - - 3 - + + True + fixed + 20 + Autostart + True + 0 + + + + 0 + + + - - - - - True - fixed - 20 - Launched - True - 4 - - - 4 - + + True + fixed + 20 + Autostop + True + 1 + + + + 1 + + + - - - - - True - 10 - 20 - Unit - True - 5 - - - 11 - + + True + fixed + 20 + Block + True + 2 + + + + 2 + + + - - - - - autosize - 20 - - True - True - 6 - - 250 + + True + fixed + 20 + Autostart + True + + + + 3 + + + + + + + True + fixed + 20 + Launched + True + 4 + + + + 4 + + + + + + + True + 10 + 20 + Unit + True + 5 + + + + 11 + + + + + + + autosize + 20 + + True + True + 6 + + + 250 + + + 5 + + - - 5 - + + True + True + 1 + - True - True - 1 + -1 @@ -1889,63 +1915,69 @@ 0 in - + True - True + False - + True True - ConfigList - both - - - - - True - fixed - 20 - File - 0 + + True + True + ConfigList + both - - - 0 - + + True + fixed + 20 + File + 0 + + + + 0 + + + - - - - - True - fixed - 20 - Change date - 1 - - - 1 - + + True + fixed + 20 + Change date + 1 + + + + 1 + + + - - - - - 20 - Description - True - 2 - - - 2 - + + 20 + Description + True + 2 + + + + 2 + + + + + -1 + @@ -2104,105 +2136,111 @@ 0 in - + True - True + False - + True True - SessionsList - both - - - - - True - fixed - 20 - Session ID - 0 + + True + True + SessionsList + both - - - 0 - + + True + fixed + 20 + Session ID + 0 + + + + 0 + + + - - - - - True - fixed - 20 - Status - 1 - - - 1 - + + True + fixed + 20 + Status + 1 + + + + 1 + + + - - - - - True - fixed - 20 - User ID - 2 - - - 2 - + + True + fixed + 20 + User ID + 2 + + + + 2 + + + - - - - - True - fixed - 20 - User name - 3 - - - 3 - + + True + fixed + 20 + User name + 3 + + + + 3 + + + - - - - - 20 - Seat ID - 4 - - - 4 - + + 20 + Seat ID + 4 + + + + 4 + + + - - - - - 20 - TTY - True - - - 6 - + + 20 + TTY + True + + + + 6 + + + + + -1 + @@ -2278,108 +2316,114 @@ 0.019999999552965164 in - + True - True + False - + True True - TimersList - both - - - - - True - fixed - 20 - Timer - 0 + + True + True + TimersList + both - - - 0 - + + True + fixed + 20 + Timer + 0 + + + + 0 + + + - - - - - True - fixed - 20 - Next - 1 - - - 1 - + + True + fixed + 20 + Next + 1 + + + + 1 + + + - - - - - True - fixed - 20 - Left - 2 - - - 2 - + + True + fixed + 20 + Left + 2 + + + + 2 + + + - - - - - True - fixed - 20 - Last - 3 - - - 3 - + + True + fixed + 20 + Last + 3 + + + + 3 + + + - - - - - True - fixed - 20 - Passed - 4 - - - 4 - + + True + fixed + 20 + Passed + 4 + + + + 4 + + + - - - - - 20 - Activates - True - 5 - - - 5 - + + 20 + Activates + True + 5 + + + + 5 + + + + + -1 +