#ifndef UBL_SETTINGS_DISKQUOTA_H
#define UBL_SETTINGS_DISKQUOTA_H
#include <gtk/gtk.h>
#include <gtk/gtkx.h>
#include "model/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"
#include "model/model.h"
#include "model/load.h"
#include "model/save.h"
#include "ubl-strings.h"
#include "model/philos_utils.h"
#ifdef WEBKIT_FOUND
    #include <webkit2/webkit2.h>
#endif
#include "view_filters.h"

#include "view_temp_u_g_p.h"
#include "model/my_device.h"

#define WIKI_LINK "https://wiki.ublinux.ru/ru/Программное_обеспечение/Программы_и_утилиты/Все/ubl-settings-diskquota"

#define LocalePath "/usr/share/locale" 
#define LocaleName "ubl-settings-diskquota"
#define _(String) gettext(String)
#define VERSION_LABEL yon_char_unite(_("Version:")," ",version_application,"\n",NULL)
#define glade_path "/com/ublinux/ui/ubl-settings-diskquota.glade"
#define banner_path "/com/ublinux/images/ubl-settings-diskquota-banner.png"
#define CssPath "/com/ublinux/css/ubl-settings-diskquota.css"
#define config_path yon_char_unite("/home/",yon_ubl_root_user_get(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL)

typedef struct {
    int always_open_documentation;
    int win_pos_x;
    int win_pos_y;
    int win_width;
    int win_height;

    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;
} config_settings_gui;

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 *treeViewGeneral;
    GtkListStore *liststoreGeneral;
    hotebook device;
    hotebook user;
    hotebook group;
    hotebook project;
    
} 
custom_window;


typedef struct {
    GtkWidget *Window;

    GtkWidget *HatText;
    GtkWidget *HeaderText;
    GtkWidget *InfoText;
    GtkWidget *AlwaysOpenCheck;

    GtkWidget *CloseButton;
    GtkWidget *AcceptButton;
} documentation_confirmation_window;

typedef char* string;
static string version_application;


main_window *setup_window(main_window* widgets, custom_window* custom_widgets);
void on_about();
void yon_open_browser(GtkWidget *self, char *link);
void on_close_subwindow(GtkWidget *self);
void on_link(GtkWidget *self, char* uri, gpointer user_data);
void on_open_documentation_confirmation(GtkWidget *self, char *link);
void yon_load_proceed(char *command);
void event(main_window *widgets);
custom_window *setup_window_custom(custom_window* custom_widgets, GtkBuilder *builder);
void on_link(GtkWidget *self, char* uri, gpointer user_data);
void config_init(config_settings_gui* main_config);
int wrapper_select_tree_view(hotebook* widgets);
int tree_view_edit(config_all* _all_config, vector* vec_temp, hotebook* widgets);
void set_time_spin(hotebook* widgets, size_t seconds_file, size_t seconds_size);
void template_set_status_disk(GtkWidget* self,hotebook* widgets);
void wrapper_fill_tree_view_generate(config_all* all_config, custom_window* custom);
#endif
