Test fix for quick installation

pull/396/head
parent bbe19cbdfb
commit c41d059c51

@ -68,7 +68,11 @@ void on_path_choose(GtkWidget *,configuration_window *window){
filechooser_window *dialog = yon_config_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_SAVE); filechooser_window *dialog = yon_config_file_chooser_window_new(GTK_FILE_CHOOSER_ACTION_SAVE);
yon_gtk_window_setup(GTK_WINDOW(dialog->Window),GTK_WINDOW(window->Window),CONFIGURATION_MODE_TITLE_LABEL,icon_path,"filechooser_window"); yon_gtk_window_setup(GTK_WINDOW(dialog->Window),GTK_WINDOW(window->Window),CONFIGURATION_MODE_TITLE_LABEL,icon_path,"filechooser_window");
if (yon_file_chooser_start(dialog)==GTK_RESPONSE_APPLY){ if (yon_file_chooser_start(dialog)==GTK_RESPONSE_APPLY){
gtk_entry_set_text(GTK_ENTRY(window->PathEntry),dialog->last_success_selection); char *path = dialog->last_success_selection;
if (!strstr(dialog->last_success_selection,".")){
path = yon_char_append(dialog->last_any_selection,".ini");
}
gtk_entry_set_text(GTK_ENTRY(window->PathEntry),path);
free(dialog); free(dialog);
} }
} }

@ -8,21 +8,38 @@ int yon_installation_start(main_window *widgets){
void yon_quick_install(GtkWidget *self, main_window *widgets){ void yon_quick_install(GtkWidget *self, main_window *widgets){
if (!yon_installation_check_packages_size(widgets)) return; if (!yon_installation_check_packages_size(widgets)) return;
if (!main_config.dry_run){ main_config.save_configured=1;
main_config.save_configured=1; gtk_widget_hide(self);
gtk_widget_hide(self); gtk_widget_show(gtk_widget_get_parent(widgets->InstallationProgress));
gtk_widget_show(gtk_widget_get_parent(widgets->InstallationProgress)); pthread_create(&main_config.install_thread,NULL,on_quick_install_start,widgets);
pthread_create(&main_config.install_thread,NULL,on_config_save,widgets); gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION);
gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION); yon_page_init(widgets,YON_PAGE_INSTALLATION);
if (!yon_char_is_empty(main_config.config_load_path)){ yon_page_update(widgets);
char *command = quick_install_command(main_config.config_load_path); }
yon_launch_app_with_arguments(command,NULL);
} void *on_quick_install_start(void *data){
yon_page_init(widgets,YON_PAGE_INSTALLATION); main_window *widgets = (main_window*)data;
yon_page_update(widgets);
} else { g_idle_add((GSourceFunc)yon_progress_bar_start,widgets);
yon_launch("ubconfig --source system get /"); if (!main_config.dry_run){
yon_launch(ubinstall_dry_run_command); char *command = yon_debug_output("%s\n",quick_install_command(main_config.config_load_path));
} yon_debug_output("%s\n","Entered installation");
if (system(yon_debug_output("%s\n",command))){
gdk_threads_add_idle((GSourceFunc)on_install_error,widgets);
free(command);
g_mutex_lock(&main_config.install_mutex);
main_config.install_complete=1;
g_mutex_unlock(&main_config.install_mutex);
return 0;
};
free(command);
g_mutex_lock(&main_config.install_mutex);
main_config.install_complete=1;
g_mutex_unlock(&main_config.install_mutex);
g_idle_add((GSourceFunc)on_install_success,widgets);
} else {
yon_launch("ubconfig --source system get /");
}
return 0;
} }

@ -157,7 +157,7 @@ layout && /description:/ {\
#define yon_check_database_command "pacman -Syy >/dev/null" #define yon_check_database_command "pacman -Syy >/dev/null"
#define internet_tomezone_check_command "curl -s ipinfo.io/timezone" #define internet_tomezone_check_command "curl -s ipinfo.io/timezone"
#define ubinstall_dry_run_command "/usr/bin/bash -c \"ubinstall --dry-run" #define ubinstall_dry_run_command "/usr/bin/bash -c \"ubinstall --dry-run\""
#define os_name_get_command "sed -En 's/^PRETTY_NAME=[\"]*([^\"]+)[\"]*/\\1/p' /etc/os-release" #define os_name_get_command "sed -En 's/^PRETTY_NAME=[\"]*([^\"]+)[\"]*/\\1/p' /etc/os-release"
#define get_keyboard_layout_change_command "grep \"grp:\" /usr/share/X11/xkb/rules/base.lst | awk '{$1=$1; sub(/^!.*$/, \"\"); if ($1 ~ /^grp:/) {opt=$1; $1=\"\"; print opt \"|\" substr($0,2)}}'" #define get_keyboard_layout_change_command "grep \"grp:\" /usr/share/X11/xkb/rules/base.lst | awk '{$1=$1; sub(/^!.*$/, \"\"); if ($1 ~ /^grp:/) {opt=$1; $1=\"\"; print opt \"|\" substr($0,2)}}'"
@ -296,7 +296,7 @@ layout && /description:/ {\
#define get_localisation_command "ubconfig -ea --source global get [autoinstall] AUTOINSTALL[installer_locale] -- get [autoinstall] AUTOINSTALL['ubconfig set [locale] LANG'] -- get [locale] LANG" #define get_localisation_command "ubconfig -ea --source global get [autoinstall] AUTOINSTALL[installer_locale] -- get [autoinstall] AUTOINSTALL['ubconfig set [locale] LANG'] -- get [locale] LANG"
#define save_config_command yon_char_unite("/usr/bin/bash -c \"nice ubinstall autoinstall",main_config.debug_mode?" --debug":""," --noautoconfig --noinstall_extra\"", NULL) #define save_config_command yon_char_unite("/usr/bin/bash -c \"nice ubinstall autoinstall",main_config.debug_mode?" --debug":"","\"", NULL)
#define quick_install_command(path) yon_char_unite("nice ubinstall autoinstall",main_config.debug_mode?" --debug":""," --config='",path,"' --noautoconfig --noinstall_extra", NULL) #define quick_install_command(path) yon_char_unite("nice ubinstall autoinstall",main_config.debug_mode?" --debug":""," --config='",path,"' --noautoconfig --noinstall_extra", NULL)
#define set_user_config_command yon_char_unite("nice ubinstall autoconfig",main_config.debug_mode?" --debug":""," install_extra", NULL) #define set_user_config_command yon_char_unite("nice ubinstall autoconfig",main_config.debug_mode?" --debug":""," install_extra", NULL)
@ -1643,3 +1643,4 @@ void *yon_status_thread_update(main_window *widgets);
void yon_db_lock_update(GFileMonitor *,GFile *,GFile *,GFileMonitorEvent ,main_window *widgets); void yon_db_lock_update(GFileMonitor *,GFile *,GFile *,GFileMonitorEvent ,main_window *widgets);
void yon_db_unlock_update(GFileMonitor *,GFile *,GFile *,GFileMonitorEvent ,main_window *widgets); void yon_db_unlock_update(GFileMonitor *,GFile *,GFile *,GFileMonitorEvent ,main_window *widgets);
void on_config_install_success(GtkWidget *self, int state, main_window *widgets); void on_config_install_success(GtkWidget *self, int state, main_window *widgets);
void *on_quick_install_start(void *data);
Loading…
Cancel
Save