master #155

Merged
asmeron merged 6 commits from YanTheKaller/ubinstall-gtk:master into master 3 weeks ago

@ -272,6 +272,10 @@ msgstr ""
msgid "No device were chosen"
msgstr ""
#: source/ubl-strings.h:71
msgid "No partition were chosen"
msgstr ""
#: source/ubl-strings.h:73
msgid "Installation parameters"
msgstr ""
@ -1166,7 +1170,7 @@ msgid "Source"
msgstr ""
#: source/ubl-strings.h:331
msgid "Skip installation"
msgid "Skip configuration"
msgstr ""
#: source/ubl-strings.h:331

@ -284,6 +284,10 @@ msgstr "Доступные языки в системе"
msgid "No device were chosen"
msgstr "Устройство не выбрано"
#: source/ubl-strings.h:71
msgid "No partition were chosen"
msgstr "Раздел не выбран"
#: source/ubl-strings.h:73
msgid "Installation parameters"
msgstr "Параметры установки"
@ -1205,8 +1209,8 @@ msgid "Source"
msgstr "Источник"
#: source/ubl-strings.h:331
msgid "Skip installation"
msgstr "Пропустить установку"
msgid "Skip configuration"
msgstr "Пропустить настройку"
msgid ""
"<b>Attention!</b> The system will be installed in the selected partition. "

@ -11,7 +11,7 @@ int yon_grub_install_save(main_window *widgets){
char *cur_device;
gtk_tree_model_get(model,&iter,0,&cur_device,-1);
if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GrubInstallPartitionTree)),&model,&iter)){
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_DEVICE_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_PART_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(widgets->GrubInstallPartitionTree));
return 0;
}
@ -45,7 +45,7 @@ int yon_grub_update_save(main_window *widgets){
char *cur_device;
gtk_tree_model_get(model,&iter,0,&cur_device,-1);
if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GrubUpdatePartitionTree)),&model,&iter)){
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_DEVICE_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_PART_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(widgets->GrubUpdatePartitionTree));
return 0;
}

@ -54,7 +54,7 @@ int yon_install_separate_save(main_window *widgets){
char *device;
gtk_tree_model_get(model,&iter,0,&device,-1);
if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->NextInstallationSysSectionTree)),&model,&iter)){
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_DEVICE_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_PART_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(widgets->CommonInstallationDevicesTree));
return 0;
}
@ -124,7 +124,7 @@ int yon_install_same_partition_save(main_window *widgets){
char *device;
gtk_tree_model_get(model,&iter,0,&device,-1);
if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->SamePlacePartTree)),&model,&iter)){
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_DEVICE_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_PART_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(widgets->CommonInstallationDevicesTree));
return 0;
}

