Library structure changes

pull/37/head
Ivan Dmitrievich Yartsev 11 months ago
parent 5997bb592a
commit ec880da212

@ -77,14 +77,9 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissin
add_library(${PROJECT_NAME} SHARED add_library(${PROJECT_NAME} SHARED
libublsettingsui-gtk3.c libublsettingsui-gtk3.c
libublsettingsui-gtk3-save.c libublsettingsui-gtk3-save.c
libublsettingsui-gtk3.h
${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C}) ${CMAKE_CURRENT_BINARY_DIR}/${GRESOURCE_C})
set(PUBLIC_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/include/libublsettingsui-gtk3.h
${CMAKE_CURRENT_SOURCE_DIR}/include/save-window/libublsettingsui-gtk3-save.h
${CMAKE_CURRENT_SOURCE_DIR}/include/strings/libublsettingsui-gtk3-strings.h
)
set(LIBRARIES set(LIBRARIES
${GTK_LIBRARIES} ${GTK_LIBRARIES}
${WEBKIT_LIBRARIES} ${WEBKIT_LIBRARIES}
@ -99,24 +94,18 @@ add_definitions(-DLIBUBLSETTINGSUI_VERSION=${VERSION})
message(STATUS ${VERSION}) message(STATUS ${VERSION})
message(${CMAKE_INSTALL_LIBDIR}) message(${CMAKE_INSTALL_LIBDIR})
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_BINARY_DIR} target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_BINARY_DIR})
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(${PROJECT_NAME} PUBLIC ${LIBRARIES}) target_link_libraries(${PROJECT_NAME} PUBLIC ${LIBRARIES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE C) set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE C)
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${PROJECT_VERSION}) set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${PROJECT_VERSION})
set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR}) set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR})
# set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER ${PROJECT_NAME}.h) set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER ${PROJECT_NAME}.h)
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}")
install(TARGETS ${PROJECT_NAME} install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
) )
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libublsettingsui-gtk3
)
# Set pkg-config file to install. # Set pkg-config file to install.

@ -1,28 +0,0 @@
#ifndef LIB_UBLSETTINGS_UI_SAVE
#define LIB_UBLSETTINGS_UI_SAVE
#include "libublsettingsui-gtk3.h"
typedef struct {
GtkWidget *Window;
GtkWidget *HeaderTopic;
GtkWidget *HeaderImage;
GtkWidget *StatusBox;
GtkWidget *ParametersTree;
GtkCellRenderer *ToggleCell;
GtkWidget *CancelButton;
GtkWidget *SaveButton;
GtkListStore *list;
GtkTreeModel *filteredModel;
GtkTreeViewColumn *OldValueColumn;
GtkCellRenderer *OldValueCell;
GtkTreeViewColumn *NewValueColumn;
GtkCellRenderer *NewValueCell;
YON_CONFIG_TYPE type;
char *custom_save_path;
} template_saving_window;
void yon_save_window_set_postsave_function(void *function, void *data);
template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...);
#endif

