diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index a9b8cd1..701dc7f 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -65,6 +65,9 @@ set(DEPENDFILES ../ubinstall-gtk-documentation.glade ../ubinstall-gtk-log-view.glade ../ubinstall-gtk-warning.glade + ../ubinstall-gtk-user.glade + ../ubinstall-gtk-menu.glade + ../ubinstall-gtk-menu-item.glade ../gresource.xml ../ubinstall-gtk.css ../modules.csv diff --git a/source/ubinstall-gtk-password.c b/source/ubinstall-gtk-password.c index f52114a..dfdd045 100644 --- a/source/ubinstall-gtk-password.c +++ b/source/ubinstall-gtk-password.c @@ -1,2 +1 @@ #include "ubinstall-gtk.h" - diff --git a/source/ubinstall-gtk-saving.c b/source/ubinstall-gtk-saving.c index a825145..a62e573 100644 --- a/source/ubinstall-gtk-saving.c +++ b/source/ubinstall-gtk-saving.c @@ -391,16 +391,16 @@ // if (!strcmp(user_name,"root")){ // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UserRootOnlyCheck),1); // } else { -// gtk_entry_set_text(GTK_ENTRY(widgets->UserLoginEntry),user_name); +// gtk_entry_set_text(GTK_ENTRY(widgets->UserRootLoginEntry),user_name); // } // } else { -// gtk_entry_set_text(GTK_ENTRY(widgets->UserLoginEntry),""); +// 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->UserNameEntry),_(user_gecos)); +// gtk_entry_set_text(GTK_ENTRY(widgets->UserRootNameEntry),_(user_gecos)); // } else { -// gtk_entry_set_text(GTK_ENTRY(widgets->UserNameEntry),""); +// gtk_entry_set_text(GTK_ENTRY(widgets->UserRootNameEntry),""); // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UsernameSensitiveCheck),0); // } // int def_size=0; @@ -412,13 +412,13 @@ // } // } // 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->UserPasswordCombo),0); -// gtk_entry_set_text(GTK_ENTRY(widgets->UserPasswordEntry),""); +// 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->UserPasswordEntry),user_password); -// gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UserPasswordCombo),1); +// 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); diff --git a/source/ubinstall-gtk-users.c b/source/ubinstall-gtk-users.c index 9695f84..53b045c 100644 --- a/source/ubinstall-gtk-users.c +++ b/source/ubinstall-gtk-users.c @@ -1,80 +1,104 @@ #include "ubinstall-gtk.h" int yon_users_save(main_window *widgets){ - if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry)))||!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->UsernameSensitiveCheck))){ - yon_config_remove_by_key(user_gecos_parameter); + if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->UserRootPasswordCombo))){ + const char *root_password = gtk_entry_get_text(GTK_ENTRY(widgets->UserRootPasswordEntry)); + if (yon_char_is_empty(root_password)){ + yon_ubl_status_box_spawn(GTK_CONTAINER(main_config.status_box),_EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(widgets->UserRootPasswordEntry); + return 0; + } + yon_config_register(root_password_parameter,root_password_parameter_command,(char*)root_password); } else { - char *username = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry)); - if (username){}; - yon_config_register(user_gecos_parameter,user_gecos_parameter_command,username); + yon_config_remove_by_key(root_password_parameter); } - - if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->UserLoginEntry)))||!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->LoginSensitiveCheck))){ - yon_config_remove_by_key(user_name_parameter); + int autologin = gtk_switch_get_active(GTK_SWITCH(widgets->UserAutologinSwitch)); + if (autologin){ + yon_config_register(autologin_parameter,autologin_parameter_command,"yes"); } else { - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->UserRootOnlyCheck))){ - yon_config_register(user_name_parameter,user_name_parameter_command,"root"); - } else { - char *login = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserLoginEntry)); - if (login){}; - yon_config_register(user_name_parameter,user_name_parameter_command,login); - } + yon_config_register(autologin_parameter,autologin_parameter_command,"no"); } - if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->UserPasswordCombo))==1){ - if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->UserPasswordEntry)))){ - yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); - yon_ubl_status_highlight_incorrect(widgets->UserPasswordEntry); - return 0; - } else { - char *password = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserPasswordEntry)); - if (password){}; - - yon_config_register(user_password_parameter,user_password_parameter_command,password); + GList *users = gtk_container_get_children(GTK_CONTAINER(widgets->UserAddBox)); + GList *iter; + for (iter=users;iter;iter=iter->next){ + yon_user_struct *user = g_object_get_data(G_OBJECT(iter->data),"yon_user_struct"); + if (user){ + if (!yon_user_save(user)){ + yon_ubl_status_box_spawn(GTK_CONTAINER(main_config.status_box),_EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + return 0; } - } else { - yon_config_remove_by_key(user_password_parameter); } + } - if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->AdminPasswordCombo))==1){ - if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->AdminPasswordEntry)))){ - yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); - yon_ubl_status_highlight_incorrect(widgets->AdminPasswordEntry); - return 0; - } else { - char *root_password = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->AdminPasswordEntry)); - if (root_password){}; - yon_config_register(root_password_parameter,root_password_parameter_command,root_password); + yon_debug_output("%s\n",yon_config_get_all_info()); + return 1; +} - } - } else { - yon_config_remove_by_key(root_password_parameter); +int yon_user_save(yon_user_struct *user){ + char *name = (char *)gtk_entry_get_text(GTK_ENTRY(user->UsernameEntry)); + char *login = (char *)gtk_entry_get_text(GTK_ENTRY(user->LoginEntry)); + char *password = NULL; + if (yon_char_is_empty(login)){ + yon_ubl_status_box_spawn(GTK_CONTAINER(main_config.status_box),_EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(user->LoginEntry); + return 0; + } + if (gtk_combo_box_get_active(GTK_COMBO_BOX(user->PasswordCombo))){ + password = (char *)gtk_entry_get_text(GTK_ENTRY(user->PasswordEntry)); + if (yon_char_is_empty(password)){ + yon_ubl_status_highlight_incorrect(user->PasswordEntry); + return 0; } + } + char *parameter = yon_char_unite(yon_char_return_if_exist(name,""),":::::",yon_char_return_if_exist(password,""),NULL); + yon_config_register(USERADD_parameter(login),USERADD_parameter_command(login),parameter); + free(parameter); + return 1; +} - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->HostnameSensitiveCheck))){ - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutoHostnameCheck))){ - yon_config_register(hostname_parameter,hostname_parameter_command,"auto"); - } else { - if (!yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->HotnameEntry)))){ - char *hostname = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->HotnameEntry)); - if (hostname){}; - yon_config_register(hostname_parameter,hostname_parameter_command,hostname); +void on_user_add(GtkWidget *,main_window *widgets){ + yon_user_struct *user = yon_user_struct_new(); + gtk_box_pack_start(GTK_BOX(widgets->UserAddBox),user->MainBox,0,0,0); +} - } else { - yon_config_remove_by_key(hostname_parameter); +void on_user_remove_clicked(GtkWidget *,yon_user_struct *user){ + gtk_widget_destroy(user->MainBox); + free(user); +} - } - } - } else { - yon_config_remove_by_key(hostname_parameter); - } +void yon_password_root_new(GtkWidget *, main_window *widgets){ + yon_password_window *window = yon_password_open(GTK_ENTRY(widgets->UserRootPasswordEntry)); + gtk_widget_hide(gtk_widget_get_parent(window->EncryptionCombo)); + gtk_widget_show(window->Window); +} - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutologinSensitiveCheck))){ - char *autologin = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->UserAutologinSwitch))?"yes":"no"; - yon_config_register(autologin_parameter,autologin_parameter_command,autologin); - } else { - yon_config_remove_by_key(autologin_parameter); - } - return 1; +void yon_password_new(GtkWidget *, yon_user_struct *user){ + yon_password_window *window = yon_password_open(GTK_ENTRY(user->PasswordEntry)); + gtk_widget_hide(gtk_widget_get_parent(window->EncryptionCombo)); + gtk_widget_show(window->Window); +} + +yon_user_struct *yon_user_struct_new(){ + yon_user_struct *user = new(yon_user_struct); + GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_user); + + user->MainBox = yon_gtk_builder_get_widget(builder,"MainBox"); + user->RemoveButton = yon_gtk_builder_get_widget(builder,"RemoveButton"); + user->UsernameEntry = yon_gtk_builder_get_widget(builder,"UsernameEntry"); + user->LoginEntry = yon_gtk_builder_get_widget(builder,"LoginEntry"); + user->PasswordCombo = yon_gtk_builder_get_widget(builder,"PasswordCombo"); + user->PasswordEntry = yon_gtk_builder_get_widget(builder,"PasswordEntry"); + user->PasswordButton = yon_gtk_builder_get_widget(builder,"PasswordButton"); + + g_object_set_data(G_OBJECT(user->MainBox),"yon_user_struct",user); + + yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(user->PasswordEntry)); + + g_signal_connect(G_OBJECT(user->PasswordCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),user->PasswordEntry); + g_signal_connect(G_OBJECT(user->PasswordCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),user->PasswordButton); + g_signal_connect(G_OBJECT(user->PasswordButton),"clicked",G_CALLBACK(yon_password_new),user); + g_signal_connect(G_OBJECT(user->RemoveButton),"clicked",G_CALLBACK(on_user_remove_clicked),user); + return user; } \ No newline at end of file diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index da34acb..ed6bf10 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -398,19 +398,14 @@ main_window *yon_main_window_complete(){ widgets->OptionsSensitiveCheck = yon_gtk_builder_get_widget(builder,"OptionsSensitiveCheck"); widgets->LayoutSensitiveCheck = yon_gtk_builder_get_widget(builder,"LayoutSensitiveCheck"); - widgets->UserNameEntry=yon_gtk_builder_get_widget(builder,"UserNameEntry"); - widgets->UserLoginEntry=yon_gtk_builder_get_widget(builder,"UserLoginEntry"); - widgets->UserPasswordCombo=yon_gtk_builder_get_widget(builder,"UserPasswordCombo"); - widgets->UserPasswordEntry=yon_gtk_builder_get_widget(builder,"UserPasswordEntry"); - widgets->UserPasswordButton=yon_gtk_builder_get_widget(builder,"UserPasswordButton"); + widgets->UserRootNameEntry=yon_gtk_builder_get_widget(builder,"UserRootNameEntry"); + widgets->UserRootLoginEntry=yon_gtk_builder_get_widget(builder,"UserRootLoginEntry"); + widgets->UserRootPasswordCombo=yon_gtk_builder_get_widget(builder,"UserRootPasswordCombo"); + widgets->UserRootPasswordEntry=yon_gtk_builder_get_widget(builder,"UserRootPasswordEntry"); + widgets->UserRootPasswordButton=yon_gtk_builder_get_widget(builder,"UserRootPasswordButton"); widgets->UserAutologinSwitch=yon_gtk_builder_get_widget(builder,"UserAutologinSwitch"); - widgets->AdminPasswordCombo=yon_gtk_builder_get_widget(builder,"AdminPasswordCombo"); - widgets->AdminPasswordEntry=yon_gtk_builder_get_widget(builder,"AdminPasswordEntry"); - widgets->AdminPasswordButton=yon_gtk_builder_get_widget(builder,"AdminPasswordButton"); - widgets->UsernameSensitiveCheck = yon_gtk_builder_get_widget(builder,"UsernameSensitiveCheck"); - widgets->LoginSensitiveCheck = yon_gtk_builder_get_widget(builder,"LoginSensitiveCheck"); - widgets->UserRootOnlyCheck = yon_gtk_builder_get_widget(builder,"UserRootOnlyCheck"); - widgets->AutologinSensitiveCheck = yon_gtk_builder_get_widget(builder,"AutologinSensitiveCheck"); + widgets->UserAddBox=yon_gtk_builder_get_widget(builder,"UserAddBox"); + widgets->UserAddButton=yon_gtk_builder_get_widget(builder,"UserAddButton"); widgets->HotnameEntry=yon_gtk_builder_get_widget(builder,"HotnameEntry"); widgets->mainSettingsButton=yon_gtk_builder_get_widget(builder,"mainSettingsButton"); @@ -464,6 +459,8 @@ main_window *yon_main_window_complete(){ widgets->HostnameSensitiveCheck = yon_gtk_builder_get_widget(builder,"HostnameSensitiveCheck"); widgets->AutoHostnameCheck=yon_gtk_builder_get_widget(builder,"AutoHostnameCheck"); widgets->network_connections = NULL; + + main_config.status_box = widgets->StatusBox; } g_signal_connect(G_OBJECT(widgets->MainWindow),"delete-event",G_CALLBACK(on_yon_exit),widgets); GtkWidget *menu = yon_gtk_builder_get_widget(builder,"menu2"); @@ -513,6 +510,12 @@ main_window *yon_main_window_complete(){ 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->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); + 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->LanguageCombo),"changed",G_CALLBACK(on_locale_changed),widgets); @@ -529,9 +532,16 @@ main_window *yon_main_window_complete(){ // g_signal_connect(G_OBJECT(widgets->AutoHostnameCheck),"toggled",G_CALLBACK(on_autohostname_check),widgets); // g_signal_connect(G_OBJECT(widgets->HotnameEntry),"changed",G_CALLBACK(on_hostname_entry_changed),widgets); + + { + yon_user_struct *user = yon_user_struct_new(); + gtk_box_pack_start(GTK_BOX(widgets->UserAddBox),user->MainBox,0,0,0); + gtk_entry_set_text(GTK_ENTRY(user->UsernameEntry),ADMINISTRATOR_LABEL); + gtk_entry_set_text(GTK_ENTRY(user->LoginEntry),"superadmin"); + } + { - yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(widgets->UserPasswordEntry)); - yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(widgets->AdminPasswordEntry)); + yon_gtk_entry_set_password_visibility_icon(GTK_ENTRY(widgets->UserRootPasswordEntry)); if (main_config.lock_load_global == 1){ gtk_widget_set_sensitive(widgets->LoadGlobalConfigurationMenuItem,0); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 3344940..e133abb 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -26,6 +26,9 @@ #define glade_path_ubinstall_language "/com/ublinux/ui/ubinstall-gtk-language.glade" #define glade_path_network_info "/com/ublinux/ui/ubinstall-gtk-network-box.glade" #define glade_path_log_view "/com/ublinux/ui/ubinstall-gtk-log-view.glade" +#define glade_path_user "/com/ublinux/ui/ubinstall-gtk-user.glade" +#define glade_path_menu_window "/com/ublinux/ui/ubinstall-gtk-menu.glade" +#define glade_path_menu_item "/com/ublinux/ui/ubinstall-gtk-menu-item.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) @@ -65,6 +68,8 @@ "/com/ublinux/images/slide-12.png", \ NULL +#define get_menus_entry_command "/usr/lib/ublinux/scripts/grub-functions exec_get_all_menuentry" + #define encrypt_domain_password_command(target) yon_char_unite("echo '",target,"' | base64",NULL) #define get_ntp_default_command "ubconfig --default get [network] NTPSERVERS_DEFAULT" @@ -146,6 +151,9 @@ NULL #define DOMAIN_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[ubconfig set [network] DOMAIN]" #define DOMAIN_admanger_parameter "AOUTINSTALL[ubconfig set [network] DOMAIN[admanger]]" #define DOMAIN_admanger_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[ubconfig set [network] DOMAIN[admanger]]" +#define USERADD_parameter_all "AUTOINSTALL['ubconfig set [users] USERADD[*]']" +#define USERADD_parameter(target) yon_char_unite("AUTOINSTALL['ubconfig set [users] USERADD[",target,"]']",NULL) +#define USERADD_parameter_command(target) yon_char_unite("ubconfig --source global get autoinstall AUTOINSTALL['ubconfig set [users] USERADD[",target,"]']",NULL) #define save_config_command(parameters) yon_char_unite("ubconfig --target system set [autoinstall] AUTOINSTALL[log]=yes ",parameters, "; nice ubinstall2 --debug autoinstall", NULL) @@ -302,6 +310,7 @@ typedef struct { int arg_size; config_str arg_target; + GtkWidget *status_box; } config; extern config main_config; @@ -371,15 +380,15 @@ typedef struct { GtkWidget *InstallationWindowsRadio; GtkWidget *InstallationOptionsRadio; - GtkWidget *UserNameEntry; - GtkWidget *UserLoginEntry; - GtkWidget *UserPasswordCombo; - GtkWidget *UserPasswordEntry; - GtkWidget *UserPasswordButton; + GtkWidget *UserRootNameEntry; + GtkWidget *UserRootLoginEntry; + GtkWidget *UserRootPasswordCombo; + GtkWidget *UserRootPasswordEntry; + GtkWidget *UserRootPasswordButton; GtkWidget *UserAutologinSwitch; - GtkWidget *AdminPasswordCombo; - GtkWidget *AdminPasswordEntry; - GtkWidget *AdminPasswordButton; + GtkWidget *UserAddBox; + GtkWidget *UserAddButton; + GtkWidget *HotnameEntry; GtkWidget *AutoHostnameCheck; GtkWidget *CancelInstallButton; @@ -388,11 +397,13 @@ typedef struct { GtkWidget *mainSettingsButton; GtkWidget *menu1; GtkWidget *menu2; + GtkWidget *RegionImage; GtkWidget *RegionBox; GtkWidget *RegionAspect; GtkWidget *KeyboardImage; GtkWidget *KeyboardBox; + GtkWidget *Notebook; GtkWidget *LicenceLabel; GtkWidget *SlidesImage; @@ -584,7 +595,7 @@ typedef struct{ GtkWidget *StatusBox; GtkWidget *UserCancelButton; GtkWidget *UserOkButton; - GtkWidget *UserPasswordEntry; + GtkWidget *UserRootPasswordEntry; GtkWidget *RepeatPasswordEntry; GtkWidget *PasswordHashEntry; GtkWidget *HashBox; @@ -624,13 +635,53 @@ typedef struct { GtkWidget *DNSEntry; } network_info; +typedef struct { + GtkWidget *MainBox; + GtkWidget *RemoveButton; + GtkWidget *UsernameEntry; + GtkWidget *LoginEntry; + GtkWidget *PasswordCombo; + GtkWidget *PasswordEntry; + GtkWidget *PasswordButton; +} yon_user_struct; + + +typedef struct { + GtkWidget *MenuWindow; + GtkWidget *BackButton; + GtkWidget *ItemsRevealer; + GtkWidget *ItemsListBox; + GtkWidget *ChildrenRevealer; + GtkWidget *ChildrenListBox; + + int seat_grab; + dictionary *menu_items; + char *cur_selection; + int button_pos_x; + int button_pos_y; +} yon_menu_window; + +typedef struct { + GtkWidget *MenuItemBox; + GtkWidget *MenuButton; + GtkWidget *MenuTextLabel; + GtkWidget *NextIconButton; + + char *target; + + main_window *widgets; + yon_menu_window *window; + + dictionary *children; + +} yon_menu_item; + void config_init(); main_window *yon_main_window_complete(); ubinstall_language_window *yon_ubinstall_language_new(); void NewFunction(ubinstall_language_window *window, GtkBuilder *builder); ubinstall_keyboard_window *yon_ubinstall_keyboard_new(); -password_window *yon_password_new(); void on_password_accept(GtkWidget *self, dictionary *dict); @@ -731,4 +782,19 @@ void yon_configuration_mode_check(main_window *widgets); void on_configuration_mode_switch(GtkWidget *self,main_window *widgets); void *_yon_installation_start(main_window *widgets); int yon_installation_start(main_window *widgets); -enum INSTALL_TYPE yon_ubl_get_install_mode(); \ No newline at end of file +enum INSTALL_TYPE yon_ubl_get_install_mode(); +int yon_user_save(yon_user_struct *user); +void on_user_add(GtkWidget *,main_window *widgets); +yon_user_struct *yon_user_struct_new(); +void on_user_remove_clicked(GtkWidget *,yon_user_struct *user); +void yon_password_new(GtkWidget *, yon_user_struct *user); +void yon_password_root_new(GtkWidget *, main_window *widgets); +yon_menu_item *yon_menu_item_new(); + yon_menu_window *yon_menu_window_new(); +void on_menu_window_size_reallocated(GtkWidget *self,GtkAllocation *,yon_menu_window *window); +void on_children_clean(GtkWidget*, yon_menu_window *window); +gboolean yon_on_revealer_switched (yon_menu_window *window); +gboolean on_menu_clicked(GtkWidget *, GdkEventButton *event, yon_menu_window *window); +yon_menu_window *yon_menu_window_open(GtkWidget *, main_window *widgets); +void on_submenu_open(GtkWidget *,yon_menu_item *item); +void on_menu_chosen(GtkWidget *, yon_menu_item *item); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index e0930c3..03e63b6 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -185,4 +185,6 @@ #define WARNING_REBOOT_TEXT_LABEL _("Are you sure want to reboot system?") #define DEFAULT_BOOTLOAD_MENU_ITEM_LABEL _("Default (Use last succeeded)") -#define ENCRYPT_ERROR_LABEL _("Password encryption error") \ No newline at end of file +#define ENCRYPT_ERROR_LABEL _("Password encryption error") + +#define DEFAULT_MENU_ITEM_LABEL _("Default (Use last succeeded)") \ No newline at end of file diff --git a/ubinstall-gtk-user.glade b/ubinstall-gtk-user.glade new file mode 100644 index 0000000..a8ddf45 --- /dev/null +++ b/ubinstall-gtk-user.glade @@ -0,0 +1,219 @@ + + + + + + + True + False + com.ublinux.libublsettingsui-gtk3.trash-symbolic + + + True + False + com.ublinux.libublsettingsui-gtk3.edit-symbolic + + + 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 + True + Administrator + + + True + True + 1 + + + + + True + True + True + image1 + + + + False + True + 3 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + False + Login: + 0 + + + False + True + 0 + + + + + True + True + superadmin + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + 5 + + + True + False + Password: + 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 + image22 + + + + False + True + 3 + + + + + False + True + 2 + + + + + False + True + 0 + + + + + False + True + 2 + + + + + diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index a667648..5320c08 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -206,11 +206,6 @@ False com.ublinux.libublsettingsui-gtk3.edit-symbolic - - True - False - com.ublinux.libublsettingsui-gtk3.edit-symbolic - True False @@ -2518,55 +2513,48 @@ and help you install UBLinux on your computer True False - vertical + 5 - + + True + True + + + False + True + 0 + + + + True False - 5 - 5 - 5 - 5 + Automatic login without password prompt + + + False + True + 1 + + + + + False + True + 2 + + + + + True + True + + + True + False + 10 5 5 - vertical - 5 - - - True - False - 5 - - - True - True - - - False - True - end - 0 - - - - - True - False - Root only - - - False - True - 1 - - - - - False - True - 1 - - True @@ -2574,181 +2562,212 @@ and help you install UBLinux on your computer vertical 5 - - True - False - - - False - True - 0 - - - - + True False - slide-up - True + vertical True False + 5 + 5 + 5 + 5 + 5 + 5 vertical 5 True False + vertical 5 - - True - False - True - Administrator - - - - True - True - 1 - - - - + True False - Account name: + 5 + + + True + False + Account name: + + + False + True + 0 + + + + + True + False + True + root + Administrator + + + True + True + 3 + + False True - 3 + 0 - - - False - True - 0 - - - - - True - False - 5 - + True False - Login: - 0 + 5 + + + True + False + Login: + 0 + + + False + True + 0 + + + + + True + False + True + root + superadmin + + + True + True + 1 + + False True - 0 - - - - - True - False - True - superadmin - - - - True - True 1 - - - False - True - 1 - - - - - True - False - 5 - + True False - Password: - 0 - - - False - True - 0 - - - - - True - False - True - 0 - - Default - Set a password - - + 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 - 1 - - - - - True - False - True - False - - ublinux - password - - - True - True + end 2 - - - True - True - True - image22 - - - - False - True - 3 - - False True - 2 + 0 + + False + True + 2 + + + + + + False + True + 0 + + + + + True + False + vertical + 5 + + @@ -2757,138 +2776,28 @@ and help you install UBLinux on your computer 1 + + + + + True + True + True + + + False + True + 2 + + - - False - True - 2 - - - False - True - 2 - - - False - True - 3 - - - - - True - False - 5 - - - True - True - - - False - True - 0 - - - - - True - False - Automatic login without password prompt - - - False - True - 1 - - - - - False - True - 4 - - - - - True - False - 5 - - - True - False - Administrator password (root): - 0 - - - False - True - 0 - - - - - True - False - False - 0 - - Default - Set a password - - - - - False - True - 1 - - - - - True - False - True - False - - ublinux - password - - - True - True - 2 - - - - - True - True - True - image21 - - - - False - True - 3 - - - - - False + True True - 5 + 6