From a0256505e8f970dd63a45df8182fa27c54ef4fe7 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 11 May 2023 17:11:20 +0600 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B0=D0=B9=D0=BB=D1=8B=20=D1=80=D0=B0?= =?UTF-8?q?=D1=81=D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D0=B5=D0=BD=D1=8B=20?= =?UTF-8?q?=D0=BF=D0=BE=20=D0=BF=D0=B0=D0=BF=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/CMakeLists.txt | 45 +++++++++++---------- source/main.cc | 2 +- source/model/CmakeLists.txt | 19 +++++++++ source/{ => model}/load.cc | 0 source/{ => model}/load.h | 0 source/{ => model}/my_device.cc | 0 source/{ => model}/my_device.h | 4 +- source/{ => model}/my_process.cc | 0 source/{ => model}/my_process.h | 0 source/{ => model}/save.cc | 0 source/{ => model}/save.h | 0 source/{ => model}/system_quotas.cc | 1 - source/{ => model}/system_quotas.h | 4 +- source/{ => model}/ubconfig_quotas.cc | 0 source/{ => model}/ubconfig_quotas.h | 4 +- source/{ => model}/util.cc | 0 source/{ => model}/util.h | 2 +- source/{ => model}/wrapper_load_save.cc | 0 source/{ => model}/wrapper_load_save.h | 4 +- source/project_lib.h | 2 +- source/view/CmakeLists.txt | 16 ++++++++ source/{ => view}/my_plug.cc | 0 source/{ => view}/my_plug.h | 3 +- source/{ => view}/ubl-settings-diskquota.cc | 8 ++-- source/{ => view}/ubl-settings-diskquota.h | 15 +++---- source/{ => view}/ubl-util-standard.c | 0 source/{ => view}/ubl-util-standard.h | 0 source/{ => view}/view_about.cc | 0 source/{ => view}/view_about.h | 2 +- source/{ => view}/view_filters.cc | 0 source/{ => view}/view_filters.h | 2 +- source/{ => view}/view_open_browser.cc | 0 source/{ => view}/view_open_browser.h | 2 +- source/{ => view}/view_set_user_group.cc | 0 source/{ => view}/view_set_user_group.h | 2 +- 35 files changed, 85 insertions(+), 52 deletions(-) create mode 100644 source/model/CmakeLists.txt rename source/{ => model}/load.cc (100%) rename source/{ => model}/load.h (100%) rename source/{ => model}/my_device.cc (100%) rename source/{ => model}/my_device.h (85%) rename source/{ => model}/my_process.cc (100%) rename source/{ => model}/my_process.h (100%) rename source/{ => model}/save.cc (100%) rename source/{ => model}/save.h (100%) rename source/{ => model}/system_quotas.cc (99%) rename source/{ => model}/system_quotas.h (95%) rename source/{ => model}/ubconfig_quotas.cc (100%) rename source/{ => model}/ubconfig_quotas.h (92%) rename source/{ => model}/util.cc (100%) rename source/{ => model}/util.h (96%) rename source/{ => model}/wrapper_load_save.cc (100%) rename source/{ => model}/wrapper_load_save.h (96%) create mode 100644 source/view/CmakeLists.txt rename source/{ => view}/my_plug.cc (100%) rename source/{ => view}/my_plug.h (93%) rename source/{ => view}/ubl-settings-diskquota.cc (98%) rename source/{ => view}/ubl-settings-diskquota.h (97%) rename source/{ => view}/ubl-util-standard.c (100%) rename source/{ => view}/ubl-util-standard.h (100%) rename source/{ => view}/view_about.cc (100%) rename source/{ => view}/view_about.h (95%) rename source/{ => view}/view_filters.cc (100%) rename source/{ => view}/view_filters.h (98%) rename source/{ => view}/view_open_browser.cc (100%) rename source/{ => view}/view_open_browser.h (97%) rename source/{ => view}/view_set_user_group.cc (100%) rename source/{ => view}/view_set_user_group.h (98%) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 0caeeb7..d4a9320 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -1,13 +1,14 @@ cmake_minimum_required(VERSION 3.7) +find_package(PkgConfig REQUIRED) project(ubl-settings-diskquota) -find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED gtkmm-3.0) include_directories(${GTK_INCLUDE_DIRS}) link_directories(${GTK_LIBRARY_DIRS}) add_definitions(${GTK_CFLAGS_OTHER}) + find_library(WEBKIT_LIBRARIES_FOUND webkit2gtk-4.0 webkit2gtk-web-extension-4.0) option(WEBKIT_FOUND "No" OFF) @@ -30,29 +31,29 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissin set(SOURCE_FILES ubl-settings-diskquota-cm.h - ubl-settings-diskquota.h - ubl-settings-diskquota.cc - ubconfig_quotas.h - ubconfig_quotas.cc - system_quotas.h - system_quotas.cc - my_device.h - my_device.cc + view/ubl-settings-diskquota.h + view/ubl-settings-diskquota.cc + model/ubconfig_quotas.cc + model/ubconfig_quotas.h + model/system_quotas.h + model/system_quotas.cc + model/my_device.h + model/my_device.cc project_lib.h my_type.h - save.h - save.cc - load.h - load.cc - my_process.h - my_process.cc - util.h - util.cc - my_plug.h - my_plug.cc - ubl-util-standard.h - ubl-util-standard.c - main.cc) + model/save.h + model/save.cc + model/load.h + model/load.cc + model/my_process.h + model/my_process.cc + model/util.h + model/util.cc + view/my_plug.h + view/my_plug.cc + view/ubl-util-standard.h + view/ubl-util-standard.c + main.cc) set(LIBRARIES ${GTK_LIBRARIES} diff --git a/source/main.cc b/source/main.cc index 85d79f4..0511543 100644 --- a/source/main.cc +++ b/source/main.cc @@ -1,4 +1,4 @@ -#include "my_plug.h" +#include "view/my_plug.h" void pars_flag(int index_start, int argc, char* argv[]); diff --git a/source/model/CmakeLists.txt b/source/model/CmakeLists.txt new file mode 100644 index 0000000..4f88ba8 --- /dev/null +++ b/source/model/CmakeLists.txt @@ -0,0 +1,19 @@ +add_library(model +load.cc +load.h +my_device.cc +my_device.h +my_process.cc +my_process.h +save.cc +save.h +system_quotas.cc +system_quotas.h +ubconfig_quotas.cc +ubconfig_quotas.h +util.cc +util.h +wrapper_load_save.cc +wrapper_load_save.h +) +target_include_directories(model PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file diff --git a/source/load.cc b/source/model/load.cc similarity index 100% rename from source/load.cc rename to source/model/load.cc diff --git a/source/load.h b/source/model/load.h similarity index 100% rename from source/load.h rename to source/model/load.h diff --git a/source/my_device.cc b/source/model/my_device.cc similarity index 100% rename from source/my_device.cc rename to source/model/my_device.cc diff --git a/source/my_device.h b/source/model/my_device.h similarity index 85% rename from source/my_device.h rename to source/model/my_device.h index 1db5317..a4cf9db 100644 --- a/source/my_device.h +++ b/source/model/my_device.h @@ -1,10 +1,10 @@ #ifndef MY_DEVICE_H #define MY_DEVICE_H -#include "project_lib.h" +#include "../project_lib.h" #include "my_process.h" #include "util.h" -#include "my_type.h" +#include "../my_type.h" namespace Devices { diff --git a/source/my_process.cc b/source/model/my_process.cc similarity index 100% rename from source/my_process.cc rename to source/model/my_process.cc diff --git a/source/my_process.h b/source/model/my_process.h similarity index 100% rename from source/my_process.h rename to source/model/my_process.h diff --git a/source/save.cc b/source/model/save.cc similarity index 100% rename from source/save.cc rename to source/model/save.cc diff --git a/source/save.h b/source/model/save.h similarity index 100% rename from source/save.h rename to source/model/save.h diff --git a/source/system_quotas.cc b/source/model/system_quotas.cc similarity index 99% rename from source/system_quotas.cc rename to source/model/system_quotas.cc index c92f609..254de2f 100644 --- a/source/system_quotas.cc +++ b/source/model/system_quotas.cc @@ -1,5 +1,4 @@ #include "system_quotas.h" -#include "my_type.h" namespace Quotas_sys { diff --git a/source/system_quotas.h b/source/model/system_quotas.h similarity index 95% rename from source/system_quotas.h rename to source/model/system_quotas.h index fd25abc..a6cc631 100644 --- a/source/system_quotas.h +++ b/source/model/system_quotas.h @@ -1,7 +1,7 @@ #ifndef SYSTEM_CMD_QUOTAS #define SYSTEM_CMD_QUOTAS -#include "project_lib.h" -#include "my_type.h" +#include "../project_lib.h" +#include "../my_type.h" #include "my_process.h" #include "util.h" diff --git a/source/ubconfig_quotas.cc b/source/model/ubconfig_quotas.cc similarity index 100% rename from source/ubconfig_quotas.cc rename to source/model/ubconfig_quotas.cc diff --git a/source/ubconfig_quotas.h b/source/model/ubconfig_quotas.h similarity index 92% rename from source/ubconfig_quotas.h rename to source/model/ubconfig_quotas.h index f9a0d4d..26124d3 100644 --- a/source/ubconfig_quotas.h +++ b/source/model/ubconfig_quotas.h @@ -1,8 +1,8 @@ #ifndef UBCONFIG_QUOTAS #define UBCONFIG_QUOTAS -#include "project_lib.h" -#include "my_type.h" +#include "../project_lib.h" +#include "../my_type.h" #include "my_process.h" #include "util.h" diff --git a/source/util.cc b/source/model/util.cc similarity index 100% rename from source/util.cc rename to source/model/util.cc diff --git a/source/util.h b/source/model/util.h similarity index 96% rename from source/util.h rename to source/model/util.h index 8afa931..faaee62 100644 --- a/source/util.h +++ b/source/model/util.h @@ -1,6 +1,6 @@ #ifndef UTIL_H #define UTIL_H -#include "project_lib.h" +#include "../project_lib.h" using namespace std; diff --git a/source/wrapper_load_save.cc b/source/model/wrapper_load_save.cc similarity index 100% rename from source/wrapper_load_save.cc rename to source/model/wrapper_load_save.cc diff --git a/source/wrapper_load_save.h b/source/model/wrapper_load_save.h similarity index 96% rename from source/wrapper_load_save.h rename to source/model/wrapper_load_save.h index 4ff82de..7f6a338 100644 --- a/source/wrapper_load_save.h +++ b/source/model/wrapper_load_save.h @@ -1,7 +1,7 @@ #ifndef WRAPPER_LOAD_H #define WRAPPER_LOAD_H -#include "my_type.h" -#include "project_lib.h" +#include "../my_type.h" +#include "../project_lib.h" #include "load.h" #include "save.h" #include "my_process.h" diff --git a/source/project_lib.h b/source/project_lib.h index 79c5c4d..51b5258 100644 --- a/source/project_lib.h +++ b/source/project_lib.h @@ -22,6 +22,6 @@ #include #include #include -#include "ubl-util-standard.c" + #include "ubl-settings-diskquota-cm.h" #endif \ No newline at end of file diff --git a/source/view/CmakeLists.txt b/source/view/CmakeLists.txt new file mode 100644 index 0000000..c755b28 --- /dev/null +++ b/source/view/CmakeLists.txt @@ -0,0 +1,16 @@ +add_library(view +my_plug.cc +my_plug.h +ubl-settings-diskquota.h +ubl-settings-diskquota.cc +ubl-util-standard.h +view_about.cc +view_about.h +view_filters.h +view_filters.cc +view_open_browser.h +view_open_browser.cc +view_set_user_group.h +view_set_user_group.cc +) +target_include_directories(view PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file diff --git a/source/my_plug.cc b/source/view/my_plug.cc similarity index 100% rename from source/my_plug.cc rename to source/view/my_plug.cc diff --git a/source/my_plug.h b/source/view/my_plug.h similarity index 93% rename from source/my_plug.h rename to source/view/my_plug.h index 5d9a3d1..46cb259 100644 --- a/source/my_plug.h +++ b/source/view/my_plug.h @@ -1,6 +1,7 @@ -#include "project_lib.h" +#include "../project_lib.h" #include "ubl-settings-diskquota.h" + class CmdArgParser : public Glib::OptionGroup { public: CmdArgParser(const std::string& p_name, const std::string& p_description, const std::string& p_help); diff --git a/source/ubl-settings-diskquota.cc b/source/view/ubl-settings-diskquota.cc similarity index 98% rename from source/ubl-settings-diskquota.cc rename to source/view/ubl-settings-diskquota.cc index bd4a7d1..4dc87a6 100755 --- a/source/ubl-settings-diskquota.cc +++ b/source/view/ubl-settings-diskquota.cc @@ -26,10 +26,10 @@ void MainWindow::settings() { this->lacalization(); this->add_CSS(); this->flag_block_gui(); - map_device = obj_device.get_parted(); - this->filling_device_combo_box_template(groupsDeviceCombo, map_device); - this->filling_device_combo_box_template(usersDeviceCombo, map_device); - this->filling_device_combo_box_template(usersProjectCombo, map_device); + //map_device = obj_device.get_parted(); + //this->filling_device_combo_box_template(groupsDeviceCombo, map_device); + //this->filling_device_combo_box_template(usersDeviceCombo, map_device); + //this->filling_device_combo_box_template(usersProjectCombo, map_device); this->init_tree_view(); this->init_spin_all(); if (geteuid() == 0) { diff --git a/source/ubl-settings-diskquota.h b/source/view/ubl-settings-diskquota.h similarity index 97% rename from source/ubl-settings-diskquota.h rename to source/view/ubl-settings-diskquota.h index 9262d17..dd56ce9 100644 --- a/source/ubl-settings-diskquota.h +++ b/source/view/ubl-settings-diskquota.h @@ -1,14 +1,11 @@ #ifndef UBL_SETTINGS_QUOTAS_H #define UBL_SETTINGS_QUOTAS_H -#include "util.h" -#include "my_type.h" -#include "my_device.h" -#include "system_quotas.h" -#include "ubconfig_quotas.h" #include - +#include "../project_lib.h" +#include "../my_type.h" +#include "ubl-util-standard.c" #ifdef WEBKIT_FOUND #include #endif @@ -287,9 +284,9 @@ class MainWindow : public Gtk::ApplicationWindow { map_str_str map_gui_cfg; map_str_str map_global_cfg; map_str_str map_system_cfg; - 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(); + //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(); vector vec_param_names; map_str_str map_device; string str_cmd_error; diff --git a/source/ubl-util-standard.c b/source/view/ubl-util-standard.c similarity index 100% rename from source/ubl-util-standard.c rename to source/view/ubl-util-standard.c diff --git a/source/ubl-util-standard.h b/source/view/ubl-util-standard.h similarity index 100% rename from source/ubl-util-standard.h rename to source/view/ubl-util-standard.h diff --git a/source/view_about.cc b/source/view/view_about.cc similarity index 100% rename from source/view_about.cc rename to source/view/view_about.cc diff --git a/source/view_about.h b/source/view/view_about.h similarity index 95% rename from source/view_about.h rename to source/view/view_about.h index f64ce41..87ef742 100644 --- a/source/view_about.h +++ b/source/view/view_about.h @@ -1,6 +1,6 @@ #ifndef VIEW_ABOUT_H #define VIEW_ABOUT_H -#include "project_lib.h" +#include "../project_lib.h" #define copyright _("Copyright © UBSoft LLC, 2022 - ") #define str_setting_user _("Setting user quotas") #define website _("https://wiki.ublinux.com") diff --git a/source/view_filters.cc b/source/view/view_filters.cc similarity index 100% rename from source/view_filters.cc rename to source/view/view_filters.cc diff --git a/source/view_filters.h b/source/view/view_filters.h similarity index 98% rename from source/view_filters.h rename to source/view/view_filters.h index 2d3fd16..e161c20 100644 --- a/source/view_filters.h +++ b/source/view/view_filters.h @@ -1,6 +1,6 @@ #ifndef VIEW_FILTERS_H #define VIEW_FILTERS_H -#include "project_lib.h" +#include "../project_lib.h" #define str_name _("Name") #define str_size _("Size") diff --git a/source/view_open_browser.cc b/source/view/view_open_browser.cc similarity index 100% rename from source/view_open_browser.cc rename to source/view/view_open_browser.cc diff --git a/source/view_open_browser.h b/source/view/view_open_browser.h similarity index 97% rename from source/view_open_browser.h rename to source/view/view_open_browser.h index 2611b47..4966887 100644 --- a/source/view_open_browser.h +++ b/source/view/view_open_browser.h @@ -1,6 +1,6 @@ #ifndef VIEW_OPEN_BROWSER_H #define VIEW_OPEN_BROWSER_H -#include "project_lib.h" +#include "../project_lib.h" #define link_doc "https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/ubl-settings-diskquota" #define cmd_xdg "xdg-open " diff --git a/source/view_set_user_group.cc b/source/view/view_set_user_group.cc similarity index 100% rename from source/view_set_user_group.cc rename to source/view/view_set_user_group.cc diff --git a/source/view_set_user_group.h b/source/view/view_set_user_group.h similarity index 98% rename from source/view_set_user_group.h rename to source/view/view_set_user_group.h index f8728d6..7644a47 100644 --- a/source/view_set_user_group.h +++ b/source/view/view_set_user_group.h @@ -1,6 +1,6 @@ #ifndef VIEW_SET_USER_GROUP_H #define VIEW_SET_USER_GROUP_H -#include "project_lib.h" +#include "../project_lib.h" #define str_device _("Device:") #define str_quota_status _("Quota use status:") #define str_size _("Size")