|
|
|
|
@ -227,6 +227,12 @@ int yon_tag_add(GtkBox *target,char *tag_label, char *tag_style, char *icon_name
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gboolean on_command_execute_success(GtkWidget *,gint status,main_window *widgets){
|
|
|
|
|
g_mutex_lock(&main_config.pulse_mutex);
|
|
|
|
|
main_config.pulse_active=0;
|
|
|
|
|
g_mutex_unlock(&main_config.pulse_mutex);
|
|
|
|
|
g_mutex_lock(&main_config.progress_mutex);
|
|
|
|
|
main_config.progress_active=0;
|
|
|
|
|
g_mutex_unlock(&main_config.progress_mutex);
|
|
|
|
|
if (!status){
|
|
|
|
|
gtk_revealer_set_transition_type(GTK_REVEALER(widgets->MainRevealer),GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
|
|
|
|
|
yon_ubl_status_box_render(OPERATION_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
@ -253,9 +259,13 @@ gboolean yon_terminal_get_progress(main_window *widgets){
|
|
|
|
|
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->InstallationProgress),percentage/100);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!gtk_revealer_get_child_revealed(GTK_REVEALER(widgets->MainRevealer))){
|
|
|
|
|
g_mutex_lock(&main_config.progress_mutex);
|
|
|
|
|
if (!main_config.progress_active){
|
|
|
|
|
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->InstallationProgress),0);
|
|
|
|
|
g_mutex_unlock(&main_config.progress_mutex);
|
|
|
|
|
return G_SOURCE_REMOVE;
|
|
|
|
|
}
|
|
|
|
|
g_mutex_unlock(&main_config.progress_mutex);
|
|
|
|
|
return G_SOURCE_CONTINUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -267,6 +277,11 @@ void *yon_command_execute_async(char *command,main_window *widgets){
|
|
|
|
|
yon_terminal_integrated_start(widgets->InstallTerminal,yon_debug_output("%s\n",command));
|
|
|
|
|
glong columns = vte_terminal_get_column_count(VTE_TERMINAL(widgets->InstallTerminal));
|
|
|
|
|
vte_terminal_set_size(VTE_TERMINAL(widgets->InstallTerminal),columns,20);
|
|
|
|
|
yon_ubl_status_box_render(OPERATION_IN_PROGRESS_LABEL,BACKGROUND_IMAGE_INFO_TYPE);
|
|
|
|
|
|
|
|
|
|
g_mutex_lock(&main_config.progress_mutex);
|
|
|
|
|
main_config.progress_active=1;
|
|
|
|
|
g_mutex_unlock(&main_config.progress_mutex);
|
|
|
|
|
gdk_threads_add_timeout(500,(GSourceFunc)yon_terminal_get_progress,widgets);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
@ -754,7 +769,8 @@ void config_init(){
|
|
|
|
|
main_config.load_mode=1;
|
|
|
|
|
main_config.save_config=1;
|
|
|
|
|
main_config.kernel_tabs=NULL;
|
|
|
|
|
main_config.addition_tabs=NULL;
|
|
|
|
|
main_config.pulse_active=0;
|
|
|
|
|
main_config.progress_active=0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_update_clicked(GtkWidget *, main_window *widgets){
|
|
|
|
|
@ -823,6 +839,17 @@ void on_changelog_clicked(GtkWidget *, kernels_tab *tab){
|
|
|
|
|
gtk_widget_show(window->window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gboolean yon_pulse_run(main_window *widgets){
|
|
|
|
|
gtk_progress_bar_pulse(GTK_PROGRESS_BAR(widgets->InstallationProgress));
|
|
|
|
|
g_mutex_lock(&main_config.pulse_mutex);
|
|
|
|
|
gboolean ret;
|
|
|
|
|
if (main_config.pulse_active) ret = 0;
|
|
|
|
|
else ret = 1;
|
|
|
|
|
|
|
|
|
|
g_mutex_unlock(&main_config.pulse_mutex);
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_build_execute(GtkWidget *, dictionary *dict){
|
|
|
|
|
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
|
|
|
|
|
install_window *window = yon_dictionary_get_data(dict->first->next,install_window*);
|
|
|
|
|
@ -833,6 +860,10 @@ void on_build_execute(GtkWidget *, dictionary *dict){
|
|
|
|
|
char *command = build_command(target,filename,debug,drivers);
|
|
|
|
|
yon_command_execute_async(command,widgets);
|
|
|
|
|
gtk_widget_destroy(window->window);
|
|
|
|
|
g_mutex_lock(&main_config.pulse_mutex);
|
|
|
|
|
main_config.pulse_active=1;
|
|
|
|
|
g_mutex_unlock(&main_config.pulse_mutex);
|
|
|
|
|
g_timeout_add(1000,(GSourceFunc)yon_pulse_run,widgets);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_building_clicked(GtkWidget *, main_window *widgets){
|
|
|
|
|
@ -932,6 +963,7 @@ void yon_main_window_complete(main_window *widgets){
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->LoadLocalMenuItem),"activate",G_CALLBACK(on_config_local_load),widgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->LoadCustomMenuItem),"activate",G_CALLBACK(on_config_custom_load),widgets);
|
|
|
|
|
|
|
|
|
|
gtk_progress_bar_set_pulse_step(GTK_PROGRESS_BAR(widgets->InstallationProgress),1);
|
|
|
|
|
GdkRGBA rgba;
|
|
|
|
|
vte_terminal_get_color_background_for_draw(VTE_TERMINAL(widgets->InstallTerminal),&rgba);
|
|
|
|
|
vte_terminal_set_color_cursor(VTE_TERMINAL(widgets->InstallTerminal),&rgba);
|
|
|
|
|
|