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.
ubl-settings-system/source/ubl-settings-system.h

159 lines
5.0 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 <libublsettings.h>
#include <libublsettings-gtk3.h>
#include <libublsettingsui-gtk3.h>
#include <locale.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <libintl.h>
#include <getopt.h>
#include <libintl.h>
#ifdef WEBKIT_FOUND
#include <webkit2/webkit2.h>
#endif
#include "ubl-strings.h"
#define WIKI_LINK "https://wiki.ublinux.ru/ru/Программное_обеспечениерограммы_и_утилиты/Все/ubl-settings-system"
#define _(String) gettext(String)
#define glade_path "/com/ublinux/ui/ubl-settings-system.glade"
#define glade_locales_path "/com/ublinux/ui/ubl-settings-system-layouts.glade"
#define banner_path "/com/ublinux/images/ubl-settings-system-banner.png"
#define CssPath "/com/ublinux/css/ubl-settings-system.css"
#define config_path yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL)
#define locale_transcriptions_path "/usr/share/ubl-settings-system/csv/locales.csv"
#define LocalePath "/usr/share/locale"
#define LocaleName "ubl-settings-system"
#define config_global_load_command "ubconfig --source global get "
#define config_local_load_command "ubconfig --source system get "
#define get_locales_command "grep '' /usr/share/ubl-settings-system/csv/locales.csv"
#define get_fonts_command "grep '' /usr/share/ubl-settings-system/csv/fonts.csv"
#define get_id_command "grep '' /etc/machine-id"
// #define get_fonts_command "ls /usr/share/kbd/consolefonts/ |grep -v \"README\"|grep -oE \"^[-a-zA-Z0-9_]{3,}.psf\"|sed -e 's/\\.psf//g'"
#define config_get_local_command "ubconfig --source system get system HOSTNAME MACHINEID", "ubconfig --source system get locale CONSOLE_FONT LOCALE LANG"
#define config_get_global_command "ubconfig --source global get system HOSTNAME MACHINEID", "ubconfig --source global get locale CONSOLE_FONT LOCALE LANG"
#define config_get_default_command "ubconfig --source default get "
#define config_get_global_only_parameters ""
#define config_get_local_only_parameters ""
#define hostname_parameter "HOSTNAME"
#define id_parameter "MACHINEID"
#define keyboard_layout_parameter "XKBLAYOUT"
#define console_font_parameter "CONSOLE_FONT"
#define num_lock_boot_parameter "NUMLOCK"
#define language_parameter "LANG"
#define locale_parameter "LOCALE"
#define LOCALE_get_command "ubconfig --source global get [locale] LOCALE"
#define HOSTNAME_get_command "ubconfig --source global get [system] HOSTNAME"
#define MACHINEID_get_command "ubconfig --source global get [system] MACHINEID"
#define CONSOLE_FONT_get_command "ubconfig --source global get [locale] CONSOLE_FONT"
// #define NUMLOCK_get_command "ubconfig --source global get [locale] NUMLOCK"
#define LANG_get_command "ubconfig --source global get [locale] LANG"
typedef char* string;
string version_application;
char *local;
typedef struct {
// Standard config. DO NOT EDIT - MUST BE SAME AS ublsettings-ui's template_config STRUCT {
int socket_id;
int load_socket_id;
int save_socket_id;
int lock_help;
int lock_save_local;
int lock_save_global;
int lock_load_global;
int lock_load_system;
int load_mode;
int always_open_documentation;
// } Standard config. DO NOT EDIT - MUST BE SAME AS ublsettings-ui's template_config STRUCT
// Type custom parameters below:
GtkListStore *localeslist;
} config;
typedef struct {
// Standard widgets. DO NOT EDIT - MUST BE SAME AS ublsettings-ui's template_main_window STRUCT {
GtkWidget *Window;
GtkWidget *HeadLabel;
GtkWidget *PlugBox;
GtkWidget *HeadOverlay;
GtkWidget *HeadImage;
GtkWidget *HeadBox;
GtkWidget *HeadTitleLabel;
GtkWidget *HeadInfoLabel;
GtkWidget *StatusBox;
GtkWidget *StatusIcon;
GtkWidget *StatusLabel;
GtkWidget *SaveMenuItem;
GtkWidget *SaveGlobalMenuItem;
GtkWidget *SaveLocalMenuItem;
GtkWidget *RightBox;
GtkWidget *LoadGlobalMenuItem;
GtkWidget *LoadLocalMenuItem;
GtkWidget *LeftBox;
GtkWidget *DocumentationMenuItem;
GtkWidget *AboutMenuItem;
GtkWidget *InterfaceBox;
// } Standard widgets. DO NOT EDIT - MUST BE SAME AS ublsettings-ui's template_main_window STRUCT
// Type custom parameters below:
// Custom
GtkWidget *HostnameEntry;
GtkWidget *IDCombo;
GtkWidget *IDEntry;
GtkWidget *IDCopyButton;
GtkWidget *ConsoleFontCombo;
GtkWidget *LanguageCombo;
GtkWidget *LocaleButton;
GtkWidget *LocaleEntry;
GtkListStore *fontlist;
GtkListStore *languagelist;
} main_window;
typedef struct {
GtkWidget *Window;
GtkWidget *HatText;
GtkWidget *HeaderText;
GtkWidget *InfoText;
GtkWidget *AlwaysOpenCheck;
GtkWidget *CloseButton;
GtkWidget *AcceptButton;
} documentation_confirmation_window;
typedef struct {
GtkWidget *Window;
GtkWidget *MainTree;
GtkWidget *CloseButton;
GtkWidget *AcceptButton;
GtkCellRenderer *ToggleCell;
} locals_window;
main_window *setup_window();
void on_id_changed(GtkEntry *self, main_window *widgets);