Status messages logic edit

pull/51/head
parent fca1c11f50
commit 7ae13249c5

@ -391,7 +391,25 @@ void *yon_interface_update(main_window *widgets){
kernels = yon_resource_open_file(kernels_addon_path, &kernels_size);
for (int i=1;i<kernels_size;i++){
additions_kernels_tab *tab = yon_additions_tab_row_new(GTK_LIST_BOX(widgets->AdditionsPackageBox),kernels[i],widgets);
g_thread_new("tags_install_tread",(GThreadFunc)yon_tab_set_installed,tab);
if (i+1==kernels_size) {
g_thread_join(g_thread_new("tags_install_tread",(GThreadFunc)yon_tab_set_installed,tab));
char *status_text = NULL;
switch (main_config.action){
case ACTION_LOAD:
status_text = main_config.load_mode==1?main_config.local_load_success_localised:main_config.global_load_success_localised;
break;
case ACTION_SAVE:
status_text = "";
break;
case ACTION_TERMINAL_EXECUTE_SUCCESS:
status_text = OPERATION_SUCCESS_LABEL;
break;
case ACTION_TERMINAL_EXECUTE_FAIL:
status_text = OPERATION_ERROR_LABEL;
break;
}
yon_ubl_status_box_render(status_text,BACKGROUND_IMAGE_SUCCESS_TYPE);
}
gtk_widget_set_can_focus(gtk_widget_get_parent(tab->main_box),0);
}
}
@ -472,11 +490,10 @@ gboolean on_command_execute_success(GtkWidget *,gint status,main_window *widgets
main_config.progress_active=0;
g_mutex_unlock(&main_config.progress_mutex);
if (!status){
yon_ubl_status_box_render(OPERATION_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
on_update_clicked(NULL,widgets);
main_config.action=ACTION_TERMINAL_EXECUTE_SUCCESS;
} else {
yon_ubl_status_box_render(OPERATION_ERROR_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
main_config.action=ACTION_TERMINAL_EXECUTE_FAIL;
}
gtk_widget_set_sensitive(widgets->UpdateButton,1);
dictionary *dict = NULL;
@ -762,6 +779,7 @@ dialog_window *yon_dialog_window_new(){
}
void on_module_install_clicked(GtkWidget *self,dictionary *dict){
main_config.action=ACTION_TERMINAL_EXECUTE_SUCCESS;
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
kernels_tab *tab = yon_dictionary_get_data(dict->first->next,kernels_tab*);
char *action_text = NULL;
@ -814,6 +832,7 @@ void on_module_install_clicked(GtkWidget *self,dictionary *dict){
}
void on_package_install_clicked(GtkWidget *self,dictionary *dict){
main_config.action=ACTION_TERMINAL_EXECUTE_SUCCESS;
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
kernels_tab *tab = yon_dictionary_get_data(dict->first->next,kernels_tab*);
char *action_text = NULL;
@ -876,6 +895,7 @@ void on_module_remove_done(GtkWidget *self, int state, kernels_tab *tab){
}
void on_module_remove_clicked(GtkWidget *self,dictionary *dict){
main_config.action=ACTION_TERMINAL_EXECUTE_SUCCESS;
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
kernels_tab *tab = yon_dictionary_get_data(dict->first->next,kernels_tab*);
int size;
@ -965,6 +985,7 @@ void on_module_remove_clicked(GtkWidget *self,dictionary *dict){
}
void on_package_remove_clicked(GtkWidget *self,dictionary *dict){
main_config.action=ACTION_TERMINAL_EXECUTE_SUCCESS;
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
kernels_tab *tab = yon_dictionary_get_data(dict->first->next,kernels_tab*);
int size;
@ -1269,9 +1290,16 @@ void config_init(){
main_config.addition_tabs=NULL;
main_config.progress_active=0;
main_config.update_active=0;
main_config.action = ACTION_LOAD;
textdomain(template_ui_LocaleName);
main_config.local_load_success_localised = LOCAL_LOAD_SUCCESS_LABEL;
main_config.global_load_success_localised = GLOBAL_LOAD_SUCCESS_LABEL;
textdomain(LocaleName);
}
void on_update_clicked(GtkWidget *, main_window *widgets){
void on_update_clicked(GtkWidget *self, main_window *widgets){
if (self)
main_config.action=ACTION_LOAD;
int lock=0;
g_mutex_lock(&main_config.update_mutex);
lock = main_config.update_active;

@ -75,6 +75,13 @@ string version_application;
char *local;
enum ACTION_TYPE{
ACTION_LOAD,
ACTION_SAVE,
ACTION_TERMINAL_EXECUTE_SUCCESS,
ACTION_TERMINAL_EXECUTE_FAIL
};
typedef struct {
template_config_fields
GMutex mutex;
@ -85,6 +92,10 @@ typedef struct {
int progress_active;
config_str launch_arguments;
int launch_size;
enum ACTION_TYPE action;
char *local_load_success_localised;
char *global_load_success_localised;
int update_active;
GMutex update_mutex;

Loading…
Cancel
Save