pull/160/head
parent ba99ba2141
commit 1cf1259ca5

@ -204,7 +204,14 @@ void yon_os_components_init(main_window *widgets){
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");
gtk_widget_set_size_request(row->NameLabel,size,-1);
int cur_size = 0;
gtk_widget_realize(row->RowBox);
gtk_widget_get_preferred_width(row->RowBox,&cur_size,NULL);
if (size<cur_size)size=cur_size;
}
for(iter = list;iter;iter=iter->next){
os_row *row = g_object_get_data(iter->data,"kernel_row");
gtk_widget_set_size_request(row->RowBox,size,-1);
}
}
@ -260,37 +267,23 @@ int yon_software_save(main_window *widgets){
}
void yon_software_init(main_window *widgets){
GtkTreeIter iter;
if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(widgets->AdditionalSoftwareList),&iter)){
int size;
config_str parsed = NULL;
parsed = yon_resource_open_file(additional_software_path,&size);
for (int i=1;i<size;i++){
int module_size;
config_str module_parsed = yon_char_parse(parsed[i],&module_size,"|");
if (module_size){
gtk_list_store_append(widgets->AdditionalSoftwareList,&iter);
gtk_list_store_set(widgets->AdditionalSoftwareList,&iter,0,1,1,module_parsed[0],2,module_parsed[1],3,module_parsed[2],-1); //2,module_parsed[2]
yon_char_parsed_free(module_parsed,module_size);
}
}
if (size) yon_char_parsed_free(parsed,size);
}
char *modules = config(modules_extra_parameter);
int size;
config_str parsed = yon_char_parse(modules,&size,",");
for_iter(GTK_TREE_MODEL(widgets->AdditionalSoftwareList),&iter){
char *target;
gtk_tree_model_get(GTK_TREE_MODEL(widgets->AdditionalSoftwareList),&iter,1,&target);
if (yon_char_parsed_check_exist(parsed,size,target)>-1){
gtk_list_store_set(widgets->AdditionalSoftwareList,&iter,0,1,-1);
} else {
gtk_list_store_set(widgets->AdditionalSoftwareList,&iter,0,0,-1);
}
int base_size;
config_str base = yon_config_load(get_modules_command,&base_size);
for (int i=0;i<base_size;i++){
yon_char_remove_last_symbol(base[i],'\n');
int parsed_size;
config_str parsed = yon_char_parse(base[i],&parsed_size,";");
struct row_data *row = malloc(sizeof(struct row_data));
row->version = parsed[1];
row->name = parsed[0];
row->tags = yon_char_replace(parsed[2]," ",", ");
row->description = parsed[3];
row->widgets=widgets;
g_idle_add((GSourceFunc)yon_os_component_insert,row);
}
yon_char_parsed_free(parsed,size);
g_idle_add((GSourceFunc)yon_spinner_switch_off,widgets->OSSpinner);
yon_char_parsed_free(base,base_size);
return NULL;
}
int yon_pacman_software_save(main_window *widgets){

@ -7,8 +7,28 @@ void configuration_mode_accept(GtkWidget *,configuration_window *window){
yon_ubl_status_highlight_incorrect(window->PathEntry);
return;
}
if (!yon_char_is_empty(main_config.config_save_path)) free(main_config.config_save_path);
main_config.config_save_path = yon_char_new(path);
if (access(path,F_OK)){
int homedir_create = 0;
if (!strstr(path,"/")){
homedir_create = 1;
}
dialog_confirmation_data *data = yon_confirmation_dialog_data_new();
data->action_text = homedir_create?CREATE_CONFIG_DIALOG_LABEL_HOMEDIR:CREATE_CONFIG_DIALOG_LABEL;
data->title = WARNING_TITLE_LABEL;
if (yon_confirmation_dialog_call(window->Window,data)==GTK_RESPONSE_ACCEPT){
char *full_path = NULL;
if (homedir_create){
full_path = yon_char_unite(yon_ubl_user_get_home_directory(),"/",path,NULL);
} else {
full_path = yon_char_new(path);
}
yon_launch(ubconfig_file_create(full_path));
} else return;
}
if (!yon_char_is_empty(main_config.config_save_path)) free(main_config.config_save_path);
main_config.config_save_path = yon_char_new(path);
gtk_widget_destroy(window->Window);
}
@ -29,6 +49,9 @@ void on_configuration_exit(GtkWidget *,configuration_window *window){
main_window *widgets = g_object_get_data(G_OBJECT(window->Window),"widgets");
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widgets->ConfigurationModeMenuItem),0);
gtk_widget_destroy(window->Window);
if (getuid()){
gtk_main_quit();
}
}
void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){
@ -48,6 +71,9 @@ void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){
g_signal_connect(G_OBJECT(window->PathButton),"clicked",G_CALLBACK(on_path_choose),window);
g_object_set_data(G_OBJECT(window->Window),"widgets",widgets);
yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->MainWindow),CONFIGURATION_MODE_TITLE_LABEL,icon_path,"configuration_window");
if (getuid()){
yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),"force_configure_mode",ROOT_FORCE_CONFIGURATION_MODE_LABEL,BACKGROUND_IMAGE_INFO_TYPE);
}
if (!yon_char_is_empty(main_config.config_save_path)) gtk_entry_set_text(GTK_ENTRY(window->PathEntry),main_config.config_save_path);
gtk_widget_show(window->Window);

