Region changes

pull/207/head
parent 2ebdf0456e
commit b9ea1beef6

@ -360,7 +360,7 @@ msgid "GRUB install"
msgstr ""
#: source/ubl-strings.h:81
msgid "Install the GRUB bootloader"
msgid "Installing the GRUB bootloader into the MBR or EFI partition"
msgstr ""
#: source/ubl-strings.h:82
@ -380,11 +380,11 @@ msgid "Installing OS components and user data on different disk partitions"
msgstr ""
#: source/ubl-strings.h:86
msgid "OS only"
msgid "System restore"
msgstr ""
#: source/ubl-strings.h:87
msgid "Installing only OS components without user data"
msgid "Restore missing or corrupted system files. Users data is not affected"
msgstr ""
#: source/ubl-strings.h:88

@ -372,8 +372,8 @@ msgid "GRUB install"
msgstr "Установка GRUB"
#: source/ubl-strings.h:81
msgid "Install the GRUB bootloader"
msgstr "Установить загрузчик GRUB"
msgid "Installing the GRUB bootloader into the MBR or EFI partition"
msgstr "Установка загрузчика GRUB в MBR или EFI-партицию"
#: source/ubl-strings.h:82
msgid "GRUB update"
@ -393,12 +393,12 @@ msgstr ""
"Установка компонентов ОС и пользовательских данных на разные разделы диска"
#: source/ubl-strings.h:86
msgid "OS only"
msgstr "Только ОС"
msgid "System restore"
msgstr "Восстановление системы"
#: source/ubl-strings.h:87
msgid "Installing only OS components without user data"
msgstr "Установка только компоненов ОС без пользовательских данных"
msgid "Restore missing or corrupted system files. Users data is not affected"
msgstr "Восстановление отсутствующих или поврежденных системных файлов. Данные пользователей не затрагиваются"
#: source/ubl-strings.h:88
msgid "User data only"

@ -153,3 +153,77 @@ gboolean on_install_slider_slide(main_window *widgets){
}
return G_SOURCE_REMOVE;
}
// 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);
// switch(page){
// case YON_PAGE_BOOTLOADER:
// gtk_widget_show(widgets->BootloaderImage);
// break;
// 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;
// case YON_PAGE_STARTUP:
// gtk_widget_show(widgets->StartupImage);
// break;
// case YON_PAGE_NETWORK:
// gtk_widget_show(widgets->NetworkImage);
// break;
// case YON_PAGE_INSTALLATION:
// gtk_widget_show(widgets->SlidesImage);
// g_timeout_add(7000,on_image_slide,widgets);
// break;
// default:
// break;
// }
// }
// void on_region_resized(GtkWidget *,main_window *widgets){
// enum YON_PAGES page = gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook));
// GtkImage *target = NULL;
// GdkPixbuf *pixbuf = NULL;
// target = GTK_IMAGE(widgets->RegionImage);
// pixbuf = widgets->region_original;
// if (target){
// yon_image_resize_from_container(target,pixbuf);
// }
// }
// int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled){
// int width = gtk_widget_get_allocated_width((gtk_widget_get_parent(GTK_WIDGET(target))));
// int height = gtk_widget_get_allocated_height((gtk_widget_get_parent(GTK_WIDGET(target))));
// int newImgWidthDef = (width <= 217) ? width : width - 30;
// int newImgHeightDef = (height <= 120) ? height : height - 80;
// int originalWidth = gdk_pixbuf_get_width(pixbuf_unscaled);
// int originalHeight = gdk_pixbuf_get_height(pixbuf_unscaled);
// int newImgHeight = (int)(originalHeight / ((double) originalWidth / newImgWidthDef));
// if (newImgHeight > newImgHeightDef) {
// newImgHeight = newImgHeightDef;
// newImgWidthDef = (int)(originalWidth / ((double) originalHeight / newImgHeight));
// }
// int newImageWidth = (int)(originalWidth / ((double) originalHeight / newImgHeight));
// GdkPixbuf *scaledPixBuf = gdk_pixbuf_scale_simple(pixbuf_unscaled, newImageWidth, newImgHeight, GDK_INTERP_BILINEAR);
// gtk_image_set_from_pixbuf(target, scaledPixBuf);
// g_object_unref(scaledPixBuf);
// return 1;
// }

