You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ubinstall-gtk/source/ubinstall-gtk.h

872 lines
35 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include <gtk/gtk.h>
#include <gtk/gtkx.h>
#include <locale.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <libintl.h>
#include <getopt.h>
#include <libintl.h>
#include <json-c/json.h>
#include <sys/statvfs.h>
#include <libublsettings.h>
#include <libublsettings-gtk3.h>
#include <libublsettingsui-gtk3.h>
#ifdef WEBKIT_FOUND
#include <webkit2/webkit2.h>
#endif
#include "ubl-strings.h"
#define WIKI_LINK "https://wiki.ublinux.ru/ru/Программное_обеспечениерограммы_и_утилиты/Все/ubinstall-gtk"
#define _(String) gettext(String)
#define glade_path "/com/ublinux/ui/ubinstall-gtk.glade"
#define glade_path_ubinstall_keyboard "/com/ublinux/ui/ubinstall-gtk-keyboard.glade"
#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 glade_path_kernel_row "/com/ublinux/ui/ubinstall-gtk-kernel-row.glade"
#define glade_path_service "/com/ublinux/ui/ubinstall-gtk-service-window.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)
#define icon_path "com.ublinux.ubinstall-gtk"
#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 regions_path "/com/ublinux/images/map-time-zone.png"
#define keyboard_path "/com/ublinux/images/keyboard.png"
#define licence_path "/usr/share/ublinux/agreement/EULA.txt"
#define languages_path "/usr/share/ubinstall-gtk/csv/locales.csv"
#define zone_path "/usr/share/zoneinfo/"
#define additional_software_path "resource:///com/ublinux/csv/modules.csv"
#define kernel_list_path "resource:///com/ublinux/csv/kernel-list.csv"
#define kernel_list_addon_path "resource:///com/ublinux/csv/kernel-list-addon.csv"
#define services_list_path "resource:///com/ublinux/csv/services-list.csv"
#define slide_0_path "/com/ublinux/images/slide-0.png"
#define slide_repeat_path "/com/ublinux/images/slide-1.png", \
"/com/ublinux/images/slide-2.png", \
"/com/ublinux/images/slide-3.png", \
"/com/ublinux/images/slide-4.png", \
"/com/ublinux/images/slide-5.png", \
"/com/ublinux/images/slide-6.png", \
"/com/ublinux/images/slide-7.png", \
"/com/ublinux/images/slide-8.png", \
"/com/ublinux/images/slide-9.png", \
"/com/ublinux/images/slide-10.png", \
"/com/ublinux/images/slide-11.png", \
"/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"
#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}<name>|^ {8,8}<description>'|sed -e 's/ *<name>//g' -e 's,</name>,,g' -e 's/ *<description>//g' -e 's,</description>,,g'"
#define check_is_password_hash(password) system(yon_char_unite("/lib/ublinux/functions is_hash_password '", password,"'",NULL))
#define get_layouts_command "xkbcli list --load-exotic | awk \"layout && /description:/ {match(\\$0,/: *(.*)/,matches);description=matches[1];printf \\\"%s|%s\\n\\\",layout,description;layout=\\\"\\\"} /layout:/ {match(\\$0, /: *'([^']+)'/,matches);l=matches[1];if (layouts[l]) next;layout=layouts[l]=l}\" | sort -u"
#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,253"
#define get_parts_and_devices_command "lsblk --noheadings --bytes -o TYPE,PATH,SIZE,FSTYPE,LABEL,PARTLABEL,MOUNTPOINT,FSUSED,FSUSE% --exclude 7,253 |awk '{print ($1\";\"$2\";\"$3\";\"$4\";\"$5\";\"$6\";\"$7\";\"$8\";\"$9)}'"
#define AUTOINSTALL_TYPE_INSTALL "AUTOINSTALL[install_type]"
#define AUTOINSTALL_TYPE_INSTALL_command "ubconfig --source global get [autoinstall] AUTOINSTALL[install_type]"
#define AUTOINSTALL_DEVICE "AUTOINSTALL[device]"
#define AUTOINSTALL_DEVICE_command "ubconfig --source global get [autoinstall] AUTOINSTALL[device]"
#define part_parameter "AUTOINSTALL[part]"
#define part_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[part]"
#define modules_parameter "AUTOINSTALL[modules]"
#define modules_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[modules]"
#define modules_extra_parameter "AUTOINSTALL[modules_extra]"
#define modules_extra_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[modules_extra]"
#define user_name_parameter "AUTOINSTALL[user_name]"
#define user_name_parameter_command "ubconfig --source global --conarg get [autoinstall] AUTOINSTALL[user_name]"
#define user_gecos_parameter "AUTOINSTALL[user_gecos]"
#define user_gecos_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[user_gecos]"
#define user_password_parameter "AUTOINSTALL[user_password]"
#define user_password_parameter_command "ubconfig --source global --conarg get [autoinstall] AUTOINSTALL[user_password]"
#define root_password_parameter "AUTOINSTALL[root_password]"
#define root_password_parameter_command "ubconfig --source global --conarg get [autoinstall] AUTOINSTALL[root_password]"
#define autologin_parameter "AUTOINSTALL[autologin]"
#define autologin_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[autologin]"
#define xkbmodel_parameter "AUTOINSTALL[xkbmodel]"
#define xkbmodel_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[xkbmodel]"
#define xkblayout_parameter "AUTOINSTALL[xkblayout]"
#define xkblayout_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[xkblayout]"
#define xkbvariant_parameter "AUTOINSTALL[xkbvariant]"
#define xkbvariant_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[xkbvariant]"
#define xkboptions_parameter "AUTOINSTALL[xkboptions]"
#define xkboptions_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[xkboptions]"
#define hostname_parameter "AUTOINSTALL[hostname]"
#define hostname_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[hostname]"
#define zone_parameter "AUTOINSTALL[zone]"
#define zone_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[zone]"
#define lang_parameter "AUTOINSTALL[lang]"
#define lang_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[lang]"
#define locale_parameter "AUTOINSTALL[locale]"
#define locale_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[locale]"
#define part_size_parameter "AUTOINSTALL[part_size]"
#define part_size_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[part_size]"
#define part_type_parameter "AUTOINSTALL[part_fs_type]"
#define part_type_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[part_fs_type]"
#define part_format_parameter "AUTOINSTALL[part_format]"
#define part_format_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[part_format]"
#define part_label_parameter "AUTOINSTALL[part_label]"
#define part_label_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[part_label]"
#define part_fs_label_parameter "AUTOINSTALL[part_fs_label]"
#define part_fs_label_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[part_fs_label]"
#define part_crypt_parameter "AUTOINSTALL[part_crypt]"
#define part_crypt_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[part_crypt]"
#define swap_parameter "AUTOINSTALL[swap]"
#define swap_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[swap]"
#define swap_size_parameter "AUTOINSTALL[swap_size]"
#define swap_size_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[swap_size]"
#define boot_parameter "AUTOINSTALL[boot]"
#define boot_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[boot]"
#define device_typevfs_parameter "AUTOINSTALL[device_typevfs]"
#define device_typevfs_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[device_typevfs]"
#define NTPSERVERS_parameter "AOUTINSTALL[ubconfig set [network] NTPSERVERS]"
#define NTPSERVERS_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[ubconfig set [network] NTPSERVERS]"
#define DOMAIN_parameter "AOUTINSTALL[ubconfig set [network] DOMAIN]"
#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 KERNEL_BOOT_parameter "AUTOINSTALL['ubconfig set [boot] KERNEL_BOOT']"
#define KERNEL_BOOT_parameter_command "ubconfig --source global geet autoinstall AUTOINSTALL[ubconfig set [boot] KERNEL_BOOT]"
#define save_config_command(parameters) yon_char_unite("ubconfig --target system set [autoinstall] AUTOINSTALL[log]=yes ",parameters, "; nice ubinstall2 --debug autoinstall", NULL)
#define set_user_config_command(parameters) yon_char_unite("ubconfig --target system set [autoinstall] ",parameters,";nice ubinstall2 autoconfig",NULL)
#define save_additional_config_command(parameters) yon_char_unite("ubconfig --target system set [autoinstall] ",parameters,NULL)
#define get_default_password_command "ubconfig --raw --conarg --source default get [users] NOSECUREROOTPASSWD"
#define open_gparted_command "gparted"
#define PASSWORD_DEFAULT "ublinux"
#define start_fast_install_command "ubinstall2 --autoinstall"
#define progress_path "/var/log/ubinstall_progress.log"
#define password_limits_path "/etc/security/pwquiality.conf"
#define short_log_path "/var/log/ubinstall_progress.log"
#define full_log_path "/var/log/ubinstall.log"
#define yon_config_get_custom_command(target) yon_char_unite("ubconfig --source ",target," --conarg get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra] AUTOINSTALL[part_label] AUTOINSTALL[locale]",NULL)
#define config_get_local_command "ubconfig --source system --conarg get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra] AUTOINSTALL[part_label] AUTOINSTALL[locale]"
#define config_get_global_command yon_char_new("ubconfig --source global --conarg get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra] AUTOINSTALL[part_label] AUTOINSTALL[locale]")
#define config_get_default_command "ubconfig --source default --conarg get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra] AUTOINSTALL[part_label] AUTOINSTALL[locale]"
#define config_get_global_only_parameters ""
#define config_get_local_only_parameters ""
#define ubconfig_file_create(target) yon_char_unite("ubconfig --target \"",target,"\" create",NULL)
#define default_langs(size) yon_char_parsed_new(size,"en_US.UTF-8","ru_RU.UTF-8",NULL);
#define install_common_parameters \
AUTOINSTALL_TYPE_INSTALL,\
AUTOINSTALL_DEVICE,\
part_format_parameter,\
part_label_parameter,\
part_type_parameter
#define install_part_parameters \
AUTOINSTALL_TYPE_INSTALL,\
AUTOINSTALL_DEVICE,\
part_format_parameter,\
part_fs_label_parameter,\
part_parameter,\
part_type_parameter,\
part_fs_label_parameter
#define install_next_parameters \
AUTOINSTALL_TYPE_INSTALL,\
AUTOINSTALL_DEVICE,\
part_format_parameter,\
part_fs_label_parameter,\
part_parameter,\
part_type_parameter,\
part_size_parameter
#define install_advanced_parameters \
AUTOINSTALL_TYPE_INSTALL,\
AUTOINSTALL_DEVICE,\
part_format_parameter,\
part_label_parameter,\
part_parameter,\
part_type_parameter,\
part_size_parameter
#define install_grub_install_update_parameters \
AUTOINSTALL_TYPE_INSTALL,\
AUTOINSTALL_DEVICE,\
part_parameter
#define install_system_only_parameters \
AUTOINSTALL_TYPE_INSTALL,\
AUTOINSTALL_DEVICE,\
part_format_parameter,\
part_label_parameter,\
part_parameter,\
part_type_parameter,\
part_size_parameter,\
part_crypt_parameter
#define install_userdata_only_parameters \
AUTOINSTALL_TYPE_INSTALL,\
AUTOINSTALL_DEVICE,\
part_format_parameter,\
part_label_parameter,\
part_parameter,\
part_type_parameter,\
part_size_parameter,\
part_crypt_parameter
typedef char* string;
__attribute__((unused)) static \
string version_application;
extern int cur_slide;
enum YON_PAGES {
YON_PAGE_WELCOME = 0,
YON_PAGE_LICENCE,
YON_PAGE_SECTIONS,
YON_PAGE_OS_COMPONENTS,
YON_PAGE_INSTALLATION_BEGIN,
YON_PAGE_KERNEL,
YON_PAGE_KERNEL_ADDON,
YON_PAGE_SOFTWARE,
YON_PAGE_REGION,
YON_PAGE_KEYBOARD,
YON_PAGE_USERS,
YON_PAGE_STARTUP,
YON_PAGE_BOOTLOADER,
YON_PAGE_NETWORK,
YON_PAGE_INSTALLATION,
YON_PAGE_COMPLETION,
YON_PAGE_COMPLETED,
YON_PAGE_INSTALL_ERROR,
YON_PAGE_CONFIGURE_END,
YON_PAGE_CONFIGURE_SAVE,
YON_PAGE_INSTALL_COMMON,
YON_PAGE_INSTALL_SEPARATE,
YON_PAGE_INSTALL_SAME_PARTITION,
YON_PAGE_INSTALL_ADVANCED,
YON_PAGE_INSTALL_RECOVERY,
YON_PAGE_RECOVERY_GRUB_INSTALL,
YON_PAGE_RECOVERY_GRUB_UPDATE,
YON_PAGE_RECOVERY_OS_ONLY,
YON_PAGE_RECOVERY_USRDATA_ONLY
};
typedef struct {
template_config_fields
config_str launch_arguments;
int launch_size;
int save_done;
int save_configured;
int install_complete;
guint slider_thread;
int install_mode;
unsigned long install_thread;
guint progress_thread;
int configure_mode;
int log_progress_buzy;
int autologin_default;
int format_default;
int log_end;
int exit_accepted;
GMutex progress_mutex;
GMutex install_mutex;
int arg_size;
config_str arg_target;
GtkWidget *status_box;
} config;
extern config main_config;
typedef struct {
GtkWidget *CommonInstallationDevicesTree;
GtkWidget *GpartedCommonButton;
GtkWidget *CommonFilesystemSensitiveCheck;
GtkWidget *CommonInstallationFilesystemTypeCombo;
GtkWidget *CommonSectionSensitiveCheck;
GtkWidget *CommonInstallationSectionNameEntry;
GtkListStore *DevicesList;
} install_common_page;
typedef struct {
GtkBuilder *builder;
GtkListStore *DevicesList;
GtkListStore *LanguagesList;
GtkTreeStore *LayoutList;
GtkListStore *AdditionalSoftwareList;
GtkListStore *PartitionsList;
GtkWidget *LoadGlobalConfigurationMenuItem;
GtkWidget *LoadLocalConfigurationMenuItem;
GtkWidget *LoadExternalConfigurationMenuItem;
GtkWidget *SaveGlobalLocalConfigurationMenuItem;
GtkWidget *SaveGlobalConfigurationMenuItem;
GtkWidget *SaveLocalConfigurationMenuItem;
GtkWidget *SaveExternalConfigurationMenuItem;
GtkWidget *SaveButton;
GtkWidget *MainWindow;
GtkWidget *StartScenarioButton;
GtkWidget *SourceButton;
GtkWidget *SkipInstallationButton;
GtkWidget *StatusBox;
GtkWidget *WelcomeToggle;
GtkWidget *LicenceToggle;
GtkWidget *LocationToggle;
GtkWidget *KeyboardToggle;
GtkWidget *SectionsToggle;
GtkWidget *UsersToggle;
GtkWidget *SummaryToggle;
GtkWidget *CompletionToggle;
GtkWidget *InstallationToggle;
GtkWidget *LanguageCombo;
GtkWidget *RegionCombo;
GtkWidget *ZoneCombo;
GtkWidget *AvailableLanguagesEntry;
GtkWidget *AvailableLanguagesButton;
GtkWidget *LanguagesCombo;
GtkWidget *KeyboardModelCombo;
GtkWidget *LayoutBindingCombo;
GtkWidget *DefaultLayoutRadio;
GtkWidget *ManualLayoutRadio;
GtkWidget *LayoutTree;
GtkWidget *AddButton;
GtkWidget *RemoveButton;
GtkWidget *InstallationRadio;
GtkWidget *InstallationNearRadio;
GtkWidget *InstallationLinuxRadio;
GtkWidget *InstallationWindowsRadio;
GtkWidget *InstallationOptionsRadio;
GtkWidget *UserRootNameEntry;
GtkWidget *UserRootLoginEntry;
GtkWidget *UserRootPasswordCombo;
GtkWidget *UserRootPasswordEntry;
GtkWidget *UserRootPasswordButton;
GtkWidget *UserAutologinSwitch;
GtkWidget *UserAddBox;
GtkWidget *UserAddButton;
GtkWidget *HotnameEntry;
GtkWidget *AutoHostnameCheck;
GtkWidget *CancelInstallButton;
GtkWidget *BackButton;
GtkWidget *NextButton;
GtkWidget *mainSettingsButton;
GtkWidget *menu1;
GtkWidget *menu2;
GtkWidget *RegionImage;
GtkWidget *RegionBox;
GtkWidget *RegionAspect;
GtkWidget *KeyboardImage;
GtkWidget *KeyboardBox;
GtkWidget *Notebook;
GtkWidget *LicenceLabel;
GtkWidget *SlidesImage;
GtkWidget *CommonInstallationDevicesTree;
GtkWidget *CommonInstallationFilesystemTypeCombo;
GtkWidget *CommonInstallationSectionNameEntry;
GtkWidget *GpartedCommonButton;
GtkWidget *NextInstallationSysDevicesTree;
GtkWidget *NextInstallationSysSectionTree;
GtkWidget *NextInstallationFormatSwitch;
GtkWidget *NextInstallationFormatRevealer;
GtkWidget *NextInstallationSizeSpin;
GtkWidget *NextInstallationSizeTypeSpin;
GtkWidget *NextInstallationFilesystemTypeCombo;
GtkWidget *NextInstallationSectionNameEntry;
GtkWidget *GpartedNextInstallationButton;
GtkWidget *SamePlaceDeviceTree;
GtkWidget *SamePlacePartTree;
GtkWidget *SameInstallationFormatSwitch;
GtkWidget *SameInstallationFormatRevealer;
GtkWidget *SameInstallationFilesystemTypeCombo;
GtkWidget *SameInstallationSectionNameEntry;
GtkWidget *GpartedSameButton;
GtkWidget *InstallationProgress;
GtkWidget *InstallationLabel;
GtkWidget *ReadShortLogButton;
GtkWidget *PackageInstallationProgress;
GtkWidget *PackageInstallationLabel;
GtkWidget *ReadFullLogButton;
GtkWidget *ConfigurationModeMenuItem;
GtkWidget *AboutMenuItem;
GtkWidget *DocumentationMenuItem;
GtkCellRenderer *AdditionalSoftwareCell;
GtkWidget *AdditionalSoftwareTree;
GtkWidget *GrubInstallRadio;
GtkWidget *GrubUpdateRadio;
GtkWidget *SeparateRadio;
GtkWidget *OSRadio;
GtkWidget *UserDataOnlyRadio;
GtkWidget *GpartedGrubInstallButton;
GtkWidget *GrubInstallDevicesTree;
GtkWidget *GrubInstallPartitionTree;
GtkWidget *GpartedGrubUpdateButton;
GtkWidget *GrubUpdateDevicesTree;
GtkWidget *GrubUpdatePartitionTree;
GtkWidget *GpartedOSButton;
GtkWidget *OSDevicesTree;
GtkWidget *OSSysSectionTree;
GtkWidget *GpartedUserdataButton;
GtkWidget *UserdataDevicesTree;
GtkWidget *UserdataSysSectionTree;
GtkTreeModel *LanguagesFilter;
GtkTreeModel *LayoutsFilter;
GdkPixbuf *regions_original;
GdkPixbuf *keyboard_original;
GList *slides_original;
float region_height_mult;
GtkWidget *RegionSensitiveCheck;
GtkWidget *LanguagesSensitiveCheck;
GtkWidget *MainLanguageSensitiveCheck;
GtkWidget *KeyboardModelSensitiveCheck;
GtkWidget *OptionsSensitiveCheck;
GtkWidget *LayoutSensitiveCheck;
GtkWidget *UsernameSensitiveCheck;
GtkWidget *LoginSensitiveCheck;
GtkWidget *UserRootOnlyCheck;
GtkWidget *AutologinSensitiveCheck;
GtkWidget *HostnameSensitiveCheck;
GtkWidget *KernelListBox;
GtkWidget *KernelInstallLabel;
GtkWidget *KernelEnableLabel;
GtkWidget *KernelNameLabel;
GtkWidget *KernelTagsLabel;
GtkWidget *KernelModulesLabel;
GtkWidget *KernelDescriptionLabel;
GtkSizeGroup *KernelSizeGroup;
GtkWidget *KernelAddonListBox;
GtkWidget *KernelAddonInstallLabel;
GtkWidget *KernelAddonNameLabel;
GtkWidget *KernelAddonModulesLabel;
GtkWidget *KernelAddonDescriptionLabel;
GtkWidget *OSSoftwareTree;
GtkListStore *OSSoftwareList;
GtkWidget *StartupServicesTree;
GtkWidget *StartupServicesAddButton;
GtkWidget *StartupServicesEditButton;
GtkWidget *StartupServicesRemoveButton;
GtkCellRenderer *StartupChosenCell;
GtkListStore *StartupList;
GtkWidget *BootloadTimerSwitch;
GtkWidget *BootloadTimerSpin;
GtkWidget *BootloadDefaultOSEntry;
GtkWidget *BootloadDefaulOSButton;
GtkWidget *BootloadNoPasswordSwitch;
GtkWidget *BootloadUserAddButton;
GtkWidget *BootloadUserRemoveButton;
GtkWidget *BootloadUserTree;
GtkListStore *BootloadUsersList;
GtkWidget *NetworkDomainSwitch;
GtkWidget *NetworkDomainNameEntry;
GtkWidget *NetworkDomainAdminEntry;
GtkWidget *NetworkDomainPasswordEntry;
GtkWidget *NetworkNTPServerSwitch;
GtkWidget *NetworkNTPCombo;
GtkWidget *NetworkNTPEntry;
GtkWidget *NetworkConnectionsBox;
GtkWidget *NetworkConnectionsAddButton;
GHashTable *network_connections;
GtkWidget *AdvancedDeviceTree;
GtkWidget *AdvancedVirtualDeviceCombo;
GtkWidget *AdvancedPartitionTree;
GtkWidget *AdvancedPartitionAddBox;
GtkWidget *AdvancedAddButton;
GtkWidget *AdvancedLoadTypeSwitch;
GtkWidget *AdvancedBiosSectorSwitch;
GtkWidget *AdvancedEFISwitch;
GtkWidget *AdvancedSwapSwitch;
GtkWidget *AdvancedSwapAutoSwitch;
GtkWidget *AdvancedSwapRamSwitch;
GtkWidget *AdvancedSwapFixedSpin;
GtkWidget *AdvancedSwapFixedSwitch;
GtkWidget *AdvancedSwapFixedSizeSwitch;
dictionary *advanced_sections;
GFile *install_progress_file;
GFileMonitor *install_progress_monitor;
GFile *install_info_file;
GFileMonitor *install_info_monitor;
} main_window;
typedef struct {
GtkWidget *MainBox;
GtkWidget *SystemSectionToggle;
GtkWidget *UserDataSectionToggle;
GtkWidget *RemoveButton;
GtkWidget *FormatSwitch;
GtkWidget *FormatExpander;
GtkWidget *SizeSpin;
GtkWidget *SizeCombo;
GtkWidget *SectionMarkEntry;
GtkWidget *FileSystemTypeCombo;
GtkWidget *FileSystemMarkentry;
GtkWidget *EncryptionCombo;
GtkWidget *EncryptionEntry;
GtkWidget *EncryptionButton;
char *part;
} advanced_section;
typedef struct {
GtkWidget *Window;
GtkWidget *HeaderLabel;
GtkWidget *AlwaysOpenCheck;
GtkWidget *CloseButton;
GtkWidget *AcceptButton;
} documentation_confirmation_window;
typedef struct{
GtkWidget *MainWindow;
GtkWidget *StatusBox;
GtkWidget *headerBar;
GtkWidget *CancelButton;
GtkWidget *SaveButton;
GtkWidget *LayoutsTree;
GtkCellRenderer *ActiveToggle;
} ubinstall_keyboard_window;
typedef struct{
GtkListStore *liststore1;
GtkWidget *MainWindow;
GtkWidget *StatusBox;
GtkWidget *DefaultCheck;
GtkWidget *headerBar;
GtkWidget *CancelButton;
GtkWidget *SaveButton;
GtkWidget *LanguagesTree;
GtkCellRenderer *ToggleRenderer;
} ubinstall_language_window;
typedef struct{
GtkWidget *CreateGroupWindow;
GtkWidget *StatusBox;
GtkWidget *UserCancelButton;
GtkWidget *UserOkButton;
GtkWidget *UserRootPasswordEntry;
GtkWidget *RepeatPasswordEntry;
GtkWidget *PasswordHashEntry;
GtkWidget *HashBox;
GtkWidget *PasswordBox;
GtkWidget *NoEncriptionCheck;
} password_window;
typedef struct {
GtkWidget *Window;
GtkWidget *ScrollWindow;
GtkWidget *StatusBox;
GtkWidget *HeadLabel;
GtkWidget *LogLabel;
GtkWidget *ScrollToEndCheck;
char *command;
} log_window;
typedef struct {
GtkWidget *Window;
GtkWidget *TitleLabel;
GtkWidget *TextLabel;
GtkWidget *AcceptButton;
GtkWidget *CancelButton;
} confirmation_window;
typedef struct {
GtkWidget *MainBox;
GtkWidget *TypeCombo;
GtkWidget *ConnectionCombo;
GtkWidget *ConnectionEntry;
GtkWidget *EnabledSwitch;
GtkWidget *RemoveButton;
GtkWidget *AutoGetIPSwitch;
GtkWidget *IpAdressEntry;
GtkWidget *GatewayEntry;
GtkWidget *MaskEntry;
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;
typedef struct {
GtkWidget *row;
GtkWidget *RowBox;
GtkWidget *InstallCheck;
GtkWidget *EnableRadio;
GtkWidget *EnableSeparator;
GtkWidget *TagsBox;
GtkWidget *TagsSeparator;
GtkWidget *NameLabel;
GtkWidget *DescriptionLabel;
GtkWidget *ModulesLabel;
char *name;
char *modules;
char *package;
} kernel_row;
typedef struct {
GtkWidget *Window;
GtkWidget *StatusBox;
GtkWidget *UnitEntry;
GtkWidget *ServiceEntry;
GtkWidget *DescriptionEntry;
GtkWidget *CancelButton;
GtkWidget *AcceptButton;
} startup_service_window;
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();
void on_password_accept(GtkWidget *self, dictionary *dict);
void yon_interface_update(main_window *widgets);
void on_summary_log_view(GtkWidget *,main_window *widgets);
void on_device_selection_changed(GtkWidget *self, main_window *widgets);
void on_toggle_button_switch_on(GtkWidget *, GtkToggleButton *toggle);
void on_autohostname_sensitiveness_check(GtkWidget *, main_window *widgets);
void on_autohostname_check(GtkWidget *, main_window *widgets);
void on_hostname_entry_changed (GtkWidget *, main_window *widgets);
gboolean on_install_success(main_window *widgets);
gboolean on_install_error(main_window *widgets);
// confirmation_window *yon_confirmation_window_new();
void on_reboot_accepted(main_window *widgets);
void on_keyboard_clicked (GtkWidget *, main_window *widgets);
void on_keyboard_accept(GtkWidget *self,main_window *widgets);
void on_layout_toggle(GtkCellRendererToggle*, gchar* path, ubinstall_keyboard_window *window);
void on_language_clicked(GtkWidget *, main_window *widgets);
void yon_language_selection_changed(GtkCellRenderer *, char *path, ubinstall_language_window *window);
void on_language_window_accept(GtkWidget *,dictionary *dict);
void on_keyboard_removed(GtkWidget *, main_window *widgets);
void on_exit_accepted(main_window *widgets);
void on_gparted_open();
// void on_same_installation_device_changed(GtkWidget *, main_window *widgets);
void on_separate_installation_changed(GtkWidget *self, main_window *widgets);
void on_partition_changed(GtkWidget *self, main_window *widgets);
void yon_set_max_size_from_partition(GtkTreeView *table, GtkSpinButton *spin_size, GtkComboBox *size_type);
gboolean on_yon_exit(GtkWidget *,GdkEvent*, main_window *widgets);
void on_locale_changed(GtkWidget *,main_window *);
void on_region_changed(GtkComboBox *self, main_window *widgets);
void on_page_navigation_clicked(GtkWidget *self, main_window *widgets);
int yon_install_options_save(GtkWidget *device_tree, GtkWidget *part_tree,char *mode,main_window *widgets);
void on_process_log_view(GtkWidget *,main_window *widgets);
gboolean yon_read_log(void *data);
log_window *yon_log_window_new();
void on_log_closed(GtkWidget *, dictionary *dict);
void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets);
gboolean yon_installation_progress_update(void *data);
void *on_config_save(void *data);
void *on_setup_system_configuration(void * data);
gboolean on_image_slide(void *data);
void on_region_resized(GtkWidget *,main_window *widgets);
int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled);
void on_configuration_mode_switch(GtkWidget *self,main_window *widgets);
double yon_size_long_convert_automatic(unsigned long bytes, char *size);
double yon_size_long_convert_to_mod(double size, char mod);
void on_root_get_root(char *argline);
void on_config_custom_save(GtkWidget *, main_window *widgets);
void on_config_global_save(GtkWidget *,main_window *widgets);
void on_config_local_save(GtkWidget *,main_window *widgets);
void on_config_global_local_save(GtkWidget *,main_window *widgets);
void on_config_custom_load(GtkWidget *,main_window *);
void on_config_global_load(GtkWidget *,main_window *);
void on_config_local_load(GtkWidget *,main_window *widgets);
// void yon_save_proceed(char *path, YON_CONFIG_TYPE type);
void on_page_next_clicked(GtkWidget *, main_window *widgets);
void on_page_prev_clicked(GtkWidget *, main_window *widgets);
void yon_load_proceed(YON_CONFIG_TYPE type);
void _yon_saving_threaded(char *final_command);
void on_layout_toggle_button_switch(GtkWidget *self, main_window *widgets);
enum YON_PAGES yon_page_get_next(main_window *widgets,enum YON_PAGES page);
enum YON_PAGES yon_page_get_prev(enum YON_PAGES page);
enum YON_PAGES yon_sections_get_next_page(main_window *widgets);
enum YON_PAGES yon_recovery_get_next(main_window *widgets);
enum YON_PAGES yon_page_get_current(GtkNotebook *target);
void yon_switch_page_render(main_window *widgets);
void yon_page_update(main_window *);
void yon_navigation_buttons_set_sensetiveness(main_window *widgets);
int yon_region_save(main_window *widgets);
int yon_keyboard_save(main_window *widgets);
int yon_install_common_save(main_window *widgets);
int yon_install_separate_save(main_window *widgets);
int yon_install_same_partition_save(main_window *widgets);
int yon_grub_install_save(main_window *widgets);
int yon_grub_update_save(main_window *widgets);
int yon_os_components_save(main_window *widgets);
int yon_software_save(main_window *widgets);
int yon_kernel_save(main_window *widgets);
int yon_page_save(main_window *widgets, enum YON_PAGES page);
int yon_users_save(main_window *widgets);
int yon_bootloader_save(main_window *widgets);
int yon_startup_save(main_window *widgets);
network_info *yon_network_info_new();
int yon_install_advanced_save(main_window *widgets);
int yon_network_save(main_window *widgets);
void on_connection_add(main_window *widgets);
void on_ntp_sync(GtkWidget *, main_window *widgets);
int yon_advanced_sections_save(dictionary *dict);
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();
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);
void yon_kernel_setup(main_window *widgets);
void yon_kernel_row_setup(kernel_row *row, char *name, char *modules,char *package, char *tags, char *description);
void yon_kernel_row_setup_tags(kernel_row *row, char *tags);
int yon_tag_add(GtkBox *target,char *tag_label, char *tag_style, char *icon_name);
kernel_row *yon_kernel_row_new();
void yon_kernel_resize(main_window *widgets);
void on_additional_software_toggled(GtkWidget *, char *path, main_window *widgets);
void yon_kernel_addon_setup(main_window *widgets);
void yon_kernel_addon_resize(main_window *widgets);
void yon_startup_services_setup(main_window *widgets);
void on_srartup_services_toggled(GtkWidget *, char *path, main_window *widgets);
void on_startup_service_edit(GtkWidget *, main_window *widgets);
void on_startup_service_add(GtkWidget *, main_window *widgets);
startup_service_window *yon_startup_service_window_new();
void on_startup_edit_accept(GtkWidget *, main_window *widgets);
void on_startup_add_accept(GtkWidget *, main_window *widgets);
void yon_startup_services_setup(main_window *widgets);
void on_startup_services_remove(GtkWidget *self,main_window *widgets);
void on_startup_services_selection_changed(GtkWidget *,main_window *widgets);