@ -8,12 +8,12 @@ enum YON_PAGES yon_page_get_next(main_window *widgets, enum YON_PAGES page){
case YON_PAGE_WELCOME: return YON_PAGE_LICENCE; break;
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 main_config.configure_mode? YON_PAGE_KERNEL : YON_PAGE_INSTALLATION_BEGIN; 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_SOFTWARE: return YON_PAGE_PACMAN_SOFTWARE; break;
case YON_PAGE_REGION: return YON_PAGE_KEYBOARD; break;
case YON_PAGE_KEYBOARD: return YON_PAGE_USERS; break;
case YON_PAGE_USERS: return YON_PAGE_STARTUP; break;
@ -50,11 +50,11 @@ enum YON_PAGES yon_page_get_prev(enum YON_PAGES page){
case YON_PAGE_LICENCE: return YON_PAGE_WELCOME; break;
case YON_PAGE_SECTIONS: return YON_PAGE_LICENCE; break;
case YON_PAGE_OS_COMPONENTS: return YON_PAGE_SECTIONS; break;
case YON_PAGE_INSTALLATION_BEGIN: 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_ADDON: return YON_PAGE_KERNEL; break;
case YON_PAGE_PACMAN_SOFTWARE: return YON_PAGE_KERNEL_ADDON; break;
case YON_PAGE_SOFTWARE: return YON_PAGE_PACMAN_SOFTWARE; break;
case YON_PAGE_REGION: return YON_PAGE_PACMAN_SOFTWARE; break;
case YON_PAGE_KEYBOARD: return YON_PAGE_REGION; break;
case YON_PAGE_USERS: return YON_PAGE_KEYBOARD; break;

@ -227,6 +227,9 @@ NULL)
#define ABOUT_TITLE_LABEL _("About system installation")
#define VALUE_REPEAT_LABEL _("Repeating values")
#define SOURCE_CREATE_ONGOING_ERROR_LABEL _("Source creation were not done")
#define CREATE_CONFIG_DIALOG_LABEL _("Configuration file does not exist. Create new configuration file?")
#define CREATE_CONFIG_DIALOG_LABEL_HOMEDIR _("Configuration file does not exist. Create new configuration file? New configuration file will be created at your user's home directory")
#define ROOT_FORCE_CONFIGURATION_MODE_LABEL _("Warning! Application was launched without root. Only configuration mode is allowed.")
// #define _LABEL _("New section at")
// #define _LABEL _("\"/ublinux-data/\" user data section")
// #define _LABEL _("\"/ublinux/\" system section")

@ -64,7 +64,7 @@
<object class="GtkBox" id="TagsBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">start</property>
<property name="halign">center</property>
<property name="margin-top">3</property>
<property name="margin-bottom">5</property>
<property name="spacing">2</property>
@ -75,6 +75,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack-type">end</property>
<property name="position">6</property>
</packing>
</child>

@ -3,18 +3,6 @@
<interface domain="ubinstall-gtk">
<requires lib="gtk+" version="3.24"/>
<!-- interface-css-provider-path ubinstall-gtk.css -->
<object class="GtkListStore" id="AdditionalSoftwareList">
<columns>
<!-- column-name Chosen -->
<column type="gboolean"/>
<!-- column-name Module -->
<column type="gchararray"/>
<!-- column-name Tag -->
<column type="gchararray"/>
<!-- column-name Description -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkAdjustment" id="AdvancedSwapAdjustment">
<property name="upper">100</property>
<property name="step-increment">1</property>
@ -2196,63 +2184,61 @@ and help you install system on your computer</property>
<property name="left-padding">5</property>
<property name="right-padding">5</property>
<child>
<object class="GtkScrolledWindow">
<object class="GtkOverlay" id="AdditionalComponentsOverlay">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<property name="can-focus">False</property>
<child>
<object class="GtkTreeView" id="AdditionalSoftwareTree">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="model">AdditionalSoftwareList</property>
<property name="search-column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn">
<child>
<object class="GtkCellRendererToggle" id="AdditionalSoftwareCell"/>
<attributes>
<attribute name="active">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Module name</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Type</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">2</attribute>
</attributes>
</child>
</object>
</child>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Description</property>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">3</attribute>
</attributes>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkListBox" id="AdditionalComponentsList">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="selection-mode">none</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="index">-1</property>
</packing>
</child>
</object>
</child>

Loading…
Cancel
Save