@ -256,6 +256,22 @@ void yon_set_max_size_from_partition(GtkTreeView *table, GtkSpinButton *spin_but
}
}
}
// char *parameter = config(part_size_parameter);
// if (!yon_char_is_empty(parameter)){
// GtkAdjustment *adj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(widgets->OSFormatSizeSpin));
// gtk_adjustment_set_value(adj,atol(parameter));
// g_signal_handlers_block_by_func(G_OBJECT(widgets->NextInstallationSizeTypeSpin),G_CALLBACK(on_partition_changed),widgets);
// g_signal_handlers_block_by_func(G_OBJECT(widgets->OSFormatSizeCombo),G_CALLBACK(on_partition_changed),widgets);
// g_signal_handlers_block_by_func(G_OBJECT(widgets->UserdataFormatSizeCombo),G_CALLBACK(on_partition_changed),widgets);
// gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->OSFormatSizeCombo),yon_get_size_get_from_letter(parameter[strlen(parameter)-1])-1);
// gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UserdataFormatSizeCombo),yon_get_size_get_from_letter(parameter[strlen(parameter)-1])-1);
// gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->NextInstallationSizeTypeSpin),yon_get_size_get_from_letter(parameter[strlen(parameter)-1])-1);
// g_signal_handlers_unblock_by_func(G_OBJECT(widgets->NextInstallationSizeTypeSpin),G_CALLBACK(on_partition_changed),widgets);
// g_signal_handlers_unblock_by_func(G_OBJECT(widgets->OSFormatSizeCombo),G_CALLBACK(on_partition_changed),widgets);
// g_signal_handlers_unblock_by_func(G_OBJECT(widgets->UserdataFormatSizeCombo),G_CALLBACK(on_partition_changed),widgets);
// }
void on_partition_changed(GtkWidget *self, main_window *widgets){
if (self==widgets->NextInstallationSysSectionTree||self == widgets->NextInstallationSizeTypeSpin){
@ -319,7 +335,7 @@ void on_device_selection_changed(GtkWidget *self, main_window *widgets){
}
}
// gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->NextInstallationSizeSpin),0.0);
// gtk_adjustment_set_upper(gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(widgets->NextInstallationSizeSpin)),0.0);
gtk_adjustment_set_upper(gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(widgets->NextInstallationSizeSpin)),0.0);
}
}

@ -40,18 +40,37 @@ void on_region_changed(GtkComboBox *self, main_window *widgets){
}
#ifdef TIMEZONEMAP_INCLUDE
gboolean on_map_box_ckicked_skip(){
return 0;
}
void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,main_window *);
void yon_map_status_hide(main_window *widgets){
gtk_widget_hide(widgets->TimeZoneMapOverlayBox);
}
void yon_map_status_hide_timeout(main_window *widgets){
g_idle_add_once((GSourceOnceFunc)yon_map_status_hide,widgets);
GMutex map_source_mutex;
guint map_status_source = -1;
gboolean yon_map_status_hide_timeout(main_window *widgets){
printf("hide\n");
g_mutex_lock(&map_source_mutex);
map_status_source=-1;
g_mutex_unlock(&map_source_mutex);
g_idle_add_once((GSourceOnceFunc)yon_map_status_hide,widgets);
return G_SOURCE_REMOVE;
}
void yon_map_status_show(main_window *widgets, char *icon_name, char *title, char *title_info){
g_mutex_lock(&map_source_mutex);
if (map_status_source!=(guint)-1){
g_source_remove(map_status_source);
printf("remove\n");
map_status_source=(guint)-1;
}
g_mutex_unlock(&map_source_mutex);
gtk_widget_show(widgets->TimeZoneMapOverlayBox);
gtk_label_set_text(GTK_LABEL(widgets->TimeZoneMapOverlayTitleLabel),title);
gtk_label_set_text(GTK_LABEL(widgets->TimeZoneMapOverlayInfoLabel),title_info);
@ -62,7 +81,10 @@ void yon_map_status_show(main_window *widgets, char *icon_name, char *title, cha
} else {
gtk_widget_hide(widgets->TimeZoneMapOverlayImage);
}
g_timeout_add_seconds_once(5,(GSourceOnceFunc)yon_map_status_hide_timeout,widgets);
g_mutex_lock(&map_source_mutex);
map_status_source = g_timeout_add_seconds(3,(GSourceFunc)yon_map_status_hide_timeout,widgets);
printf("%d\n",map_status_source);
g_mutex_unlock(&map_source_mutex);
}
void on_zone_changed(GtkWidget *, main_window *widgets){
@ -96,11 +118,12 @@ void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,main_wind
gtk_tree_model_get(GTK_TREE_MODEL(widgets->RegionTimezoneCompletionList),&iter,0,&render,1,&tz,-1);
if (!strcmp(timezone,tz)){
gtk_entry_set_text(GTK_ENTRY(widgets->RegionEntry),render);
char *utc = yon_timezone_get_utc(tz);
yon_map_status_show(widgets,NULL,MAP_TITLE_LABEL(utc),render);
}
}
yon_map_status_show(widgets,NULL,MAP_TITLE_LABEL,MAP_INFO_LABEL);
g_signal_handlers_unblock_by_func(G_OBJECT(widgets->ZoneCombo),G_CALLBACK(on_zone_changed),widgets);
g_signal_handlers_unblock_by_func(G_OBJECT(widgets->RegionEntry),G_CALLBACK(on_region_entry_changed),widgets);
}
@ -128,9 +151,11 @@ void on_region_entry_changed(GtkWidget *, main_window *widgets){
}
void yon_region_init(main_window *widgets){
yon_timezone_init();
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->RegionCombo));
gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->KeyboardNumLockCombo));
#ifdef TIMEZONEMAP_INCLUDE
#ifdef TIMEZONEMAP_INCLUDE // insert timezonemap's interactive map
GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->RegionMapBox));
if (list){
GList *iter;
@ -147,28 +172,19 @@ void yon_region_init(main_window *widgets){
if (!yon_char_is_empty(config_param)){
cc_timezone_map_set_timezone(CC_TIMEZONE_MAP(widgets->RegionMapTarget),config_param);
}
#else // if timezonemap does not installed, static image inserts
#endif
int size;
config_str parsed = NULL;
parsed = yon_dir_get_contents(zone_path,&size);
for (int i=0;i<size;i++){
if (!strstr(parsed[i],".")&&strcmp(parsed[i],"posix")&&strcmp(parsed[i],"right")){
char *path = yon_char_append(zone_path,parsed[i]);
if (yon_file_is_directory(path)){
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widgets->RegionCombo),parsed[i],_(parsed[i]));
char *active = yon_char_append("/usr/share/zoneinfo/",parsed[i]);
int zone_size;
config_str zone_parsed = yon_file_ls(active,&zone_size);
size_t size;
GtkTreeIter iter;
for (int j=0;j<zone_size;j++){
char *zone_name = yon_char_unite(_(zone_parsed[j]),", ",_(parsed[i]), NULL);
char *zone_string = yon_char_unite(parsed[i],"/",zone_parsed[j], NULL);
config_str parsed = yon_timezone_get_all(&size);
for (size_t i=0;i<size;i++){
char *zone_country = yon_timezone_get_country(parsed[i]);
char *zone_city = yon_timezone_get_city(parsed[i]);
char *zone_name = yon_char_unite(_(zone_city),", ", _(zone_country),NULL);
gtk_list_store_append(widgets->RegionTimezoneCompletionList,&iter);
gtk_list_store_set(widgets->RegionTimezoneCompletionList,&iter,0,zone_name,1,zone_string,-1);
}
}
free(path);
}
gtk_list_store_set(widgets->RegionTimezoneCompletionList,&iter,0,zone_name,1,parsed[i],-1);
// gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widgets))
}
while(gtk_events_pending()) gtk_main_iteration();
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->RegionCombo),0);

