diff --git a/.install.sh b/.install.sh
deleted file mode 100755
index ad955f9..0000000
--- a/.install.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-make
-gcc compile/resources.c compile/ubl-cmake.h source/view_set_disk.h source/view_set_disk.c source/view_check_user_table.c source/view_check_user_table.h source/view_filters.c source/model/vector.c source/model/vector.h source/view_filters.h source/view_temp_u_g_p.c source/view_temp_u_g_p.h source/controler.h source/controler.c source/model/philos_utils.h source/model/philos_utils.c source/model/my_device.h source/model/save.h source/model/save.c source/model/my_device.c source/model/model.h source/model/load.h source/model/load.c source/model/model.c source/ubl-settings-diskquota.c source/ubl-settings-diskquota.h source/ubl-strings.h source/model/ubl-utils.c source/model/ubl-utils.h -o ubl-settings-diskquota `pkg-config --cflags --libs gtk+-3.0 vte-2.91 webkit2gtk-4.0 webkit2gtk-web-extension-4.0` -g
-sudo make install clean
-cd ./terminal-commands
-make
-cd ../
diff --git a/Makefile b/Makefile
index c0be6ef..f309614 100644
--- a/Makefile
+++ b/Makefile
@@ -9,8 +9,10 @@ CMAKE_COMMAND = cmake
CMAKE_SOURCE_DIR = $(MAKEFILE_PATH)source
CMAKE_BUILD_DIR = $(MAKEFILE_PATH)compile
DEPENDS = /bin/cmake
-PREFIX ?= /usr
+PREFIX ?= /usr/local
PKGNAME = $(MAKEFILE_DIR)
+FILE_VER = source/${PKGNAME}.h
+PKGIDENT=$(subst /,-,${PREFIX})
default_target: all
@@ -21,11 +23,16 @@ all: init build
init:
@echo "Initialize ..."; \
if [ -d ".git" ]; then \
- LATEST_TAG=$$(git describe --tags | sed 's/^v//'|grep -oE "^[0-9]{1,}.[0-9]{1,}"); \
+ LATEST_TAG=$$(git describe --abbrev=0 --tags | sed 's/^v//'); \
+ if [ -z "$${LATEST_TAG}" ]; \
+ then \
+ LATEST_TAG=$$"0.0"; \
+ echo "$${LATEST_TAG} is empty"; \
+ fi; \
else \
- LATEST_TAG="0.0"; \
+ LATEST_TAG="Development"; \
fi; \
- sed -r "s/^(string version_application).*/\1=\"$${LATEST_TAG}\";/" -i source/${PKGNAME}.h; \
+ sed -r "s/^(string version_application).*/\1 = \"$${LATEST_TAG}\";/" -i ${FILE_VER}; \
echo "-- Build path: ${CMAKE_BUILD_DIR}"
depend:
@@ -43,8 +50,6 @@ debug:
@echo "Debug ..."
if [ ! -d ${CMAKE_BUILD_DIR} ]; then \
$(CMAKE_COMMAND) -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="${PREFIX}"; \
- @gcc compile/resources.c compile/ubl-cmake.h source/view_set_disk.h source/view_set_disk.c source/view_check_user_table.c source/view_check_user_table.h source/view_filters.c source/model/vector.c source/model/vector.h source/view_filters.h source/view_temp_u_g_p.c source/view_temp_u_g_p.h source/controler.h source/controler.c source/model/philos_utils.h source/model/philos_utils.c source/model/my_device.h source/model/save.h source/model/save.c source/model/my_device.c source/model/model.h source/model/load.h source/model/load.c source/model/model.c source/ubl-settings-diskquota.c source/ubl-settings-diskquota.h source/ubl-strings.h source/model/ubl-utils.c source/model/ubl-utils.h -o ubl-settings-diskquota `pkg-config --cflags --libs gtk+-3.0 vte-2.91 webkit2gtk-4.0 webkit2gtk-web-extension-4.0` -g
-
fi; \
echo "Debug: OK"
@@ -66,7 +71,8 @@ check:
build: depend prepare
@echo "Build ..."; \
- make --directory=${CMAKE_BUILD_DIR}; \
+ $(MAKE_COMMAND) --directory=${CMAKE_BUILD_DIR}; \
+ sed -r "s/^(string version_application).*/\1;/" -i ${FILE_VER}; \
echo "Build: OK"
uninstall:
@@ -74,7 +80,7 @@ uninstall:
@for FILE_PO in $(wildcard *.po); do \
LANG=$${FILE_PO##*_};LANG=$${LANG%.*}; \
FILE_MO=$${FILE_PO##*/}; FILE_MO="$${FILE_MO%_*.po}.mo"; \
- PATH_FILE_MO="${DESTDIR}${PREFIX}/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \
+ PATH_FILE_MO="${DESTDIR}/usr/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \
$(RM) "$${PATH_FILE_MO}"; \
done
@for SIZE in 16x16 32x32 48x48 scalable; do \
@@ -89,9 +95,7 @@ uninstall:
@$(RM) "${DESTDIR}${PREFIX}/bin/${PKGNAME}"
@$(RM) "${DESTDIR}${PREFIX}/share/applications/${PKGNAME}.desktop"
@$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/com.ublinux.${PKGNAME}.svg"
- @$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/com.ublinux.${PKGNAME}.checked.svg"
- @$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/com.ublinux.${PKGNAME}.warning.svg"
- @$(RM) "${DESTDIR}${PREFIX}/share/polkit-1/actions/com.ublinux.${PKGNAME}.policy"
+ @$(RM) "${DESTDIR}/usr/share/polkit-1/actions/com.ublinux.${PKGNAME}${PKGIDENT}.policy"
@if [ -z ${DESTDIR} ]; then \
[ -d "${DESTDIR}${PREFIX}/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}${PREFIX}/share/icons/hicolor/" &>/dev/null || true; \
update-desktop-database --quiet &>/dev/null || true; \
@@ -103,9 +107,9 @@ install: check uninstall
@echo "Install ..."
@for FILE_PO in $(wildcard *.po); do \
LANG=$${FILE_PO##*_};LANG=$${LANG%.*}; \
- install -dm755 "${DESTDIR}${PREFIX}/share/locale/$${LANG}/LC_MESSAGES"; \
+ install -dm755 "${DESTDIR}/usr/share/locale/$${LANG}/LC_MESSAGES"; \
FILE_MO=$${FILE_PO##*/}; FILE_MO="$${FILE_MO%_*.po}.mo"; \
- PATH_FILE_MO="${DESTDIR}${PREFIX}/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \
+ PATH_FILE_MO="${DESTDIR}/usr/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \
echo "$${FILE_PO}"; \
msgfmt "$${FILE_PO}" -v -f -o "$${PATH_FILE_MO}"; \
done
@@ -113,25 +117,22 @@ install: check uninstall
install -dm755 "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps"; \
rsvg-convert -w $${SIZE} -h $${SIZE} -f svg --keep-image-data "com.ublinux.${PKGNAME}.svg" -o "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/com.ublinux.${PKGNAME}.svg"; \
done
- @install -dm755 "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/" "com.ublinux.${PKGNAME}.svg"
- @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.checked.svg"
- @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.warning.svg"
- @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.funnel.svg"
- @install -dm755 "${DESTDIR}${PREFIX}/share/polkit-1/actions"
- @install -Dm644 -t "${DESTDIR}${PREFIX}/share/polkit-1/actions/" "com.ublinux.${PKGNAME}.policy"
- @install -Dm644 -t "${DESTDIR}${PREFIX}/share/polkit-1/actions/" "gdb.policy"
+ @cp ./com.ublinux.${PKGNAME}.policy ./compile/com.ublinux.${PKGNAME}${PKGIDENT}.policy
+ @sed -e 's+/usr/bin+${PREFIX}/bin+' -e 's+.run+${PKGIDENT}.run+g' ./compile/com.ublinux.${PKGNAME}${PKGIDENT}.policy -i
@install -Dm755 -t "${DESTDIR}${PREFIX}/bin/" "${CMAKE_BUILD_DIR}/${PKGNAME}"
- @install -dm755 "${DESTDIR}/etc/xdg"
- @install -dm755 "${DESTDIR}${PREFIX}/share/applications"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/applications/" "${PKGNAME}.desktop"
+ @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.checked.svg"
+ @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.warning.svg"
+ @install -Dm644 -t "${DESTDIR}/usr/share/polkit-1/actions/" "${CMAKE_BUILD_DIR}/com.ublinux.${PKGNAME}${PKGIDENT}.policy"
+ @install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.funnel-symbolic.svg"
+ @ldconfig -n /usr/local/lib
@if [ -z ${DESTDIR} ]; then \
[ -d "${DESTDIR}${PREFIX}/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}${PREFIX}/share/icons/hicolor/" &>/dev/null || true; \
update-desktop-database --quiet &>/dev/null || true; \
[ -d "${DESTDIR}${PREFIX}/share/applications" ] && touch "${DESTDIR}${PREFIX}/share/applications" &>/dev/null || true; \
fi
@echo "Install: OK"
- @sed -r "s/^(string version_application=\"*\").*/string version_application;/" -i source/${PKGNAME}.h; \
clean:
@echo "Clean ..."
@@ -151,5 +152,4 @@ help:
echo "... compile"; \
echo "... install"; \
echo "... uninstall"; \
- echo "... clean"
-
+ echo "... clean"
\ No newline at end of file
diff --git a/com.ublinux.ubl-settings-diskquota.funnel.svg b/com.ublinux.ubl-settings-diskquota.funnel-symbolic.svg
similarity index 100%
rename from com.ublinux.ubl-settings-diskquota.funnel.svg
rename to com.ublinux.ubl-settings-diskquota.funnel-symbolic.svg
diff --git a/gdb.policy b/gdb.policy
deleted file mode 100644
index c1a7da0..0000000
--- a/gdb.policy
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
- UBLinux
- https://ublinux.ru
-
-
- Run ubl-settings-diskquota as root
- Запуск утилиты ubl-settings-diskquota с правами root
- Authentication is required to run ubl-settings-diskquota
- Требуется авторизация для запуска утилиты ubl-settings-diskquota с правами root
-
- auth_admin
- auth_admin
- auth_admin
-
- /usr/bin/gdb
- true
-
-
-
diff --git a/source/controler.c b/source/controler.c
index d4ab4ad..75b8b33 100644
--- a/source/controler.c
+++ b/source/controler.c
@@ -181,6 +181,14 @@ void wrapper_edit_view_device_show(GtkWidget* self) {
g_signal_connect(G_OBJECT(get_widget_view_device()->btnSaveTempSave),"clicked",G_CALLBACK(entry_device_disk),&i);
}
+void on_status_changed(){
+ int active = gtk_combo_box_get_active(GTK_COMBO_BOX(get_widget_view_device()->cmbDeviceSetStatus));
+ if (active == 0|| active ==1)
+ gtk_widget_set_sensitive(get_widget_view_device()->boxBlockDisabledStatus,0);
+ else
+ gtk_widget_set_sensitive(get_widget_view_device()->boxBlockDisabledStatus,1);
+}
+
void wrapper_add_view_device_show(GtkWidget* self) {
view_device_set_vector_device(&all_config.v_disk_status);
view_device_set_index(-1);
@@ -189,6 +197,7 @@ void wrapper_add_view_device_show(GtkWidget* self) {
view_device_show(NULL, glade_path);
int i = 0;
g_signal_connect(G_OBJECT(get_widget_view_device()->btnSaveTempSave),"clicked",G_CALLBACK(entry_device_disk),&i);
+ g_signal_connect(G_OBJECT(get_widget_view_device()->cmbDeviceSetStatus),"changed",G_CALLBACK(on_status_changed),NULL);
}
void block_tree_view(hotebook* widgets,void (*f)()) {
@@ -369,6 +378,7 @@ void wrapper_all_save() {
yon_ubl_status_box_render(MESS_NOTHING_SAVE, BACKGROUND_IMAGE_SUCCESS_TYPE);
}
}
+
void wrapper_global_save() {
if (wrapper_template_save(&all_config, CMD_SAVE_GLOBAL, CMD_REMOVE_GLOBAL)) {
yon_ubl_status_box_render(GLOBAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
diff --git a/source/model/ubl-utils.h b/source/model/ubl-utils.h
index b956787..841561f 100644
--- a/source/model/ubl-utils.h
+++ b/source/model/ubl-utils.h
@@ -219,8 +219,8 @@ void yon_terminal_integrated_start(GtkWidget *terminal, char* command, void *end
enum YON_TYPE{
YON_TYPE_STRING,
- YON_TYPE_INT,
YON_TYPE_STRING_LIST,
+ YON_TYPE_INT,
YON_TYPE_BOOLEAN,
YON_TYPE_OTHER
};
@@ -365,4 +365,4 @@ void yon_ubl_browser_window_open(char *link, char *browser_window_name);
void yon_ubl_browser_window_open(char *link, char *browser_window_name);
#endif
#endif
-#endif
+#endif
\ No newline at end of file
diff --git a/source/ubl-settings-diskquota.c b/source/ubl-settings-diskquota.c
index d8823fd..d617d8c 100644
--- a/source/ubl-settings-diskquota.c
+++ b/source/ubl-settings-diskquota.c
@@ -237,5 +237,36 @@ custom_window *setup_window_custom(custom_window* custom_widgets, GtkBuilder *bu
custom_widgets->device.btnDel = yon_gtk_builder_get_widget(builder,"btnDelDevice");
custom_widgets->device.tree_view = yon_gtk_builder_get_widget(builder,"DeviceQuotasTree");
custom_widgets->device.liststore = GTK_LIST_STORE(gtk_builder_get_object(builder, "liststoreDevice"));
+
+ GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(custom_widgets->treeViewGeneral));
+ for (int i = 0; i < g_list_length(list); i++){
+ yon_window_config_add_listener(g_list_nth_data(list,i),yon_char_append("general_tree",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
+ }
+ g_list_free(list);
+
+ list = gtk_tree_view_get_columns(GTK_TREE_VIEW(custom_widgets->device.tree_view));
+ for (int i = 0; i < g_list_length(list); i++){
+ yon_window_config_add_listener(g_list_nth_data(list,i),yon_char_append("device_tree",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
+ }
+ g_list_free(list);
+
+ list = gtk_tree_view_get_columns(GTK_TREE_VIEW(custom_widgets->user.tree_view));
+ for (int i = 0; i < g_list_length(list); i++){
+ yon_window_config_add_listener(g_list_nth_data(list,i),yon_char_append("user_tree",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
+ }
+ g_list_free(list);
+
+ list = gtk_tree_view_get_columns(GTK_TREE_VIEW(custom_widgets->group.tree_view));
+ for (int i = 0; i < g_list_length(list); i++){
+ yon_window_config_add_listener(g_list_nth_data(list,i),yon_char_append("group_tree",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
+ }
+ g_list_free(list);
+
+ list = gtk_tree_view_get_columns(GTK_TREE_VIEW(custom_widgets->project.tree_view));
+ for (int i = 0; i < g_list_length(list); i++){
+ yon_window_config_add_listener(g_list_nth_data(list,i),yon_char_append("project_tree",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
+ }
+ g_list_free(list);
+
return custom_widgets;
}
diff --git a/source/ubl-settings-diskquota.h b/source/ubl-settings-diskquota.h
index dc27156..0f13a2d 100755
--- a/source/ubl-settings-diskquota.h
+++ b/source/ubl-settings-diskquota.h
@@ -109,7 +109,7 @@ typedef struct {
} documentation_confirmation_window;
typedef char* string;
-static string version_application="";
+static string version_application;
main_window *setup_window(main_window* widgets, custom_window* custom_widgets);
diff --git a/source/ubl-strings.h b/source/ubl-strings.h
index a300675..b786276 100644
--- a/source/ubl-strings.h
+++ b/source/ubl-strings.h
@@ -93,9 +93,10 @@
#define STR_ERROR_PROJECT_NAME_ENTER_VALUE _("Project name required field")
#define STR_ERROR_LIST_USER_NULL _("The list of users is empty")
#define STR_ERROR_NO_SELECTED_DISK _("To save, you need to select a disk")
-#define STR_ERROR_ENTRY_VALUE_VOLUME_OR_FILES _("The volume and files fields must have at least one value")
+#define STR_ERROR_ENTRY_VALUE_VOLUME_OR_FILES _("Insert at leat one value before saving")
#define STR_ERROR_PATH_IS_DISK_FALSE _("The selected directory is not located on the target device")
-
-
-
+#define ADD_LABEL _("Add")
+#define UPDATE_LABEL _("Update")
+#define CANCEL_LABEL _("Cancel")
+#define SAVE_LABEL _("Save")
diff --git a/source/view_set_disk.c b/source/view_set_disk.c
index 5d9a68c..e8b743e 100644
--- a/source/view_set_disk.c
+++ b/source/view_set_disk.c
@@ -53,6 +53,7 @@ view_device_set_window *view_device_setup_window_custom(view_device_set_window*
obj_view_device_widgets->DeviceCombo = yon_gtk_builder_get_widget(builder,"DeviceCombo");
obj_view_device_widgets->lblHeadQuotasEditDeviceWindow = yon_gtk_builder_get_widget(builder,"lblHeadQuotasEditDeviceWindow");
obj_view_device_widgets->boxBlockGuiAddEditDevice = yon_gtk_builder_get_widget(builder,"boxBlockGuiAddEditDevice");
+ obj_view_device_widgets->boxBlockDisabledStatus = yon_gtk_builder_get_widget(builder,"boxBlockDisabledStatus");
if (strcmp(view_device_set_add_edit, "add") == 0) {
gtk_label_set_label(GTK_LABEL(obj_view_device_widgets->lblHeadQuotasEditDeviceWindow), STR_TITLE_ADD_QUOTAS);
gtk_widget_hide(obj_view_device_widgets->lblNameDevice);
diff --git a/source/view_set_disk.h b/source/view_set_disk.h
index 34c08dd..b14c47b 100644
--- a/source/view_set_disk.h
+++ b/source/view_set_disk.h
@@ -35,6 +35,7 @@ typedef struct {
GtkWidget* cmbDeviceSetStatus;
GtkWidget* lblHeadQuotasEditDeviceWindow;
GtkWidget* boxBlockGuiAddEditDevice;
+ GtkWidget* boxBlockDisabledStatus;
char* name;
} view_device_set_window;
diff --git a/source/view_temp_u_g_p.c b/source/view_temp_u_g_p.c
index a296659..cefd227 100644
--- a/source/view_temp_u_g_p.c
+++ b/source/view_temp_u_g_p.c
@@ -339,6 +339,10 @@ void update_max_size_spin(GtkWidget *self, int* flag) {
for (int i = 0; i < get_device_vec()->vectorList.total; i++) {
device_config* _config = (device_config*)get_device_vec()->pfVectorGet(get_device_vec(), i);
if (strstr(str_disk, _config->name_disk)) {
+ if (self==temp_widgets->quotegroupSizeSoftLimitCombo)
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(temp_widgets->quotegroupSizeSoftLimitSpin),0.0);
+ else if (self==temp_widgets->quotegroupSizeHardLimitCombo)
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(temp_widgets->quotegroupSizeHardLimitSpin),0.0);
philos_set_spin_adjustment(temp_widgets->quotegroupSizeSoftLimitCheck,
temp_widgets->quotegroupSizeSoftLimitSpin,
temp_widgets->quotegroupSizeSoftLimitCombo, _config->size_disk);
diff --git a/ubl-settings-diskquota.glade b/ubl-settings-diskquota.glade
index 7e349b7..7407eaa 100644
--- a/ubl-settings-diskquota.glade
+++ b/ubl-settings-diskquota.glade
@@ -369,36 +369,76 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1
10
-