@ -114,7 +114,7 @@ void on_language_window_accept(GtkWidget *,dictionary *dict){
char *final = "";
for_iter(widgets->LanguagesList,&iter){
char *code, *labl;
gtk_tree_model_get(GTK_TREE_MODEL(widgets->LanguagesList),&iter,1,&labl,2,&code,-1);
gtk_tree_model_get(GTK_TREE_MODEL(widgets->LanguagesList),&iter,1,&code,2,&labl,-1);
if (yon_char_parsed_check_exist(lang_parsed,size,code)!=-1){
gtk_list_store_set(widgets->LanguagesList,&iter,0,1,-1);
char *tmp = yon_char_unite(final,!yon_char_is_empty(final)?";":"",labl,NULL);
@ -137,7 +137,7 @@ void on_language_window_accept(GtkWidget *,dictionary *dict){
for_iter(GTK_TREE_MODEL(window->liststore1),&iter){
char *current;
int status;
gtk_tree_model_get(GTK_TREE_MODEL(window->liststore1),&iter,0,&status,1,&current,-1);
gtk_tree_model_get(GTK_TREE_MODEL(window->liststore1),&iter,0,&status,2,&current,-1);
if (status)
yon_char_parsed_add_or_create_if_exists(parsed,&size,current);
}
@ -211,6 +211,7 @@ void on_language_clicked(GtkWidget *, main_window *widgets){
yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets);
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
g_signal_connect(G_OBJECT(window->SaveButton),"clicked",G_CALLBACK(on_language_window_accept),dict);
gtk_tree_view_column_clicked(gtk_tree_view_get_column(GTK_TREE_VIEW(window->LanguagesTree),0));
gtk_widget_show(window->MainWindow);
}

@ -430,14 +430,16 @@ void on_page_cancel_clicked(GtkWidget *, main_window *widgets){
gtk_widget_set_sensitive(widgets->ConfigurationModeMenuItem,1);
yon_page_update(widgets);
dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
data->action_text=INTERRUPT_TEXT_LABEL;
data->title=WARNING_TITLE_LABEL;
if (yon_confirmation_dialog_call(widgets->MainWindow,data)==GTK_RESPONSE_ACCEPT ){
if (main_config.install_thread){
gtk_widget_hide(gtk_widget_get_parent(widgets->InstallationProgress));
gtk_widget_hide(gtk_widget_get_parent(widgets->PackageInstallationProgress));
pthread_cancel((pthread_t)main_config.install_thread);
if (main_config.install_thread){
dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
data->action_text=INTERRUPT_TEXT_LABEL;
data->title=WARNING_TITLE_LABEL;
if (yon_confirmation_dialog_call(widgets->MainWindow,data)==GTK_RESPONSE_ACCEPT ){
if (main_config.install_thread){
gtk_widget_hide(gtk_widget_get_parent(widgets->InstallationProgress));
gtk_widget_hide(gtk_widget_get_parent(widgets->PackageInstallationProgress));
pthread_cancel((pthread_t)main_config.install_thread);
}
}
}
}

@ -77,16 +77,16 @@ void yon_region_init(main_window *widgets){
GtkTreeIter iter;
gtk_list_store_clear(widgets->LanguagesList);
parsed = yon_file_open(languages_path,&size);
yon_locale_init();
config_str languages = yon_config_load(languages_command,&size);
for (int i=0;i<size;i++){
int cur_size;
yon_char_remove_last_symbol(parsed[i],'\n')
config_str cur = yon_char_parse(parsed[i],&cur_size,";");
if (cur_size){
int parsed_size;
config_str parsed = yon_char_parse(languages[i],&parsed_size,"|");
gtk_list_store_append(widgets->LanguagesList,&iter);
gtk_list_store_set(widgets->LanguagesList,&iter,0,0,1,_(cur[1]),2,cur[0],-1);
}
yon_char_parsed_free(cur,cur_size);
gtk_list_store_set(widgets->LanguagesList,&iter,0,0,1,parsed[0],2,parsed[1],3,parsed[2],-1);
}
yon_char_parsed_free(parsed,size);
if (lang)

@ -9,7 +9,7 @@ int yon_install_options_save(GtkWidget *device_tree, GtkWidget *part_tree,char *
return 0;
}
if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(part_tree)),&model2,&itar)){
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_DEVICE_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_PART_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(part_tree));
return 0;
}

@ -554,6 +554,18 @@ void config_init(){
main_config.force_ini=NULL;
main_config.network_types = g_hash_table_new(g_str_hash,g_str_equal);
main_config.cur_slide=0;
main_config.languages = g_hash_table_new(g_str_hash,g_str_equal);
int size;
config_str languages = yon_config_load(languages_command,&size);
for (int i=0;i<size;i++){
yon_char_remove_last_symbol(languages[i],'\n');
int parsed_size;
config_str parsed = yon_char_parse(languages[i],&parsed_size,"|");
g_hash_table_insert(main_config.languages,yon_char_new(parsed[0]),yon_char_new(languages[i]));
yon_char_parsed_free(parsed,parsed_size);
}
yon_char_parsed_free(languages,size);
}
// void on_root_get_root(char *argline){

@ -272,6 +272,8 @@ layout && /description:/ {\
#define default_langs(size) yon_char_parsed_new(size,"en_US.UTF-8","ru_RU.UTF-8",NULL);
#define languages_command "while IFS= read -ru3 SELECT_LOCALE; do SELECT_LOCALE=\"${SELECT_LOCALE% *}\"; [[ $(< /usr/share/i18n/locales/${SELECT_LOCALE%.*}) =~ (\"language\"[[:blank:]]*\\\"([^\\\"]*)\\\".*\"territory\"[[:blank:]]*\\\"([^\\\"]*)\\\".*\"country_name\"[[:blank:]]*\\\"([^\\\"]*)\\\".*\"lang_name\"[[:blank:]]*\\\"([^\\\"]*)\\\")|(\"language\"[[:blank:]]*\\\"([^\\\"]*)\\\".*\"territory\"[[:blank:]]*\\\"([^\\\"]*)\\\".*\"lang_name\"[[:blank:]]*\\\"([^\\\"]*)\\\")|(\"language\"[[:blank:]]*\\\"([^\\\"]*)\\\".*\"territory\"[[:blank:]]*\\\"([^\\\"]*)\\\") ]] && echo \"${SELECT_LOCALE}|${BASH_REMATCH[2]}${BASH_REMATCH[7]}${BASH_REMATCH[11]}${BASH_REMATCH[5]:+ (${BASH_REMATCH[5]})}${BASH_REMATCH[9]:+ (${BASH_REMATCH[9]})}|${BASH_REMATCH[3]}${BASH_REMATCH[8]}${BASH_REMATCH[12]}${BASH_REMATCH[4]:+ (${BASH_REMATCH[4]})}\" || echo \"${SELECT_LOCALE}\"; done 3< \"/usr/share/i18n/SUPPORTED\""
#define install_common_parameters \
AUTOINSTALL_TYPE_INSTALL,\
AUTOINSTALL_DEVICE,\
@ -390,6 +392,8 @@ typedef struct {
int exit_accepted;
GMutex progress_mutex;
GMutex install_mutex;
GHashTable *languages;
int arg_size;
config_str arg_target;

@ -74,6 +74,7 @@ NULL)
#define AVALIABLE_LANGUAGES_TITLE_LABEL _("Available languages in the system")
#define NO_DEVICE_CHOSEN_LABEL _("No device were chosen")
#define NO_PART_CHOSEN_LABEL _("No partition were chosen")
#define INSTALLATION_PARAMETERS_LABEL _("Installation parameters")
@ -340,4 +341,4 @@ NULL)
// #define _LABEL _("Recovery section")
// #define _LABEL _("Start installation scenario")
// #define _LABEL _("Source")
// #define _LABEL _("Skip installation")
// #define _LABEL _("Skip configuration")

@ -1,14 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkListStore" id="liststore1">
<columns>
<!-- column-name gboolean1 -->
<!-- column-name Chosen -->
<column type="gboolean"/>
<!-- column-name gchararray1 -->
<!-- column-name Code -->
<column type="gchararray"/>
<!-- column-name gchararray2 -->
<!-- column-name Name -->
<column type="gchararray"/>
<!-- column-name Description -->
<column type="gchararray"/>
</columns>
</object>
@ -73,7 +75,9 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="model">liststore1</property>
<property name="headers-visible">False</property>
<property name="search-column">1</property>
<property name="enable-grid-lines">both</property>
<property name="activate-on-single-click">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
@ -89,14 +93,51 @@
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Locale</property>
<child>
<object class="GtkCellRendererText"/>
<object class="GtkCellRendererText">
<property name="wrap-mode">word</property>
<property name="wrap-width">150</property>
</object>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="sizing">autosize</property>
<property name="min-width">35</property>
<property name="title" translatable="yes">Language</property>
<property name="expand">True</property>
<child>
<object class="GtkCellRendererText">
<property name="wrap-mode">word</property>
<property name="wrap-width">100</property>
</object>
<attributes>
<attribute name="text">2</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="sizing">autosize</property>
<property name="title" translatable="yes">Territory</property>
<property name="expand">True</property>
<child>
<object class="GtkCellRendererText">
<property name="wrap-mode">word</property>
<property name="wrap-width">125</property>
</object>
<attributes>
<attribute name="text">3</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<!-- Generated with glade 3.40.0 -->
<interface domain="ubinstall-gtk">
<requires lib="gtk+" version="3.24"/>
<!-- interface-css-provider-path ubinstall-gtk.css -->
@ -108,11 +108,13 @@
</object>
<object class="GtkListStore" id="LanguagesList">
<columns>
<!-- column-name gboolean1 -->
<!-- column-name Chosen -->
<column type="gboolean"/>
<!-- column-name gchararray1 -->
<!-- column-name Name -->
<column type="gchararray"/>
<!-- column-name gchararray2 -->
<!-- column-name Code -->
<column type="gchararray"/>
<!-- column-name Description -->
<column type="gchararray"/>
</columns>
</object>
@ -10672,7 +10674,7 @@ separately into the selected partition.</property>
</child>
<child>
<object class="GtkButton" id="SkipInstallationButton">
<property name="label" translatable="yes">Skip installation</property>
<property name="label" translatable="yes">Skip configuration</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">image28</property>

Loading…
Cancel
Save