@ -1,72 +0,0 @@
#ifndef UBL_SETTINGS_UI_STRINGS
#define UBL_SETTINGS_UI_STRINGS
#define VERSION_LABEL yon_char_unite(_("Version:")," ",!yon_char_is_empty(template_app_information.app_version)?template_app_information.app_version:"","\n",NULL)
#define HELP_LABEL(rest) yon_char_unite(template_app_information.app_tech_name,_(" version:")," ", !yon_char_is_empty(template_app_information.app_version)?template_app_information.app_version:"","\n",template_app_information.app_title,"\n",_("Usage:"), " ",template_app_information.app_tech_name," ",_("[OPTIONS]"),"\n",_("Options:"),"\n\t--help, -h\t\t\t",_("Show this help"),"\n\t--version, -V\t\t\t",_("Show package version"),"\n\t--lock-help\t\t\t",_("Lock this help menu"),"\n\t--lock-save\t\t\t",_("Lock configuration saving"),"\n\t--lock-save-local\t\t",_("Lock local configration saving"),"\n\t--lock-save-global\t\t",_("Lock global configration saving"),"\n\t--lock-load-global\t\t",_("Lock global configration loading"),"\n\t--clear-config\t\t\t",_("Reset application settings"),"\n",!yon_char_is_empty(rest)?rest:NULL,NULL)
#define template_ui_LocalePath "/usr/share/locale"
#define template_ui_LocaleName "libublsettingsui-gtk3"
#define SUCCESS_LABEL _("Operation succeeded")
#define ROOT_WARNING_LABEL _("Warning! Application was launched without root - root-dependent actions are locked")
#define ABOUT_LABEL _("About")
#define DOCUMENTATION_LABEL _("Documentation")
#define SAVE_CUSTOM_LABEL _("Save to specific file")
#define SAVE_LOCAL_LABEL _("Save to local configuration")
#define SAVE_GLOBAL_LABEL _("Save to global configuration")
#define SAVE_CONFIGURATION_LABEL _("Save configuration")
#define SAVE_LABEL _("Save")
#define SAVE_PROCESS_LABEL _("Saving...")
#define LOAD_CUSTOM_LABEL _("Load from specific file")
#define LOAD_LOCAL_LABEL _("Load local configuration")
#define LOAD_GLOBAL_LABEL _("Load global configuration")
#define LOAD_LABEL _("Load")
#define CANCEL_LABEL _("Cancel")
#define ACCEPT_LABEL _("Accept")
#define OPEN_LABEL _("Open")
#define HELP_TITLE_LABEL _("Would you like to read documentation in the Web?")
#define HELP_INFO_LABEL _("You will be redirected to documentation website where documentation is\ntranslated and supported by community.")
#define HELP_ALWAYS_OPEN_LABEL _("Always redirect to online documentation")
#define OPEN_HELP_LABEL _("Open documentation")
#define PROJECT_HOME_LABEL _("Project Home Page")
#define NOTHING_CHOSEN_LABEL _("Nothing were chosen")
#define AUTHORS_LABEL _(L"Copyright © 2022 - 2023, UBSoft LLC")
#define GLOBAL_LOAD_SUCCESS_LABEL _("Global configuration loading succeeded.")
#define LOCAL_LOAD_SUCCESS_LABEL _("Local configuration loading succeeded.")
#define LOAD_FAILED_LABEL _("Config loading failed")
#define GLOBAL_LOCAL_SAVE_SUCCESS_LABEL _("Local and global configuration saving succeeded.")
#define GLOBAL_SAVE_SUCCESS_LABEL _("Global configuration saving succeeded.")
#define LOCAL_SAVE_SUCCESS_LABEL _("Local configuration saving succeeded.")
#define PARAMETER_LABEL _("Parameter")
#define OLD_VALUE_LABEL _("Old value")
#define NEW_VALUE_LABEL _("New value")
#define COMPARE_VALUE_LABEL _("Value\n(Old/New)")
#define NOTHING_TO_SAVE_LABEL _("Nothing to save")
#define SAVING_LOCAL_STATE_LABEL _("Saving into local configuration")
#define SAVING_GLOBAL_STATE_LABEL _("Saving into global configuration")
#define SAVING_GLOBAL_LOCAL_STATE_LABEL _("Saving into global and local configuration")
#define SAVING_CUSTOM_STATE_LABEL(target_path) yon_char_unite(_("Saving into custom configuration at")," ",target_path,NULL)
#define SYSTEMBOOT_STATEMODE "SYSTEMBOOT_STATEMODE"
#define SYSTEMBOOT_STATEMODE_SECTION "[system]"
#define SAVE_MODE_FULL_LABEL _("Full saving mode")
#define SAVE_MODE_MODULE_LABEL _("Saving into module")
#define SAVE_MODE_SANDBOX_LABEL _("Sandbox mode")
#define SAVE_MODE_RAM_HOME_LABEL _("Sandbox with profile saving")
#define SAVE_MODE_HDD_LABEL _("HDD sandbox")
#define SAVE_MODE_HDD_HOME_LABEL _("HDD sandbox with profile saving")
#define CUSTOM_CONFIG_CREATION_ERROR_LABEL _("New configuration file creation failed")
#define ROOT_CHECK_LABEL _("Upgrade to root")
#define SETTINGS_TITLE_LABEL _("Settings")
#endif

