|
|
|
|
@ -129,7 +129,7 @@ void yon_installation_progress_update(GFileMonitor *,GFile *,GFile *,GFileMonito
|
|
|
|
|
|
|
|
|
|
g_mutex_unlock(&main_config.progress_mutex);
|
|
|
|
|
|
|
|
|
|
if (size) {
|
|
|
|
|
if (size&&text) {
|
|
|
|
|
if (!yon_char_is_empty(text[size-1]) && text[size-1][0] == '(') {
|
|
|
|
|
char *current_copy = yon_char_new(text[size-1]);
|
|
|
|
|
char *percentage = yon_char_divide_search(current_copy, ")", -1);
|
|
|
|
|
@ -149,13 +149,12 @@ void yon_installation_progress_update(GFileMonitor *,GFile *,GFile *,GFileMonito
|
|
|
|
|
double fraction = atof(parsed[3]) / 100;
|
|
|
|
|
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->PackageInstallationProgress), fraction);
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel), yon_char_parsed_to_string(parsed, size, " "));
|
|
|
|
|
yon_char_parsed_free(parsed,size);
|
|
|
|
|
// yon_char_parsed_free(parsed,size);
|
|
|
|
|
}
|
|
|
|
|
if (!yon_char_is_empty(current_copy)) free(current_copy);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
yon_char_parsed_free(text, size);
|
|
|
|
|
size=0;
|
|
|
|
|
text=NULL;
|
|
|
|
|
}
|
|
|
|
|
@ -165,6 +164,7 @@ gboolean yon_progress_bar_start(main_window *widgets){
|
|
|
|
|
GFile *file_desc = g_file_new_for_path(progress_path);
|
|
|
|
|
widgets->install_info_monitor = g_file_monitor_file(file_desc,G_FILE_MONITOR_NONE,NULL,NULL);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->install_info_monitor),"changed",G_CALLBACK(yon_installation_progress_update),widgets);
|
|
|
|
|
// g_thread_new("progress",(GThreadFunc)yon_progress_thread_test,widgets);
|
|
|
|
|
g_object_unref(file_desc);
|
|
|
|
|
if (access(progress_path,F_OK)){
|
|
|
|
|
FILE *file = fopen(progress_path,"w");
|
|
|
|
|
|