diff --git a/gresource.xml b/gresource.xml index fc38ddb..cfb8b35 100644 --- a/gresource.xml +++ b/gresource.xml @@ -19,6 +19,8 @@ ubinstall-gtk-configuration-mode.glade ubinstall-gtk-source.glade ubinstall-gtk-source-element.glade + ubinstall-gtk-layouts.glade + ubinstall-gtk-keyboard-layouts.glade ubinstall-gtk.css diff --git a/locale/ubinstall-gtk.pot b/locale/ubinstall-gtk.pot index 68c41b1..cb0e8ea 100644 --- a/locale/ubinstall-gtk.pot +++ b/locale/ubinstall-gtk.pot @@ -1173,10 +1173,6 @@ msgstr "" msgid "Skip configuration" msgstr "" -#: source/ubl-strings.h:331 -msgid "Are you sure want to exit and\ninterrupt installation process?" -msgstr "" - #: source/ubl-strings.h:331 msgid "Are you sure want to interrupt installation process?" msgstr "" @@ -1201,4 +1197,117 @@ msgstr "" msgid "Module:" msgstr "" +#: source/ubl-strings.h:331 +msgid "Yes, I agree to the License Agreement" +msgstr "" + +#: source/ubl-strings.h:331 +msgid "No, I do not agree" +msgstr "" + +#: source/ubl-strings.h:11 +msgid "Keyboard layouts:" +msgstr "" + + + +#: source/ubl-strings.h:13 +msgid "Move layout up" +msgstr "" + +#: source/ubl-strings.h:14 +msgid "Move layout down" +msgstr "" + +#: source/ubl-strings.h:15 +msgid "Add layout" +msgstr "" + +#: source/ubl-strings.h:24 +msgid "Layouts:" +msgstr "" + +#: source/ubl-strings.h:25 +msgid "Default layout" +msgstr "" + +#: source/ubl-strings.h:26 +msgid "Changing the layout:" +msgstr "" + + +#: source/ubl-strings.h:28 +msgid "Set Compose (Multi_Key) to the right Win key" +msgstr "" + +#: source/ubl-strings.h:29 +msgid "Scroll Lock indication when switching layouts" +msgstr "" + +#: source/ubl-strings.h:32 +msgid "NumLock:" +msgstr "" + +#: source/ubl-strings.h:34 +msgid "Key layout and switch:" +msgstr "" + +#: source/ubl-strings.h:37 +msgid "Variant" +msgstr "" + +#: source/ubl-strings.h:20 +msgid "Are you sure you want to remove current layout?" +msgstr "" + +#: source/ubl-strings.h:20 +msgid "Layout deletion" +msgstr "" + +#: source/ubl-strings.h:20 +msgid "Manual input:" +msgstr "" + +#: source/ubl-strings.h:20 +msgid "Specify your preferred keyboard settings" +msgstr "" + +#: source/ubl-strings.h:20 +msgid "Available locales in the system:" +msgstr "" + +#: source/ubl-strings.h:20 +msgid "System locale" +msgstr "" + +#: source/ubl-strings.h:20 +msgid "Locale" +msgstr "" + +#: source/ubl-strings.h:20 +msgid "Language" +msgstr "" + +#: source/ubl-strings.h:20 +msgid "Territory" +msgstr "" + +#: source/ubl-strings.h:20 +msgid "Add locales" +msgstr "" + +#: source/ubl-strings.h:20 +msgid "Specify your preferred system languages" +msgstr "" + +#: source/ubl-strings.h:20 +msgid "Remove locale" +msgstr "" + +#: source/ubl-strings.h:20 +msgid "New partition:" +msgstr "" +#: source/ubl-strings.h:20 +msgid "Attention! The selected partition will be reduced and the next new partition will be created. The data will be saved in the selected partition. The new partition will be formatted." +msgstr "" \ No newline at end of file diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index 20d9b39..d7393e2 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -101,8 +101,7 @@ msgid "Installation completion" msgstr "Завершение установки" #: source/ubl-strings.h:24 -msgid "" -"Deleting all data on the selected disk and then installing the system" +msgid "Deleting all data on the selected disk and then installing the system" msgstr "" "Удаление всех данных на выбранном диске с последующей установкой системы " "UBLinux" @@ -120,7 +119,8 @@ msgid "Installation on the same partition as another system" msgstr "Установка в раздел другой системы" #: source/ubl-strings.h:28 -msgid "Unpacking the system into an existing system" +#, fuzzy +msgid "Unpacking the file system into an existing system" msgstr "Установить ОС в уже существующий раздел" #: source/ubl-strings.h:29 source/ubl-strings.h:281 @@ -413,10 +413,11 @@ msgid "Format" msgstr "Форматировать" #: source/ubl-strings.h:107 +#, fuzzy msgid "" "You have system installed on your computer.\n" "You can reboot and use your new system\n" -"or continue working in the environment, booted from the Live image." +"or continue working in the system Live environment." msgstr "" "На вашем компьютере установлена система.\n" "Вы можете перезагрузить и использовать свою новую систему\n" @@ -509,8 +510,8 @@ msgstr "Ошибка установки" #: source/ubl-strings.h:135 msgid "" -"Attention! The system will be installed on the selected partition with " -"OS already installed. All user data will be saved." +"Attention! The system will be installed on the selected partition with OS " +"already installed. All user data will be saved." msgstr "" "Внимание! В выбранный раздел будет произведена установка системы. " "Если не менять тип ФС и не форматировать, все данные на разделе будут " @@ -663,10 +664,6 @@ msgstr "" "Вы уверены, что хотите закрыть программу и\n" "прервать процесс установки?" -#: source/ubl-strings.h:331 -msgid "Are you sure want to interrupt installation process?" -msgstr "Вы уверены, что хотите прервать процесс установки?" - #: source/ubl-strings.h:187 msgid "Are you sure want to reboot system?" msgstr "Вы уверены что хотите перезагрузить систему?" @@ -1212,6 +1209,94 @@ msgstr "Источник" msgid "Skip configuration" msgstr "Пропустить настройку" +#: source/ubl-strings.h:331 +msgid "Are you sure want to interrupt installation process?" +msgstr "Вы уверены, что хотите прервать процесс установки?" + +#: source/ubl-strings.h:331 +msgid "Repeating values" +msgstr "Повторяющиеся значения" + +#: source/ubl-strings.h:331 +msgid "Package information" +msgstr "Информация о пакете" + +#: source/ubl-strings.h:331 +msgid "Package:" +msgstr "Пакет:" + +#: source/ubl-strings.h:331 +msgid "Module:" +msgstr "Модуль:" + +#: source/ubl-strings.h:331 +msgid "Yes, I agree to the License Agreement" +msgstr "Да, я согласен с лицензионным соглашением" + +#: source/ubl-strings.h:331 +msgid "No, I do not agree" +msgstr "Нет, я не согласен" + +#: source/ubl-strings.h:11 +msgid "Keyboard layouts:" +msgstr "Раскладки клавиатуры:" + +#: source/ubl-strings.h:13 +msgid "Move layout up" +msgstr "Переместить раскладку выше" + +#: source/ubl-strings.h:14 +msgid "Move layout down" +msgstr "Переместить раскладку ниже" + +#: source/ubl-strings.h:15 +msgid "Add layout" +msgstr "Добавить раскладку" + +#: source/ubl-strings.h:24 +msgid "Layouts:" +msgstr "Раскладки:" + +#: source/ubl-strings.h:25 +msgid "Default layout" +msgstr "Раскладка по умолчанию" + +#: source/ubl-strings.h:26 +msgid "Changing the layout:" +msgstr "Смена раскладки:" + +#: source/ubl-strings.h:28 +msgid "Set Compose (Multi_Key) to the right Win key" +msgstr "Установить Compose (Multi_Key) на клавишу \"правая Win\"" + +#: source/ubl-strings.h:29 +msgid "Scroll Lock indication when switching layouts" +msgstr "Индикация Scroll Lock при переключении раскладки" + +#: source/ubl-strings.h:32 +msgid "NumLock:" +msgstr "NumLock:" + +#: source/ubl-strings.h:34 +msgid "Key layout and switch:" +msgstr "Раскладка клавиш и переключатель:" + +#: source/ubl-strings.h:37 +msgid "Variant" +msgstr "Вариант" + +#: source/ubl-strings.h:20 +msgid "Are you sure you want to remove current layout?" +msgstr "Вы уверены что хотите удалить данную раскладку?" + +#: source/ubl-strings.h:20 +msgid "Layout deletion" +msgstr "Удаление раскладки" + +#: source/ubl-strings.h:20 +msgid "Manual input:" +msgstr "Ручной выбор:" + msgid "" "Attention! The system will be installed in the selected partition. " "If you do not change the FS type or format, all data on the partition " @@ -3025,18 +3110,46 @@ msgstr "Зулу" msgid "Zurich" msgstr "Цюрих" -#: source/ubl-strings.h:331 -msgid "Repeating values" -msgstr "Повторяющиеся значения" +#: source/ubl-strings.h:20 +msgid "Specify your preferred keyboard settings" +msgstr "Укажите предпочитаемые настройки клавиатуры" -#: source/ubl-strings.h:331 -msgid "Package information" -msgstr "Информация о пакете" +#: source/ubl-strings.h:20 +msgid "Available locales in the system:" +msgstr "Доступные языки системы:" -#: source/ubl-strings.h:331 -msgid "Package:" -msgstr "Пакет:" +#: source/ubl-strings.h:20 +msgid "System locale" +msgstr "Язык системы" -#: source/ubl-strings.h:331 -msgid "Module:" -msgstr "Модуль:" +#: source/ubl-strings.h:20 +msgid "Locale" +msgstr "Локаль" + +#: source/ubl-strings.h:20 +msgid "Language" +msgstr "Язык" + +#: source/ubl-strings.h:20 +msgid "Territory" +msgstr "Территория" + +#: source/ubl-strings.h:20 +msgid "Add locales" +msgstr "Добавить локаль" + +#: source/ubl-strings.h:20 +msgid "Specify your preferred system languages" +msgstr "Укажите предпочитаемый язык системы" + +#: source/ubl-strings.h:20 +msgid "Remove locale" +msgstr "Удалить локаль" + +#: source/ubl-strings.h:20 +msgid "New partition:" +msgstr "Новый раздел:" + +#: source/ubl-strings.h:20 +msgid "Attention! The selected partition will be reduced and the next new partition will be created. The data will be saved in the selected partition. The new partition will be formatted." +msgstr "Внимание! Выбранный раздел будет уменьшен и будет создан следующий новый раздел. На выбранном разделе данные будут сохранены. Новый раздел будет отформатирован." \ No newline at end of file diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index acc10a7..eb5a90b 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -72,6 +72,8 @@ set(DEPENDFILES ../ubinstall-gtk-configuration-mode.glade ../ubinstall-gtk-source.glade ../ubinstall-gtk-source-element.glade + ../ubinstall-gtk-layouts.glade + ../ubinstall-gtk-keyboard-layouts.glade ../gresource.xml ../ubinstall-gtk.css ../modules.csv @@ -147,6 +149,7 @@ set(SOURCE_FILES ubinstall-gtk-install-start.c ubinstall-gtk-startup-services.c ubinstall-gtk-kernel.c + ubinstall-gtk-language.c ubinstall-gtk.h ubl-strings.h ) diff --git a/source/ubinstall-gtk-advanced.c b/source/ubinstall-gtk-advanced.c index 2d87075..b5b4a89 100644 --- a/source/ubinstall-gtk-advanced.c +++ b/source/ubinstall-gtk-advanced.c @@ -119,7 +119,7 @@ void yon_advanced_partition_set_from_section(advanced_partition *part, advanced_ gtk_switch_set_active(GTK_SWITCH(part->FormatSwitch),1); if (section->size){ gtk_spin_button_set_value(GTK_SPIN_BUTTON(part->SizeSpin),section->size); - gtk_combo_box_set_active(GTK_COMBO_BOX(part->SizeCombo),yon_get_size_get_from_letter(section->size_letter)); + gtk_combo_box_set_active(GTK_COMBO_BOX(part->SizeCombo),yon_get_size_get_from_letter(section->size_letter)-1); } if (section->part_label){ gtk_entry_set_text(GTK_ENTRY(part->PartLabelEntry),section->part_label); diff --git a/source/ubinstall-gtk-components.c b/source/ubinstall-gtk-components.c index ad413ef..1af6ded 100644 --- a/source/ubinstall-gtk-components.c +++ b/source/ubinstall-gtk-components.c @@ -49,7 +49,7 @@ int yon_kernel_addon_save(main_window *widgets){ GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->KernelAddonListBox)); char *install_modules = yon_char_new(parameter); for(GList *iter = list;iter;iter = iter->next){ - kernel_row *row = g_object_get_data(G_OBJECT(iter->data),"kernel_row"); + kernel_addon_row *row = g_object_get_data(G_OBJECT(iter->data),"kernel_row"); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(row->InstallCheck))){ char *temp = yon_char_append_element(install_modules,row->modules," "); if (!yon_char_is_empty(install_modules)) free(install_modules); @@ -195,24 +195,27 @@ void yon_os_components_init(main_window *widgets){ int size = 0; GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->OSSoftwareListBox)); GList *iter; - if (!list){ - gtk_overlay_add_overlay(GTK_OVERLAY(widgets->OSOverlay),widgets->OSSpinner); - gtk_spinner_start(GTK_SPINNER(widgets->OSSpinner)); - gtk_widget_show(widgets->OSSpinner); - g_thread_new("geag",(GThreadFunc)yon_os_components_setup,widgets); - while(gtk_events_pending()) gtk_main_iteration(); - list = gtk_container_get_children(GTK_CONTAINER(widgets->OSSoftwareListBox)); - for(iter = list;iter;iter=iter->next){ - os_row *row = g_object_get_data(iter->data,"kernel_row"); - int cur_size = 0; - gtk_widget_realize(row->RowBox); - gtk_widget_get_preferred_width(row->RowBox,&cur_size,NULL); - if (sizenext){ - os_row *row = g_object_get_data(iter->data,"kernel_row"); - gtk_widget_set_size_request(row->RowBox,size,-1); - } + for (iter=list;iter;iter=iter->next){ + os_row *row = g_object_get_data(iter->data,"kernel_row"); + free(row); + gtk_widget_destroy(GTK_WIDGET(iter->data)); + } + gtk_overlay_add_overlay(GTK_OVERLAY(widgets->OSOverlay),widgets->OSSpinner); + gtk_spinner_start(GTK_SPINNER(widgets->OSSpinner)); + gtk_widget_show(widgets->OSSpinner); + g_thread_new("geag",(GThreadFunc)yon_os_components_setup,widgets); + while(gtk_events_pending()) gtk_main_iteration(); + list = gtk_container_get_children(GTK_CONTAINER(widgets->OSSoftwareListBox)); + for(iter = list;iter;iter=iter->next){ + os_row *row = g_object_get_data(iter->data,"kernel_row"); + int cur_size = 0; + gtk_widget_realize(row->RowBox); + gtk_widget_get_preferred_width(row->RowBox,&cur_size,NULL); + if (sizenext){ + os_row *row = g_object_get_data(iter->data,"kernel_row"); + gtk_widget_set_size_request(row->RowBox,size,-1); } char *modules = config(modules_parameter); diff --git a/source/ubinstall-gtk-decorations.c b/source/ubinstall-gtk-decorations.c index 9545480..603f6d8 100644 --- a/source/ubinstall-gtk-decorations.c +++ b/source/ubinstall-gtk-decorations.c @@ -4,7 +4,6 @@ void yon_resize_images_update(main_window *widgets){ enum YON_PAGES page = gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook)); gtk_widget_hide(widgets->BootloaderImage); gtk_widget_hide(widgets->RegionImage); - gtk_widget_hide(widgets->KeyboardImage); gtk_widget_hide(widgets->UserImage); gtk_widget_hide(widgets->StartupImage); gtk_widget_hide(widgets->NetworkImage); @@ -16,9 +15,6 @@ void yon_resize_images_update(main_window *widgets){ case YON_PAGE_REGION: gtk_widget_show(widgets->RegionImage); break; - case YON_PAGE_KEYBOARD: - gtk_widget_show(widgets->KeyboardImage); - break; case YON_PAGE_USERS: gtk_widget_show(widgets->UserImage); break; @@ -51,11 +47,6 @@ void on_region_resized(GtkWidget *,main_window *widgets){ target = GTK_IMAGE(widgets->RegionImage); pixbuf = widgets->region_original; - break; - case YON_PAGE_KEYBOARD: - target = GTK_IMAGE(widgets->KeyboardImage); - pixbuf = widgets->keyboard_original; - break; case YON_PAGE_USERS: target = GTK_IMAGE(widgets->UserImage); diff --git a/source/ubinstall-gtk-installation.c b/source/ubinstall-gtk-installation.c index 802b662..ac6c95c 100644 --- a/source/ubinstall-gtk-installation.c +++ b/source/ubinstall-gtk-installation.c @@ -535,7 +535,7 @@ void yon_install_init(main_window *widgets, enum YON_PAGES page){ gtk_combo_box_set_active(GTK_COMBO_BOX(partition_encryption_combo),0); } char *format = config(part_format_parameter); - if ((!yon_char_is_empty(format)&&!strcmp(format,"yes"))||format_switch==widgets->CommonFormatSwitch){ + if ((!yon_char_is_empty(format)&&!strcmp(format,"yes"))||!gtk_widget_get_sensitive(format_switch)){ gtk_switch_set_active(GTK_SWITCH(format_switch),1); if (device_label){ char *parameter = config(part_label_parameter); @@ -550,7 +550,7 @@ void yon_install_init(main_window *widgets, enum YON_PAGES page){ char *parameter = config(part_size_parameter); if (!yon_char_is_empty(parameter)){ gtk_spin_button_set_value(GTK_SPIN_BUTTON(partition_size_spin),atol(parameter)); - gtk_combo_box_set_active(GTK_COMBO_BOX(partition_size_combo),yon_get_size_get_from_letter(parameter[strlen(parameter)-1])); + gtk_combo_box_set_active(GTK_COMBO_BOX(partition_size_combo),yon_get_size_get_from_letter(parameter[strlen(parameter)-1])-1); } else { gtk_spin_button_set_value(GTK_SPIN_BUTTON(partition_size_spin),0); gtk_combo_box_set_active(GTK_COMBO_BOX(partition_size_combo),0); @@ -586,7 +586,7 @@ void yon_install_init(main_window *widgets, enum YON_PAGES page){ gtk_entry_set_text(GTK_ENTRY(partition_encryption_entry),""); } } - } else { + } else if (gtk_widget_get_sensitive(format_switch)){ gtk_switch_set_active(GTK_SWITCH(format_switch),0); } } diff --git a/source/ubinstall-gtk-keyboard.c b/source/ubinstall-gtk-keyboard.c index 0c2f096..9ff1a63 100644 --- a/source/ubinstall-gtk-keyboard.c +++ b/source/ubinstall-gtk-keyboard.c @@ -1,385 +1,467 @@ #include "ubinstall-gtk.h" int yon_keyboard_save(main_window *widgets){ - GtkTreeIter iter,iter_child; - if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(widgets->LayoutList),&iter)){ - yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),LAYOUTS_CHOSEN_BUT_EMPTY_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); - yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(widgets->LayoutTree)); + if (gtk_switch_get_active(GTK_SWITCH(widgets->KeyboardDefaultLayoutsSwitch))){ + yon_config_remove_by_key(xkblayout_parameter); + } else { + GtkTreeIter iter; + if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(widgets->LayoutsList),&iter)){ + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),yon_char_get_localised_from_lib(EMPTY_IMPORTANT_LABEL),5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(widgets->KeyboardLayoutTree); return 0; } - char *layouts_list=""; - GtkTreeModel *layouts_model=GTK_TREE_MODEL(widgets->LayoutList); - char *cur_layout=NULL; - for_iter(layouts_model,&iter){ - int chosen=0; - int primary=0; - gtk_tree_model_get(layouts_model,&iter,0,&cur_layout,3,&chosen,4,&primary,-1); - if (chosen) - layouts_list = yon_char_unite(layouts_list,yon_char_is_empty(layouts_list)?"":",",cur_layout,NULL); - if (primary){ - yon_config_register(xkbvariant_parameter,xkbvariant_parameter_command,cur_layout); - } - if (gtk_tree_model_iter_children(layouts_model,&iter_child,&iter)){ - for(int valid2=1;valid2;valid2 = gtk_tree_model_iter_next(GTK_TREE_MODEL(widgets->LayoutList),&iter_child)){ - gtk_tree_model_get(layouts_model,&iter_child,0,&cur_layout,3,&chosen,4,&primary,-1); - if (chosen) - layouts_list = yon_char_unite(layouts_list,yon_char_is_empty(layouts_list)?"":",",cur_layout,NULL); - if (primary){ - yon_config_register(xkbvariant_parameter,xkbvariant_parameter_command,cur_layout); - } - } - } - } + } + return 1; +} - if (!yon_char_is_empty(layouts_list)) - yon_config_register(xkblayout_parameter,xkblayout_parameter_command,layouts_list); - else - yon_config_remove_by_key(xkblayout_parameter); +void yon_keyboard_init(main_window *widgets){ + g_signal_handlers_block_by_func(G_OBJECT(widgets->KeyboardModelCombo),G_CALLBACK(on_model_changed),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->KeyboardLayoutChangingCombo),G_CALLBACK(on_options_save),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->KeyboardNumLockCombo),G_CALLBACK(on_num_lock_changed),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->KeyboardScrollLockSwitch),G_CALLBACK(on_scroll_lock_switch),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->KeyboardComposeSwitch),G_CALLBACK(on_compose_switch),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->KeyboardDefaultLayoutsSwitch),G_CALLBACK(on_layout_default_toggled),widgets); + gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->KeyboardModelCombo)); + int size; + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->KeyboardModelCombo),DEFAULT_LABEL); + config_str models = yon_config_load(get_keyboard_models_command,&size); + for (int i=0;iKeyboardModelCombo),parsed[0],_(parsed[1])); + yon_char_parsed_free(parsed,parsed_size); + } + yon_char_parsed_free(models,size); + + // g_signal_handlers_block_by_func(G_OBJECT(widgets->TTYLayoutCombo),G_CALLBACK(on_tty_changed),widgets); - if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->KeyboardModelCombo))){ - char *model = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->KeyboardModelCombo)); - if (!yon_char_is_empty(model)) - yon_config_register(xkbmodel_parameter,xkbmodel_parameter_command,model); - } else{ - yon_config_remove_by_key(xkbmodel_parameter); + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->KeyboardModelCombo),0); + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->KeyboardNumLockCombo),0); + { + char *kbmodel = yon_config_get_by_key(xkbmodel_parameter); + if (kbmodel) { + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->KeyboardModelCombo),kbmodel); + } } - - if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->LayoutBindingCombo))){ - char *options = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->LayoutBindingCombo)); - if (options){}; - yon_config_register(xkboptions_parameter,xkboptions_parameter_command,options); - } else { - yon_config_remove_by_key(xkboptions_parameter); + { + gtk_list_store_clear(widgets->LayoutsList); + char *layouts = config(xkblayout_parameter); + + int layouts_parsed_size; + config_str layouts_parsed = yon_char_parse(layouts,&layouts_parsed_size,","); + for(int i=0;iKeyboardDefaultLayoutsSwitch),1); + } else { + gtk_switch_set_active(GTK_SWITCH(widgets->KeyboardDefaultLayoutsSwitch),0); + } + + if (yon_char_is_empty(layouts)){ + char *element = yon_char_parsed_check_exist_begins_with(main_config.layouts_list,main_config.layouts_size,"us|"); + if (element){ + int parsed_size; + config_str parsed = yon_char_parse(element,&parsed_size,"|"); + GtkTreeIter iter; + gtk_list_store_append(widgets->LayoutsList,&iter); + gtk_list_store_set(widgets->LayoutsList,&iter,0,parsed[0],2,_(parsed[1]),-1); + yon_char_parsed_free(parsed,parsed_size); + } + } } - - if (!main_config.configure_mode){ + { + gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->KeyboardLayoutChangingCombo)); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->KeyboardLayoutChangingCombo),DEFAULT_LABEL); int size; - config_str parameters = yon_config_get_save_parameters_by_key(&size,xkbvariant_parameter,xkblayout_parameter,xkbmodel_parameter,xkboptions_parameter,NULL); - if (parameters){ - char *command_parameters = yon_char_parsed_to_string(parameters,size," -- "); - char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL); - if (!system(yon_debug_output("%s\n",command))){} - free(command); - yon_char_parsed_free(parameters,size); + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->KeyboardLayoutChangingCombo),0); + config_str options = yon_config_load(grp_options_command,&size); + + for (int i=0;iKeyboardLayoutChangingCombo),parsed[0],_(parsed[1])); + yon_char_parsed_free(parsed,parsed_size); } + yon_char_parsed_free(options,size); } - return 1; -} - -ubinstall_keyboard_window *yon_ubinstall_keyboard_new(){ -void on_additional_software_toggled(); - ubinstall_keyboard_window *window = malloc(sizeof(ubinstall_keyboard_window)); - GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_ubinstall_keyboard); - window->MainWindow=yon_gtk_builder_get_widget(builder,"MainWindow"); - window->StatusBox=yon_gtk_builder_get_widget(builder,"StatusBox"); - window->headerBar=yon_gtk_builder_get_widget(builder,"headerBar"); - window->CancelButton=yon_gtk_builder_get_widget(builder,"CancelButton"); - window->SaveButton=yon_gtk_builder_get_widget(builder,"SaveButton"); - window->LayoutsTree=yon_gtk_builder_get_widget(builder,"LayoutsTree"); - window->ActiveToggle = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"ActiveToggle")); + { + char *name = yon_config_get_by_key(num_lock_boot_parameter); + if (name) { + if (!strcmp(name,"yes")) gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->KeyboardNumLockCombo),1); + else if (!strcmp(name,"no")) gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->KeyboardNumLockCombo),2); + } + } + { + char *options = config(xkboptions_parameter); + if (!yon_char_is_empty(options)){ + int size; + config_str parsed = yon_char_parse(options,&size,","); + if (!yon_char_is_empty(parsed[0])){ + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->KeyboardLayoutChangingCombo),parsed[0]); + } else { + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->KeyboardLayoutChangingCombo),0); + } + if (yon_char_parsed_check_exist(parsed,size,"compose:rwin")>-1){ + gtk_switch_set_active(GTK_SWITCH(widgets->KeyboardComposeSwitch),1); + } else { + gtk_switch_set_active(GTK_SWITCH(widgets->KeyboardComposeSwitch),0); + } + if (yon_char_parsed_check_exist(parsed,size,"grp_led:scroll")>-1){ + gtk_switch_set_active(GTK_SWITCH(widgets->KeyboardScrollLockSwitch),1); + } else { + gtk_switch_set_active(GTK_SWITCH(widgets->KeyboardScrollLockSwitch),0); + } + } - g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); + } -return window; + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->KeyboardModelCombo),G_CALLBACK(on_model_changed),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->KeyboardNumLockCombo),G_CALLBACK(on_num_lock_changed),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->KeyboardLayoutChangingCombo),G_CALLBACK(on_options_save),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->KeyboardScrollLockSwitch),G_CALLBACK(on_scroll_lock_switch),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->KeyboardComposeSwitch),G_CALLBACK(on_compose_switch),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->KeyboardDefaultLayoutsSwitch),G_CALLBACK(on_layout_default_toggled),widgets); } -void on_keyboard_removed(GtkWidget *, main_window *widgets){ - GtkTreeModel *model; - GtkTreeIter iter, childiter; - if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->LayoutTree)),&model,&iter)){ - gtk_tree_model_filter_convert_iter_to_child_iter(GTK_TREE_MODEL_FILTER(widgets->LayoutsFilter),&childiter,&iter); - gtk_tree_store_set(widgets->LayoutList,&childiter,3,0,-1); +void on_layouts_accept(GtkWidget *self, layouts_window *window){ + main_window *widgets = g_object_get_data(G_OBJECT(window->Window),"widgets"); + if (!yon_char_is_empty(window->parameters)){ + yon_config_register(xkblayout_parameter,xkblayout_parameter_command,window->parameters); + } else { + yon_config_remove_by_key(xkblayout_parameter); } + on_subwindow_close(self); + yon_keyboard_init(widgets); } -void yon_language_selection_changed(GtkCellRenderer *, char *path, ubinstall_language_window *window){ +void on_layouts_chosen(GtkCellRenderer *, gchar *path, layouts_window *window){ GtkTreeIter iter; - int state; + gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(window->list),&iter,path); + int chosen; + char *layout, *variant; + gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,0,&layout,1,&variant,3,&chosen,-1); + gtk_tree_store_set(GTK_TREE_STORE(window->list),&iter,3,!chosen,-1); - if (gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(window->liststore1),&iter,path)){ - gtk_tree_model_get(GTK_TREE_MODEL(window->liststore1),&iter,0,&state,-1); - gtk_list_store_set(window->liststore1,&iter,0,!state,-1); - } -} -void on_language_window_accept(GtkWidget *,dictionary *dict){ - main_window *widgets= yon_dictionary_get_data(dict->first,main_window*); - ubinstall_language_window *window = yon_dictionary_get_data(dict->first->next,ubinstall_language_window*); - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->DefaultCheck))){ - gtk_entry_set_text(GTK_ENTRY(widgets->AvailableLanguagesEntry),""); - GtkTreeIter iter; - int size; - config_str lang_parsed = default_langs(&size); - - char *final = ""; - for_iter(widgets->LanguagesList,&iter){ - char *code, *labl; - 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); - if (!yon_char_is_empty(final)) free(final); - final = tmp; - } else - gtk_list_store_set(widgets->LanguagesList,&iter,0,0,-1); - } - if (!yon_char_is_empty(final)){ - gtk_entry_set_text(GTK_ENTRY(widgets->AvailableLanguagesEntry),final); - } - gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LanguagesCombo),-1); - gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); + char *full_layout = NULL; + if (!yon_char_is_empty(variant)){ + full_layout = yon_char_unite(layout,"_",variant,NULL); } else { - yon_gtk_list_store_copy_full(widgets->LanguagesList,window->liststore1); - gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); - config_str parsed = NULL; - int size; - GtkTreeIter iter; - for_iter(GTK_TREE_MODEL(window->liststore1),&iter){ - char *current; - int status; - gtk_tree_model_get(GTK_TREE_MODEL(window->liststore1),&iter,0,&status,2,¤t,-1); - if (status) - yon_char_parsed_add_or_create_if_exists(parsed,&size,current); - } - if (parsed){ - char *final = yon_char_parsed_to_string(parsed,size,"; "); - gtk_entry_set_text(GTK_ENTRY(widgets->AvailableLanguagesEntry),!yon_char_is_empty(final)?final:""); - if (yon_char_is_empty(final)) { - gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LanguagesCombo),-1); - } - if (final) free(final); - yon_char_parsed_free(parsed,size); - } else - gtk_entry_set_text(GTK_ENTRY(widgets->AvailableLanguagesEntry),""); - + full_layout = layout; } - on_subwindow_close(window->MainWindow); - free(window); + if (!chosen){ + char *temp = yon_char_append_element(window->parameters,full_layout,","); + free(window->parameters); + window->parameters = temp; + } else { + char *temp = yon_char_remove_element(window->parameters,full_layout,","); + free(window->parameters); + window->parameters = temp; + } + free(full_layout); } -void yon_focus_set(GtkWidget *,GtkWidget *target){ - gtk_widget_grab_focus(target); - +void on_system_layouts_add(GtkWidget *, main_window *widgets){ + yon_layouts_add(GTK_TREE_VIEW(widgets->KeyboardLayoutTree),widgets->LayoutsList,widgets); } -ubinstall_language_window *yon_ubinstall_language_new(){ - ubinstall_language_window *window = malloc(sizeof(ubinstall_language_window)); - GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_ubinstall_language); - window->liststore1=GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1")); - window->MainWindow=yon_gtk_builder_get_widget(builder,"MainWindow"); - window->StatusBox=yon_gtk_builder_get_widget(builder,"StatusBox"); - window->DefaultCheck=yon_gtk_builder_get_widget(builder,"DefaultCheck"); - window->LanguagesTree=yon_gtk_builder_get_widget(builder,"LanguagesTree"); - window->headerBar=yon_gtk_builder_get_widget(builder,"headerBar"); - window->CancelButton=yon_gtk_builder_get_widget(builder,"CancelButton"); - window->SaveButton=yon_gtk_builder_get_widget(builder,"SaveButton"); - window->ToggleRenderer=GTK_CELL_RENDERER(gtk_builder_get_object(builder,"ToggleRenderer")); - - g_signal_connect(G_OBJECT(window->DefaultCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->LanguagesTree); - g_signal_connect(G_OBJECT(window->DefaultCheck),"toggled",G_CALLBACK(yon_focus_set),window->LanguagesTree); - g_signal_connect(G_OBJECT(window->ToggleRenderer),"toggled",G_CALLBACK(yon_language_selection_changed),window); +layouts_window *yon_layouts_window_new(){ + GtkBuilder *builder = gtk_builder_new_from_resource(glade_layouts_path); + layouts_window *window = malloc(sizeof(layouts_window)); + memset(window,0,sizeof(layouts_window)); + window->Window = yon_gtk_builder_get_widget(builder,"Window"); + window->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton"); + window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton"); + window->ChosenCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"ChosenCell")); + window->MainTree = yon_gtk_builder_get_widget(builder,"LayoutsTree"); + window->parameters = yon_char_new(config(xkblayout_parameter)); + g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); -return window; + g_signal_connect(G_OBJECT(window->ChosenCell),"toggled",G_CALLBACK(on_layouts_chosen),window); + return window; } -void on_language_clicked(GtkWidget *, main_window *widgets){ - ubinstall_language_window *window = yon_ubinstall_language_new(); - g_object_ref(G_OBJECT(window->liststore1)); - gtk_tree_view_set_model(GTK_TREE_VIEW(window->LanguagesTree),NULL); - yon_gtk_list_store_copy_full(window->liststore1,widgets->LanguagesList); - gtk_tree_view_set_model(GTK_TREE_VIEW(window->LanguagesTree),GTK_TREE_MODEL(window->liststore1)); - yon_gtk_window_setup(GTK_WINDOW(window->MainWindow),GTK_WINDOW(widgets->MainWindow),TITLE_LABEL,icon_path,"language-chooser-window"); - gtk_tree_view_set_search_column(GTK_TREE_VIEW(window->LanguagesTree),2); - if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->AvailableLanguagesEntry)))){ - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->DefaultCheck),1); - } +void yon_layouts_add(GtkTreeView *, GtkListStore *, main_window *widgets){ + layouts_window *window = yon_layouts_window_new(); + yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->MainWindow),TITLE_LABEL,icon_path,"layout_window"); + + window->list = main_config.layouts_store; + + gtk_tree_view_set_model(GTK_TREE_VIEW(window->MainTree), GTK_TREE_MODEL(main_config.layouts_store)); + gtk_tree_view_column_clicked(GTK_TREE_VIEW_COLUMN(gtk_tree_view_get_column(GTK_TREE_VIEW(window->MainTree),0))); + yon_layout_build(window); + g_object_set_data(G_OBJECT(window->Window),"widgets",widgets); + g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_layouts_accept),window); + char *languages = config(xkblayout_parameter); int size; - int found=0; - int statusfound=0; - config_str langs = default_langs(&size); - GtkTreeIter iter; - for_iter(widgets->LanguagesList,&iter){ - char *cur; - int status; - gtk_tree_model_get(GTK_TREE_MODEL(widgets->LanguagesList),&iter,0,&status,2,&cur,-1); - if (status){ - statusfound++; - if (yon_char_parsed_check_exist(langs,size,cur)>-1) - found++; + config_str parsed = yon_char_parse(languages,&size,","); + GtkTreeIter iter,itar; + for_iter(window->list,&iter){ + int found = 0; + char *id, *id_var; + gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,0,&id,-1); + for (int i=0;ilist),&iter,3,1,-1); + found=1; + break; + } + } + if (!found) { + gtk_tree_store_set(GTK_TREE_STORE(window->list),&iter,3,0,-1); + } + if (gtk_tree_model_iter_children(GTK_TREE_MODEL(window->list),&itar,&iter)){ + for (int valid2=1;valid2;valid2 = gtk_tree_model_iter_next(GTK_TREE_MODEL(window->list),&itar)){ + gtk_tree_model_get(GTK_TREE_MODEL(window->list),&itar,0,&id,1,&id_var,-1); + for (int i=0;ilist),&itar,3,1,-1); + found=1; + break; + } + } + } } - } - if ((found==size)&&statusfound==size){ - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->DefaultCheck),1); - } - dictionary *dict=NULL; - 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); - + } } - - -void on_layout_toggle(GtkCellRendererToggle*, gchar* path, ubinstall_keyboard_window *window){ - GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(window->LayoutsTree)); + +void yon_layouts_remove(GtkTreeView *tree, GtkListStore *cur_list, main_window *widgets){ + GtkTreeModel *model = GTK_TREE_MODEL(cur_list); GtkTreeIter iter; - if (gtk_tree_model_get_iter_from_string(model,&iter,path)){ - int status=0; - gtk_tree_model_get(model,&iter,3,&status,-1); - gtk_tree_store_set(GTK_TREE_STORE(model),&iter,3,!status,-1); + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(tree),&model,&iter)){ + dialog_confirmation_data *data = yon_confirmation_dialog_data_new(); + data->action_text = LAYOUT_REMOVE_LABEL; + data->title = LAYOUT_REMOVE_TITLE_LABEL; + if (yon_confirmation_dialog_call(widgets->MainWindow,data)!=GTK_RESPONSE_ACCEPT) return; + gtk_list_store_remove(widgets->LayoutsList,&iter); } + yon_keyboard_init(widgets); } - -void on_keyboard_accept(GtkWidget *self,main_window *widgets){ - gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LayoutsFilter)); - on_subwindow_close(self); +void on_system_layouts_remove(GtkWidget *, main_window *widgets){ + yon_layouts_remove(GTK_TREE_VIEW(widgets->KeyboardLayoutTree),widgets->LayoutsList,widgets); } +// standard functions -void on_keyboard_clicked (GtkWidget *, main_window *widgets){ - ubinstall_keyboard_window *window = yon_ubinstall_keyboard_new(); - yon_gtk_window_setup(GTK_WINDOW(window->MainWindow),GTK_WINDOW(widgets->MainWindow),KEYBOARD_TITLE_LABEL,icon_path,"keyboard-window"); - gtk_tree_view_set_model(GTK_TREE_VIEW(window->LayoutsTree),GTK_TREE_MODEL(widgets->LayoutList)); - gtk_tree_view_column_clicked(gtk_tree_view_get_column(GTK_TREE_VIEW(window->LayoutsTree),1)); - - g_signal_connect(G_OBJECT(window->ActiveToggle),"toggled",G_CALLBACK(on_layout_toggle),window); - g_signal_connect(G_OBJECT(window->SaveButton),"clicked",G_CALLBACK(on_keyboard_accept),widgets); - gtk_widget_show(window->MainWindow); +config_str yon_layout_get_children(char *layout_id, int *size){ + (*size)=0; + config_str final = NULL; + for (int i=0;iLayoutList,&parent,NULL); - gtk_tree_store_set(widgets->LayoutList,&parent,0,key,1,_((char*)g_hash_table_lookup(value,"")),2,1,3,0,-1); - - GList *list = g_hash_table_get_keys(value); - GList *iterator = NULL; - for (iterator=list;iterator;iterator=iterator->next){ - if (!yon_char_is_empty((char*)iterator->data)){ - gtk_tree_store_append(widgets->LayoutList,&iter,&parent); - gtk_tree_store_set(widgets->LayoutList,&iter,0,(char*)iterator->data,1,_((char*)g_hash_table_lookup(value,iterator->data)),2,1,3,0,4,0,-1); + if (strstr(layout,"_")){ + char *cur_variant = yon_char_new(layout); + char *cur_layout = yon_char_divide_search(cur_variant,"_",-1); + for (int i=0;iLayoutsList,&iter); + gtk_list_store_set(widgets->LayoutsList,&iter,0,parsed[0],1,parsed[1],2,_(parsed[2]),-1); + } + } + + } else { + for (int i=0;iLayoutsList,&iter); + gtk_list_store_set(widgets->LayoutsList,&iter,0,parsed[0],2,_(parsed[1]),-1); + } } } } -void yon_keyboard_init(main_window *widgets){ +void yon_layout_build(layouts_window *window){ + gtk_tree_store_clear(window->list); + GtkTreeIter parent; + GtkTreeIter iter; int size; - config_str parsed = NULL; - parsed = yon_config_load(yon_debug_output("%s\n",get_layouts_command),&size); - GHashTable *table = g_hash_table_new(g_str_hash,g_str_equal); + config_str layouts = yon_config_load(layouts_command,&size); for (int i=0;ilist,&parent,NULL); + gtk_tree_store_set(window->list,&parent,0,parsed[0],2,_(parsed[1]),-1); + int variants_size; + config_str variants = yon_layout_get_children(parsed[0],&variants_size); + yon_char_parsed_free(parsed,parsed_size); + for (int k=0;klist,&iter,&parent); + gtk_tree_store_set(window->list,&iter,0,parsed[0],1,parsed[1],2,_(parsed[2]),-1); + yon_char_parsed_free(parsed,parsed_size); } + yon_char_parsed_free(variants,variants_size); + } + yon_char_parsed_free(layouts,size); + +} - g_hash_table_foreach(table,(GHFunc)yon_layout_build,widgets); - yon_char_parsed_free(parsed,size); - config_str models = yon_config_load(yon_debug_output("%s\n",get_models_command),&size); - for (int i=0;iKeyboardModelCombo),models[i],_(models[i+1])); +void on_layout_move_up(GtkWidget *, main_window *widgets){ + GtkTreeModel *model; + GtkTreeIter iter,*previter; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->KeyboardLayoutTree)),&model,&iter)){ + previter = gtk_tree_iter_copy(&iter); + if (!gtk_tree_model_iter_previous(model,previter)) return; + char *a, *b; + gtk_tree_model_get(model,&iter,0,&a,-1); + gtk_tree_model_get(model,previter,0,&b,-1); + char *layouts = config(xkblayout_parameter); + char *temp = yon_char_swap_element(layouts,a,b,","); + yon_config_register(xkblayout_parameter,xkblayout_parameter_command,temp); + free(temp); + gtk_list_store_swap(widgets->LayoutsList,&iter,previter); + gtk_tree_iter_free(previter); } - if (size) yon_char_parsed_free(models,size); +} - char *keyboard = config(xkbmodel_parameter); - char *option_parameter = config(xkboptions_parameter); - char *layouts = config(xkblayout_parameter); - char *variant = config(xkbvariant_parameter); +void on_layout_move_down(GtkWidget *, main_window *widgets){ + GtkTreeModel *model; + GtkTreeIter iter,*nextiter; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->KeyboardLayoutTree)),&model,&iter)){ + nextiter = gtk_tree_iter_copy(&iter); + if (!gtk_tree_model_iter_next(model,nextiter)) return; + char *a, *b; + gtk_tree_model_get(model,&iter,0,&a,-1); + gtk_tree_model_get(model,nextiter,0,&b,-1); + char *layouts = config(xkblayout_parameter); + char *temp = yon_char_swap_element(layouts,a,b,","); + yon_config_register(xkblayout_parameter,xkblayout_parameter_command,temp); + free(temp); + gtk_list_store_swap(widgets->LayoutsList,&iter,nextiter); + gtk_tree_iter_free(nextiter); + } +} - if (!yon_char_is_empty(keyboard)){ - gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->KeyboardModelCombo),keyboard); - } else { - gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->KeyboardModelCombo),0); +void on_compose_switch(GtkWidget *,int status,main_window *widgets){ + switch(status){ + case 0:{ + yon_config_remove_element(xkboptions_parameter,"compose:rwin",","); + } break; + case 1:{ + yon_config_append_element(xkboptions_parameter,"compose:rwin",","); + } break; } + yon_keyboard_init(widgets); +} - if (!yon_char_is_empty(option_parameter)){ - gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->LayoutBindingCombo),option_parameter); - } else{ - gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LayoutBindingCombo),0); +void on_scroll_lock_switch(GtkWidget *,int status,main_window *widgets){ + switch(status){ + case 0:{ + yon_config_remove_element(xkboptions_parameter,"grp_led:scroll",","); + } break; + case 1:{ + yon_config_append_element(xkboptions_parameter,"grp_led:scroll",","); + } break; } + yon_keyboard_init(widgets); +} - if (!yon_char_is_empty(layouts)){ - int parsed_size; - config_str parsed = yon_char_parse(layouts,&parsed_size,","); +void on_layout_default_sensitive_toggled(GtkWidget *, int status, main_window *widgets){ + gtk_widget_set_sensitive(widgets->KeyboardLayoutTree,!status); + gtk_widget_set_sensitive(widgets->KeyboardLayoutAddButton,!status); + if (status){ + gtk_widget_set_sensitive(widgets->KeyboardLayoutRemoveButton,!status); + gtk_widget_set_sensitive(widgets->KeyboardLayoutMoveUpButton,!status); + gtk_widget_set_sensitive(widgets->KeyboardLayoutMoveDownButton,!status); + }else { + on_layout_selection_changed(GTK_TREE_VIEW(widgets->KeyboardLayoutTree),widgets); - GtkTreeIter iter, chiter; - GtkTreeModel *model = GTK_TREE_MODEL(widgets->LayoutList); + } +} + +void on_layout_default_toggled(GtkWidget *, int status, main_window *widgets){ + if (!status){ + GtkTreeModel *model = GTK_TREE_MODEL(widgets->LayoutsList); + GtkTreeIter iter; + char *locales = NULL; for_iter(model,&iter){ - char *target; - gtk_tree_model_get(model,&iter,0,&target,-1); - if (yon_char_parsed_check_exist(parsed,parsed_size,target)>-1){ - gtk_tree_store_set(widgets->LayoutList,&iter,2,1,3,1,-1); - if (!strcmp(variant,target)){ - gtk_tree_store_set(widgets->LayoutList,&iter,4,1,-1); - } else { - gtk_tree_store_set(widgets->LayoutList,&iter,4,0,-1); + char *target, *variant; - } - for (int valid2 = gtk_tree_model_iter_children(model,&chiter,&iter);valid2;valid2 = gtk_tree_model_iter_next(model,&chiter)){ - gtk_tree_model_get(model,&chiter,0,&target,-1); - if (yon_char_parsed_check_exist(parsed,parsed_size,target)>-1){ - gtk_tree_store_set(widgets->LayoutList,&chiter,2,1,3,1,-1); - if (!strcmp(variant,target)){ - gtk_tree_store_set(widgets->LayoutList,&chiter,4,1,-1); - - } - } else { - gtk_tree_store_set(widgets->LayoutList,&chiter,3,0,4,0,-1); - } - } + gtk_tree_model_get(model,&iter,0,&target,1,&variant,-1); + char *key = NULL; + if (!yon_char_is_empty(variant)){ + key = yon_char_unite(target,"_",variant,NULL); } else { - gtk_tree_store_set(widgets->LayoutList,&iter,3,0,4,0,-1); + key = yon_char_new(target); } - + char *temp = yon_char_append_element(locales?locales:"",key,","); + if (!yon_char_is_empty(locales)) free(locales); + locales = temp; + } + if (!yon_char_is_empty(locales)){ + yon_config_register(xkblayout_parameter,xkblayout_parameter_command,locales); } - } else { - } } -void on_keyboard_layout_chosen(GtkCellRenderer *, gchar *path, main_window *widgets){ - GtkTreeIter iter, itar, itor, itur; - gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(widgets->LayoutsFilter),&iter,path); - int status; - char *target; - gtk_tree_model_filter_convert_iter_to_child_iter(GTK_TREE_MODEL_FILTER(widgets->LayoutsFilter),&itur,&iter); - gtk_tree_model_get(GTK_TREE_MODEL(widgets->LayoutList),&itur,4,&status,1,&target,-1); - // g_signal_handlers_block_by_func(self,G_CALLBACK(on_keyboard_layout_chosen),widgets); - for_iter(GTK_TREE_MODEL(widgets->LayoutsFilter),&itar){ - gtk_tree_model_filter_convert_iter_to_child_iter(GTK_TREE_MODEL_FILTER(widgets->LayoutsFilter),&itor,&itar); - // gtk_tree_model_sort_convert_iter_to_child_iter(GTK_TREE_MODEL_SORT(widgets->LayoutList),&itar,&itor); - gtk_tree_store_set(widgets->LayoutList,&itor,4,0,-1); - GtkTreeIter itor_child; - if (gtk_tree_model_iter_children(GTK_TREE_MODEL(widgets->LayoutList),&itor_child,&itor)){ - for(int valid2=1;valid2;valid2 = gtk_tree_model_iter_next(GTK_TREE_MODEL(widgets->LayoutList),&itor_child)){ - gtk_tree_store_set(widgets->LayoutList,&itor_child,4,0,-1); - } - } +void on_layout_selection_changed(GtkTreeView *self,main_window *widgets){ + int status = gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(self)),NULL,NULL); + gtk_widget_set_sensitive(widgets->KeyboardLayoutMoveDownButton,status); + gtk_widget_set_sensitive(widgets->KeyboardLayoutMoveUpButton,status); + gtk_widget_set_sensitive(widgets->KeyboardLayoutRemoveButton,status); + +} +void on_num_lock_changed(GtkComboBox *self, main_window *){ + switch (gtk_combo_box_get_active(self)){ + case 0: + yon_config_remove_by_key(num_lock_boot_parameter); + break; + case 1: yon_config_register(num_lock_boot_parameter,num_lock_boot_parameter_command,"yes"); + break; + case 2:yon_config_register(num_lock_boot_parameter,num_lock_boot_parameter_command,"no"); + break; } - gtk_tree_store_set(widgets->LayoutList,&itur,4,!status,-1); - // g_signal_handlers_unblock_by_func(self,G_CALLBACK(on_keyboard_layout_chosen),widgets); - if (!status){ - yon_config_register(xkbvariant_parameter,xkbvariant_parameter_command,target); +} + +void on_model_changed(GtkComboBoxText *self, main_window *widgets){ + switch (gtk_combo_box_get_active(GTK_COMBO_BOX(self))){ + case 0: + yon_config_remove_by_key(xkbmodel_parameter); + break; + default: + char *id = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->KeyboardModelCombo)); + yon_config_register(xkbmodel_parameter,xkbmodel_parameter_command,id); + break; + } +} + +void on_options_save(GtkWidget *,main_window *widgets){ + char *main_id = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->KeyboardLayoutChangingCombo)); + int parameter_parsed_size; + config_str parameter_parsed = NULL; + yon_char_parsed_add_or_create_if_exists(parameter_parsed,¶meter_parsed_size,!yon_char_is_empty(main_id)?main_id:""); + char *final_parameter = yon_char_parsed_to_string_full(parameter_parsed,parameter_parsed_size,","); + yon_char_parsed_free(parameter_parsed,parameter_parsed_size); + if (!yon_char_is_empty(final_parameter)){ + yon_config_register(xkboptions_parameter,xkboptions_parameter_command,final_parameter); + free(final_parameter); } else { - yon_config_remove_by_key(xkbvariant_parameter); + yon_config_remove_by_key(xkboptions_parameter); } } \ No newline at end of file diff --git a/source/ubinstall-gtk-language.c b/source/ubinstall-gtk-language.c new file mode 100644 index 0000000..0c0b0bb --- /dev/null +++ b/source/ubinstall-gtk-language.c @@ -0,0 +1,243 @@ +#include "ubinstall-gtk.h" + +void yon_language_update(main_window *widgets){ + gtk_list_store_clear(widgets->LanguageList); + { + char *config_locale = config(locale_parameter); + char *config_languages = config(lang_parameter); + if (yon_char_is_empty(config_locale)||yon_config_check_ignore(locale_parameter)){ + gtk_switch_set_active(GTK_SWITCH(widgets->LocaleDefaultSwitch),1); + } else { + gtk_switch_set_active(GTK_SWITCH(widgets->LocaleDefaultSwitch),0); + int parsed_param_size; + config_str parsed_param = yon_char_parse(config_locale,&parsed_param_size,","); + GtkTreeIter iter; + for (int i=0;iLanguageList,&iter); + gtk_list_store_set(widgets->LanguageList,&iter,1,parsed[1],2,parsed[2],3,parsed[0],-1); + if (!yon_char_is_empty(config_languages)){ + if (!strcmp(config_languages,parsed[0])){ + gtk_list_store_set(widgets->LanguageList,&iter,0,1,-1); + } + } else if (yon_char_is_empty(config_languages)&&!i){ + gtk_list_store_set(widgets->LanguageList,&iter,0,1,-1); + } + yon_char_parsed_free(parsed,parsed_size); + } + } + } + } + +} + + +void on_locale_toggle(GtkCellRenderer *, gchar *path,language_window *window){ + GtkTreeIter iter; + GtkTreeModel *model = GTK_TREE_MODEL(window->LanguagesList); + gtk_tree_model_get_iter_from_string(model,&iter,path); + gboolean is_active; + char *target; + gtk_tree_model_get(model,&iter,0,&is_active,1,&target,-1); + gtk_list_store_set(GTK_LIST_STORE(model),&iter,0,!is_active,-1); + + char *locales = (char*)gtk_entry_get_text(GTK_ENTRY(window->ManualEntry)); + if (!is_active){ + if (!yon_char_check_element(locales,target,",")){ + char *temp = yon_char_append_element(locales,target,","); + gtk_entry_set_text(GTK_ENTRY(window->ManualEntry),temp); + free(temp); + } + } else { + char *temp = yon_char_remove_element(locales,target,","); + gtk_entry_set_text(GTK_ENTRY(window->ManualEntry),temp); + if (!yon_char_is_empty(temp)) free(temp); + } +} + +void on_locale_accept(GtkWidget *self, language_window *window){ + main_window *widgets = g_object_get_data(G_OBJECT(window->Window),"widgets"); + + char *final = (char*)gtk_entry_get_text(GTK_ENTRY(window->ManualEntry)); + if (yon_char_is_empty(final)) { + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),yon_char_get_localised_from_lib(NOTHING_CHOSEN_LABEL),5,BACKGROUND_IMAGE_FAIL_TYPE); + return; + } + char *locale_str = config(locale_parameter); + GtkTreeIter iter,itar; + for_iter (GTK_TREE_MODEL(window->LanguagesList),&iter){ + char *locale,*lang,*territory; + int status; + gtk_tree_model_get(GTK_TREE_MODEL(window->LanguagesList),&iter,0,&status,1,&locale,2,&lang,3,&territory,-1); + if (status){ + gtk_list_store_append(widgets->LanguageList,&itar); + gtk_list_store_set(widgets->LanguageList,&itar,1,lang,2,territory,3,locale,-1); + if (!yon_char_is_empty(locale_str)&&!strcmp(locale_str,locale)){ + gtk_list_store_set(widgets->LanguageList,&itar,0,1,-1); + } + } + } + if (yon_char_is_empty(locale_str)){ + if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(widgets->LanguageList),&iter)){ + gtk_list_store_set(widgets->LanguageList,&iter,0,1,-1); + } + } + on_subwindow_close(self); +} + +gboolean yon_locale_window_set_locales(struct locales_struct *data){ + GtkTreeIter iter; + gtk_list_store_append(GTK_LIST_STORE(data->list),&iter); + gtk_list_store_set(GTK_LIST_STORE(data->list),&iter,1,data->locale,2,data->lang,3,data->territory,0,data->chosen,-1); + if(!yon_char_is_empty(data->lang)) free(data->lang); + if(!yon_char_is_empty(data->locale)) free(data->locale); + if(!yon_char_is_empty(data->territory)) free(data->territory); + if(!yon_char_is_empty(data->lang)) free(data); + return G_SOURCE_REMOVE; +} + +gboolean yon_locale_window_unlock(GtkWidget *spinner){ + gtk_widget_hide(spinner); + return G_SOURCE_REMOVE; +} + +void *yon_locales_load_func(language_window *window){ + char *config_value = config(locale_parameter); + int config_parsed_size; + config_str config_parsed = NULL; + if (config_value){ + gtk_entry_set_text(GTK_ENTRY(window->ManualEntry),config_value); + config_parsed = yon_char_parse(config_value,&config_parsed_size,","); + } + + int size; + config_str languages = yon_config_load(languages_command,&size); + for (int i=0;ilist=window->LanguagesList; + yon_char_remove_last_symbol(languages[i],'\n'); + int parsed_size; + config_str parsed = yon_char_parse(languages[i],&parsed_size,"|"); + data_struct->locale = yon_char_new(parsed[0]); + data_struct->lang = yon_char_new(parsed[1]); + data_struct->territory = yon_char_new(parsed[2]); + + if (config_parsed_size&&yon_char_parsed_check_exist(config_parsed,config_parsed_size,parsed[0])>-1){ + data_struct->chosen=1; + } else { + data_struct->chosen=0; + } + g_idle_add((GSourceFunc)yon_locale_window_set_locales,data_struct); + yon_char_parsed_free(parsed,parsed_size); + } + g_idle_add((GSourceFunc)yon_locale_window_unlock,window->LoadingSpinner); + yon_char_parsed_free(config_parsed,config_parsed_size); + g_thread_exit(NULL); +} + +language_window *yon_language_window_new(){ + language_window *window = malloc(sizeof(language_window)); + GtkBuilder *builder = gtk_builder_new_from_resource(glade_locales_path); + window->Window = yon_gtk_builder_get_widget(builder,"Window"); + window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox"); + window->LanguagesTree = yon_gtk_builder_get_widget(builder,"LanguagesTree"); + window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton"); + window->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton"); + window->ManualEntry = yon_gtk_builder_get_widget(builder,"ManualEntry"); + window->LoadingOverlay = yon_gtk_builder_get_widget(builder,"LoadingOverlay"); + window->LoadingSpinner = yon_gtk_builder_get_widget(builder,"LoadingSpinner"); + window->ToggleCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"ToggleCell")); + window->LanguagesList = GTK_LIST_STORE(gtk_builder_get_object(builder,"LanguagesList")); + + g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); + g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_locale_accept),window); + g_signal_connect(G_OBJECT(window->ToggleCell),"toggled",G_CALLBACK(on_locale_toggle),window); + yon_gtk_tree_view_minimal_fixed_size_set_full(GTK_TREE_VIEW(window->LanguagesTree)); + + gtk_overlay_add_overlay(GTK_OVERLAY(window->LoadingOverlay),window->LoadingSpinner); + g_thread_new("locales-thread",(GThreadFunc)yon_locales_load_func,window); + return window; +} + +void on_language_open(GtkWidget *, main_window *widgets){ + language_window *window = yon_language_window_new(); + + g_object_set_data(G_OBJECT(window->Window),"widgets",widgets); + + yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->MainWindow),ADD_LANGUAGE_TITLE_LABEL,icon_path,"LocalesWindow"); + + gtk_widget_show(window->Window); + +} + +void on_language_remove(GtkWidget *, main_window *widgets){ + GtkTreeIter iter; + GtkTreeModel *model; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->LocaleTree)),&model,&iter)){ + gtk_list_store_remove(widgets->LanguageList,&iter); + } +} + + +void on_language_default_toggled(GtkWidget *, int status, main_window *widgets){ + gtk_widget_set_sensitive(widgets->LocaleTree,!status); + gtk_widget_set_sensitive(widgets->LocaleAddButton,!status); + GtkTreeModel *model; + GtkTreeIter iter; + if (!status&>k_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->LocaleTree)),&model,&iter)){ + gtk_widget_set_sensitive(widgets->LocaleRemoveButton,1); + } else { + gtk_widget_set_sensitive(widgets->LocaleRemoveButton,0); + } +} + +void on_locale_toggled(GtkCellRenderer *, gchar *path, main_window *widgets){ + GtkTreeIter fiter; + GtkTreeIter iter; + GtkTreeModel *model = GTK_TREE_MODEL(widgets->LanguageList); + gtk_tree_model_get_iter_from_string(model,&fiter,path); + for_iter(model,&iter){ + gtk_list_store_set(GTK_LIST_STORE(model),&iter,0,0,-1); + + } + char *target; + gtk_tree_model_get(model,&fiter,3,&target,-1); + gtk_list_store_set(GTK_LIST_STORE(model),&fiter,0,1,-1); + // yon_config_register(lang_parameter,lang_parameter_command,target); +} + +int yon_language_save(main_window *widgets){ + int status = gtk_switch_get_active(GTK_SWITCH(widgets->LocaleDefaultSwitch)); + if (!status){ + GtkTreeModel *model = GTK_TREE_MODEL(widgets->LanguageList); + GtkTreeIter iter; + char *locales = NULL; + for_iter(model,&iter){ + int status; + char *target; + + gtk_tree_model_get(model,&iter,0,&status,3,&target,-1); + char *temp = yon_char_append_element(locales?locales:"",target,","); + if (!yon_char_is_empty(locales)) free(locales); + locales = temp; + if (status){ + yon_config_register(lang_parameter,lang_parameter_command,target); + } + } + if (!yon_char_is_empty(locales)){ + yon_config_register(locale_parameter,locale_parameter_command,locales); + } + } else { + yon_config_remove_by_key(lang_parameter); + yon_config_remove_by_key(locale_parameter); + } + + return 1; +} + +void yon_language_init(main_window *widgets){ + yon_language_update(widgets); +} diff --git a/source/ubinstall-gtk-page-switch.c b/source/ubinstall-gtk-page-switch.c index 22b2787..ba60189 100644 --- a/source/ubinstall-gtk-page-switch.c +++ b/source/ubinstall-gtk-page-switch.c @@ -9,17 +9,19 @@ enum YON_PAGES yon_page_get_next(main_window *widgets, enum YON_PAGES page){ case YON_PAGE_LICENCE: return YON_PAGE_SECTIONS; break; case YON_PAGE_SECTIONS: return yon_sections_get_next_page(widgets); break; case YON_PAGE_OS_COMPONENTS: return YON_PAGE_SOFTWARE; break; - case YON_PAGE_SOFTWARE: return main_config.configure_mode? YON_PAGE_KERNEL : YON_PAGE_INSTALLATION_BEGIN; break; - case YON_PAGE_INSTALLATION_BEGIN: return YON_PAGE_KERNEL; break; - case YON_PAGE_KERNEL: return YON_PAGE_KERNEL_ADDON; break; - case YON_PAGE_KERNEL_ADDON: return YON_PAGE_PACMAN_SOFTWARE; break; - case YON_PAGE_PACMAN_SOFTWARE: return YON_PAGE_REGION; - case YON_PAGE_REGION: return YON_PAGE_KEYBOARD; break; + case YON_PAGE_SOFTWARE: return main_config.configure_mode? YON_PAGE_REGION : YON_PAGE_INSTALLATION_BEGIN; break; + case YON_PAGE_INSTALLATION_BEGIN: return YON_PAGE_REGION; break; + case YON_PAGE_KERNEL: return YON_PAGE_PACKAGES_HUB; break; + case YON_PAGE_KERNEL_ADDON: return YON_PAGE_PACKAGES_HUB; break; + case YON_PAGE_PACMAN_SOFTWARE: return YON_PAGE_PACKAGES_HUB; break; + case YON_PAGE_REGION: return YON_PAGE_LANGUAGE; break; + case YON_PAGE_LANGUAGE: return YON_PAGE_KEYBOARD; break; case YON_PAGE_KEYBOARD: return YON_PAGE_USERS; break; case YON_PAGE_USERS: return YON_PAGE_STARTUP; break; case YON_PAGE_STARTUP: return YON_PAGE_BOOTLOADER; break; case YON_PAGE_BOOTLOADER: return YON_PAGE_NETWORK; break; - case YON_PAGE_NETWORK: return main_config.configure_mode? YON_PAGE_CONFIGURE_END : YON_PAGE_INSTALLATION; break; + case YON_PAGE_NETWORK: return YON_PAGE_KERNEL; break; + case YON_PAGE_PACKAGES_HUB: return main_config.configure_mode? YON_PAGE_CONFIGURE_END : YON_PAGE_INSTALLATION; case YON_PAGE_INSTALL_COMMON: return YON_PAGE_OS_COMPONENTS; break; case YON_PAGE_INSTALL_SEPARATE: return YON_PAGE_OS_COMPONENTS; break; case YON_PAGE_INSTALL_SAME_PARTITION: return YON_PAGE_OS_COMPONENTS; break; @@ -52,10 +54,10 @@ enum YON_PAGES yon_page_get_prev(enum YON_PAGES page){ case YON_PAGE_OS_COMPONENTS: return YON_PAGE_SECTIONS; break; case YON_PAGE_SOFTWARE: return YON_PAGE_OS_COMPONENTS; break; case YON_PAGE_INSTALLATION_BEGIN: return YON_PAGE_SOFTWARE; break; - case YON_PAGE_KERNEL: return YON_PAGE_SECTIONS; break; + case YON_PAGE_KERNEL: return YON_PAGE_NETWORK; break; case YON_PAGE_KERNEL_ADDON: return YON_PAGE_KERNEL; break; case YON_PAGE_PACMAN_SOFTWARE: return YON_PAGE_KERNEL_ADDON; break; - case YON_PAGE_REGION: return YON_PAGE_PACMAN_SOFTWARE; break; + case YON_PAGE_REGION: return YON_PAGE_SECTIONS; break; case YON_PAGE_KEYBOARD: return YON_PAGE_REGION; break; case YON_PAGE_USERS: return YON_PAGE_KEYBOARD; break; case YON_PAGE_STARTUP: return YON_PAGE_USERS; break; @@ -106,7 +108,11 @@ void yon_navigation_buttons_set_sensetiveness(main_window *widgets){ case YON_PAGE_LICENCE: gtk_widget_show(widgets->BackButton); gtk_widget_set_sensitive(widgets->BackButton,1); + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->LicenseAgreeRadio))) gtk_widget_set_sensitive(widgets->NextButton,1); + else + gtk_widget_set_sensitive(widgets->NextButton,0); + gtk_widget_set_sensitive(widgets->CancelInstallButton,1); break; case YON_PAGE_INSTALLATION: @@ -176,6 +182,9 @@ int yon_page_save(main_window *widgets, enum YON_PAGES page){ case YON_PAGE_REGION: return yon_region_save(widgets); break; + case YON_PAGE_LANGUAGE: + return yon_language_save(widgets); + break; case YON_PAGE_KEYBOARD: return yon_keyboard_save(widgets); break; @@ -255,6 +264,7 @@ void yon_switch_page_render(main_window *widgets){ case YON_PAGE_REGION: page = 3; break; + case YON_PAGE_LANGUAGE: case YON_PAGE_KEYBOARD: page = 4; break; @@ -264,6 +274,7 @@ void yon_switch_page_render(main_window *widgets){ case YON_PAGE_BOOTLOADER: case YON_PAGE_STARTUP: case YON_PAGE_NETWORK: + case YON_PAGE_PACKAGES_HUB: page = 6; break; case YON_PAGE_INSTALLATION: @@ -355,6 +366,9 @@ void yon_page_init(main_window *widgets, enum YON_PAGES page){ case YON_PAGE_REGION: yon_region_init(widgets); break; + case YON_PAGE_LANGUAGE: + yon_language_init(widgets); + break; case YON_PAGE_KEYBOARD: yon_keyboard_init(widgets); break; @@ -418,7 +432,6 @@ void on_page_prev_clicked(GtkWidget *, main_window *widgets){ } void on_page_cancel_clicked(GtkWidget *, main_window *widgets){ - gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_WELCOME); gtk_widget_hide(widgets->BackButton); gtk_widget_hide(widgets->SourceButton); gtk_widget_hide(widgets->SkipInstallationButton); @@ -436,11 +449,16 @@ void on_page_cancel_clicked(GtkWidget *, main_window *widgets){ data->title=WARNING_TITLE_LABEL; if (yon_confirmation_dialog_call(widgets->MainWindow,data)==GTK_RESPONSE_ACCEPT ){ if (main_config.install_thread){ + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_LICENCE); + on_page_prev_clicked(NULL,widgets); 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); } } + } else { + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_LICENCE); + on_page_prev_clicked(NULL,widgets); } } @@ -451,8 +469,13 @@ void on_system_setup_pass(GtkWidget *, main_window *widgets){ } else { if (main_config.install_complete) { gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETION); + yon_page_init(widgets,YON_PAGE_COMPLETION); + yon_page_update(widgets); } else { gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION); + yon_page_init(widgets,YON_PAGE_INSTALLATION); + yon_page_update(widgets); + } } yon_page_update(widgets); diff --git a/source/ubinstall-gtk-region.c b/source/ubinstall-gtk-region.c index 5a51c75..22a8af0 100644 --- a/source/ubinstall-gtk-region.c +++ b/source/ubinstall-gtk-region.c @@ -77,8 +77,6 @@ void yon_region_init(main_window *widgets){ GtkTreeIter iter; gtk_list_store_clear(widgets->LanguagesList); - - yon_locale_init(); config_str languages = yon_config_load(languages_command,&size); diff --git a/source/ubinstall-gtk-saving.c b/source/ubinstall-gtk-saving.c index 78c8281..165605a 100644 --- a/source/ubinstall-gtk-saving.c +++ b/source/ubinstall-gtk-saving.c @@ -1,52 +1,33 @@ #include "ubinstall-gtk.h" - - -// void _yon_saving_threaded(char *final_command){ -// FILE *file = popen(final_command,"r"); -// int file_save; -// config_str file_return = yon_config_load_file(file,&file_save); -// pclose(file); -// file_return = yon_char_parsed_append(file_return,&file_save,final_command); -// char *result = yon_char_parsed_to_string(file_return,file_save,""); -// yon_debug_output("%s\n",result); -// yon_char_parsed_free(file_return,file_save); -// free(result); -// } - void yon_config_save_proceed(char *path, YON_CONFIG_TYPE type){ yon_debug_output("%s\n",yon_config_save_simple(type,path)); } - -void yon_load_proceed(YON_CONFIG_TYPE type){ + +void yon_load_proceed(YON_CONFIG_TYPE type){ if (type!=YON_CONFIG_CUSTOM){ yon_config_clean(); - yon_config_load_config(YON_CONFIG_DEFAULT,yon_config_get_command(main_config.config_load_path),NULL); } - if (type==YON_CONFIG_GLOBAL){ - yon_config_load_config(type,yon_config_get_command(main_config.config_load_path),NULL); - } else if (type==YON_CONFIG_LOCAL){ - yon_config_load_config(type,yon_config_get_command(main_config.config_load_path),NULL); - } else if (type==YON_CONFIG_CUSTOM){ - textdomain(template_ui_LocaleName); - GtkWidget *dialog = yon_config_save_window_new(); - textdomain(LocaleName); - int response = gtk_dialog_run(GTK_DIALOG(dialog)); - if (response == GTK_RESPONSE_ACCEPT){ - char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); - if (!yon_char_is_empty(file)){ - main_config.config_load_path=yon_char_new(file); + if (!yon_char_is_empty(config_get_default_command)) + yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL); + switch (type){ + case YON_CONFIG_GLOBAL: + yon_config_load_config(type,config_get_command("global"),NULL); + break; + case YON_CONFIG_LOCAL: + yon_config_load_config(type,config_get_command("system"),NULL); + break; + case YON_CONFIG_CUSTOM: + char *path = NULL; + path=yon_custom_config_init(GTK_FILE_CHOOSER_ACTION_OPEN); + if (!yon_char_is_empty(path)){ yon_config_clean(); - if (!yon_char_is_empty(config_get_default_command)) - yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL); - char *command = yon_config_get_command(main_config.config_load_path); - yon_config_load_config(type,command,NULL); - } - gtk_widget_destroy(dialog); - } else { - gtk_widget_destroy(dialog); - } - } + yon_config_load_config(type,config_get_command(path),NULL); + } + break; + default: + break; + } } void on_config_local_load(GtkWidget *,main_window *widgets){ @@ -83,7 +64,7 @@ void on_config_custom_load_last(GtkWidget *,main_window *widgets){ yon_config_clean(); if (!yon_char_is_empty(config_get_default_command)) yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL); - char *command = yon_config_get_command(main_config.config_load_path); + char *command = config_get_command(main_config.config_load_path); yon_config_load_config(YON_CONFIG_CUSTOM,command,NULL); yon_page_init(widgets,gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook))); main_config.load_mode=YON_CONFIG_CUSTOM; @@ -106,372 +87,6 @@ void on_config_global_save(GtkWidget *,main_window *widgets){ } -// void on_config_custom_save(GtkWidget *, main_window *widgets){ -// char *path = NULL; -// GtkWidget *dialog = gtk_file_chooser_dialog_new(TITLE_LABEL,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,SAVE_LABEL,GTK_RESPONSE_ACCEPT,NULL); -// textdomain(TITLE_LABEL); -// GtkFileFilter *filter = gtk_file_filter_new(); -// gtk_window_set_icon_name(GTK_WINDOW(dialog),yon_char_append("com.ublinux.",LocaleName)); -// gtk_file_filter_add_pattern(filter,"*.ini"); -// gtk_file_filter_set_name(filter, "*.ini"); -// gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter); -// int response = gtk_dialog_run(GTK_DIALOG(dialog)); -// if (response == GTK_RESPONSE_ACCEPT){ -// char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); -// if (!yon_char_is_empty(file)){ -// if (!strstr(file,".ini")) file = yon_char_append(file,".ini"); -// if (access(file,0)!=F_OK){ -// char *command_creation = ubconfig_file_create(file); -// int a = system(yon_debug_output("%s\n",command_creation)); -// if (access(file,0)!=F_OK||a){ -// yon_ubl_status_box_render(CUSTOM_CONFIG_CREATION_ERROR_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); -// return; -// } -// } -// } -// path = yon_char_unite("'",file,"'",NULL); -// free(file); -// gtk_widget_destroy(dialog); -// } else { -// gtk_widget_destroy(dialog); -// return; -// } -// yon_save_proceed(path,YON_CONFIG_CUSTOM); -// if (path) free(path); -// gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETED); -// } -// -// void yon_open_browser(GtkWidget *, char *link); -// void yon_open_browser(GtkWidget *, char *link){ -// GtkWidget *window = yon_ubl_browser_window_open(link,TITLE_LABEL); -// if (window) -// gtk_window_set_icon_name(GTK_WINDOW(window),yon_char_append("com.ublinux.",LocaleName)); -// } - -// void yon_interface_update(main_window *widgets){ -// if (widgets){}; -// enum YON_PAGES page=YON_PAGE_COMPLETED; -// char *type = config(AUTOINSTALL_TYPE_INSTALL); -// if (!yon_char_is_empty(type)){ -// if (!strcmp(type,"fast")){ -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationRadio),1); -// page = YON_PAGE_INSTALL_COMMON; -// } else if (!strcmp(type,"next")){ -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationNearRadio),1); -// page = YON_PAGE_INSTALL_SEPARATE; -// } else if (!strcmp(type,"part")){ -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationLinuxRadio),1); -// page = YON_PAGE_INSTALL_SAME_PARTITION; -// } else if (!strcmp(type,"grub_install")){ -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->GrubInstallRadio),1); -// page = YON_PAGE_OPTIONS_GRUB_INSTALL; -// } else if (!strcmp(type,"grub_update")){ -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->GrubUpdateRadio),1); -// page = YON_PAGE_OPTIONS_GRUB_UPDATE; -// } else if (!strcmp(type,"system_only")){ -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->OSRadio),1); -// page = YON_PAGE_OPTIONS_OS_ONLY; -// } else if (!strcmp(type,"data_only")){ -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UserDataOnlyRadio),1); -// page = YON_PAGE_OPTIONS_USRDATA_ONLY; -// } else if (!strcmp(type,"custom")){ -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SeparateRadio),1); -// page = YON_PAGE_OPTIONS_SEPARATE; -// } -// } -// char *device = config(AUTOINSTALL_DEVICE); -// char *part = NULL; -// if (page!=YON_PAGE_INSTALL_COMMON) -// part = config(part_parameter); -// char *fs_type = config(part_fs_type_parameter); -// char *device_label = config(device_label_parameter); -// char *format = config(part_format_parameter); -// char *part_size = config(part_size_parameter); -// GtkListStore *device_list = widgets->DevicesList; -// GtkListStore *part_list=widgets->PartitionsList; -// GtkWidget *device_tree=NULL; -// GtkWidget *part_tree=NULL; -// switch (page){ -// case YON_PAGE_INSTALL_COMMON:{ -// device_tree = widgets->CommonInstallationDevicesTree; -// } break; -// -// case YON_PAGE_INSTALL_SEPARATE:{ -// device_tree = widgets->NextInstallationSysDevicesTree; -// part_tree = widgets->NextInstallationSysSectionTree; -// if (!yon_char_is_empty(part_size)){ -// gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->NextInstallationSizeSpin),atof(part_size)); -// if (part_size[strlen(part_size)-1]=='M') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->NextInstallationSizeTypeSpin),0); -// if (part_size[strlen(part_size)-1]=='G') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->NextInstallationSizeTypeSpin),1); -// if (part_size[strlen(part_size)-1]=='T') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->NextInstallationSizeTypeSpin),2); -// } -// if (format&&!strcmp(format,"yes")) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck),1); -// else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck),main_config.format_default); -// if (!yon_char_is_empty(fs_type)) -// gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->NextInstallationFilesystemTypeCombo),fs_type); -// if (device_label) -// gtk_entry_set_text(GTK_ENTRY(widgets->NextInstallationSectionNameEntry),device_label); -// else -// gtk_entry_set_text(GTK_ENTRY(widgets->NextInstallationSectionNameEntry),""); -// -// } break; -// -// case YON_PAGE_INSTALL_SAME_PARTITION:{ -// device_tree = widgets->SamePlaceDeviceTree; -// part_tree = widgets->SamePlacePartTree; -// if (!yon_char_is_empty(fs_type)) -// gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->SameInstallationFilesystemTypeCombo),fs_type); -// if (format&&!strcmp(format,"yes")) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck),1); -// else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck),main_config.format_default); -// if (device_label) -// gtk_entry_set_text(GTK_ENTRY(widgets->SameInstallationSectionNameEntry),device_label); -// else -// gtk_entry_set_text(GTK_ENTRY(widgets->SameInstallationSectionNameEntry),""); -// -// } break; -// case YON_PAGE_OPTIONS_GRUB_INSTALL:{ -// device_tree = widgets->GrubInstallDevicesTree; -// } break; -// -// case YON_PAGE_OPTIONS_GRUB_UPDATE:{ -// device_tree = widgets->GrubUpdateDevicesTree; -// } break; -// -// case YON_PAGE_OPTIONS_SEPARATE:{ -// GtkTreeIter iter; -// device_tree = widgets->SeparateDevicesTree; -// part_tree = widgets->SeparateSysSectionTree; -// for_iter(GTK_TREE_MODEL(device_list),&iter){ -// char *cur_device; -// gtk_tree_model_get(GTK_TREE_MODEL(device_list),&iter, 0,&cur_device,-1); -// if (!strcmp(cur_device,device)){ -// gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(device_tree)),&iter); -// break; -// } -// } -// on_near_installation_device_changed(device_tree,widgets); -// for_iter(GTK_TREE_MODEL(part_list),&iter){ -// char *cur_part; -// gtk_tree_model_get(GTK_TREE_MODEL(device_list),&iter, 0,&cur_part,-1); -// if (!strcmp(cur_part,part)){ -// gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(part_tree)),&iter); -// } -// } -// } break; -// -// case YON_PAGE_OPTIONS_OS_ONLY:{ -// device_tree = widgets->OSDevicesTree; -// part_tree = widgets->OSSysSectionTree; -// } break; -// -// case YON_PAGE_OPTIONS_USRDATA_ONLY:{ -// device_tree = widgets->UserdataDevicesTree; -// part_tree = widgets->UserdataSysSectionTree; -// } break; -// -// default:{}break; -// } -// GtkTreeIter iter; -// char *cur_device=""; -// if (page!=YON_PAGE_OPTIONS_SEPARATE && !yon_char_is_empty(device)){ -// for_iter (widgets->DevicesList,&iter){ -// gtk_tree_model_get(GTK_TREE_MODEL(widgets->DevicesList),&iter,0,&cur_device,-1); -// if (!strcmp(device,cur_device)){ -// gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(device_tree)),&iter); -// break; -// } -// } -// on_near_installation_device_changed(device_tree,widgets); -// if (!yon_char_is_empty(part)){ -// for_iter (widgets->PartitionsList,&iter){ -// gtk_tree_model_get(GTK_TREE_MODEL(widgets->PartitionsList),&iter,0,&part,-1); -// if (!strcmp(device,cur_device)){ -// gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(part_tree)),&iter); -// break; -// } -// } -// } -// } -// char *system_locale = config(locale_parameter); -// if (!yon_char_is_empty(system_locale)){ -// char *chosen_langs = ""; -// for_iter(widgets->LanguagesList,&iter){ -// char *cur=NULL, *render = NULL; -// gtk_tree_model_get(GTK_TREE_MODEL(widgets->LanguagesList),&iter,1,&render,2,&cur,-1); -// if (strstr(system_locale,cur)){ -// gtk_list_store_set((widgets->LanguagesList),&iter,0,1,-1); -// chosen_langs = yon_char_unite(chosen_langs,!yon_char_is_empty(chosen_langs)?";":"",render,NULL); -// } else { -// gtk_list_store_set((widgets->LanguagesList),&iter,0,0,-1); -// } -// } -// if (!yon_char_is_empty(chosen_langs)){ -// gtk_entry_set_text(GTK_ENTRY(widgets->AvailableLanguagesEntry),chosen_langs); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->LanguagesSensitiveCheck),1); -// free(chosen_langs); -// } else { -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->LanguagesSensitiveCheck),0); -// gtk_entry_set_text(GTK_ENTRY(widgets->AvailableLanguagesEntry),""); -// } -// } else { -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->LanguagesSensitiveCheck),0); -// gtk_entry_set_text(GTK_ENTRY(widgets->AvailableLanguagesEntry),""); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->LanguagesSensitiveCheck),0); -// int langsize; -// config_str lang = default_langs(&langsize); -// for_iter(widgets->LanguagesList,&iter){ -// char *cur=NULL; -// gtk_tree_model_get(GTK_TREE_MODEL(widgets->LanguagesList),&iter,2,&cur,-1); -// if (lang&&yon_char_parsed_check_exist(lang,langsize,cur)>-1){ -// gtk_list_store_set(widgets->LanguagesList,&iter,0,1,-1); -// } else { -// gtk_list_store_set(widgets->LanguagesList,&iter,0,0,-1); -// } -// if (cur) free(cur); -// } -// if (langsize) yon_char_parsed_free(lang,langsize); -// } -// char *zone = config(zone_parameter); -// char *region = NULL; -// -// if (!yon_char_is_empty(zone)) region = yon_char_divide_search(zone,"/",-1); else {gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RegionSensitiveSwitch),0);} -// if (!yon_char_is_empty(region)){ -// gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->RegionCombo),region); -// } else { -// gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->RegionCombo),"Europe"); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RegionSensitiveSwitch),0); -// } -// if (!yon_char_is_empty(zone)){ -// gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->ZoneCombo),zone); -// } else { -// gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->ZoneCombo),"Moscow"); -// } -// char *language = config(lang_parameter); -// if (!yon_char_is_empty(language)){ -// gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->LanguageCombo),language); -// } else { -// gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LanguageCombo),0); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->MainLanguageSensitiveCheck),0); -// } -// char *kbmodel = config (xkbmodel_parameter); -// char *optinos = config(xkboptions_parameter); -// char *layout = config(xkblayout_parameter); -// if (!yon_char_is_empty(kbmodel)){ -// gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->KeyboardModelCombo),kbmodel); -// } else { -// gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->KeyboardModelCombo),0); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->KeyboardModelSensitiveCheck),0); -// -// } -// if (!yon_char_is_empty(optinos)){ -// gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->LayoutBindingCombo),optinos); -// } else { -// gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LayoutBindingCombo),0); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->OptionsSensitiveCheck),0); -// } -// if (!yon_char_is_empty(layout)){ -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->ManualLayoutRadio),1); -// for_iter(widgets->LayoutList,&iter){ -// char *cur=NULL; -// gtk_tree_model_get(GTK_TREE_MODEL(widgets->LayoutList),&iter,0,&cur,-1); -// if (strstr(layout,cur)){ -// gtk_tree_store_set(widgets->LayoutList,&iter,3,1,-1); -// } else { -// gtk_tree_store_set(widgets->LayoutList,&iter,3,0,-1); -// } -// } -// } else { -// for_iter(widgets->LayoutList,&iter){ -// char *id; -// gtk_tree_model_get(GTK_TREE_MODEL(widgets->LayoutList),&iter,0,&id,-1); -// if (!strcmp(id,"ru")||!strcmp(id,"us")){ -// gtk_tree_store_set(widgets->LayoutList,&iter,3,1,-1); -// } else { -// gtk_tree_store_set((widgets->LayoutList),&iter,3,0,-1); -// } -// } -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->LayoutSensitiveCheck),0); -// } -// char *user_name = config(user_name_parameter); -// char *user_gecos = config(user_gecos_parameter); -// char *user_password = config(user_password_parameter); -// char *root_password = config(root_password_parameter); -// char *autologin = config(autologin_parameter); -// char *hostname = config(hostname_parameter); -// if (!yon_char_is_empty(user_name)){ -// if (!strcmp(user_name,"root")){ -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UserRootOnlyCheck),1); -// } else { -// gtk_entry_set_text(GTK_ENTRY(widgets->UserRootLoginEntry),user_name); -// } -// } else { -// gtk_entry_set_text(GTK_ENTRY(widgets->UserRootLoginEntry),""); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->LoginSensitiveCheck),0); -// } -// if (!yon_char_is_empty(user_gecos)){ -// gtk_entry_set_text(GTK_ENTRY(widgets->UserRootNameEntry),_(user_gecos)); -// } else { -// gtk_entry_set_text(GTK_ENTRY(widgets->UserRootNameEntry),""); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UsernameSensitiveCheck),0); -// } -// int def_size=0; -// config_str default_password = NULL; -// if (!getuid()){ -// default_password = yon_config_load(yon_debug_output("%s\n",get_default_password_command), &def_size); -// if (def_size>0&&default_password){ -// yon_char_remove_last_symbol(default_password[0],'\n'); -// } -// } -// if ((def_size>0&&!strcmp(default_password[0],user_password))||yon_char_is_empty(user_password)){ -// gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UserRootPasswordCombo),0); -// gtk_entry_set_text(GTK_ENTRY(widgets->UserRootPasswordEntry),""); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->PasswordSensitiveCheck),0); -// -// } else if (!yon_char_is_empty(user_password)){ -// gtk_entry_set_text(GTK_ENTRY(widgets->UserRootPasswordEntry),user_password); -// gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UserRootPasswordCombo),1); -// } -// if ((def_size>0&&!strcmp(default_password[0],user_password))||yon_char_is_empty(user_password)){ -// gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->AdminPasswordCombo),0); -// gtk_entry_set_text(GTK_ENTRY(widgets->AdminPasswordEntry),""); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->RootPasswordSensitiveCheck),0); -// -// } else if (!yon_char_is_empty(root_password)){ -// gtk_entry_set_text(GTK_ENTRY(widgets->AdminPasswordEntry),root_password); -// gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->AdminPasswordCombo),1); -// } -// if (!yon_char_is_empty(autologin)){ -// if (!strcmp(autologin,"yes")) -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UserAutologinSwitch),1); -// else -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UserAutologinSwitch),0); -// } else { -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UserAutologinSwitch),main_config.autologin_default); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutologinSensitiveCheck),0); -// } -// if (!yon_char_is_empty(hostname)){ -// if (strcmp(hostname,"auto")){ -// gtk_entry_set_text(GTK_ENTRY(widgets->HotnameEntry),hostname); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutoHostnameCheck),0); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->HostnameSensitiveCheck),1); -// } else{ -// gtk_entry_set_text(GTK_ENTRY(widgets->HotnameEntry),""); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutoHostnameCheck),1); -// } -// } else { -// gtk_entry_set_text(GTK_ENTRY(widgets->HotnameEntry),""); -// g_signal_handlers_block_by_func(G_OBJECT(widgets->AutoHostnameCheck),on_autohostname_check,widgets); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutoHostnameCheck),1); -// g_signal_handlers_unblock_by_func(G_OBJECT(widgets->AutoHostnameCheck),on_autohostname_check,widgets); -// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->HostnameSensitiveCheck),0); -// } -// } - gboolean on_install_success(main_window *widgets){ gtk_label_set_text(GTK_LABEL(widgets->InstallationLabel),""); gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETION); diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 5c88d01..5d0f8f5 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -1,6 +1,11 @@ #include "ubinstall-gtk.h" config main_config; + +void yon_license_init(main_window *widgets){ + gtk_widget_set_sensitive(widgets->NextButton,0); +} + void yon_open_browser(GtkWidget *, char *link){ GtkWidget *window = yon_ubl_browser_window_open(link,TITLE_LABEL); if (window) @@ -566,6 +571,16 @@ void config_init(){ yon_char_parsed_free(parsed,parsed_size); } yon_char_parsed_free(languages,size); + + main_config.layouts_store = gtk_tree_store_new(4,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_BOOLEAN); + main_config.variants_list = yon_config_load(layouts_variant_command,&main_config.variants_size); + main_config.layouts_list = yon_config_load(layouts_command,&main_config.layouts_size); + for (int i=0;iStatusBox2 = yon_gtk_builder_get_widget(builder,"StatusBox2"); widgets->Notebook = yon_gtk_builder_get_widget(builder,"Notebook"); widgets->MainSpinner=yon_gtk_builder_get_widget(builder,"MainSpinner"); + widgets->LicenseAgreeRadio = yon_gtk_builder_get_widget(builder,"LicenseAgreeRadio"); + widgets->LicenseDisgreeRadio = yon_gtk_builder_get_widget(builder,"LicenseDisgreeRadio"); widgets->EnableVNCMenuItem = yon_gtk_builder_get_widget(builder,"EnableVNCMenuItem"); widgets->DocumentationMenuItem = yon_ubl_menu_item_documentation_new(DOCUMENTATION_LABEL); @@ -832,7 +849,6 @@ void yon_main_window_create(main_window *widgets){ widgets->WelcomeToggle=yon_gtk_builder_get_widget(builder,"WelcomeToggle"); widgets->LicenceToggle=yon_gtk_builder_get_widget(builder,"LicenceToggle"); widgets->LocationToggle=yon_gtk_builder_get_widget(builder,"LocationToggle"); - widgets->KeyboardToggle=yon_gtk_builder_get_widget(builder,"KeyboardToggle"); widgets->SectionsToggle=yon_gtk_builder_get_widget(builder,"SectionsToggle"); widgets->UsersToggle=yon_gtk_builder_get_widget(builder,"UsersToggle"); widgets->SummaryToggle=yon_gtk_builder_get_widget(builder,"SummaryToggle"); @@ -937,7 +953,7 @@ void yon_main_window_create(main_window *widgets){ widgets->LanguagesFilter = GTK_TREE_MODEL(gtk_builder_get_object(builder,"LanguagesFilter")); widgets->LayoutsFilter = GTK_TREE_MODEL(gtk_builder_get_object(builder,"LayoutsFilter")); - widgets->LayoutList = GTK_TREE_STORE(gtk_builder_get_object(builder,"LayoutList")); + widgets->LayoutsList = GTK_LIST_STORE(gtk_builder_get_object(builder,"LayoutsList")); widgets->LanguagesTree=yon_gtk_builder_get_widget(builder,"LanguagesTree"); widgets->CountryLanguagesTree=yon_gtk_builder_get_widget(builder,"CountryLanguagesTree"); widgets->InstallerCountryList=GTK_LIST_STORE(gtk_builder_get_object(builder,"InstallerCountryList")); @@ -949,7 +965,6 @@ void yon_main_window_create(main_window *widgets){ widgets->AvailableLanguagesEntry=yon_gtk_builder_get_widget(builder,"AvailableLanguagesEntry"); widgets->AvailableLanguagesButton=yon_gtk_builder_get_widget(builder,"AvailableLanguagesButton"); widgets->LanguagesCombo=yon_gtk_builder_get_widget(builder,"LanguagesCombo"); - widgets->KeyboardModelCombo=yon_gtk_builder_get_widget(builder,"KeyboardModelCombo"); widgets->LayoutBindingCombo=yon_gtk_builder_get_widget(builder,"LayoutBindingCombo"); widgets->LayoutTree=yon_gtk_builder_get_widget(builder,"LayoutTree"); widgets->AddButton=yon_gtk_builder_get_widget(builder,"AddButton"); @@ -966,18 +981,33 @@ void yon_main_window_create(main_window *widgets){ widgets->UserAddBox=yon_gtk_builder_get_widget(builder,"UserAddBox"); widgets->UserAddButton=yon_gtk_builder_get_widget(builder,"UserAddButton"); + widgets->LocaleTree = yon_gtk_builder_get_widget(builder,"LocaleTree"); + widgets->LocaleAddButton = yon_gtk_builder_get_widget(builder,"LocaleAddButton"); + widgets->LocaleRemoveButton = yon_gtk_builder_get_widget(builder,"LocaleRemoveButton"); + widgets->LocaleDefaultSwitch = yon_gtk_builder_get_widget(builder,"LocaleDefaultSwitch"); + widgets->LocaleCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"LocaleCell")); + widgets->LanguageList = GTK_LIST_STORE(gtk_builder_get_object(builder,"LanguageList")); + widgets->HotnameEntry=yon_gtk_builder_get_widget(builder,"HotnameEntry"); widgets->mainSettingsButton=yon_gtk_builder_get_widget(builder,"mainSettingsButton"); widgets->RegionImage = yon_gtk_builder_get_widget(builder,"RegionImage"); widgets->RegionBox = yon_gtk_builder_get_widget(builder,"RegionBox"); widgets->RegionAspect = yon_gtk_builder_get_widget(builder,"RegionAspect"); - widgets->KeyboardImage = yon_gtk_builder_get_widget(builder,"KeyboardImage"); - widgets->KeyboardBox = yon_gtk_builder_get_widget(builder,"KeyboardBox"); - widgets->KeyboardLayoutChosenCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"KeyboardLayoutChosenCell")); + + widgets->KeyboardModelCombo = yon_gtk_builder_get_widget(builder,"KeyboardModelCombo"); + widgets->KeyboardDefaultLayoutsSwitch = yon_gtk_builder_get_widget(builder,"KeyboardDefaultLayoutsSwitch"); + widgets->KeyboardLayoutTree = yon_gtk_builder_get_widget(builder,"KeyboardLayoutTree"); + widgets->KeyboardLayoutMoveUpButton = yon_gtk_builder_get_widget(builder,"KeyboardLayoutMoveUpButton"); + widgets->KeyboardLayoutMoveDownButton = yon_gtk_builder_get_widget(builder,"KeyboardLayoutMoveDownButton"); + widgets->KeyboardLayoutAddButton = yon_gtk_builder_get_widget(builder,"KeyboardLayoutAddButton"); + widgets->KeyboardLayoutRemoveButton = yon_gtk_builder_get_widget(builder,"KeyboardLayoutRemoveButton"); + widgets->KeyboardLayoutChangingCombo = yon_gtk_builder_get_widget(builder,"KeyboardLayoutChangingCombo"); + widgets->KeyboardComposeSwitch = yon_gtk_builder_get_widget(builder,"KeyboardComposeSwitch"); + widgets->KeyboardScrollLockSwitch = yon_gtk_builder_get_widget(builder,"KeyboardScrollLockSwitch"); + widgets->KeyboardNumLockCombo = yon_gtk_builder_get_widget(builder,"KeyboardNumLockCombo"); widgets->AdditionalComponentsList = yon_gtk_builder_get_widget(builder,"AdditionalComponentsList"); - widgets->InstallationProgress = yon_gtk_builder_get_widget(builder,"InstallationProgress"); widgets->InstallationLabel = yon_gtk_builder_get_widget(builder,"InstallationLabel"); widgets->ReadShortLogButton = yon_gtk_builder_get_widget(builder,"ReadShortLogButton"); @@ -1064,6 +1094,8 @@ void yon_main_window_create(main_window *widgets){ gtk_menu_shell_append(GTK_MENU_SHELL(menu),widgets->DocumentationMenuItem); gtk_menu_shell_append(GTK_MENU_SHELL(menu),widgets->AboutMenuItem); + g_signal_connect(G_OBJECT(widgets->LicenseAgreeRadio),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->NextButton); + g_signal_connect(G_OBJECT(widgets->LoadGlobalConfigurationMenuItem),"activate",G_CALLBACK(on_config_global_load),widgets); g_signal_connect(G_OBJECT(widgets->LoadLocalConfigurationMenuItem),"activate",G_CALLBACK(on_config_local_load),widgets); g_signal_connect(G_OBJECT(widgets->LoadExternalConfigurationMenuItem),"activate",G_CALLBACK(on_config_custom_load),widgets); @@ -1080,13 +1112,28 @@ void yon_main_window_create(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->MainWindow),"check-resize",G_CALLBACK(on_region_resized),widgets); g_signal_connect(G_OBJECT(widgets->NextButton),"clicked",G_CALLBACK(on_page_next_clicked),widgets); g_signal_connect(G_OBJECT(widgets->BackButton),"clicked",G_CALLBACK(on_page_prev_clicked),widgets); + + g_signal_connect(G_OBJECT(widgets->LocaleAddButton),"clicked",G_CALLBACK(on_language_open),widgets); + g_signal_connect(G_OBJECT(widgets->LocaleRemoveButton),"clicked",G_CALLBACK(on_language_remove),widgets); + g_signal_connect(G_OBJECT(widgets->LocaleDefaultSwitch),"state-set",G_CALLBACK(on_language_default_toggled),widgets); + g_signal_connect(G_OBJECT(widgets->LocaleCell),"toggled",G_CALLBACK(on_locale_toggled),widgets); + g_signal_connect(G_OBJECT(widgets->CancelInstallButton),"clicked",G_CALLBACK(on_page_cancel_clicked),widgets); - g_signal_connect(G_OBJECT(widgets->AvailableLanguagesButton),"clicked",G_CALLBACK(on_language_clicked),widgets); g_signal_connect(G_OBJECT(widgets->RegionCombo),"changed",G_CALLBACK(on_region_changed),widgets); g_signal_connect(G_OBJECT(widgets->RegionSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->RegionCombo); g_signal_connect(G_OBJECT(widgets->RegionSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->ZoneCombo); - g_signal_connect(G_OBJECT(widgets->AddButton),"clicked",G_CALLBACK(on_keyboard_clicked),widgets); - g_signal_connect(G_OBJECT(widgets->RemoveButton),"clicked",G_CALLBACK(on_keyboard_removed),widgets); + + g_signal_connect(G_OBJECT(widgets->KeyboardLayoutTree),"cursor-changed",G_CALLBACK(on_layout_selection_changed),widgets); + g_signal_connect(G_OBJECT(widgets->KeyboardDefaultLayoutsSwitch),"state-set",G_CALLBACK(on_layout_default_toggled),widgets); + g_signal_connect(G_OBJECT(widgets->KeyboardDefaultLayoutsSwitch),"state-set",G_CALLBACK(on_layout_default_sensitive_toggled),widgets); + g_signal_connect(G_OBJECT(widgets->KeyboardLayoutMoveUpButton),"clicked",G_CALLBACK(on_layout_move_up),widgets); + g_signal_connect(G_OBJECT(widgets->KeyboardLayoutMoveDownButton),"clicked",G_CALLBACK(on_layout_move_down),widgets); + g_signal_connect(G_OBJECT(widgets->KeyboardLayoutAddButton),"clicked",G_CALLBACK(on_system_layouts_add),widgets); + g_signal_connect(G_OBJECT(widgets->KeyboardLayoutRemoveButton),"clicked",G_CALLBACK(on_system_layouts_remove),widgets); + g_signal_connect(G_OBJECT(widgets->KeyboardModelCombo),"changed",G_CALLBACK(on_model_changed),widgets); + g_signal_connect(G_OBJECT(widgets->KeyboardNumLockCombo),"changed",G_CALLBACK(on_num_lock_changed),widgets); + g_signal_connect(G_OBJECT(widgets->KeyboardComposeSwitch),"state-set",G_CALLBACK(on_compose_switch),widgets); + g_signal_connect(G_OBJECT(widgets->KeyboardScrollLockSwitch),"state-set",G_CALLBACK(on_scroll_lock_switch),widgets); g_signal_connect(G_OBJECT(widgets->GrubInstallDevicesTree),"cursor-changed",G_CALLBACK(on_device_selection_changed),widgets); g_signal_connect(G_OBJECT(widgets->GrubUpdateDevicesTree),"cursor-changed",G_CALLBACK(on_device_selection_changed),widgets); @@ -1106,7 +1153,6 @@ void yon_main_window_create(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->UserAddButton),"clicked",G_CALLBACK(on_user_add),widgets); g_signal_connect(G_OBJECT(widgets->UserRootPasswordButton),"clicked",G_CALLBACK(yon_password_root_new),widgets); g_signal_connect(G_OBJECT(widgets->BootloadDefaulOSButton),"clicked",G_CALLBACK(yon_menu_window_open),widgets); - gtk_tree_model_filter_set_visible_column(GTK_TREE_MODEL_FILTER(widgets->LayoutsFilter),3); g_signal_connect(G_OBJECT(widgets->LanguagesTree),"cursor-changed",G_CALLBACK(on_locale_changed),widgets); g_signal_connect(G_OBJECT(widgets->CountryLanguagesTree),"row-activated",G_CALLBACK(on_installer_language_changed),widgets); @@ -1157,7 +1203,6 @@ void yon_main_window_create(main_window *widgets){ // g_signal_connect(G_OBJECT(widgets->AdvancedAddButton),"clicked",G_CALLBACK(on_install_advanced_add_new),widgets); g_signal_connect(G_OBJECT(widgets->AdvancedDeviceChosenCell),"toggled",G_CALLBACK(on_install_advanced_device_chosen),widgets); // g_signal_connect(G_OBJECT(widgets->AdvancedPartChosenCell),"toggled",G_CALLBACK(on_install_advanced_partition_chosen),widgets); - g_signal_connect(G_OBJECT(widgets->KeyboardLayoutChosenCell),"toggled",G_CALLBACK(on_keyboard_layout_chosen),widgets); // g_signal_connect(G_OBJECT(widgets->AdvancedPartitionAddBox),"add",G_CALLBACK(on_advanced_parts_added),widgets); // g_signal_connect(G_OBJECT(widgets->AdvancedPartitionAddBox),"remove",G_CALLBACK(on_advanced_parts_removed),widgets); g_signal_connect(G_OBJECT(widgets->StartScenarioButton),"clicked",G_CALLBACK(yon_quick_install),widgets); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index fb7f732..71d3ee1 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -17,7 +17,7 @@ #endif #include "ubl-strings.h" -#define WIKI_LINK "https://wiki.ublinux.com/Software/Programs_and_utilities/All/ubinstall-gtk" +#define WIKI_LINK "https://wiki.ublinux.com/software/programs_and_utilities/all/ubinstall-gtk" #define _(String) gettext(String) @@ -38,6 +38,8 @@ #define glade_path_configuration_mode "/com/ublinux/ui/ubinstall-gtk-configuration-mode.glade" #define glade_path_source "/com/ublinux/ui/ubinstall-gtk-source.glade" #define glade_path_source_element "/com/ublinux/ui/ubinstall-gtk-source-element.glade" +#define glade_locales_path "/com/ublinux/ui/ubinstall-gtk-layouts.glade" +#define glade_layouts_path "/com/ublinux/ui/ubinstall-gtk-keyboard-layouts.glade" #define CssPath "/com/ublinux/css/ubinstall-gtk.css" #define config_path yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL) @@ -107,6 +109,7 @@ NULL #define get_ntp_ru_command "ubconfig --default get [network] NTPSERVERS_RU" #define get_models_command "sed '/<\\/modelList>/q' /usr/share/X11/xkb/rules/base.xml | grep -E '^ {8,8}|^ {8,8}'|sed -e 's/ *//g' -e 's,,,g' -e 's/ *//g' -e 's,,,g'" +#define get_keyboard_models_command "sed -En '/^! model$/,/^ *$/!d;s/[[:blank:]]+([^ ]+)[[:blank:]]+(.*)/\\1|\\2/p' /usr/share/X11/xkb/rules/evdev.lst" #define check_is_password_hash(password) system(yon_char_unite("/lib/ublinux/functions is_hash_password '", password,"'",NULL)) @@ -134,8 +137,8 @@ layout && /description:/ {\ #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 enable_vnc_command "ubconfig --target system set [desktop] X11VNC=ublinux" -#define disable_vnc_command "ubconfig --target system remove [desktop] X11VNC=ublinux" +#define enable_vnc_command "ubconfig --target system set [desktop] X11VNC[password]=ublinux" +#define disable_vnc_command "ubconfig --target system remove [desktop] X11VNC[password]" #define get_layouts_local_command(layout) yon_char_unite("xkbcli list --load-exotic | awk -v layout=\"",layout,"\" \"BEGIN {layout_pattern = sprintf(\\\"^ *- *layout: *'%s'\\\",layout);matched=0} matched && /variant:/ {match(\\$0, /: *'([^']+)'/, matches);variant = matches[1]} matched && /description:/ {match(\\$0, /: *(.+)/, matches);description = matches[1]} matched && /^ *-/{matched=0; if (variant) printf \\\"%s|%s\\n\\\",variant,description} \\$0 ~ layout_pattern {matched=1;variant=\\\"\\\";description=\\\"\\\";next}\" | sort -u",NULL) #define get_devices_command "lsblk --noheadings --nodeps -Jo PATH,SIZE,MODEL,VENDOR,SERIAL --exclude 7" @@ -178,6 +181,8 @@ layout && /description:/ {\ #define lang_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL['ubconfig set [locale] LANG']" #define locale_parameter "AUTOINSTALL[ubconfig set [locale] LOCALE]" #define locale_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL['ubconfig set [locale] LOCALE']" +#define num_lock_boot_parameter "AUTOINSTALL['ubconfig set [keyboard] NUMLOCK']" +#define num_lock_boot_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL['ubconfig set [keyboard] NUMLOCK']" /*------------------------------------------------------------*/ #define part_size_parameter "AUTOINSTALL[part_size]" @@ -262,7 +267,7 @@ layout && /description:/ {\ #define full_log_path "/var/log/ubinstall.log" -#define yon_config_get_command(target) yon_char_unite("ubconfig --source ",target," --conarg get [autoinstall] AUTOINSTALL[*]",NULL) +#define config_get_command(target) yon_char_unite("ubconfig --source ",target," --conarg get [autoinstall] AUTOINSTALL[*]",NULL) #define config_get_default_command "ubconfig --source default --conarg get [autoinstall] AUTOINSTALL[*]" @@ -277,6 +282,10 @@ layout && /description:/ {\ #define get_package_info_command(target) yon_char_append("pacman -Si ",target) +#define layouts_command "sed -En '/^! layout$/,/^ *$/!d;s/[[:blank:]]+([^ ]+)[[:blank:]]+(.*)/\\1|\\2/p' /usr/share/X11/xkb/rules/evdev.lst" +#define layouts_variant_command "sed -En '/^! variant$/,/^ *$/!d;s/[[:blank:]]+([^ ]+)[[:blank:]]+([^ :]+):[[:blank:]]+(.*)/\\2|\\1|\\3/p' /usr/share/X11/xkb/rules/evdev.lst" +#define grp_options_command "sed -En '/^! option$/,/^ *$/!d;s/[[:blank:]]+(grp:[^ ]+)[[:blank:]]+(.*)/\\1|\\2/p' /usr/share/X11/xkb/rules/evdev.lst" + #define install_common_parameters \ AUTOINSTALL_TYPE_INSTALL,\ AUTOINSTALL_DEVICE,\ @@ -351,11 +360,13 @@ enum YON_PAGES { YON_PAGE_SOFTWARE, YON_PAGE_PACMAN_SOFTWARE, YON_PAGE_REGION, + YON_PAGE_LANGUAGE, YON_PAGE_KEYBOARD, YON_PAGE_USERS, YON_PAGE_STARTUP, YON_PAGE_BOOTLOADER, YON_PAGE_NETWORK, + YON_PAGE_PACKAGES_HUB, YON_PAGE_INSTALLATION, YON_PAGE_COMPLETION, YON_PAGE_COMPLETED, @@ -406,6 +417,14 @@ typedef struct { unsigned int cur_slide; gboolean dry_run; + + GtkTreeStore *layouts_store; + + GtkListStore *models_list; + config_str variants_list; + int variants_size; + config_str layouts_list; + int layouts_size; } config; extern config main_config; @@ -422,7 +441,7 @@ typedef struct { GtkBuilder *builder; GtkListStore *DevicesList; GtkListStore *LanguagesList; - GtkTreeStore *LayoutList; + GtkListStore *LayoutsList; GtkListStore *PartitionsList; GtkWidget *LoadGlobalConfigurationMenuItem; @@ -436,6 +455,9 @@ typedef struct { GtkWidget *MainWindow; + GtkWidget *LicenseAgreeRadio; + GtkWidget *LicenseDisgreeRadio; + GtkWidget *StartScenarioButton; GtkWidget *SourceButton; GtkWidget *SkipInstallationButton; @@ -446,7 +468,6 @@ typedef struct { GtkWidget *WelcomeToggle; GtkWidget *LicenceToggle; GtkWidget *LocationToggle; - GtkWidget *KeyboardToggle; GtkWidget *SectionsToggle; GtkWidget *UsersToggle; GtkWidget *SummaryToggle; @@ -463,7 +484,6 @@ typedef struct { GtkWidget *AvailableLanguagesEntry; GtkWidget *AvailableLanguagesButton; GtkWidget *LanguagesCombo; - GtkWidget *KeyboardModelCombo; GtkWidget *LayoutBindingCombo; GtkWidget *LayoutTree; GtkWidget *AddButton; @@ -494,12 +514,28 @@ typedef struct { GtkWidget *menu1; GtkWidget *menu2; + GtkWidget *LocaleDefaultSwitch; + GtkWidget *LocaleTree; + GtkWidget *LocaleAddButton; + GtkWidget *LocaleRemoveButton; + GtkCellRenderer *LocaleCell; + GtkListStore *LanguageList; + GtkWidget *RegionImage; GtkWidget *RegionBox; GtkWidget *RegionAspect; - GtkWidget *KeyboardImage; - GtkWidget *KeyboardBox; - GtkCellRenderer *KeyboardLayoutChosenCell; + + GtkWidget *KeyboardModelCombo; + GtkWidget *KeyboardDefaultLayoutsSwitch; + GtkWidget *KeyboardLayoutTree; + GtkWidget *KeyboardLayoutMoveUpButton; + GtkWidget *KeyboardLayoutMoveDownButton; + GtkWidget *KeyboardLayoutAddButton; + GtkWidget *KeyboardLayoutRemoveButton; + GtkWidget *KeyboardLayoutChangingCombo; + GtkWidget *KeyboardComposeSwitch; + GtkWidget *KeyboardScrollLockSwitch; + GtkWidget *KeyboardNumLockCombo; GtkWidget *Notebook; GtkWidget *LicenceLabel; @@ -994,6 +1030,43 @@ struct row_data { char *description; }; +typedef struct { + GtkWidget *Window; + GtkWidget *StatusBox; + GtkWidget *LanguagesTree; + + GtkWidget *CancelButton; + GtkWidget *AcceptButton; + GtkWidget *ManualEntry; + GtkWidget *LoadingOverlay; + GtkWidget *LoadingSpinner; + GtkCellRenderer *ToggleCell; + + GtkListStore *LanguagesList; +} language_window; + +struct locales_struct { + char *locale; + char *lang; + char *territory; + int chosen; + GtkListStore *list; +}; + +typedef struct { + GtkWidget *Window; + GtkWidget *StatusBox; + GtkWidget *MainTree; + GtkWidget *CancelButton; + GtkWidget *AcceptButton; + GtkWidget *OptionsFilterCombo; + GtkWidget *OptionsEntry; + GtkCellRenderer *ChosenCell; + GtkTreeStore *list; + GtkListStore *OptionsList; + GtkTreeModel *OptionsFilter; + char *parameters; +} layouts_window; void config_init(); main_window *yon_main_window_complete(); @@ -1169,7 +1242,6 @@ advanced_partition *yon_advanced_partition_new(); void on_advanced_part_remove(GtkWidget *self, main_window *widgets); int yon_advanced_get_part_size(main_window *widgets); void yon_advanced_partition_clear(main_window *widgets); -void yon_layout_build(char *key, GHashTable *value, main_window *widgets); void yon_os_row_setup(os_row *row, char *name, char *version,char *tags, char *description); os_row *yon_os_row_new(); void yon_quick_install(GtkWidget *, main_window *widgets); @@ -1231,4 +1303,38 @@ void *yon_maximize(main_window *widgets); kernel_addon_row *yon_kernel_addon_row_new(); void yon_kernel_addon_row_setup(kernel_addon_row *row, char *name, char *modules,char *package, char *description); void on_kernel_addon_install_enabled(GtkWidget *, kernel_addon_row *row); -void on_kernel_addon_info(GtkLabel *self); \ No newline at end of file +void on_kernel_addon_info(GtkLabel *self); +void yon_license_init(main_window *widgets); +void on_locale_toggle(GtkCellRenderer *, gchar *path,language_window *window); +void on_locale_accept(GtkWidget *self, language_window *window); +gboolean yon_locale_window_set_locales(struct locales_struct *data); +gboolean yon_locale_window_unlock(GtkWidget *spinner); +void *yon_locales_load_func(language_window *window); +language_window *yon_language_window_new(); +void on_language_open(GtkWidget *, main_window *widgets); +void on_language_remove(GtkWidget *, main_window *widgets); +void on_language_default_toggled(GtkWidget *, int status, main_window *widgets); +void on_locale_toggled(GtkCellRenderer *, gchar *path, main_window *widgets); +void yon_language_update(main_window *widgets); +int yon_language_save(main_window *widgets); +void yon_language_init(main_window *widgets); +void on_layouts_accept(GtkWidget *self, layouts_window *window); +void on_layouts_chosen(GtkCellRenderer *, gchar *path, layouts_window *window); +void on_system_layouts_add(GtkWidget *, main_window *widgets); +layouts_window *yon_layouts_window_new(); +void yon_layouts_add(GtkTreeView *, GtkListStore *, main_window *widgets); +void yon_layouts_remove(GtkTreeView *tree, GtkListStore *cur_list, main_window *widgets); +void on_system_layouts_remove(GtkWidget *, main_window *widgets); +config_str yon_layout_get_children(char *layout_id, int *size); +void yon_layout_load(char *layout,main_window *widgets); +void yon_layout_build(layouts_window *window); +void on_layout_move_up(GtkWidget *, main_window *widgets); +void on_layout_move_down(GtkWidget *, main_window *widgets); +void on_compose_switch(GtkWidget *,int status,main_window *widgets); +void on_scroll_lock_switch(GtkWidget *,int status,main_window *widgets); +void on_layout_default_sensitive_toggled(GtkWidget *, int status, main_window *widgets); +void on_layout_default_toggled(GtkWidget *, int status, main_window *widgets); +void on_layout_selection_changed(GtkTreeView *self,main_window *widgets); +void on_num_lock_changed(GtkComboBox *self, main_window *); +void on_model_changed(GtkComboBoxText *self, main_window *widgets); +void on_options_save(GtkWidget *,main_window *widgets); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 5a3b300..24c2978 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -42,7 +42,6 @@ NULL) #define ZONE_LABEL _("Zone:") #define LANGUAGE_LABEL _("Language:") #define KEYBOARD_MODEL_LABEL _("Keyboard model:") -#define LAYOUT_CHANGING_LABEL _("Layout changing:") #define DEFAUL_LAYOUT_LABEL _("Default layout (ru)") #define DEFINE_LABEL _("Define") #define SETTINGS_LABEL _("Settings") @@ -232,6 +231,45 @@ NULL) #define ROOT_FORCE_CONFIGURATION_MODE_LABEL _("Warning! Application was launched without root. Only configuration mode is allowed.") #define PACKAGE_NOT_FOUND_LABEL _("Package were not found") #define PACKAGE_INFO_LABEL _("Package information") +#define LICENCE_AGREE_LABEL _("Yes, I agree to the License Agreement") +#define LICENCE_DISAGREE_LABEL _("No, I do not agree") +#define ADD_LANGUAGE_TITLE_LABEL _("Add locales") +#define LAYOUT_REMOVE_LABEL _("Are you sure you want to remove current layout?") +#define LAYOUT_REMOVE_TITLE_LABEL _("Layout deletion") +#define MANUAL_LABEL _("Manual input:") +#define MODEL_LABEL _("Keyboard model:") + +#define KEYBOARD_LAYOUTS_LABEL _("Keyboard layouts:") + +#define MOVE_UP_LABEL _("Move layout up") +#define MOVE_DOWN_LABEL _("Move layout down") +#define ADD_LABEL _("Add layout") +#define REMOVE_LABEL _("Remove layout") + +#define KEYBOARD_MODEL_LABEL _("Keyboard model:") +#define LAYOUTS_LABEL _("Layouts:") +#define DEFAULT_LAYOUT_LABEL _("Default layout") +#define LAYOUT_CHANGING_LABEL _("Changing the layout:") +#define SET_COMPOSE_LABEL _("Set Compose (Multi_Key) to the right Win key") +#define SCROLL_LOCK_LABEL _("Scroll Lock indication when switching layouts") +#define NUMLOCK_LABEL _("NumLock:") +#define KEYBOARD_LAYOUT_LABEL _("Keyboard layout") +#define DESIGNATION_LABEL _("Designation") +#define VARIANT_LABEL _("Variant") +#define NAME_LABEL _("Name") +#define DESCRIPTION_LABEL _("Description") +#define OPTIONS_LABEL _("Options:") +#define MANUAL_LABEL _("Manual input:") +#define KEYBOARD_TITLE_INFO_LABEL _("Specify your preferred keyboard settings") +#define AVAILABLE_LOCALES_LABEL _("Available locales in the system:") +#define SYSTEM_LOCALE_LABEL _("System locale") +#define LOCALE_LABEL _("Locale") +#define LOCALE_LANGUAGE_LABEL _("Language") +#define TERRITORY_LABEL _("Territory") +#define LANGUAGE_TITLE_INFO_LABEL _("Specify your preferred system languages") +#define REMOVE_LOCALE_TOOLTIP_LABEL _("Remove locale") +#define NEW_PARTITION_LABEL _("New partition:") + // #define _LABEL _("Package:") // #define _LABEL _("Module:") // #define _LABEL _("New section at") diff --git a/ubinstall-gtk-keyboard-layouts.glade b/ubinstall-gtk-keyboard-layouts.glade new file mode 100644 index 0000000..7a0cb5a --- /dev/null +++ b/ubinstall-gtk-keyboard-layouts.glade @@ -0,0 +1,123 @@ + + + + + + True + False + com.ublinux.libublsettingsui-gtk3.accept-symbolic + + + True + False + com.ublinux.libublsettingsui-gtk3.cancel-uncolored-symbolic + + + 450 + 550 + True + False + com.ublinux.ubl-settings-keyboard + + + True + True + in + + + True + True + False + 1 + + + column + + + + 3 + + + + + + + column + 0 + + + + 2 + + + + + + + + + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 2 + Keyboard + + + + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 32 + com.ublinux.ubl-settings-keyboard + + + + + Cancel + True + True + True + image2 + + + 1 + + + + + Accept + True + True + True + image1 + + + end + 2 + + + + + + + diff --git a/ubinstall-gtk-layouts.glade b/ubinstall-gtk-layouts.glade new file mode 100644 index 0000000..b359c15 --- /dev/null +++ b/ubinstall-gtk-layouts.glade @@ -0,0 +1,238 @@ + + + + + + + + + + + + + + + + + + True + False + True + + + True + False + com.ublinux.libublsettingsui-gtk3.cancel-uncolored-symbolic + + + True + False + com.ublinux.libublsettingsui-gtk3.accept-symbolic + + + 500 + 550 + False + True + com.ublinux.ubl-settings-system + + + True + False + 5 + vertical + 5 + + + True + False + vertical + + + + + + False + True + 0 + + + + + True + False + + + True + True + 5 + 5 + never + in + + + True + True + LanguagesList + 1 + both + True + + + + + + + + + 0 + + + + + + + Locale + + + word + 150 + + + 1 + + + + + + + autosize + 35 + Language + True + + + word + 100 + + + 2 + + + + + + + autosize + Territory + True + + + word + 125 + + + 3 + + + + + + + + + -1 + + + + + True + True + 1 + + + + + True + False + 5 + 5 + 5 + + + True + False + Manual input: + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + False + True + 2 + + + + + + + True + False + + + True + False + System configuration + + + + + + + + Cancel + True + True + True + image8 + + + + + + Apply + True + True + True + image9 + + + + end + 1 + + + + + + diff --git a/ubinstall-gtk-source.glade b/ubinstall-gtk-source.glade index 1a3e61e..ac022cc 100644 --- a/ubinstall-gtk-source.glade +++ b/ubinstall-gtk-source.glade @@ -301,7 +301,7 @@ True False 2 - UBLinux installation + Source diff --git a/ubinstall-gtk.desktop b/ubinstall-gtk.desktop old mode 100644 new mode 100755 diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index bb8bea3..5c7c0fc 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -94,6 +94,18 @@ + + + + + + + + + + + + @@ -109,23 +121,17 @@ LanguagesList - + - + + + - - - - - - - - LayoutList - + True False @@ -239,12 +245,12 @@ True False - com.ublinux.libublsettingsui-gtk3.increase-symbolic + com.ublinux.libublsettingsui-gtk3.pan-up True False - com.ublinux.libublsettingsui-gtk3.trash-symbolic + com.ublinux.libublsettingsui-gtk3.pan-down True @@ -321,11 +327,31 @@ False com.ublinux.libublsettingsui-gtk3.flag-finish-symbolic + + True + False + com.ublinux.libublsettingsui-gtk3.increase-symbolic + True False com.ublinux.libublsettingsui-gtk3.properties-symbolic + + True + False + com.ublinux.libublsettingsui-gtk3.trash-symbolic + + + True + False + com.ublinux.libublsettingsui-gtk3.increase-symbolic + + + True + False + com.ublinux.libublsettingsui-gtk3.trash-symbolic + True False @@ -1048,7 +1074,7 @@ agreement True False - This program will ask you few questions and help you install system on your computer + Please read the license agreement before continuing the installation. center True 0 @@ -1146,7 +1172,7 @@ agreement - No, i do not agree + No, I do not agree True True False @@ -1238,7 +1264,7 @@ agreement True False - This program will ask you few questions and help you install system on your computer + Please specify what type of installation you want to perform center True 0 @@ -1768,7 +1794,7 @@ agreement True False - Installation completion + Selection of main components True 0 @@ -1788,7 +1814,7 @@ agreement True False - This program will ask you few questions and help you install system on your computer + Specify what type of installation you want to perform center True 0 @@ -1909,12 +1935,8 @@ agreement - - - True - False - Selecting additional software to install from the repository via the Internet - + + @@ -3273,7 +3295,7 @@ agreement True False - Choose system kernel + Location True 0 @@ -3293,7 +3315,7 @@ agreement True False - This program will ask you few questions and help you install system on your computer + Enter your time zone center True 0 @@ -3650,10 +3672,10 @@ agreement False vertical - + True False - Choose system kernel + Language True 0 @@ -3670,10 +3692,10 @@ agreement - + True False - This program will ask you few questions and help you install system on your computer + Specify your preferred system languages center True 0 @@ -3720,160 +3742,50 @@ agreement - - True - False - Keyboard - - - - - - - - - False - True - 1 - - - - + True False - 0 - none + 5 - - 1 - 1 + True False + Available locales in the system: + + False + True + 0 + - - - - - - True - True - 2 - - - - - True - False - vertical - 5 - + True - False - 5 - - - True - False - Keyboard model: - - - False - True - 0 - - - - - True - True - 0 - - Default (Regular 105-key) - - - - True - True - 2 - - + True False True - 0 + 1 - + True False - 5 - - - True - False - Layout changing: - - - False - True - 0 - - - - - True - True - 0 - - Default (L_Alt + L_Shift) - Left Alt - Caps Lock - Shift + Caps Lock - Alt + Caps Lock - Alt + Shift - Ctrl + Shift - Both Shift together - Both Alt together - Both Ctrl together - Left Ctrl+Left Shift - Right Ctrl+Right Shift - Alt+Ctrl - Left Alt+Left Shift - Alt+Space - Menu - Left Win - Win+Space - Right Win - Left Shift - Right Shift - Left Ctrl - Right Ctrl - Scroll Lock - Left Ctrl+Left Win - - - - True - True - 2 - - + Default False True - 1 + 2 False True - 3 + 1 @@ -3886,40 +3798,45 @@ agreement True True in - 128 + 125 - + True True - LayoutsFilter + LanguageList 0 + System locale - + + True + - 4 + 0 - Layout + 100 + Locale - 0 + 3 - Designation + Language + True @@ -3928,6 +3845,18 @@ agreement + + + Territory + True + + + + 2 + + + + @@ -3944,12 +3873,12 @@ agreement vertical 5 - + True True True - Add layouts - image13 + Add locales + image29 @@ -3961,12 +3890,12 @@ agreement - + True True True - Remove layout - image14 + Remove locale + image30 @@ -3986,9 +3915,9 @@ agreement - False + True True - 4 + 2 @@ -4000,7 +3929,7 @@ agreement True False - Keyboard + Language 10 @@ -4048,10 +3977,10 @@ agreement False vertical - + True False - Choose system kernel + Keyboard True 0 @@ -4068,10 +3997,10 @@ agreement - + True False - This program will ask you few questions and help you install system on your computer + Specify your preferred keyboard settings center True 0 @@ -4117,57 +4046,42 @@ agreement 0 - - - True - False - Settings - - - - - - - - - False - True - 1 - - - - - True - False - 0 - none - - - 1 - 1 - True - False - - - - - - - - True - True - 2 - - True False - 5 + vertical + 6 - + True - True + False + 5 + + + True + False + Keyboard model: + 1 + + + False + True + 0 + + + + + True + False + 0 + + + True + True + 1 + + False @@ -4176,36 +4090,10 @@ agreement - - True - False - Automatic login without password prompt - - - False - True - 1 - - - - - False - True - 3 - - - - - True - True - 290 - - + True False - 10 - 5 - 5 + 5 True @@ -4216,194 +4104,314 @@ agreement True False - vertical + 10 - + True False - 5 - 5 - 5 - 5 - 5 - 5 - vertical - 5 + Layouts: + 1 + + + False + True + 0 + + + + + True + True + True + + + False + True + 1 + + + + + True + False + Default layout + + + False + True + 2 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + True + in + 100 + 150 - + True - False - vertical - 5 + False + True + LayoutsList + False + 0 + both + + + - - True - False - 5 - - - True - False - Account name: - - - False - True - 0 - - + + Keyboard layout - - True - False - True - root - Administrator - - - True - True - 3 - + + + 2 + - - False - True - 0 - - - True - False - 5 - - - True - False - Login: - 0 - - - False - True - 0 - - + + Designation - - True - False - True - root - superadmin - - - True - True - 1 - + + + 0 + - - False - True - 1 - - - True - False - 5 - - - True - False - Administrator password (root): - 0 - - - False - True - 0 - - - - - True - False - 0 - - Default - Set a password - - - - False - True - 1 - - - - - True - False - False - False - - ublinux - password - - - True - True - 2 - - + + Variant - - True - False - True - True - image21 - - - - False - True - 3 - + + + 1 + - - False - True - end - 2 - - - False - True - 0 - - False + True True - 2 + 0 + + + + + True + False + vertical + 5 + + + True + False + True + True + Move layout up + image13 + + + + False + True + 0 + + + + + True + False + True + True + Move layout down + image14 + + + + False + True + 1 + + + + + True + False + True + True + Add layout + image31 + + + + False + True + 2 + + + + + True + False + True + True + Remove layout + image32 + + + + False + True + 3 + + + + + False + True + 1 + + + + + True + True + 1 + + + + + True + True + 1 + + + + + True + True + 1 + + + + + True + False + 5 + + + True + False + Changing the layout: + 1 + + + False + True + 0 + + + + + True + False + + Default + + + + True + True + 1 + + + + + False + True + 2 + + + + + True + False + 5 + + + True + False + start + 1 + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + 5 + + + True + True + + + False + True + 0 + + + + + True + False + Set Compose (Multi_Key) to the right Win key + + + False + True + 1 - False @@ -4412,13 +4420,32 @@ agreement - + True False - vertical 5 - + + True + True + + + False + True + 0 + + + + + True + False + Scroll Lock indication when switching layouts + + + False + True + 1 + @@ -4427,43 +4454,1306 @@ agreement 1 - - - + - True - True - True + + + False + True + 1 + + + + + False + True + 4 + + + + + True + False + 5 + + + True + False + NumLock: + 1 + + + False + True + 0 + + + + + True + False + 0 + + Default + On + Off + + + + True + True + 1 + + + + + False + True + 6 + + + + + False + True + 1 + + + + + 11 + + + + + True + False + Keyboard + + + 11 + False + + + + + True + False + vertical + 5 + + + True + False + vertical + 5 + + + True + False + 10 + 10 + 10 + 10 + 5 + + + True + False + 48 + com.ublinux.ubinstall-gtk + 0 + + + False + True + 0 + + + + + True + False + vertical + + + True + False + Choose system kernel + True + 0 + + + + + + + + + False + True + 0 + + + + + True + False + This program will ask you few questions and help you install system on your computer + center + True + 0 + + + + + + False + True + 1 + + + + + True + True + 1 + + + + + False + True + -1 + + + + + True + False + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + Settings + + + + + + + + + False + True + 1 + + + + + True + False + 0 + none + + + 1 + 1 + True + False + + + + + + + + True + True + 2 + + + + + True + False + 5 + + + True + True + + + False + True + 0 + + + + + True + False + Automatic login without password prompt + + + False + True + 1 + + + + + False + True + 3 + + + + + True + True + 290 + + + True + False + 10 + 5 + 5 + + + True + False + vertical + 5 + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + vertical + 5 + + + True + False + vertical + 5 + + + True + False + 5 + + + True + False + Account name: + + + False + True + 0 + + + + + True + False + True + root + Administrator + + + True + True + 3 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + False + Login: + 0 + + + False + True + 0 + + + + + True + False + True + root + superadmin + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + 5 + + + True + False + Administrator password (root): + 0 + + + False + True + 0 + + + + + True + False + 0 + + Default + Set a password + + + + False + True + 1 + + + + + True + False + False + False + + ublinux + password + + + True + True + 2 + + + + + True + False + True + True + image21 + + + + False + True + 3 + + + + + False + True + end + 2 + + + + + False + True + 0 + + + + + False + True + 2 + + + + + + False + True + 0 + + + + + True + False + vertical + 5 + + + + + + False + True + 1 + + + + + + + True + True + True + + + False + True + 2 + + + + + + + + + False + True + 6 + + + + + 12 + + + + + True + False + Users + + + 12 + False + + + + + True + False + vertical + 5 + + + True + False + Startup services + + + + + + + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + 10 + 10 + 10 + 10 + 5 + + + True + False + 48 + com.ublinux.ubinstall-gtk + 0 + + + False + True + 0 + + + + + True + False + vertical + + + True + False + Choose system kernel + True + 0 + + + + + + + + + False + True + 0 + + + + + True + False + This program will ask you few questions and help you install system on your computer + center + True + 0 + + + + + + False + True + 1 + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + + + False + True + 2 + + + + + False + True + 1 + + + + + True + False + 0 + none + + + 1 + 1 + True + False + + + + + + + + True + True + 2 + + + + + True + False + 5 + + + Add + True + True + True + Add service + image24 + + + False + True + 0 + + + + + Edit + True + False + True + True + Edit service + image23 + + + False + True + 1 + + + + + Remove + True + False + True + True + Remove service + image22 + + + False + True + 2 + + + + + False + True + 3 + + + + + True + True + in + 290 + + + True + True + StartupList + both + + + + + + Autostart + + + + 0 + + + + + + + Unit + + + + 1 + + + + + + + Service + + + + 2 + + + + + + + Description + + + word + 450 + + + 3 + + + + + + + + + False + True + 4 + + + + + 13 + + + + + True + False + Startup configuration + + + 13 + False + + + + + True + False + vertical + 5 + + + True + False + Boot load + + + + + + + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + 10 + 10 + 10 + 10 + 5 + + + True + False + 48 + com.ublinux.ubinstall-gtk + 0 + + + False + True + 0 + + + + + True + False + vertical + + + True + False + Choose system kernel + True + 0 + + + + + + + + + False + True + 0 + + + + + True + False + This program will ask you few questions and help you install system on your computer + center + True + 0 + + + + + + False + True + 1 + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + + + False + True + 2 + + + + + False + True + 1 + + + + + True + False + 0 + none + + + 1 + 1 + True + False + + + + + + + + True + True + 2 + + + + + True + False + vertical + 5 + + + True + False + 5 + + + True + True + + + False + True + 0 + + + + + True + False + Boot selection menu timer: + + + False + True + 1 + + + + + True + False + True + BootloaderTimer + + + False + True + 2 + + + + + True + False + seconds + + + False + True + 3 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + False + Default OS: + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + True + True + True + image19 + + + + False + True + 2 + + + + + False + True + 1 + + + + + True + False + 5 + + + True + True + + + False + True + 0 + + + + + True + False + Login without password request + + + False + True + 1 + + + + + False + True + 2 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 + 5 + + + True + False + 5 + + + True + True + in + 128 + 256 + + + True + True + BootloadUsersList + + + + + + Administrator + + + + 0 + + + + + + + Username + + + + 1 + + + + + + + Password + + + + 3 + + + + + + + + + True + True + 0 + + + + + True + False + vertical + 5 + + + True + True + True + image17 + + + + False + True + 0 + + + + + True + True + True + image18 + + + + False + True + 1 + + + + + False + True + 1 + + - - False - True - 2 - + + + True + False + Bootloader menu users + + + + False + True + 3 + False True - 6 + 3 - 11 + 14 True False - Users + Bootloader - 11 + 14 False @@ -4477,7 +5767,7 @@ agreement True False - Startup services + Network @@ -4491,201 +5781,108 @@ agreement 0 - - - True - False - 0 - none - - - 1 - 1 - True - False - - - - - - - - True - True - 1 - - True False + vertical 5 - - Add - True - True - True - Add service - image24 - - - False - True - 0 - - - - - Edit - True - False - True - True - Edit service - image23 - - - False - True - 1 - - - - - Remove - True - False - True - True - Remove service - image22 - - - False - True - 2 - - - - - False - True - 2 - - - - - True - True - in - 290 - - + True - True - StartupList - both - - - - - - Autostart - - - - 0 - - - - + False + 10 + 10 + 10 + 10 + 5 - - Unit - - - - 1 - - + + True + False + 48 + com.ublinux.ubinstall-gtk + 0 + + False + True + 0 + - - Service + + True + False + vertical - - - 2 - + + True + False + Choose system kernel + True + 0 + + + + + + + + + False + True + 0 + - - - - - Description - - word - 450 + + True + False + This program will ask you few questions and help you install system on your computer + center + True + 0 + + + - - 3 - - - - - - - - - False - True - 3 - - - - - - - - 12 - - - - - True - False - Startup configuration - - - 12 - False - - - - - True - False - vertical - 5 - - - True - False - Boot load - - - - - - + + False + True + 1 + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + + + False + True + 2 + + False True - 0 + 1 @@ -4695,9 +5892,7 @@ agreement 0 none - - 1 - 1 + True False @@ -4709,11 +5904,12 @@ agreement True True - 1 + 2 + 350 True False vertical @@ -4724,7 +5920,7 @@ agreement False 5 - + True True @@ -4738,7 +5934,7 @@ agreement True False - Boot selection menu timer: + Domain name: False @@ -4747,11 +5943,11 @@ agreement - + True False True - BootloaderTimer + 10 False @@ -4763,7 +5959,7 @@ agreement True False - seconds + Domain administrator: False @@ -4771,6 +5967,46 @@ agreement 3 + + + True + False + True + 10 + + + False + True + 4 + + + + + True + False + Password: + + + False + True + 5 + + + + + True + False + True + False + * + 10 + + + False + True + 6 + + False @@ -4784,10 +6020,9 @@ agreement False 5 - + True - False - Default OS: + True False @@ -4796,25 +6031,31 @@ agreement - + True - True + False + NTP Server: - True + False True 1 - + True - True - True - image19 - + False + False + 0 + + Default + DHCP + NTP (ntp.org) + NTP (vniiftri.ru) + Manual + Do not configure + False @@ -4822,6 +6063,18 @@ agreement 2 + + + True + False + True + + + True + True + 3 + + False @@ -4835,7 +6088,7 @@ agreement False 5 - + True True @@ -4849,7 +6102,8 @@ agreement True False - Login without password request + Host name: + 0 False @@ -4857,6 +6111,34 @@ agreement 1 + + + True + False + True + auto + + + True + True + 2 + + + + + Automatically + True + False + True + False + True + + + False + True + 3 + + False @@ -4882,106 +6164,51 @@ agreement True False + vertical 5 True True - in - 128 - 256 - + True - True - BootloadUsersList - - - - - - Administrator - - - - 0 - - - - - - - Username - - - - 1 - - - - + False + none - - Password + + True + False + vertical + 5 - - - 3 - + - - - - - - True - True - 0 - - - - - True - False - vertical - 5 - - - True - True - True - image17 - - - - False - True - 0 - - - - - True - True - True - image18 - - - - False - True - 1 - + + + + True + True + 0 + + + + + + + True + True + True + + False True + end 1 @@ -4993,12 +6220,12 @@ agreement True False - Bootloader menu users + Net interfaces - False + True True 3 @@ -5007,25 +6234,22 @@ agreement False True - 2 + 3 - - - - 13 + 15 True False - Bootloader + Network - 13 + 15 False @@ -5035,49 +6259,8 @@ agreement False vertical 5 - - - True - False - Network - - - - - - - - - False - True - 0 - - - - - True - False - 0 - none - - - True - False - - - - - - - - True - True - 1 - - - 350 True False vertical @@ -5086,11 +6269,18 @@ agreement True False + 10 + 10 + 10 + 10 5 - + True - True + False + 48 + com.ublinux.ubinstall-gtk + 0 False @@ -5099,82 +6289,55 @@ agreement - + True False - Domain name: + vertical + + + True + False + Choose system kernel + True + 0 + + + + + + + + + False + True + 0 + + + + + True + False + This program will ask you few questions and help you install system on your computer + center + True + 0 + + + + + + False + True + 1 + + - False + True True 1 - - - True - False - True - 10 - - - False - True - 2 - - - - - True - False - Domain administrator: - - - False - True - 3 - - - - - True - False - True - 10 - - - False - True - 4 - - - - - True - False - Password: - - - False - True - 5 - - - - - True - False - True - False - * - 10 - - - False - True - 6 - - False @@ -5182,83 +6345,102 @@ agreement 0 + + + True + False + + + False + True + 2 + + + + + False + True + 0 + + + + + True + False + vertical + 5 True False + 5 + 5 + 5 + 5 5 - - - True - True - - - False - True - 0 - - True False - NTP Server: - - - False - True - 1 - - - - - True - False - False - 0 - - Default - DHCP - NTP (ntp.org) - NTP (vniiftri.ru) - Manual - Do not configure - + Selecting additional installation components False True - 2 + 0 - + + button True - False True + True - True + False True - 3 + end + 1 False True - 1 + 0 + + + + False + True + 1 + + + + + True + False + vertical + 5 True False + 5 + 5 + 5 + 5 5 - + True - True + False + Selecting additional components for the system kernel False @@ -5267,160 +6449,165 @@ agreement - + + button True - False - Host name: - 0 + True + True False True + end 1 + + + False + True + 0 + + + + + + False + True + 2 + + + + + True + False + vertical + 5 + + + True + False + 5 + 5 + 5 + 5 + 5 - + True - False - True - auto + False + Selecting the system kernel - True + False True - 2 + 0 - - Automatically + + button True - False True - False - True + True False True - 3 + end + 1 False True - 2 + 0 + + + + False + True + 3 + + + + + True + False + vertical + 5 - + True False - 0.019999999552965164 - in + 5 + 5 + 5 + 5 + 5 - + True False - 5 - 5 - 5 - 5 - - - True - False - vertical - 5 - - - True - True - - - True - False - none - - - True - False - vertical - 5 - - - - - - - - - - True - True - 0 - - - - - + - True - True - True - - - - False - True - end - 1 - - - - + Selecting additional components from packages + + False + True + 0 + - - + + + button True - False - Net interfaces + True + True + + False + True + end + 1 + - True + False True - 3 + 0 + False True - 2 + 4 - - - - 14 + 16 True False - Network + Packages - 14 + 16 False @@ -5564,7 +6751,7 @@ agreement - 15 + 17 @@ -5574,7 +6761,7 @@ agreement Installation process - 15 + 17 False @@ -5755,7 +6942,7 @@ or continue working in the environment, booted from the Live image. - 16 + 18 @@ -5765,7 +6952,7 @@ or continue working in the environment, booted from the Live image. Completion - 16 + 18 False @@ -5944,7 +7131,7 @@ or continue working in the environment, booted from the Live image. - 17 + 19 @@ -5954,7 +7141,7 @@ or continue working in the environment, booted from the Live image. Completed - 17 + 19 False @@ -6133,7 +7320,7 @@ or continue working in the environment, booted from the Live image. - 18 + 20 @@ -6143,7 +7330,7 @@ or continue working in the environment, booted from the Live image. Configuration error - 18 + 20 False @@ -6322,7 +7509,7 @@ or continue working in the environment, booted from the Live image. - 19 + 21 @@ -6332,7 +7519,7 @@ or continue working in the environment, booted from the Live image. Configuration end - 19 + 21 False @@ -6511,7 +7698,7 @@ or continue working in the environment, booted from the Live image. - 20 + 22 @@ -6521,7 +7708,7 @@ or continue working in the environment, booted from the Live image. Configuration saved - 20 + 22 False @@ -6975,7 +8162,7 @@ or continue working in the environment, booted from the Live image. - 21 + 23 @@ -6985,7 +8172,7 @@ or continue working in the environment, booted from the Live image. Common Installation - 21 + 23 False @@ -7119,7 +8306,7 @@ or continue working in the environment, booted from the Live image. True False - <b>Attention!</b> The system will be installed in the selected partition. If you do not change the FS type or format, all data on the partition will be saved. + <b>Attention!</b> The selected partition will be reduced and the next new partition will be created. The data will be saved in the selected partition. The new partition will be formatted. True True 0 @@ -7411,7 +8598,7 @@ or continue working in the environment, booted from the Live image. True False - Partition: + New partition: 0 @@ -7447,7 +8634,9 @@ or continue working in the environment, booted from the Live image. True + False True + True False @@ -7495,6 +8684,7 @@ or continue working in the environment, booted from the Live image. True False + True True @@ -7649,7 +8839,7 @@ or continue working in the environment, booted from the Live image. - 22 + 24 @@ -7659,7 +8849,7 @@ or continue working in the environment, booted from the Live image. Installation next to system - 22 + 24 False @@ -8278,7 +9468,7 @@ or continue working in the environment, booted from the Live image. - 23 + 25 @@ -8288,7 +9478,7 @@ or continue working in the environment, booted from the Live image. Installation on same partition - 23 + 25 False @@ -9334,7 +10524,7 @@ separately into the selected partition. - 24 + 26 @@ -9344,7 +10534,7 @@ separately into the selected partition. Advanced section - 24 + 26 False @@ -9819,7 +11009,7 @@ separately into the selected partition. - 25 + 27 @@ -9829,7 +11019,7 @@ separately into the selected partition. Recovery section - 25 + 27 False @@ -10221,7 +11411,7 @@ separately into the selected partition. - 26 + 28 @@ -10231,7 +11421,7 @@ separately into the selected partition. GRUB install - 26 + 28 False @@ -10610,7 +11800,7 @@ separately into the selected partition. - 27 + 29 @@ -10620,7 +11810,7 @@ separately into the selected partition. GRUB update - 27 + 29 False @@ -11346,7 +12536,7 @@ separately into the selected partition. - 28 + 30 @@ -11356,7 +12546,7 @@ separately into the selected partition. OS only - 28 + 30 False @@ -12152,7 +13342,7 @@ separately into the selected partition. - 29 + 31 @@ -12162,7 +13352,7 @@ separately into the selected partition. User data only - 29 + 31 False