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

113 lines
3.6 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_command(source) yon_char_unite("ubconfig --source ", source, " get system HOSTNAME MACHINEID",NULL), yon_char_unite("ubconfig --source ", source, " get locale CONSOLE_FONT LOCALE LANG",NULL)
#define config_get_default_command ""
#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 {
template_config_fields
GtkListStore *localeslist;
} config;
typedef struct {
template_window_fields
// 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);