@ -123,13 +123,6 @@ typedef struct{
char *code_full;
} locale_struct;
int yon_char_parsed_compare(const void *a, const void *b){
const config_str str_a = (const config_str)a;
const config_str str_b = (const config_str)b;
return strcmp(*str_a,*str_b);
}
gboolean on_languages_search_func(GtkTreeModel *model, gint ,const char *key, GtkTreeIter *iter, main_window *){
char *target;
char *loc_target;
@ -152,7 +145,7 @@ void yon_set_locales_list(main_window *widgets){
char *config_code = yon_char_new(config(installer_locale_parameter));
int size;
config_str locales = yon_locale_get_all_codes(&size);
qsort(locales,size,sizeof(char*),yon_char_parsed_compare);
qsort(locales,size,sizeof(char*),(__compar_fn_t)yon_char_parsed_compare);
GtkTreeIter iter,itar;
GHashTable *added = g_hash_table_new(g_str_hash,g_str_equal);
textdomain(LOCALES_DOMAIN_NAME);

@ -786,6 +786,7 @@ void yon_main_window_create(main_window *widgets){
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->RegionSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->RegionMapBox);
g_signal_connect(G_OBJECT(widgets->RegionSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->RegionEntry);
g_signal_connect(G_OBJECT(widgets->RegionMapBox),"button-press-event",G_CALLBACK(on_map_box_ckicked_skip),NULL);
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);
@ -806,6 +807,8 @@ void yon_main_window_create(main_window *widgets){
g_signal_connect(G_OBJECT(widgets->SamePlacePartTree),"cursor-changed",G_CALLBACK(on_partition_changed),widgets);
g_signal_connect(G_OBJECT(widgets->NextInstallationSysSectionTree),"cursor-changed",G_CALLBACK(on_partition_changed),widgets);
g_signal_connect(G_OBJECT(widgets->NextInstallationSizeTypeSpin),"changed",G_CALLBACK(on_partition_changed),widgets);
g_signal_connect(G_OBJECT(widgets->OSFormatSizeCombo),"changed",G_CALLBACK(on_partition_changed),widgets);
g_signal_connect(G_OBJECT(widgets->UserdataFormatSizeCombo),"changed",G_CALLBACK(on_partition_changed),widgets);
g_signal_connect(G_OBJECT(widgets->UserRootPasswordCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),widgets->UserRootPasswordEntry);
g_signal_connect(G_OBJECT(widgets->UserRootPasswordCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),widgets->UserRootPasswordButton);

@ -1365,7 +1365,6 @@ void yon_main_window_create(main_window *widgets);
void yon_set_locales_list(main_window *widgets);
void on_installer_language_changed(GtkWidget *self, GtkTreePath *, GtkTreeViewColumn *, main_window *widgets);
gboolean on_country_filter(GtkTreeModel *self, GtkTreeIter *iter, main_window *widgets);
int yon_char_parsed_compare(const void *a, const void *b);
gboolean yon_os_component_insert(struct row_data *row_input);
void *yon_os_components_setup(main_window *widgets);
gboolean yon_spinner_switch_off(GtkSpinner *target);
@ -1490,5 +1489,6 @@ gboolean on_region_refilter(GtkTreeModel* model, GtkTreeIter* iter, main_window
void on_region_entry_changed(GtkWidget *, main_window *widgets);
char *yon_size_get_name_from_letter(char letter);
void yon_map_status_hide(main_window *widgets);
void yon_map_status_hide_timeout(main_window *widgets);
gboolean yon_map_status_hide_timeout(main_window *widgets);
void yon_map_status_show(main_window *widgets, char *icon_name, char *title, char *title_info);
gboolean on_map_box_ckicked_skip();

@ -75,13 +75,13 @@ NULL)
#define ADVANCED_INSTALLATION_LABEL _("Installing OS files, user data on different partitions, creating RAID, etc.")
#define ADVANCED_INSTALLATION_ATTENTION_LABEL _("Attention! The selected system components will be installed\nseparately into the selected partition.")
#define GRUB_INSTALL_HEAD_LABEL _("GRUB install")
#define GRUB_INSTALL_LABEL _("Install the GRUB bootloader")
#define GRUB_INSTALL_LABEL _("Installing the GRUB bootloader into the MBR or EFI partition")
#define GRUB_UPDATE_HEAD_LABEL _("GRUB update")
#define GRUN_UPDATE_LABEL _("Update (reinstall) the GRUB bootloader")
#define SEPARATE_INSTALL_HEAD_LABEL _("Separate installation")
#define SEPARATE_INSTALL_LABEL _("Installing OS components and user data on different disk partitions")
#define OS_ONLY_HEAD_LABEL _("OS only")
#define OS_ONLY_LABEL _("Installing only OS components without user data")
#define OS_ONLY_HEAD_LABEL _("System restore")
#define OS_ONLY_LABEL _("Restore missing or corrupted system files. Users data is not affected")
#define USER_DATA_HEAD_LABEL _("User data only")
#define USER_DATA_LABEL _("Installing only user data without OS components")
@ -290,8 +290,8 @@ NULL)
#define REBOOT_LABEL _("Reboot")
#define SHUTDOWN_LABEL _("Shudown")
#define FINISH_ACTION_LABEL _("After successful installation:")
#define MAP_TITLE_LABEL _("Feasf")
#define MAP_INFO_LABEL _("Geasfa")
#define MAP_TITLE_LABEL(utc) yon_char_unite(_("UTC"),utc,NULL)
#define MAP_INFO_LABEL(tz_location) yon_char_unite(_("Geasfa"),tz_location,NULL)
// #define _LABEL _("Select your language:")
// #define _LABEL _("Selecting additional system kernel components")

@ -277,7 +277,7 @@
<columns>
<!-- column-name region/zone -->
<column type="gchararray"/>
<!-- column-name timezone -->
<!-- column-name timezone_name -->
<column type="gchararray"/>
</columns>
</object>
@ -10568,7 +10568,7 @@ separately into the selected partition.</property>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Install the GRUB bootloader</property>
<property name="label" translatable="yes">Installing the GRUB bootloader into the MBR or EFI partition</property>
<property name="xalign">0</property>
</object>
<packing>
@ -10707,7 +10707,7 @@ separately into the selected partition.</property>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">OS only</property>
<property name="label" translatable="yes">System restore</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
@ -10724,7 +10724,7 @@ separately into the selected partition.</property>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Installing only OS components without user data</property>
<property name="label" translatable="yes">Restore missing or corrupted system files. Users data is not affected</property>
<property name="xalign">0</property>
</object>
<packing>
@ -10785,7 +10785,7 @@ separately into the selected partition.</property>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">User data only</property>
<property name="label" translatable="yes">User data restore</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>

Loading…
Cancel
Save