@ -1,4 +1,3 @@
#include "save-window/libublsettingsui-gtk3-save.h"
#include "libublsettingsui-gtk3.h" #include "libublsettingsui-gtk3.h"
struct loaded_config { struct loaded_config {
@ -141,7 +140,7 @@ config_str yon_loaded_config_convert_to_save_command(struct loaded_config *targe
for_dictionaries(current,target){ for_dictionaries(current,target){
dictionary *cur_section=NULL; dictionary *cur_section=NULL;
if (sections&&(cur_section=yon_dictionary_get(&sections,current->section))){ if (sections&&(cur_section=yon_dictionary_get(&sections,current->section))){
char *temp = yon_char_unite((char*)cur_section->data," ", current->key,"='",(char*)current->data,"'",NULL); char *temp = yon_char_unite((char*)cur_section->data," ", current->key,"=\'",(char*)current->data,"\'",NULL);
free(current->data); free(current->data);
current->data = temp; current->data = temp;
} else { } else {

@ -4,8 +4,6 @@
#include <gtk/gtkx.h> #include <gtk/gtkx.h>
#include <libublsettings.h> #include <libublsettings.h>
#include <libublsettings-gtk3.h> #include <libublsettings-gtk3.h>
#include "save-window/libublsettingsui-gtk3-save.h"
#include "strings/libublsettingsui-gtk3-strings.h"
#include <vte/vte.h> #include <vte/vte.h>
#include <locale.h> #include <locale.h>
#include <stdio.h> #include <stdio.h>
@ -222,4 +220,98 @@ void yon_gtk_scrolled_window_set_horizontal_at_desired_size(GtkWidget *window, G
template_app_info yon_ubl_get_app_info(); template_app_info yon_ubl_get_app_info();
typedef struct {
GtkWidget *Window;
GtkWidget *HeaderTopic;
GtkWidget *HeaderImage;
GtkWidget *StatusBox;
GtkWidget *ParametersTree;
GtkCellRenderer *ToggleCell;
GtkWidget *CancelButton;
GtkWidget *SaveButton;
GtkListStore *list;
GtkTreeModel *filteredModel;
GtkTreeViewColumn *OldValueColumn;
GtkCellRenderer *OldValueCell;
GtkTreeViewColumn *NewValueColumn;
GtkCellRenderer *NewValueCell;
YON_CONFIG_TYPE type;
char *custom_save_path;
} template_saving_window;
void yon_save_window_set_postsave_function(void *function, void *data);
template_saving_window *yon_save_proceed(char *path,YON_CONFIG_TYPE type, ...);
#define VERSION_LABEL yon_char_unite(_("Version:")," ",!yon_char_is_empty(template_app_information.app_version)?template_app_information.app_version:"","\n",NULL)
#define HELP_LABEL(rest) yon_char_unite(template_app_information.app_tech_name,_(" version:")," ", !yon_char_is_empty(template_app_information.app_version)?template_app_information.app_version:"","\n",template_app_information.app_title,"\n",_("Usage:"), " ",template_app_information.app_tech_name," ",_("[OPTIONS]"),"\n",_("Options:"),"\n\t--help, -h\t\t\t",_("Show this help"),"\n\t--version, -V\t\t\t",_("Show package version"),"\n\t--lock-help\t\t\t",_("Lock this help menu"),"\n\t--lock-save\t\t\t",_("Lock configuration saving"),"\n\t--lock-save-local\t\t",_("Lock local configration saving"),"\n\t--lock-save-global\t\t",_("Lock global configration saving"),"\n\t--lock-load-global\t\t",_("Lock global configration loading"),"\n\t--clear-config\t\t\t",_("Reset application settings"),"\n",!yon_char_is_empty(rest)?rest:NULL,NULL)
#define template_ui_LocalePath "/usr/share/locale"
#define template_ui_LocaleName "libublsettingsui-gtk3"
#define SUCCESS_LABEL _("Operation succeeded")
#define ROOT_WARNING_LABEL _("Warning! Application was launched without root - root-dependent actions are locked")
#define ABOUT_LABEL _("About")
#define DOCUMENTATION_LABEL _("Documentation")
#define SAVE_CUSTOM_LABEL _("Save to specific file")
#define SAVE_LOCAL_LABEL _("Save to local configuration")
#define SAVE_GLOBAL_LABEL _("Save to global configuration")
#define SAVE_CONFIGURATION_LABEL _("Save configuration")
#define SAVE_LABEL _("Save")
#define SAVE_PROCESS_LABEL _("Saving...")
#define LOAD_CUSTOM_LABEL _("Load from specific file")
#define LOAD_LOCAL_LABEL _("Load local configuration")
#define LOAD_GLOBAL_LABEL _("Load global configuration")
#define LOAD_LABEL _("Load")
#define CANCEL_LABEL _("Cancel")
#define ACCEPT_LABEL _("Accept")
#define OPEN_LABEL _("Open")
#define HELP_TITLE_LABEL _("Would you like to read documentation in the Web?")
#define HELP_INFO_LABEL _("You will be redirected to documentation website where documentation is\ntranslated and supported by community.")
#define HELP_ALWAYS_OPEN_LABEL _("Always redirect to online documentation")
#define OPEN_HELP_LABEL _("Open documentation")
#define PROJECT_HOME_LABEL _("Project Home Page")
#define NOTHING_CHOSEN_LABEL _("Nothing were chosen")
#define AUTHORS_LABEL _(L"Copyright © 2022 - 2023, UBSoft LLC")
#define GLOBAL_LOAD_SUCCESS_LABEL _("Global configuration loading succeeded.")
#define LOCAL_LOAD_SUCCESS_LABEL _("Local configuration loading succeeded.")
#define LOAD_FAILED_LABEL _("Config loading failed")
#define GLOBAL_LOCAL_SAVE_SUCCESS_LABEL _("Local and global configuration saving succeeded.")
#define GLOBAL_SAVE_SUCCESS_LABEL _("Global configuration saving succeeded.")
#define LOCAL_SAVE_SUCCESS_LABEL _("Local configuration saving succeeded.")
#define PARAMETER_LABEL _("Parameter")
#define OLD_VALUE_LABEL _("Old value")
#define NEW_VALUE_LABEL _("New value")
#define COMPARE_VALUE_LABEL _("Value\n(Old/New)")
#define NOTHING_TO_SAVE_LABEL _("Nothing to save")
#define SAVING_LOCAL_STATE_LABEL _("Saving into local configuration")
#define SAVING_GLOBAL_STATE_LABEL _("Saving into global configuration")
#define SAVING_GLOBAL_LOCAL_STATE_LABEL _("Saving into global and local configuration")
#define SAVING_CUSTOM_STATE_LABEL(target_path) yon_char_unite(_("Saving into custom configuration at")," ",target_path,NULL)
#define SYSTEMBOOT_STATEMODE "SYSTEMBOOT_STATEMODE"
#define SYSTEMBOOT_STATEMODE_SECTION "[system]"
#define SAVE_MODE_FULL_LABEL _("Full saving mode")
#define SAVE_MODE_MODULE_LABEL _("Saving into module")
#define SAVE_MODE_SANDBOX_LABEL _("Sandbox mode")
#define SAVE_MODE_RAM_HOME_LABEL _("Sandbox with profile saving")
#define SAVE_MODE_HDD_LABEL _("HDD sandbox")
#define SAVE_MODE_HDD_HOME_LABEL _("HDD sandbox with profile saving")
#define CUSTOM_CONFIG_CREATION_ERROR_LABEL _("New configuration file creation failed")
#define ROOT_CHECK_LABEL _("Upgrade to root")
#define SETTINGS_TITLE_LABEL _("Settings")
#endif #endif
Loading…
Cancel
Save