Fixed device and partitions lables

pull/71/head
parent 653adbd198
commit 03857aa110

@ -1788,8 +1788,17 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){
case YON_PAGE_INSTALL_ERROR:
case YON_PAGE_COMPLETION:
if (!system("reboot"))
return;
confirmation_window *window = yon_confirmation_window_new();
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->AcceptButton),"clicked",G_CALLBACK(on_reboot_accepted),dict);
gtk_window_set_transient_for(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->MainWindow));
gtk_window_set_title(GTK_WINDOW(window->Window),TITLE_LABEL);
gtk_window_set_icon_name(GTK_WINDOW(window->Window),icon_path);
gtk_label_set_text(GTK_LABEL(window->TextLabel),WARNING_TEXT_LABEL);
gtk_label_set_text(GTK_LABEL(window->TitleLabel),WARNING_TITLE_LABEL);
gtk_widget_show(window->Window);
break;
case YON_PAGE_INSTALL_OPTIONS: {
@ -2121,7 +2130,7 @@ void on_near_installation_device_changed(GtkWidget *self, main_window *widgets){
json_object_object_get_ex(root, "blockdevices", &blockdevices);
for (long unsigned int i = 0; i < json_object_array_length(blockdevices); i++) {
struct json_object *device = json_object_array_get_idx(blockdevices, i);
struct json_object *type, *path, *size, *model, *fstype, *fsused;
struct json_object *type, *path, *size, *model, *fstype, *fsused, *label;
json_object_object_get_ex(device, "type", &type);
if (strcmp("part",json_object_get_string(type)))
@ -2132,6 +2141,7 @@ void on_near_installation_device_changed(GtkWidget *self, main_window *widgets){
}
json_object_object_get_ex(device, "size", &size);
json_object_object_get_ex(device, "model", &model);
json_object_object_get_ex(device, "label", &label);
json_object_object_get_ex(device, "fstype", &fstype);
json_object_object_get_ex(device, "fsused", &fsused);
@ -2165,7 +2175,7 @@ void on_near_installation_device_changed(GtkWidget *self, main_window *widgets){
// gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->InstallationNearSizeSpin),0.0);
gtk_adjustment_set_upper(gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(widgets->InstallationNearSizeSpin)),0.0);
gtk_list_store_append(widgets->PartitionsList,&iter);
gtk_list_store_set(widgets->PartitionsList,&iter,0,json_object_get_string(path),1,json_object_get_string(size),2,free_space_string,3,json_object_get_string(fstype),-1);
gtk_list_store_set(widgets->PartitionsList,&iter,0,json_object_get_string(path),1,json_object_get_string(size),2,free_space_string,3,json_object_get_string(fstype),4,json_object_get_string(label),-1);
}
yon_char_parsed_free(parsed,size);
}
@ -2217,6 +2227,22 @@ void on_gparted_open(){
gboolean on_yon_exit(GtkWidget *,GdkEvent*, main_window *widgets);
void on_reboot_accepted(GtkWidget *,dictionary *dict){
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
confirmation_window *window = yon_dictionary_get_data(dict->first->next,confirmation_window*);
g_mutex_lock(&main_config.install_mutex);
if (main_config.install_thread){
pthread_cancel((pthread_t)main_config.install_thread);
g_mutex_unlock(&main_config.install_mutex);
}
main_config.exit_accepted=1;
g_signal_emit_by_name(G_OBJECT(widgets->MainWindow),"delete-event");
free(window);
yon_dictionary_free_all(dict,NULL);
free(dict);
if (system("reboot")){};
}
void on_exit_accepted(GtkWidget *,dictionary *dict);
void on_exit_accepted(GtkWidget *,dictionary *dict){
main_window *widgets = yon_dictionary_get_data(dict->first,main_window*);
@ -2234,23 +2260,31 @@ void on_exit_accepted(GtkWidget *,dictionary *dict){
gtk_widget_destroy(widgets->MainWindow);
}
gboolean on_yon_exit(GtkWidget *,GdkEvent*, main_window *widgets){
if (!main_config.exit_accepted){
if (widgets){};
confirmation_window *window = malloc(sizeof(confirmation_window));
confirmation_window *yon_confirmation_window_new(){
confirmation_window *window = malloc(sizeof(confirmation_window));
GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_confirmation);
window->Window = yon_gtk_builder_get_widget(builder,"MainWindow");
window->TitleLabel = yon_gtk_builder_get_widget(builder,"TitleLabel");
window->TextLabel = yon_gtk_builder_get_widget(builder,"TextLabel");
window->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton");
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
return window;
}
gboolean on_yon_exit(GtkWidget *,GdkEvent*, main_window *widgets){
if (!main_config.exit_accepted){
if (widgets){};
confirmation_window *window = yon_confirmation_window_new();
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->AcceptButton),"clicked",G_CALLBACK(on_exit_accepted),dict);
g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
gtk_window_set_transient_for(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->MainWindow));
gtk_window_set_title(GTK_WINDOW(window->Window),TITLE_LABEL);
gtk_window_set_icon_name(GTK_WINDOW(window->Window),icon_path);
gtk_label_set_text(GTK_LABEL(window->TextLabel),WARNING_TEXT_LABEL);
gtk_label_set_text(GTK_LABEL(window->TitleLabel),WARNING_TITLE_LABEL);
gtk_widget_show(window->Window);
@ -2498,6 +2532,18 @@ main_window *yon_main_window_complete(){
g_signal_connect(G_OBJECT(widgets->RootPasswordSensitiveCheck),"toggled",G_CALLBACK(yon_password_set_sensitive_from_toggle),widgets);
g_signal_connect(G_OBJECT(widgets->PasswordSensitiveCheck),"toggled",G_CALLBACK(yon_password_set_sensitive_from_toggle),widgets);
if (main_config.lock_load_global == 1){
gtk_widget_set_sensitive(widgets->LoadGlobalConfigurationMenuItem,0);
}
if (main_config.lock_save_global == 1){
gtk_widget_set_sensitive(widgets->SaveGlobalConfigurationMenuItem,0);
gtk_widget_set_sensitive(widgets->SaveGlobalLocalConfigurationMenuItem,0);
}
if (main_config.lock_save_local == 1){
gtk_widget_set_sensitive(widgets->SaveLocalConfigurationMenuItem,0);
gtk_widget_set_sensitive(widgets->SaveGlobalLocalConfigurationMenuItem,0);
}
gtk_tree_model_filter_set_visible_column(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter),0);
gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter));

@ -35,9 +35,9 @@
#define LocalePath "/usr/share/locale"
#define LocaleName "ubinstall-gtk"
#define clear_config_both_command "ubconfig remove TEMP_SECTION TEMP_PATAMETER"
#define clear_config_global_command "ubconfig --target global remove TEMP_SECTION TEMP_PATAMETER"
#define clear_config_local_command "ubconfig --target system remove TEMP_SECTION TEMP_PATAMETER"
#define clear_config_both_command "pkexec bash -c 'ubconfig remove TEMP_SECTION TEMP_PATAMETER '"
#define clear_config_global_command "pkexec bash -c 'ubconfig --target global remove TEMP_SECTION TEMP_PATAMETER '"
#define clear_config_local_command "pkexec bash -c 'ubconfig --target system remove TEMP_SECTION TEMP_PATAMETER '"
#define regions_path "/com/ublinux/images/map-time-zone.png"
#define keyboard_path "/com/ublinux/images/keyboard.png"
@ -441,6 +441,8 @@ typedef struct {
typedef struct {
GtkWidget *Window;
GtkWidget *TitleLabel;
GtkWidget *TextLabel;
GtkWidget *AcceptButton;
GtkWidget *CancelButton;
} confirmation_window;
@ -470,4 +472,8 @@ void on_hostname_entry_changed (GtkWidget *, main_window *widgets);
gboolean on_install_success(main_window *widgets);
void *on_install_error(main_window *widgets);
void *on_install_error(main_window *widgets);
confirmation_window *yon_confirmation_window_new();
void on_reboot_accepted(GtkWidget *,dictionary *dict);

@ -9,7 +9,7 @@
#define OPEN_LABEL _("Open")
#define KEYBOARD_TITLE_LABEL _("Keyboard layout")
#define CUSTOM_CONFIG_CREATION_ERROR_LABEL _("New configuration file creation failed")
#define CUSTOM_CONFIG_CREATION_ERROR_LABEL _("New configuration file creation failed")
#define CANCEL_LABEL _("Cancel")
#define BACK_LABEL _("Back")
@ -59,7 +59,7 @@
#define CHOOSE_SECTION_LABEL _("Choose a section:")
#define ATTENSION_LABEL _("<b>Attention!</b> The selected partition will be modified: the size will be reduced. In the resulting free space, a partition will be created into which the UBLinux OS will be\ninstalled.")
#define DEVICE_LABEL _("Device")
#define MARK_LABEL _("Mark")
#define MARK_LABEL _("Label")
#define SIZE_LABEL _("Size")
#define FREE_LABEL _("Free")
#define SPECIFY_LABEL _("Specify the size of the new partition for UBLinux OS:")
@ -173,8 +173,6 @@
#define ACCEPT_LABEL _("Accept")
#define GPARTED_LABEL _("Start GParted")
#define EXIT_WARNING_LABEL _("Are you sure want to exit and interrupt installation process?")
#define PROGRESS_LOG_LABEL _("Progress log")
#define INSTALL_LOG_LABEL _("Installation log")

@ -60,7 +60,7 @@
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="TextLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
@ -105,7 +105,7 @@ interrupt installation process?</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<child type="title">
<object class="GtkLabel" id="webHeaderNameLabel">
<object class="GtkLabel" id="TitleLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Warning</property>

@ -3049,7 +3049,7 @@ or continue working in the UBLinux Live environment.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Mark</property>
<property name="title" translatable="yes">Label</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -3071,7 +3071,7 @@ or continue working in the UBLinux Live environment.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Free</property>
<property name="title" translatable="yes">Serial</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -3456,7 +3456,7 @@ installed.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Mark</property>
<property name="title" translatable="yes">Label</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -4046,7 +4046,7 @@ installed.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Mark</property>
<property name="title" translatable="yes">Description</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -4057,7 +4057,7 @@ installed.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Capacity</property>
<property name="title" translatable="yes">Label</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -4068,7 +4068,7 @@ installed.</property>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Location</property>
<property name="title" translatable="yes">Size</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
@ -4077,6 +4077,17 @@ installed.</property>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Serial</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">4</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>

@ -272,7 +272,7 @@ msgid "Device"
msgstr ""
#: source/ubl-strings.h:58
msgid "Mark"
msgid "Label"
msgstr ""
#: source/ubl-strings.h:59

@ -286,7 +286,7 @@ msgid "Device"
msgstr "Устройство"
#: source/ubl-strings.h:58
msgid "Mark"
msgid "Label"
msgstr "Метка"
#: source/ubl-strings.h:59

Loading…
Cancel
Save