|
|
|
@ -1,146 +1,27 @@
|
|
|
|
|
#ifndef UBL_SETTINGS_QUOTAS_H
|
|
|
|
|
#define UBL_SETTINGS_QUOTAS_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <dlfcn.h>
|
|
|
|
|
#include "view_open_browser.h"
|
|
|
|
|
#include "../project_lib.h"
|
|
|
|
|
#include "../my_type.h"
|
|
|
|
|
#include "ubl-util-standard.c"
|
|
|
|
|
#ifdef WEBKIT_FOUND
|
|
|
|
|
#include <webkit2/webkit2.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define name_app _("ubl-settings-diskquota")
|
|
|
|
|
#define configuring_system_boot _("Configuring system boot parameters")
|
|
|
|
|
#define system_boot _("System boot")
|
|
|
|
|
#define str_about _("About ubl-settings-diskquota")
|
|
|
|
|
#define command_line_parameters _("Command line parameters:")
|
|
|
|
|
#define load_default _("Load default:")
|
|
|
|
|
#define seconds _("seconds")
|
|
|
|
|
#define download_menu _("Download menu")
|
|
|
|
|
#define terminal_for_input _("Terminal for input")
|
|
|
|
|
#define terminal_for_output _("Terminal for output")
|
|
|
|
|
#define boot_selection_menu_timer _("Boot selection menu timer")
|
|
|
|
|
#define str_help _("Help")
|
|
|
|
|
#define str_about_1 _("About")
|
|
|
|
|
#define str_save_local _("Save")
|
|
|
|
|
#define str_load_local _("Load")
|
|
|
|
|
#define save_all _("Save in global and local configuration")
|
|
|
|
|
#define save_local _("Save in local configuration")
|
|
|
|
|
#define save_global _("Save in global configuration")
|
|
|
|
|
#define load_global _("Load global configuration")
|
|
|
|
|
#define load_local _("Load local configuration")
|
|
|
|
|
#define read_online _("Read online")
|
|
|
|
|
#define cancel _("Cancel")
|
|
|
|
|
#define always_redirect _("Always redirect")
|
|
|
|
|
#define boot_screen_display_mode _("Boot screen display mode:")
|
|
|
|
|
#define no_loading_animation _("No loading animation, full log")
|
|
|
|
|
#define boot_menu_user_name _("Boot menu user name:")
|
|
|
|
|
#define boot_menu_user_password _("Boot menu user password:")
|
|
|
|
|
#define last_successful_upload _("Last successful upload")
|
|
|
|
|
#define read_documentation_web _("Would you like to read documentation in the Web?")
|
|
|
|
|
#define redirected_documentation _("You will be redirected to documentation site, where user help pages are ""translated and supported by community.")
|
|
|
|
|
#define local_read_error _("Local configuration reading error")
|
|
|
|
|
#define global_read_error _("Global configuration read error")
|
|
|
|
|
#define local_write_error _("Local configuration write error")
|
|
|
|
|
#define global_write_error _("Global configuration write error")
|
|
|
|
|
#define error_save_all _("Error saved local and global configuration")
|
|
|
|
|
#define local_load_ok _("Local configuration downloaded successfully")
|
|
|
|
|
#define global_load_ok _("Global configuration downloaded successfully")
|
|
|
|
|
#define local_ok_written _("Local configuration successfully written")
|
|
|
|
|
#define global_ok_written _("Global configuration successfully written")
|
|
|
|
|
#define successfully_save_all _("Successfully saved local and global configuration")
|
|
|
|
|
#define nothing_save _("Nothing to save!")
|
|
|
|
|
#define program_as_root _("The program must be run as root")
|
|
|
|
|
|
|
|
|
|
#define str_weeks _("weeks")
|
|
|
|
|
#define str_days _("days")
|
|
|
|
|
#define str_hours _("hours")
|
|
|
|
|
#define str_minutes _("minutes")
|
|
|
|
|
#define str_device _("Device:")
|
|
|
|
|
#define str_users _("Users")
|
|
|
|
|
#define str_groups _("Groups")
|
|
|
|
|
#define str_files _("files")
|
|
|
|
|
#define str_hard_limit _("Hard limit")
|
|
|
|
|
#define str_file_system _("File system:")
|
|
|
|
|
#define str_name _("Name")
|
|
|
|
|
#define str_size _("Size")
|
|
|
|
|
#define str_quotas_mode _("Direct control of the file system")
|
|
|
|
|
#define str_lb_head _("Configuration of disk quotas parameters for system groups and users")
|
|
|
|
|
#define str_soft_limit _("Soft limit")
|
|
|
|
|
#define str_currently_using _("Currently using:")
|
|
|
|
|
#define str_currently_using_space _("Currently using: ")
|
|
|
|
|
#define str_filters _("Filters")
|
|
|
|
|
#define str_quotas _("Quotas")
|
|
|
|
|
#define str_help_h _("GTK settings disk quota for UBLinux\n" \
|
|
|
|
|
"\n" \
|
|
|
|
|
"Usage: ubl-settings-diskquota [OPTIONS...]\n" \
|
|
|
|
|
"Options:\n" \
|
|
|
|
|
" -h, --help\t Show this help\n" \
|
|
|
|
|
" -V, --version\t Show package version\n" \
|
|
|
|
|
" --lock-help Lock utility help\n" \
|
|
|
|
|
" --lock-save Lock saving local and global configuration\n" \
|
|
|
|
|
" --lock-save-local Lock save global configuration\n" \
|
|
|
|
|
" --lock-save-global Lock load global configuration\n" \
|
|
|
|
|
" --lock-load-global Lock load global configuration\n")
|
|
|
|
|
#define str_version _("ubl-settings-diskquota version: ")
|
|
|
|
|
#define str_user _("User")
|
|
|
|
|
#define str_group _("Group")
|
|
|
|
|
#define str_projects _("Projects")
|
|
|
|
|
#define str_user_1 _("User:")
|
|
|
|
|
#define str_group_1 _("Group:")
|
|
|
|
|
#define str_project_1 _("Projects:")
|
|
|
|
|
#define str_device_project _("Device\nProject")
|
|
|
|
|
#define str_quota _("Quota type")
|
|
|
|
|
#define str_status _("Status")
|
|
|
|
|
#define str_excess_size_delay _("Excess size delay period")
|
|
|
|
|
#define str_excess_files_delay _("Excess files delay period")
|
|
|
|
|
#define str_disk_quotas_device _("Disk quotas for this device:")
|
|
|
|
|
#define str_user_quotas_device _("User quotas for this device: ")
|
|
|
|
|
|
|
|
|
|
#define str_soft_limit_size _("Soft limit (size)")
|
|
|
|
|
#define str_tw_soft_limit _("Soft limit\n(size)")
|
|
|
|
|
#define str_hard_limit_size _("Hard limit (size)")
|
|
|
|
|
#define str_deferring_hard_limit_size _("Deferring a hard limit (size)")
|
|
|
|
|
#define str_hard_activation_size _("Hard limit activation time (size)")
|
|
|
|
|
#define str_hard_limit_time _("Hard limit (file) activation time")
|
|
|
|
|
#define str_group_quotas_device _("Group quotas for this device:")
|
|
|
|
|
#define str_general_settings _("General settings")
|
|
|
|
|
|
|
|
|
|
#define str_tw_severe_limitation _("Severe\nlimitation\n(size)")
|
|
|
|
|
#define str_tw_general_deferring_size _("Deferring\n(size)")
|
|
|
|
|
#define str_tw_general_deferring_files _("Deferring\n(files)")
|
|
|
|
|
#define str_tw_deferring_size _("Deferring\na hard\nlimit\n(files)")
|
|
|
|
|
#define str_tw_deferring_files _("Deferring\na hard\nlimit\n(files)")
|
|
|
|
|
#define str_tw_soft_limit_files _("Soft limit\n(files)")
|
|
|
|
|
#define str_tw_severe_limitation_files _("Severe\nlimitation\n(files)")
|
|
|
|
|
#define str_soft_restriction_files _("Soft Restriction (files)")
|
|
|
|
|
#define str_severe_limitation_files _("Severe limitation (files)")
|
|
|
|
|
#define str_deferring_limit_files _("Deferring a hard limit (files)")
|
|
|
|
|
#define info_box_ok_css "boxInfoMessOK"
|
|
|
|
|
#define info_box_error_css "boxInfoMessError"
|
|
|
|
|
#define icon_checked "com.ublinux.ubl-settings-diskquota.checked"
|
|
|
|
|
#define icon_warning "com.ublinux.ubl-settings-diskquota.warning"
|
|
|
|
|
|
|
|
|
|
#define path_app "/usr/bin/"
|
|
|
|
|
#define path_glade "/usr/share/ubl-settings-diskquota/ui/ubl-settings-diskquota.glade"
|
|
|
|
|
#define path_css "/usr/share/ubl-settings-diskquota/css/ubl-settings-diskquota.css"
|
|
|
|
|
#define app_name "ubl-settings-diskquota"
|
|
|
|
|
#define path_resources "/usr/share/ubl-settings-diskquota"
|
|
|
|
|
#define path_img_head_background "/usr/share/ubl-settings-diskquota/images/logo-background.png"
|
|
|
|
|
#define no_recognized _("Argument not recognized\n")
|
|
|
|
|
#include "../var.h"
|
|
|
|
|
#include "model/wrapper_load_save.h"
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern string version_application;
|
|
|
|
|
extern bool flag_save;
|
|
|
|
|
extern bool flag_save_local;
|
|
|
|
|
extern bool flag_save_global;
|
|
|
|
|
extern bool flag_load_global;
|
|
|
|
|
extern bool flag_lock_help;
|
|
|
|
|
extern int socket_ext_id_I;
|
|
|
|
|
extern int socket_trd_id_I;
|
|
|
|
|
class MainWindow : public Gtk::ApplicationWindow {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MainWindow {
|
|
|
|
|
public:
|
|
|
|
|
class ModelColumns : public Gtk::TreeModel::ColumnRecord {
|
|
|
|
|
public:
|
|
|
|
@ -284,6 +165,7 @@ class MainWindow : public Gtk::ApplicationWindow {
|
|
|
|
|
map_str_str map_gui_cfg;
|
|
|
|
|
map_str_str map_global_cfg;
|
|
|
|
|
map_str_str map_system_cfg;
|
|
|
|
|
Wrapper_load_save* obj_wrapper_load = NULL;
|
|
|
|
|
//Devices::Parted obj_device = Devices::Parted();
|
|
|
|
|
//Quotas_sys::Quotas_sys obj_quotas_sys = Quotas_sys::Quotas_sys();
|
|
|
|
|
//Quotas_ubconfig::Quotas_ubconfig obj_quotas_ubconfig = Quotas_ubconfig::Quotas_ubconfig();
|
|
|
|
@ -304,10 +186,13 @@ class MainWindow : public Gtk::ApplicationWindow {
|
|
|
|
|
bool flag_validate_del_users = false;
|
|
|
|
|
bool flag_validate_del_project = false;
|
|
|
|
|
Gtk::TreeModel::Row row;
|
|
|
|
|
int* socket_ext_id_I = NULL;
|
|
|
|
|
int* socket_trd_id_I = NULL;
|
|
|
|
|
View_open_browser* obj_open_browser;
|
|
|
|
|
const struct tv_g_u_p obj_tv_g_u_p {"", "", "", "", "", "", "", "", "",""};
|
|
|
|
|
public:
|
|
|
|
|
MainWindow(BaseObjectType* obj, Glib::RefPtr<Gtk::Builder> const& builder);
|
|
|
|
|
MainWindow(Glib::RefPtr<Gtk::Builder> const& builder);
|
|
|
|
|
// MainWindow(BaseObjectType* obj, Glib::RefPtr<Gtk::Builder> const& builder);
|
|
|
|
|
MainWindow(Glib::RefPtr<Gtk::Builder> builder, View_open_browser* obj_open_browser, int* socket_ext_id_I, int* socket_trd_id_I);
|
|
|
|
|
~MainWindow();
|
|
|
|
|
void settings();
|
|
|
|
|
void flag_block_gui();
|
|
|
|
@ -315,6 +200,7 @@ class MainWindow : public Gtk::ApplicationWindow {
|
|
|
|
|
void add_CSS();
|
|
|
|
|
void get_builder();
|
|
|
|
|
void event();
|
|
|
|
|
void open_browser();
|
|
|
|
|
void info_warning_error(int mess, int error_save, int error_load);
|
|
|
|
|
void init_work_tv_g_u_p();
|
|
|
|
|
void remove_line_template(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter, Gtk::TreeModel::iterator& iter_del, bool& flag_del);
|
|
|
|
@ -323,8 +209,10 @@ class MainWindow : public Gtk::ApplicationWindow {
|
|
|
|
|
void entry_combo_box_temp(Gtk::ComboBoxText *combo_box, Gtk::Label *label);
|
|
|
|
|
void info_status_app(string stule);
|
|
|
|
|
void filters_show();
|
|
|
|
|
void set_obj_wrapper_load(Wrapper_load_save* obj_wrapper_load);
|
|
|
|
|
void init_tree_view();
|
|
|
|
|
void del_columns();
|
|
|
|
|
void set_obj_browser(View_open_browser* obj_open_browser);
|
|
|
|
|
void set_add_tv_g_u_p(Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListStore> list_store, struct tv_g_u_p obj_tv_g_u_p);
|
|
|
|
|
void off_quota_system(Gtk::ComboBoxText* combo_box, string quota_type);
|
|
|
|
|
void mode_switch_quota();
|
|
|
|
@ -338,6 +226,6 @@ class MainWindow : public Gtk::ApplicationWindow {
|
|
|
|
|
void format_cmd_quotas_ubconfig(struct struct_quotas& _struct_quota);
|
|
|
|
|
struct partition_cmd wrapper_settings_quotas();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void wrapper_help_show(GtkWidget *self, char* link, gpointer user_data);
|
|
|
|
|
void help();
|
|
|
|
|
#endif
|
|
|
|
|