|
|
#include <gtk/gtk.h>
|
|
|
#include <gtk/gtkx.h>
|
|
|
#include <ubl-utils.h>
|
|
|
#include <locale.h>
|
|
|
#include <stdio.h>
|
|
|
#include <unistd.h>
|
|
|
#include <stdlib.h>
|
|
|
#include <libintl.h>
|
|
|
#include <getopt.h>
|
|
|
#include <libintl.h>
|
|
|
#include "../compile/ubl-cmake.h"
|
|
|
#ifdef WEBKIT_FOUND
|
|
|
#include <webkit2/webkit2.h>
|
|
|
#endif
|
|
|
|
|
|
#define ui_WIKI_LINK "https://wiki.ublinux.ru/ru/Программное_обеспечение/Программы_и_утилиты/Все/ublsettings-ui"
|
|
|
|
|
|
#define _(String) gettext(String)
|
|
|
|
|
|
#define ui_glade_path "/com/ublinux/ui/ublsettings-ui.glade"
|
|
|
#define ui_banner_path "/com/ublinux/images/ublsettings-ui-banner.png"
|
|
|
#define ui_CssPath "/com/ublinux/css/ublsettings-ui.css"
|
|
|
#define ui_config_path yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",app_information.app_locale,"/",app_information.app_locale,".conf",NULL)
|
|
|
|
|
|
#define ui_LocalePath "/usr/share/locale"
|
|
|
#define ui_LocaleName "ublsettings-ui"
|
|
|
typedef char* string;
|
|
|
string version_application;
|
|
|
|
|
|
char *local;
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
GtkWidget *interface;
|
|
|
char *app_name;
|
|
|
char *app_description;
|
|
|
char *app_locale;
|
|
|
char *app_title;
|
|
|
char *wiki_link;
|
|
|
gboolean always_open_documentation;
|
|
|
int socket_id;
|
|
|
int load_socket_id;
|
|
|
int save_socket_id;
|
|
|
} app_info;
|
|
|
|
|
|
static app_info app_information;
|
|
|
|
|
|
typedef struct {
|
|
|
//Standard
|
|
|
GtkWidget *Window;
|
|
|
GtkWidget *HatLabel;
|
|
|
GtkWidget *PlugBox;
|
|
|
|
|
|
GtkWidget *HeadOverlay;
|
|
|
GtkWidget *HeadImage;
|
|
|
GtkWidget *HeadBox;
|
|
|
GtkWidget *HeadTitleLabel;
|
|
|
GtkWidget *HeadInfoLabel;
|
|
|
|
|
|
GtkWidget *StatusBox;
|
|
|
GtkWidget *StatusIcon;
|
|
|
GtkWidget *StatusLabel;
|
|
|
|
|
|
GtkWidget *SaveLabel;
|
|
|
GtkWidget *SaveMenuItem;
|
|
|
GtkWidget *SaveGlobalMenuItem;
|
|
|
GtkWidget *SaveLocalMenuItem;
|
|
|
GtkWidget *RightBox;
|
|
|
|
|
|
GtkWidget *LoadLabel;
|
|
|
GtkWidget *LoadGlobalMenuItem;
|
|
|
GtkWidget *LoadLocalMenuItem;
|
|
|
GtkWidget *LeftBox;
|
|
|
|
|
|
GtkWidget *DocumentationMenuItem;
|
|
|
GtkWidget *AboutMenuItem;
|
|
|
// Custom
|
|
|
} main_window;
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
GtkWidget *Window;
|
|
|
|
|
|
GtkWidget *HatText;
|
|
|
GtkWidget *HeaderText;
|
|
|
GtkWidget *InfoText;
|
|
|
GtkWidget *AlwaysOpenCheck;
|
|
|
|
|
|
GtkWidget *CloseButton;
|
|
|
GtkWidget *AcceptButton;
|
|
|
} documentation_confirmation_window;
|
|
|
|
|
|
|
|
|
#define GLOBAL_LOAD_SUCCESS_LABEL _("Global configuration loading succseeded.")
|
|
|
#define LOCAL_LOAD_SUCCESS_LABEL _("Local configuration loading succseeded.")
|
|
|
#define LOAD_FAILED_LABEL _("Config loading failed")
|
|
|
|
|
|
#define GLOBAL_LOCAL_SAVE_SUCCESS_LABEL _("Local and global configuration saving succseeded.")
|
|
|
#define GLOBAL_SAVE_SUCCESS_LABEL _("Global configuration saving succseeded.")
|
|
|
#define LOCAL_SAVE_SUCCESS_LABEL _("Local configuration saving succseeded.")
|
|
|
|
|
|
#define ABOUT_LABEL _("About")
|
|
|
#define DOCUMENTATION_LABEL _("Documentation")
|
|
|
|
|
|
#define SUCCESS_LABEL _("Operation succeeded")
|
|
|
#define ROOT_WARNING_LABEL _("Warning! Application was launched without root - root-dependent actions are locked")
|
|
|
|
|
|
main_window *yon_ubl_window_init(int argc, char *argv[]);
|
|
|
int yon_ubl_window_setup(GtkWidget *interface, char *app_name, char *app_description, char *locale); |