diff --git a/icons/actions/com.ublinux.libublsettingsui-gtk3.down-symbolic.svg b/icons/actions/com.ublinux.libublsettingsui-gtk3.down-symbolic.svg new file mode 100644 index 0000000..aae7004 --- /dev/null +++ b/icons/actions/com.ublinux.libublsettingsui-gtk3.down-symbolic.svg @@ -0,0 +1,37 @@ + + + + + + + diff --git a/icons/actions/com.ublinux.libublsettingsui-gtk3.pause-symbolic.svg b/icons/actions/com.ublinux.libublsettingsui-gtk3.pause-symbolic.svg new file mode 100644 index 0000000..831dd0a --- /dev/null +++ b/icons/actions/com.ublinux.libublsettingsui-gtk3.pause-symbolic.svg @@ -0,0 +1,55 @@ + + + + + + + + + + + diff --git a/icons/actions/com.ublinux.libublsettingsui-gtk3.up-symbolic.svg b/icons/actions/com.ublinux.libublsettingsui-gtk3.up-symbolic.svg new file mode 100644 index 0000000..1a1d8ed --- /dev/null +++ b/icons/actions/com.ublinux.libublsettingsui-gtk3.up-symbolic.svg @@ -0,0 +1,37 @@ + + + + + + + diff --git a/icons/status/com.ublinux.libublsettingsui-gtk3.checkbox-attention-symbolic.svg b/icons/status/com.ublinux.libublsettingsui-gtk3.checkbox-attention-symbolic.svg new file mode 100644 index 0000000..38ef542 --- /dev/null +++ b/icons/status/com.ublinux.libublsettingsui-gtk3.checkbox-attention-symbolic.svg @@ -0,0 +1,152 @@ + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + + + + Gnome Symbolic Icon Theme + + + + + + + + + + + + + + diff --git a/icons/status/com.ublinux.libublsettingsui-gtk3.checkbox-checked-symbolic.svg b/icons/status/com.ublinux.libublsettingsui-gtk3.checkbox-checked-symbolic.svg new file mode 100644 index 0000000..afeca62 --- /dev/null +++ b/icons/status/com.ublinux.libublsettingsui-gtk3.checkbox-checked-symbolic.svg @@ -0,0 +1,148 @@ + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + + + + Gnome Symbolic Icon Theme + + + + + + + + + + + + + + diff --git a/icons/status/com.ublinux.libublsettingsui-gtk3.checkbox-symbolic.svg b/icons/status/com.ublinux.libublsettingsui-gtk3.checkbox-symbolic.svg new file mode 100644 index 0000000..88400f8 --- /dev/null +++ b/icons/status/com.ublinux.libublsettingsui-gtk3.checkbox-symbolic.svg @@ -0,0 +1,142 @@ + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + + + + Gnome Symbolic Icon Theme + + + + + + + + + + + + + diff --git a/libublsettingsui-gtk3-app-chooser.glade b/libublsettingsui-gtk3-app-chooser.glade index bf8e48b..4d75105 100644 --- a/libublsettingsui-gtk3-app-chooser.glade +++ b/libublsettingsui-gtk3-app-chooser.glade @@ -174,7 +174,6 @@ True False - True True diff --git a/libublsettingsui-gtk3-service-control.glade b/libublsettingsui-gtk3-service-control.glade index fc2eb74..daae9cb 100644 --- a/libublsettingsui-gtk3-service-control.glade +++ b/libublsettingsui-gtk3-service-control.glade @@ -282,7 +282,7 @@ 5 - Disable + Disable autolaunch True True True @@ -297,7 +297,7 @@ - Enable + Enable autolaunch True True True diff --git a/libublsettingsui-gtk3.pot b/libublsettingsui-gtk3.pot index d4e06d4..ba54224 100644 --- a/libublsettingsui-gtk3.pot +++ b/libublsettingsui-gtk3.pot @@ -352,11 +352,11 @@ msgid "Restart" msgstr "" #: source/libublsettingsui-gtk3.h:486 -msgid "Enable" +msgid "Enable autolaunch" msgstr "" #: source/libublsettingsui-gtk3.h:487 -msgid "Disable" +msgid "Disable autolaunch" msgstr "" #: source/libublsettingsui-gtk3.h:489 diff --git a/libublsettingsui-gtk3_ru.po b/libublsettingsui-gtk3_ru.po index 67811f7..79ec1ef 100644 --- a/libublsettingsui-gtk3_ru.po +++ b/libublsettingsui-gtk3_ru.po @@ -359,17 +359,17 @@ msgid "Restart" msgstr "Перезапустить" #: source/libublsettingsui-gtk3.h:486 -msgid "Enable" +msgid "Enable autolaunch" msgstr "Включить автозапуск" #: source/libublsettingsui-gtk3.h:487 -msgid "Disable" -msgstr "Отключить" +msgid "Disable autolaunch" +msgstr "Отключить автозапуск" #: source/libublsettingsui-gtk3.h:489 #, c-format msgid "\"%s\" service configuration" -msgstr "Управление сервисом \"%s\"" +msgstr "Управление службой \"%s\"" #: source/libublsettingsui-gtk3.h:490 #, c-format diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 0b2b0e7..9aeefed 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -77,7 +77,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissin -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \ -fstack-clash-protection -fcf-protection") - add_library(${PROJECT_NAME} SHARED libublsettingsui-gtk3.c libublsettingsui-gtk3-save.c diff --git a/source/libublsettingsui-gtk3-app-chooser.c b/source/libublsettingsui-gtk3-app-chooser.c index a005eae..389acc1 100644 --- a/source/libublsettingsui-gtk3-app-chooser.c +++ b/source/libublsettingsui-gtk3-app-chooser.c @@ -61,15 +61,18 @@ int yon_app_chooser_convert_apps(yon_app_chooser_window *window){ window->apps_convert = NULL; for (int i=0;iapps_size;i++){ if (g_key_file_load_from_file(file,window->apps[i],G_KEY_FILE_KEEP_TRANSLATIONS,NULL)){ + char *exec_temp = yon_char_new(window->apps[i]); + free(yon_char_divide(exec_temp,yon_char_find_last(exec_temp,'/'))); struct application *app = new(struct application); memset(app,0,sizeof(struct application)); app->name = g_key_file_get_locale_string(file,"Desktop Entry","Name",setlocale(LC_ALL,NULL),NULL); app->description = g_key_file_get_locale_string(file,"[Desktop Entry","Comment",setlocale(LC_ALL,NULL),NULL); app->tags = g_key_file_get_string(file,"Desktop Entry","Categories",NULL); - app->execute = g_key_file_get_string(file,"Desktop Entry","Exec",NULL); + app->execute = yon_char_divide(exec_temp,yon_char_find_last(exec_temp,'.')); app->icon = g_key_file_get_string(file,"Desktop Entry","Icon",NULL); app->path = yon_char_new(window->apps[i]); yon_dictionary_add_or_create_if_exists_with_data(window->apps_convert,app->name,app); + free(exec_temp); } } if (window->apps_convert) return 1; else return 0; @@ -137,7 +140,7 @@ void on_app_chooser_accept(GtkWidget *, yon_app_chooser_window *window){ for_iter(model,&iter){ int status; char *name; - gtk_tree_model_get(GTK_TREE_MODEL(window->treestore),&iter,0,&status,1,&name,-1); + gtk_tree_model_get(GTK_TREE_MODEL(window->treestore),&iter,0,&status,6,&name,-1); if (status){ yon_char_parsed_add_or_create_if_exists(window->final->chosen_apps,&window->final->size,name); } @@ -152,6 +155,19 @@ void on_app_chooser_accept(GtkWidget *, yon_app_chooser_window *window){ gtk_widget_destroy(window->MainWindow); } +int yon_app_chooser_window_select(yon_app_chooser_window *window,config_str selection,int size){ + GtkTreeIter iter; + for(int i=0;itreestore),&iter){ + char *target; + gtk_tree_model_get(GTK_TREE_MODEL(window->treestore),&iter,6,&target,-1); + if (!yon_char_is_empty(target)&&!yon_char_is_empty(selection[i])&&!strcmp(target,selection[i])){ + gtk_tree_store_set(window->treestore,&iter,0,1,-1); + } + } + } +} + yon_app_chooser_window *yon_app_chooser_window_new(int multiple_choise){ yon_app_chooser_window *window = new(yon_app_chooser_window); GtkBuilder *builder = gtk_builder_new_from_resource(ui_glade_path_app_chooser); diff --git a/source/libublsettingsui-gtk3-save.c b/source/libublsettingsui-gtk3-save.c index 9cac806..109a2e0 100644 --- a/source/libublsettingsui-gtk3-save.c +++ b/source/libublsettingsui-gtk3-save.c @@ -106,9 +106,21 @@ config_str yon_loaded_config_convert_to_save_command(struct loaded_config *targe } else { parameters_for_current_command = yon_char_unite(current->key,"=\'",(char*)current->data,"\'",NULL); } - dictionary *sections_dict = (dictionary*)sections; - yon_dictionary_add_or_create_if_exists_with_data(sections_dict,current->section,parameters_for_current_command); - sections = realloc(sections_dict,sizeof(struct yon_temp_command_sections)); + dictionary *sections_dict = NULL; + if (sections) sections_dict = yon_dictionary_get_last((dictionary*)sections); + sections = malloc(sizeof(struct yon_temp_command_sections)); + sections->data=parameters_for_current_command; + sections->first=sections; + sections->key=yon_char_new(current->section); + sections->next=NULL; + sections->prev=NULL; + sections->status=0; + if (sections_dict){ + sections_dict->next = (dictionary*)sections; + sections->prev=(struct yon_temp_command_sections*)sections_dict; + sections->first=(struct yon_temp_command_sections*)sections_dict->first; + } + // yon_dictionary_add_or_create_if_exists_with_data(sections_dict,current->section,parameters_for_current_command); sections->status=yon_config_get_status(current->key); } diff --git a/source/libublsettingsui-gtk3-standard-callbacks.c b/source/libublsettingsui-gtk3-standard-callbacks.c index 75bda32..41236ed 100644 --- a/source/libublsettingsui-gtk3-standard-callbacks.c +++ b/source/libublsettingsui-gtk3-standard-callbacks.c @@ -105,7 +105,7 @@ void yon_ubl_settings_window_set_standard_callbacks(template_main_window *widget } if (!yon_char_is_empty(get_global_command)){ g_signal_connect(G_OBJECT(widgets->LoadCustomMenuItem),"activate",G_CALLBACK(__on_config_custom_load),NULL); - g_signal_connect(G_OBJECT(widgets->SaveCustomMenuItem),"activate",G_CALLBACK(__on_config_custom_load),NULL); + g_signal_connect(G_OBJECT(widgets->SaveCustomMenuItem),"activate",G_CALLBACK(__on_config_custom_save),NULL); config_get_custom_command = yon_char_new(get_custom_command); config_set_custom_command = yon_char_replace_single(get_custom_command,"get","set"); } diff --git a/source/libublsettingsui-gtk3.c b/source/libublsettingsui-gtk3.c index 43e1a0d..ae7b9f4 100644 --- a/source/libublsettingsui-gtk3.c +++ b/source/libublsettingsui-gtk3.c @@ -527,7 +527,7 @@ void __yon_config_init(){ template_config->lock_load_global=0; template_config->lock_save_global=0; template_config->lock_save_local=0; - template_config->load_mode=1; + template_config->load_mode=YON_CONFIG_LOCAL; } template_main_window *yon_ubl_window_setup(){ @@ -543,7 +543,7 @@ template_main_window *yon_ubl_window_setup(){ yon_ubl_status_box_render(LOCAL_LOAD_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); } textdomain(template_app_information.app_locale); - template_config->load_mode=1; + template_config->load_mode=YON_CONFIG_LOCAL; if(template_config) yon_ubl_setup_sockets(widgets->PlugBox,widgets->LeftBox,widgets->RightBox,template_config->socket_id,template_config->load_socket_id,template_config->save_socket_id); yon_window_config_setup(GTK_WINDOW(widgets->Window)); diff --git a/source/libublsettingsui-gtk3.h b/source/libublsettingsui-gtk3.h index 822bf0b..fec78cf 100644 --- a/source/libublsettingsui-gtk3.h +++ b/source/libublsettingsui-gtk3.h @@ -384,6 +384,7 @@ service_window *yon_service_window_new(char *name, char *start_command, char *check_active_command, char *check_enable_command); void yon_service_window_run(service_window *window); +int yon_app_chooser_window_select(yon_app_chooser_window *window,config_str selection,int size); config_str yon_app_chooser_window_run(yon_app_chooser_window *window, int *size); yon_app_chooser_window *yon_app_chooser_window_new(int multiple_choise); @@ -497,8 +498,9 @@ yon_app_chooser_window *yon_app_chooser_window_new(int multiple_choise); #define _SERVICE_START_BUTTON_LABEL _("Start") #define _SERVICE_STOP_BUTTON_LABEL _("Stop") #define _SERVICE_RESTART_BUTTON_LABEL _("Restart") - #define _SERVICE_ENABLE_BUTTON_LABEL _("Enable") - #define _SERVICE_DISABLE_BUTTON_LABEL _("Disable") + + #define _SERVICE_ENABLE_BUTTON_LABEL _("Enable autolaunch") + #define _SERVICE_DISABLE_BUTTON_LABEL _("Disable autolaunch") #define _SERVICE_HEAD_LABEL(target) g_strdup_printf(yon_char_get_localised_from_lib(_("\"%s\" service configuration")), target) #define _SERVICE_TITLE_LABEL(target) g_strdup_printf(yon_char_get_localised_from_lib(_("\"%s\" service:")), target)