diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57ab3b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.vscode/ +ubl-settings-update.glade~ +ubl-settings-update +ubl-settings-update_ru.po~ +build/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..aef26b5 --- /dev/null +++ b/Makefile @@ -0,0 +1,159 @@ +#!/usr/bin/make -f + +#SHELL := /bin/bash +MAKEFILE_FILEPATH := $(abspath $(lastword $(MAKEFILE_LIST))) +MAKEFILE_DIR := $(notdir $(patsubst %/,%,$(dir $(MAKEFILE_FILEPATH)))) +MAKEFILE_PATH := $(dir $(MAKEFILE_FILEPATH)) + +CMAKE_COMMAND = cmake +CMAKE_SOURCE_DIR = $(MAKEFILE_PATH)source +CMAKE_BUILD_DIR = $(MAKEFILE_PATH)compile +#CMAKE_SOURCE_DIR = ./source +#CMAKE_BUILD_DIR = ./compile +FILE_VERSION = VERSION.md +DEPENDS = /bin/cmake +PREFIX ?= /usr +PKGNAME = $(MAKEFILE_DIR) +#PKGNAME = ubl-settings-manager + +default_target: all + +.PHONY: all init depend debug prepare check build uninstall install clean up_ver help + +all: init build + +init: + @echo "Initialize ..."; \ + sed -r "s/(version_application = ).*/\1\"$$(grep 'VERSION' ${FILE_VERSION} | cut -d" " -f2)\";/" -i source/ubl-settings-update.h; \ + echo "-- Build path: ${CMAKE_BUILD_DIR}" + +depend: + @echo "Check depends ..." + @for FILE_DEPEND in $(DEPENDS); do \ + if [ ! -f $${FILE_DEPEND} ]; then \ + echo "ERROR: Depend '$${FILE_DEPEND}' not found !"; \ + exit 1; \ + fi; \ + done; \ + echo "Check depends: OK" +# $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 + +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}"; \ + fi; \ + echo "Debug: OK" + +prepare: + @echo "Prepare ..."; \ + if [ ! -d ${CMAKE_BUILD_DIR} ]; then \ + $(CMAKE_COMMAND) -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}"; \ + fi; \ + echo "Prepare: OK" + +check: + @echo "Check ..."; \ + if [ -f ${CMAKE_BUILD_DIR}/${PKGNAME} ]; then \ + echo "Check: OK"; \ + else \ + echo "Check: ${CMAKE_BUILD_DIR}/${PKGNAME} not found !"; \ + exit 1; \ + fi + +build: depend prepare + @echo "Build ..."; \ + make --directory=${CMAKE_BUILD_DIR}; \ + echo "Build: OK" + +uninstall: + @echo "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}"; \ + $(RM) "$${PATH_FILE_MO}"; \ + done + @for SIZE in 16x16 32x32 48x48 scalable; do \ + $(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}/apps/com.ublinux.${PKGNAME}.svg"; \ + $(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}/apps/com.ublinux.${PKGNAME}.png"; \ + done + @for FILE_SVG in $(wildcard *.svg); do \ + for SIZE in 16x16 32x32 48x48 scalable; do \ + $(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}/status/$${FILE_SVG%.*}".{svg,png,jpg}; \ + done; \ + done + @$(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) -rd "${DESTDIR}${PREFIX}/share/${PKGNAME}/images/${PKGNAME}-banner.png" + @$(RM) -rd "${DESTDIR}${PREFIX}/share/${PKGNAME}" + @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 "Uninstall: OK" + +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"; \ + FILE_MO=$${FILE_PO##*/}; FILE_MO="$${FILE_MO%_*.po}.mo"; \ + PATH_FILE_MO="${DESTDIR}${PREFIX}/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \ + echo "$${FILE_PO}"; \ + msgfmt "$${FILE_PO}" -v -f -o "$${PATH_FILE_MO}"; \ + done + @for SIZE in 16 32 48; do \ + 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 -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 -dm755 "${DESTDIR}${PREFIX}/share/${PKGNAME}"/{ui,css,images} + @install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/ui/" "${PKGNAME}.glade" + @install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/css/" "${PKGNAME}.css" + @install -dm755 -d "${DESTDIR}${PREFIX}/share/${PKGNAME}/images" + @install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/images/" "${PKGNAME}-banner.png" + @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" + @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" + +clean: + @echo "Clean ..." + @$(RM) -rd ${CMAKE_BUILD_DIR} + @if [ -d ${CMAKE_BUILD_DIR} ]; then \ + echo "Clean: error, compile directory exist ${CMAKE_BUILD_DIR}"; \ + else \ + echo "Clean: OK"; \ + fi + +up_ver: + @CURRENT=$$(grep 'VERSION' ${FILE_VERSION} | cut -d" " -f2); \ + MAJOR=$$(cut -d. -f1 <<< $${CURRENT}); \ + MINOR=$$(cut -d. -f2 <<< $${CURRENT}); \ + VER="$${MAJOR}.$$(($${MINOR}+1))"; \ + sed "s/VERSION *[[:digit:]]*.*/VERSION $${VER}/" -i ${FILE_VERSION}; \ + echo "Updated version to VERSION.md: $${CURRENT} to $${VER}" + +help: + @echo "The following are some of the valid targets for this Makefile:"; \ + echo "... all (the default if no target is provided)"; \ + echo "... init"; \ + echo "... debug"; \ + echo "... prepare"; \ + echo "... compile"; \ + echo "... install"; \ + echo "... uninstall"; \ + echo "... clean"; \ + echo "... up_ver" diff --git a/README.md b/README.md index 35f3e4e..7055ab1 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,28 @@ # ubl-settings-update +# Выполнить +# Build +In order to build ubl-settings-manager you will need: + +- CMake +- C compiler +- GTK+ 3 & dependencies + +Once you have all the necessary dependencies, you can use: +```sh +$ make +``` + +# Installation +After a successful build, just use: +```sh +$ sudo make install clean +``` + +# Uninstallation +After a successful build, just use: +```sh +$ sudo make uninstall +``` + +![alt text](screenshot/screenshot.png) diff --git a/VERSION.md b/VERSION.md new file mode 100644 index 0000000..31c5941 --- /dev/null +++ b/VERSION.md @@ -0,0 +1 @@ +VERSION 1.2 diff --git a/com.ublinux.ubl-settings-update.checked.svg b/com.ublinux.ubl-settings-update.checked.svg new file mode 100644 index 0000000..e3cab42 --- /dev/null +++ b/com.ublinux.ubl-settings-update.checked.svg @@ -0,0 +1,327 @@ + + + + + + + + + + + + + + + + diff --git a/com.ublinux.ubl-settings-update.svg b/com.ublinux.ubl-settings-update.svg new file mode 100644 index 0000000..f636c26 --- /dev/null +++ b/com.ublinux.ubl-settings-update.svg @@ -0,0 +1,4957 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.ublinux.ubl-settings-update.warning.svg b/com.ublinux.ubl-settings-update.warning.svg new file mode 100644 index 0000000..9a90dba --- /dev/null +++ b/com.ublinux.ubl-settings-update.warning.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt new file mode 100644 index 0000000..b961ad3 --- /dev/null +++ b/source/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.7) +project(ubl-settings-update) + +find_package(PkgConfig REQUIRED) + +pkg_check_modules(GTK REQUIRED gtk+-3.0) +include_directories(${GTK_INCLUDE_DIRS}) +link_directories(${GTK_LIBRARY_DIRS}) +add_definitions(${GTK_CFLAGS_OTHER}) + +#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a") +#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -lm") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \ + -O2 -pipe -fno-plt -fexceptions \ + -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \ + -fstack-clash-protection -fcf-protection") + +set(SOURCE_FILES + ubl-settings-update.c + ubl-settings-update.h + ubl-utils.c) + +set(LIBRARIES + ${GTK_LIBRARIES} + pthread) + + +add_executable(ubl-settings-update ${SOURCE_FILES}) +target_link_libraries(ubl-settings-update ${LIBRARIES}) +install(TARGETS ubl-settings-update DESTINATION bin) \ No newline at end of file diff --git a/source/ubl-settings-update.c b/source/ubl-settings-update.c new file mode 100644 index 0000000..0ee60fc --- /dev/null +++ b/source/ubl-settings-update.c @@ -0,0 +1,190 @@ +#include +#include "ubl-settings-update.h" + +void on_repo_window_open(GtkWidget *self){ + repo_window *widgets=setup_repo_window(); +} + +void on_close_subwindow(GtkWidget *self){ + gtk_widget_destroy(gtk_widget_get_toplevel(self)); +} + +void on_about(){ + GtkBuilder *builder=gtk_builder_new_from_file(glade_path); + GtkWidget *window=yon_gtk_builder_get_widget(builder,"AboutWindow"); + GtkWidget *hideButtonBox=yon_gtk_builder_get_widget(builder,"buttonBoxHide"); + gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(window),_("UBlinux System update")); + gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(window),version_application); + gtk_about_dialog_set_website_label(GTK_ABOUT_DIALOG(window),_("Project Home Page")); + gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(window),_("Update configurator")); + gtk_widget_set_visible(hideButtonBox,0); + gtk_widget_show(window); +} + +repo_window *setup_repo_window(){ + repo_window *widgets=NULL; + widgets=malloc(sizeof(repo_window)); + widgets->builder= gtk_builder_new_from_file(glade_path); + widgets->window=yon_gtk_builder_get_widget(widgets->builder, "RepoWindow"); + + widgets->repoTypeLabel=yon_gtk_builder_get_widget(widgets->builder, "repoTypeLabel"); + widgets->repoTypeEntry=yon_gtk_builder_get_widget(widgets->builder, "repoTypeEntry"); + widgets->repoURILabel=yon_gtk_builder_get_widget(widgets->builder, "repoURILabel"); + widgets->repoURIMeanLabel=yon_gtk_builder_get_widget(widgets->builder, "repoURIMeanLabel"); + widgets->repoDistributionLabel=yon_gtk_builder_get_widget(widgets->builder, "repoDistributionLabel"); + widgets->repoDistributionMeanLabel=yon_gtk_builder_get_widget(widgets->builder, "repoDistributionMeanLabel"); + widgets->repoSectionsLabel=yon_gtk_builder_get_widget(widgets->builder, "repoSectionsLabel"); + widgets->repoSectionsMeanlabel=yon_gtk_builder_get_widget(widgets->builder, "repoSectionsMeanlabel"); + + widgets->repoCancelButton=yon_gtk_builder_get_widget(widgets->builder, "repoCancelButton"); + widgets->repoAcceptButton=yon_gtk_builder_get_widget(widgets->builder, "repoAcceptButton"); + + g_signal_connect(G_OBJECT(widgets->repoCancelButton), "clicked", G_CALLBACK(on_close_subwindow), NULL); + g_signal_connect(G_OBJECT(widgets->repoAcceptButton), "clicked", G_CALLBACK(on_close_subwindow), NULL); + + + gtk_window_set_title(GTK_WINDOW(widgets->window),_("System update")); + + gtk_label_set_text(GTK_LABEL(widgets->repoTypeLabel),_("Type: ")); + gtk_label_set_text(GTK_LABEL(widgets->repoURILabel),_("URI: ")); + gtk_label_set_text(GTK_LABEL(widgets->repoURIMeanLabel),_(" ")); + gtk_label_set_text(GTK_LABEL(widgets->repoDistributionLabel),_("Distribution: ")); + gtk_label_set_text(GTK_LABEL(widgets->repoDistributionMeanLabel),_(" ")); + gtk_label_set_text(GTK_LABEL(widgets->repoSectionsLabel),_("Sections: ")); + gtk_label_set_text(GTK_LABEL(widgets->repoSectionsMeanlabel),_(" ")); + + gtk_button_set_label(GTK_BUTTON(widgets->repoCancelButton),_("Cancel")); + gtk_button_set_label(GTK_BUTTON(widgets->repoAcceptButton),_("Save")); + gtk_widget_show_all(widgets->window); +} + +main_window *setup_window(){ + main_window *widgets=NULL; + widgets=malloc(sizeof(main_window)); + widgets->builder=gtk_builder_new_from_file(glade_path); + widgets->window=yon_gtk_builder_get_widget(widgets->builder,"MainWindow"); + + widgets->HeaderTopic=yon_gtk_builder_get_widget(widgets->builder,"headerTopic"); + + widgets->generalSettingsTabLabel=yon_gtk_builder_get_widget(widgets->builder,"generalTabLabel"); + widgets->repositoriesSettingsTabLabel=yon_gtk_builder_get_widget(widgets->builder,"repositoriesTabLabel"); + widgets->extraSettingsTabLabel=yon_gtk_builder_get_widget(widgets->builder,"extraTabLabel"); + + widgets->generalSettingsHideNoUpdatesCheck=yon_gtk_builder_get_widget(widgets->builder,"hideIfNoUpdatesCheck"); + widgets->generalSettingsUpdatesCheckFreqLabel=yon_gtk_builder_get_widget(widgets->builder,"UpdateCheckFreqLabel"); + widgets->generalSettingsUpdatesCheckFreqCombo=yon_gtk_builder_get_widget(widgets->builder,"UpdateCheckFreqCombo"); + widgets->generalSettingsDownloadAutoCheck=yon_gtk_builder_get_widget(widgets->builder,"DownloadAutoCheck"); + + widgets->repositoriesSettingsActivateAURCheck=yon_gtk_builder_get_widget(widgets->builder,"AcivateAURCheck"); + widgets->repositoriesSettingsActivateUBURCheck=yon_gtk_builder_get_widget(widgets->builder,"AcivateUBURCheck"); + widgets->repositoriesSettingsMoveUpButton=yon_gtk_builder_get_widget(widgets->builder,"MoveUpButton"); + widgets->repositoriesSettingsMoveDownButton=yon_gtk_builder_get_widget(widgets->builder,"MoveDownButton"); + widgets->repositoriesSettingsCreateButton=yon_gtk_builder_get_widget(widgets->builder,"CreateButton"); + widgets->repositoriesSettingsEditButton=yon_gtk_builder_get_widget(widgets->builder,"EditButton"); + widgets->repositoriesSettingsDeleteButton=yon_gtk_builder_get_widget(widgets->builder,"DeleteButton"); + widgets->repositoriesSettingsRepositoriesTreeView=yon_gtk_builder_get_widget(widgets->builder,"RepositoriesTreeView"); + widgets->repositoriesSettingsEnabledColumn=GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder,"EnabledColumn")); + widgets->repositoriesSettingsURIColumn=GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(widgets->builder,"URIColumn")); + + widgets->extraSettingsPackageManagerLabel=yon_gtk_builder_get_widget(widgets->builder,"PackageManagerLabel"); + widgets->extraSettingsPackageManagerEntry=yon_gtk_builder_get_widget(widgets->builder,"PackageManagerEntry"); + widgets->extraSettingsUpdateCommandLabel=yon_gtk_builder_get_widget(widgets->builder,"UpdateCommandLabel"); + widgets->extraSettingsUpdateCommandEntry=yon_gtk_builder_get_widget(widgets->builder,"UpdateCommandEntry"); + widgets->extraSettingsCacheCleanlabel=yon_gtk_builder_get_widget(widgets->builder,"CleanCommandLabel"); + widgets->extraSettingsCacheCleanEntry=yon_gtk_builder_get_widget(widgets->builder,"CleanCommandEntry"); + widgets->extraSettingsLaunchPackageManagerButton=yon_gtk_builder_get_widget(widgets->builder,"LaunchPackageManagerButton"); + + widgets->headerLoadConfigLabel=yon_gtk_builder_get_widget(widgets->builder,"headerLoadConfigLabel"); + widgets->headerLoadGlobalConfigButton=yon_gtk_builder_get_widget(widgets->builder,"LoadGlobalConfigurationMenuItem"); + widgets->headerLoadLocalConfigButton=yon_gtk_builder_get_widget(widgets->builder,"LoadLocalConfigurationMenuItem"); + + widgets->headerSaveConfigLabel=yon_gtk_builder_get_widget(widgets->builder,"headerSaveConfigLabel"); + widgets->headerSaveGlobalLocalConfigButton=yon_gtk_builder_get_widget(widgets->builder,"SaveGlobalLocalConfigurationMenuItem"); + widgets->headerSaveGlobalConfigButton=yon_gtk_builder_get_widget(widgets->builder,"SaveGlobalConfigurationMenuItem"); + widgets->headerSaveLocalConfigButton=yon_gtk_builder_get_widget(widgets->builder,"SaveLocalConfigurationMenuItem"); + + widgets->headerDocumentationButton=yon_gtk_builder_get_widget(widgets->builder,"DocumentationMenuItem"); + widgets->headerAboutButton=yon_gtk_builder_get_widget(widgets->builder,"AboutMenuItem"); + + widgets->mainCheckForUpdatesButton=yon_gtk_builder_get_widget(widgets->builder,"checkForUpdatesButton"); + + gtk_window_set_title(GTK_WINDOW(widgets->window),_("System update")); + + gtk_label_set_text(GTK_LABEL(widgets->HeaderTopic),_("System update")); + + gtk_label_set_text(GTK_LABEL(widgets->generalSettingsTabLabel),_("General")); + gtk_label_set_text(GTK_LABEL(widgets->repositoriesSettingsTabLabel),_("Repositories")); + gtk_label_set_text(GTK_LABEL(widgets->extraSettingsTabLabel),_("Extra")); + + gtk_label_set_text(GTK_LABEL(widgets->generalSettingsUpdatesCheckFreqLabel),_("Update checking frequency")); + gtk_button_set_label(GTK_BUTTON(widgets->generalSettingsHideNoUpdatesCheck),_("Hide icon of no updates found")); + gtk_button_set_label(GTK_BUTTON(widgets->generalSettingsDownloadAutoCheck),_("Download updates automatically")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->generalSettingsUpdatesCheckFreqCombo),_("Every 1 hour")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->generalSettingsUpdatesCheckFreqCombo),_("Every 2 hours")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->generalSettingsUpdatesCheckFreqCombo),_("Every 3 hours")); + + gtk_button_set_label(GTK_BUTTON(widgets->repositoriesSettingsActivateAURCheck),_("Activate AUR")); + gtk_button_set_label(GTK_BUTTON(widgets->repositoriesSettingsActivateUBURCheck),_("Activate UBUR")); + gtk_button_set_label(GTK_BUTTON(widgets->repositoriesSettingsCreateButton),_("Create")); + gtk_button_set_label(GTK_BUTTON(widgets->repositoriesSettingsEditButton),_("Edit")); + gtk_button_set_label(GTK_BUTTON(widgets->repositoriesSettingsDeleteButton),_("Delete")); + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->repositoriesSettingsEnabledColumn),_("Enabled")); + gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->repositoriesSettingsURIColumn),_("URI")); + + gtk_label_set_text(GTK_LABEL(widgets->extraSettingsPackageManagerLabel),_("Package manager: ")); + gtk_label_set_text(GTK_LABEL(widgets->extraSettingsUpdateCommandLabel),_("Update command: ")); + gtk_label_set_text(GTK_LABEL(widgets->extraSettingsCacheCleanlabel),_("Cache clean command: ")); + gtk_button_set_label(GTK_BUTTON(widgets->extraSettingsLaunchPackageManagerButton),_("Launch package manager")); + + gtk_label_set_text(GTK_LABEL(widgets->headerLoadConfigLabel),_("load")); + gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->headerLoadGlobalConfigButton),_("Load global configuration")); + gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->headerLoadLocalConfigButton),_("Load local configuration")); + + gtk_label_set_text(GTK_LABEL(widgets->headerSaveConfigLabel),_("Save")); + gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->headerSaveGlobalLocalConfigButton),_("Save to global and local configuration")); + gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->headerSaveGlobalConfigButton),_("Save to global configuration")); + gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->headerSaveLocalConfigButton),_("Save to local configuration")); + + gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->headerDocumentationButton),_("Documentation")); + gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->headerAboutButton),_("About")); + + gtk_button_set_label(GTK_BUTTON(widgets->mainCheckForUpdatesButton),_("Check for updates")); + + + + + GtkWidget *Header = yon_gtk_builder_get_widget(widgets->builder,"boxColor"); + GtkWidget *Image = yon_gtk_builder_get_widget(widgets->builder,"HeadBackgroundImage"); + GtkWidget *Overlay = yon_gtk_builder_get_widget(widgets->builder,"HeadOverlay"); + + GtkWidget *UnderNoteOverlay = yon_gtk_builder_get_widget(widgets->builder,"UnderNoteOverlay"); + GtkWidget *checkForUpdatesButton = yon_gtk_builder_get_widget(widgets->builder,"checkForUpdatesButton"); + GtkWidget *headLabel = yon_gtk_builder_get_widget(widgets->builder,"headLabel"); + yon_ubl_header_setup(Overlay,Header,Image,image_path); + gtk_overlay_add_overlay(GTK_OVERLAY(UnderNoteOverlay),checkForUpdatesButton); + + gtk_label_set_text(GTK_LABEL(headLabel),_("System update parameter configuration")); + gtk_widget_show_all(widgets->window); + + + g_signal_connect(G_OBJECT(widgets->repositoriesSettingsCreateButton), "clicked", G_CALLBACK(on_repo_window_open), NULL); + g_signal_connect(G_OBJECT(widgets->repositoriesSettingsEditButton), "clicked", G_CALLBACK(on_repo_window_open), NULL); + + g_signal_connect(G_OBJECT(widgets->headerAboutButton), "activate", G_CALLBACK(on_about), NULL); + + g_signal_connect(G_OBJECT(widgets->window), "destroy", G_CALLBACK(gtk_main_quit), NULL); +} + + +int main(int argc, char *argv[]){ + local=setlocale(LC_ALL, ""); + textdomain (LocaleName); + gtk_init(&argc,&argv); + main_window *widgets = setup_window(); + GtkCssProvider *css=gtk_css_provider_new(); + gtk_css_provider_load_from_path(css,CssPath,NULL); + gtk_style_context_add_provider_for_screen(gdk_screen_get_default(), + GTK_STYLE_PROVIDER(css), + -1); + gtk_main(); +} \ No newline at end of file diff --git a/source/ubl-settings-update.h b/source/ubl-settings-update.h new file mode 100644 index 0000000..e5129f0 --- /dev/null +++ b/source/ubl-settings-update.h @@ -0,0 +1,92 @@ + +#include "ubl-utils.h" +#include +#include +#include +#include +#include + +#define _(String) gettext(String) + +#define glade_path "/usr/share/ubl-settings-update/ui/ubl-settings-update.glade" +#define image_path "/usr/share/ubl-settings-update/images/ubl-settings-update-banner.png" +#define CssPath "/usr/share/ubl-settings-update/css/ubl-settings-update.css" + +#define LocalePath "/usr/share/locale" +#define LocaleName "ubl-settings-update" +typedef char* string; +string version_application = "1.2"; + +char *local; + +typedef struct { + GtkWidget *window; + GtkBuilder *builder; + + GtkWidget *HeaderTopic; + + GtkWidget *generalSettingsTabLabel; + GtkWidget *repositoriesSettingsTabLabel; + GtkWidget *extraSettingsTabLabel; + + GtkWidget *generalSettingsHideNoUpdatesCheck; + GtkWidget *generalSettingsUpdatesCheckFreqLabel; + GtkWidget *generalSettingsUpdatesCheckFreqCombo; + GtkWidget *generalSettingsDownloadAutoCheck; + + GtkWidget *repositoriesSettingsActivateAURCheck; + GtkWidget *repositoriesSettingsActivateUBURCheck; + GtkWidget *repositoriesSettingsMoveUpButton; + GtkWidget *repositoriesSettingsMoveDownButton; + GtkWidget *repositoriesSettingsCreateButton; + GtkWidget *repositoriesSettingsEditButton; + GtkWidget *repositoriesSettingsDeleteButton; + GtkWidget *repositoriesSettingsRepositoriesTreeView; + GtkTreeViewColumn *repositoriesSettingsEnabledColumn; + GtkTreeViewColumn *repositoriesSettingsURIColumn; + + GtkWidget *extraSettingsPackageManagerLabel; + GtkWidget *extraSettingsPackageManagerEntry; + GtkWidget *extraSettingsUpdateCommandLabel; + GtkWidget *extraSettingsUpdateCommandEntry; + GtkWidget *extraSettingsCacheCleanlabel; + GtkWidget *extraSettingsCacheCleanEntry; + GtkWidget *extraSettingsLaunchPackageManagerButton; + + GtkWidget *headerLoadConfigLabel; + GtkWidget *headerLoadGlobalConfigButton; + GtkWidget *headerLoadLocalConfigButton; + + GtkWidget *headerSaveConfigLabel; + GtkWidget *headerSaveGlobalLocalConfigButton; + GtkWidget *headerSaveGlobalConfigButton; + GtkWidget *headerSaveLocalConfigButton; + + GtkWidget *headerDocumentationButton; + GtkWidget *headerAboutButton; + + GtkWidget *mainCheckForUpdatesButton; + +} main_window; + +typedef struct { + GtkWidget *window; + GtkBuilder *builder; + + GtkWidget *repoTypeLabel; + GtkWidget *repoTypeEntry; + GtkWidget *repoURILabel; + GtkWidget *repoURIMeanLabel; + GtkWidget *repoDistributionLabel; + GtkWidget *repoDistributionMeanLabel; + GtkWidget *repoSectionsLabel; + GtkWidget *repoSectionsMeanlabel; + + GtkWidget *repoCancelButton; + GtkWidget *repoAcceptButton; +} repo_window; + +void on_repo_window_open(GtkWidget *self); + +main_window *setup_window(); +repo_window *setup_repo_window(); \ No newline at end of file diff --git a/source/ubl-utils.c b/source/ubl-utils.c new file mode 100644 index 0000000..ed01b97 --- /dev/null +++ b/source/ubl-utils.c @@ -0,0 +1,599 @@ +#include "ubl-utils.h" +#ifndef UBL_UTILS + +typedef enum { + DICTIONARY_ACTION_WIDGETS_TYPE, + DICTIONARY_IVGRAPHICALS_TYPE, + DICTIONARY_OTHER_TYPE + +} DICT_TYPE; + +typedef struct dictionary { + char *key; + void *data; + struct dictionary *next; + struct dictionary *prev; + struct dictionary *first; + DICT_TYPE data_type; +} dictionary; + +typedef struct apps{ + char *Name; + int Type; + char *Categories; + char *Exec; + char *Icon; + int Pluggable; + int DualPluggable; + } apps; + +typedef struct { + char *command; + int *exitcode; +} thread_output; + +#ifdef __GTK_H__ +typedef struct IVGrapgicals{ + char *sectionName; + char *categories; + GtkListStore *LV; + GtkWidget *Box; + GtkWidget *IV; + GtkWidget *label; + GtkWidget *sep; + GtkCellRendererPixbuf *iconRender; +} IVGraphicals; +#endif +#endif + + +//dictionary functions + +/** + * yon_dictionary_create_empty: + * Creates and returns empty dictionary +*/ +dictionary *yon_dictionary_create_empty(){ + dictionary *dict=malloc(sizeof(dictionary)); + dict->data=NULL; + dict->key=NULL; + dict->next=NULL; + dict->prev=NULL; + dict->first=dict; + dict->data_type=DICTIONARY_OTHER_TYPE; + return dict; +} + +void yon_dictionary_switch_to_last(dictionary **dict){ + if ((*dict)->next!=NULL) + for ((*dict)=(*dict)->first;(*dict)->next!=NULL;(*dict)=(*dict)->next){} +} + +dictionary * yon_dictionary_create_conneced(dictionary *targetdict){ + targetdict=yon_dictionary_get_last(targetdict); + targetdict->next=yon_dictionary_create_empty(); + targetdict->next->prev=targetdict; + targetdict->next->first=targetdict->first; + targetdict->next->data_type=DICTIONARY_OTHER_TYPE; + return targetdict->next; +} + +dictionary *yon_dictionary_get_last(dictionary *dict){ + dictionary *dct=NULL; + for (dct=dict->first;dct->next!=NULL;dct=dct->next){} + return dct; +} + +dictionary *yon_dictionary_switch_places(dictionary *dict,int aim){ + if (aim<0){ + if (dict->prev){ + if (dict->prev->prev){ + dictionary *next = dict->next,*prev=dict->prev,*preprev=prev->prev; + if (next){ + preprev->next=dict; + dict->prev=preprev; + dict->next=prev; + prev->prev=dict; + prev->next=next; + next->prev=prev; + } else { + preprev->next=dict; + dict->prev=preprev; + dict->next=prev; + prev->prev=dict; + prev->next=NULL; + } + return prev; + } else { + dictionary *next = dict->next,*prev=dict->prev; + if (next){ + yon_dictionary_make_first(dict); + dict->prev=NULL; + dict->next=prev; + prev->prev=dict; + prev->next=next; + next->prev=prev; + } else { + dict->prev=NULL; + dict->next=prev; + prev->prev=dict; + prev->next=NULL; + } + return prev; + } + } + } else if (aim>0){ + if (dict->next){ + if (dict->next->next){ + dictionary *next = dict->next,*prev=dict->prev,*afnext=next->next; + if (prev){ + prev->next=next; + next->prev=prev; + next->next=dict; + dict->prev=next; + dict->next=afnext; + afnext->prev=dict; + } else { + yon_dictionary_make_first(next); + next->prev=NULL; + next->next=dict; + dict->prev=next; + dict->next=afnext; + afnext->prev=dict; + } + return next; + } else { + dictionary *next = dict->next,*prev=dict->prev; + if (prev){ + prev->next=next; + next->prev=prev; + next->next=dict; + dict->prev=next; + dict->next=NULL; + } else { + next->prev=NULL; + next->next=dict; + dict->prev=next; + dict->next=NULL; + } + } + } + } +} + +void yon_dictionary_make_first(dictionary *dict){ + for (dictionary *dct=dict->first;dct!=NULL;dct=dct->next){ + dct->first=dict; + } +} + +void yon_dictionary_make_nth(dictionary *dict, int nth){ + dictionary *dct=dict->first; + for (int i=0;inext;} + yon_dictionary_rip(dict); + dictionary *prev=dct->prev; + prev->next=dict; + dict->prev=prev; + dict->next=dct; + dct->prev=dict; +} + +dictionary *yon_dictionary_create_with_data(char *key, void *data){ + dictionary *dct=yon_dictionary_create_empty(); + dct->key=yon_char_new(key); + dct->data=data; + dct->data_type=DICTIONARY_OTHER_TYPE; + return dct; +} + +dictionary *yon_dictionary_create_with_data_connected(dictionary *dict, char *key, void *data){ + dictionary *dct=yon_dictionary_create_conneced(dict); + dct->key=yon_char_new(key); + dct->data=data; + dct->data_type=DICTIONARY_OTHER_TYPE; + return dct; +} + +dictionary *yon_dictionary_connect(dictionary *old, dictionary *toconnect){ + dictionary *dict=yon_dictionary_get_last(old); + dict->next=toconnect; + toconnect->prev=dict; + toconnect->first=dict->first; + return toconnect; +} + +dictionary *yon_dictionary_find(dictionary **dict, char *key){ + dictionary *dct=*dict; + for (dictionary *pointer=dct->first;pointer!=NULL;pointer=pointer->next){ + if (strcmp(pointer->key,key)==0){ + *dict=pointer; + return pointer; + } + } + return NULL; +} + + +dictionary *yon_dictionary_rip(dictionary *dict){ + if (!dict->next){ + dictionary *prev=dict->prev; + if (prev){ + prev->next=NULL; + return prev; + } else return dict; + } + else if (!dict->prev){ + dictionary *next=dict->next; + if (next){ + yon_dictionary_make_first(next); + next->prev=NULL; + return next; + } + else return dict; + } + else { + dictionary *next=dict->next, *prev=dict->prev; + next->prev=prev; + prev->next=next; + return next; + } +} + +dictionary *yon_dictionary_get_nth(dictionary *dict, int place){ + dict=dict->first; + for (int i=0;inext; + if (dict) return dict; + else return NULL; +} + +//char functions + +/** + * creates new char string by combining two char strings. +*/ +char *yon_char_get_augumented(char *source, char *append){ + if (source&&append){ + int size=strlen(source)+strlen(append)+1; + char *final=malloc(size); + memset(final,0,size); + if (strstr(source,"%%")) + sprintf(final,source,append); + else + sprintf(final,"%s%s",source,append); + return final; + } else + return NULL; +} + +/** + * creates new char string by copying another char. +*/ +char *yon_char_new(char *chr){ + char *newchar=malloc(strlen(chr)+1); + memset(newchar,0,strlen(chr)+1); + memcpy(newchar,chr,strlen(chr)); + return newchar; +} + +/** + * cuts source string by size length from startpos position. +*/ +char *yon_cut(char *source, int size, int startpos){ + char *cut=NULL; + cut=malloc(size+1); + memset(cut,0,size+1); + memcpy(cut,source+startpos,size); + return cut; +} +/** + * divides source string in dividepos position, + * returning left part of divided string and + * inserting right part to source string. +*/ +char *yon_char_divide(char *source, int dividepos){ + char *cut=malloc(dividepos+1); + memset(cut,0,dividepos+1); + memcpy(cut,source,dividepos); + char *left=malloc(strlen(source)-strlen(cut)); + memset(left,0,strlen(source)-strlen(cut)); + memcpy(left,source+dividepos+1,(strlen(source)-dividepos)); + memset(source,0,strlen(source)); + memcpy(source,left,strlen(left)); + return cut; +} + +/** + * searches string dividepos in source string and divides it, + * returning left part of divided string and + * inserting right part to source string. + * if delete_divider is 0, left part will contain delete_divider substring, else + * it will stay in right part. +*/ +char *yon_char_divide_search(char *source, char* dividepos, int delete_divider){ + char *cut=strstr(source,dividepos); + int leng=strlen(source)-strlen(cut); + cut=yon_char_divide(source,leng); + return cut; +} +/** + * converts int to char. +*/ +char *yon_char_from_int(int int_to_convert){ + int i=1; + float convert_check=(float)int_to_convert; + for (i=1;convert_check>10;i++){ + convert_check=convert_check/10; + } + char *ch=malloc(i*sizeof(char)+1); + sprintf(ch,"%d",int_to_convert); + return ch; +} + + +//parsing functions + +apps *yon_apps_scan_and_parse_desktops(int *sizef){ + int size=0; + struct apps *applist; + { + DIR *directory=opendir(DesktopPath); + struct dirent *de; + while ((de = readdir(directory))) + { + FILE *file; + char *path=yon_char_get_augumented(DesktopPath,de->d_name); + file=fopen(path,"r"); + if (strlen(de->d_name)>9) + { + char *extension=strstr(path,"."); + if (extension!=NULL) + { + if (strcmp(extension,".desktop")==0) + { + apps tempapp; + GKeyFile *gfile=g_key_file_new(); + GError *err=NULL; + g_key_file_load_from_file(gfile,path,G_KEY_FILE_KEEP_TRANSLATIONS,NULL); + char *Type=g_key_file_get_string(gfile,"Desktop Entry", "Type",&err); + if (err){ + printf("%s\n",err->message); + } + if (strcmp(Type,"Application")==0) tempapp.Type=1; else if (strcmp(Type,"pyApplication")==0) tempapp.Type=2; else continue; + tempapp.Name=g_key_file_get_locale_string(gfile,"Desktop Entry","Name",setlocale(LC_ALL,NULL),NULL); + if (tempapp.Name==NULL) continue; + tempapp.Categories=g_key_file_get_string(gfile,"Desktop Entry", "Categories",NULL); + if (tempapp.Categories==NULL) continue; + tempapp.Exec=g_key_file_get_string(gfile,"Desktop Entry", "Exec",NULL); + if (tempapp.Exec==NULL) continue; + tempapp.Icon=g_key_file_get_string(gfile,"Desktop Entry", "Icon",NULL); + if (tempapp.Icon==NULL) continue; + tempapp.Pluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "Pluggable",NULL); + if (!tempapp.Pluggable) tempapp.Pluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "X-XfcePluggable",NULL); + if (tempapp.Pluggable) tempapp.DualPluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "X-UBLPluggable",NULL); + if (g_key_file_get_boolean(gfile,"Desktop Entry", "X-UBL-SettingsManager-Hidden",NULL)==0) + if (size==0){ + applist=(apps*)malloc(size+1*sizeof(apps)); + applist[0].Name=yon_char_new(tempapp.Name); + applist[0].Categories=yon_char_new(tempapp.Categories); + applist[0].Exec=yon_char_new(tempapp.Exec); + applist[0].Icon=yon_char_new(tempapp.Icon); + applist[0].Type=tempapp.Type; + applist[0].Pluggable=tempapp.Pluggable; + applist[0].DualPluggable=tempapp.DualPluggable; + size++; + } else { + applist=(apps*)realloc(applist,(size+1)*sizeof(apps)); + applist[size].Name=yon_char_new(tempapp.Name); + applist[size].Categories=yon_char_new(tempapp.Categories); + applist[size].Exec=yon_char_new(tempapp.Exec); + applist[size].Icon=yon_char_new(tempapp.Icon); + applist[size].Pluggable=tempapp.Pluggable; + applist[size].DualPluggable=tempapp.DualPluggable; + applist[size].Type=tempapp.Type; + size++; + } + } + } + } + } + } + *sizef=size; + return applist; +}; + + +void yon_apps_sort(apps *applist,int size){ + apps tmp; + if (size>2) + { + for (int i=1;icommand=path; + thread->exitcode=malloc(sizeof(int)); + pthread_t thread_id; + pthread_create(&thread_id, NULL, (void*)yon_launch, thread); + return *thread->exitcode; +}; + + +int yon_launch_app_with_arguments(char *name, char *args){ + char *path=yon_char_get_augumented("/usr/bin/",name); + path=yon_char_get_augumented(path," "); + path=yon_char_get_augumented(path,args); + pthread_t thread_id; + thread_output *thread=malloc(sizeof(thread_output)); + thread->command=path; + thread->exitcode=malloc(sizeof(int)); + pthread_create(&thread_id, NULL, (void*)yon_launch, thread); + return *thread->exitcode; +}; + + +int yon_launch(thread_output *thread){ + int a=0; + a=system(thread->command); + *thread->exitcode=a; + return *thread->exitcode; +} + + +//Gtk functions + +#ifdef __GTK_H__ + +// dictionary *yon_gtk_app_chooser_create(GtkBuilder *builder){ +// GtkWidget *chooserWindow=gtk_window_new(GTK_WINDOW_TOPLEVEL); +// GtkWidget *Box=gtk_box_new(GTK_ORIENTATION_VERTICAL,5); +// GtkWidget *Frame=gtk_frame_new(""); +// GtkWidget *Scroll=gtk_scrolled_window_new(NULL, gtk_adjustment_new(0,0,10000,1,10,100)); +// GtkWidget *PackBox=gtk_box_new(GTK_ORIENTATION_VERTICAL,5); +// GtkWidget *ButtonsBox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5); +// GtkWidget *ButtonsPlaceBox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5); + +// GtkWidget *CancelButton=gtk_button_new_with_label("Cancel"); +// GtkWidget *AcceptButton=gtk_button_new_with_label("Accept"); +// gtk_container_add(GTK_CONTAINER(chooserWindow),Box); +// gtk_box_pack_start(GTK_BOX(Box),Frame,1,1,0); +// gtk_container_add(GTK_CONTAINER(Frame),PackBox); +// gtk_box_pack_start(GTK_BOX(Box),ButtonsBox,0,0,0); +// gtk_box_pack_end(GTK_BOX(ButtonsBox),ButtonsPlaceBox,0,0,0); +// gtk_box_pack_end(GTK_BOX(ButtonsPlaceBox),AcceptButton,0,0,0); +// gtk_box_pack_end(GTK_BOX(ButtonsPlaceBox),CancelButton,0,0,0); +// gtk_box_pack_start(GTK_BOX(PackBox),(GtkWidget*)yon_gtk_app_chooser_apps_create(builder),0,0,0); +// gtk_widget_show_all(chooserWindow); +// } + +/** + * yon_iv_segment_create: + * connect_to - dictionary, in the end of which new one will be connected; + * name - name of this segment, renders on label; + * categories - desktop file categories that application NEEDS to have to render in that category; + * segment_icon_name - icon name for this section; + * builder - newly allocated builder with glade file connected where template widgets are stored: + * - templateAppsIconView - setted up icon view; + * - templateAppsPack - setted up container for every template widget; + * - templateAppsImage - image for rendering section image; + * - templateAppsLabel - label for rendering section name; +*/ +// dictionary *yon_iv_segment_create(dictionary *connect_to, char *name, char *categories, char *segment_icon_name){ +// IVSegment *segment=malloc(sizeof(IVSegment)); +// segment->name=name; +// segment->categories=categories; +// GtkBuilder *builder=gtk_builder_new_from_string(return_app_string(),-1); +// GtkWidget *iv=yon_gtk_builder_get_widget(builder,"templateAppsIconView"); +// GtkWidget *expander=yon_gtk_builder_get_widget(builder,"templateAppsPack"); +// GtkWidget *image=yon_gtk_builder_get_widget(builder,"templateAppsImage"); +// GtkWidget *label=yon_gtk_builder_get_widget(builder,"templateAppsLabel"); +// GtkIconTheme *theme=gtk_icon_theme_get_default(); +// gtk_image_set_from_pixbuf(GTK_IMAGE(image),gtk_icon_theme_load_icon_for_scale(theme,segment_icon_name,20,1,GTK_ICON_LOOKUP_FORCE_SVG,NULL)); +// gtk_label_set_text(GTK_LABEL(label),name); +// GtkListStore *ls=GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore5")); +// // g_signal_connect(G_OBJECT(iv), "item-activated", G_CALLBACK(on_activate), videoconfig.applist); +// segment->Expander=expander; +// segment->IV=iv; +// segment->LS=ls; +// segment->Image=image; +// dictionary *dict=NULL; +// if (connect_to) { +// // connect_to=yon_dictionary_get_last(connect_to); +// dict=yon_dictionary_create_with_data_connected(connect_to,name,segment); +// } else +// dict=yon_dictionary_create_with_data(name,segment); +// return dict; +// } + +// GtkWidget *yon_gtk_app_chooser_apps_create(){ +// GtkWidget *Box=gtk_box_new(GTK_ORIENTATION_VERTICAL,0); +// dictionary *IVS=yon_iv_segment_create(NULL, "Graphics", "", "dialog-yes-symbolic"); +// yon_iv_segment_create(IVS, "Tools", "", "dialog-yes-symbolic"); +// yon_iv_segment_create(IVS, "Internet", "", "dialog-yes-symbolic"); +// yon_iv_segment_create(IVS, "Multimedia", "", "dialog-yes-symbolic"); +// yon_iv_segment_create(IVS, "Settings", "", "dialog-yes-symbolic"); +// yon_iv_segment_create(IVS, "Education", "", "dialog-yes-symbolic"); +// yon_iv_segment_create(IVS, "Office", "", "dialog-yes-symbolic"); +// yon_iv_segment_create(IVS, "Other", "", "dialog-yes-symbolic"); +// yon_iv_segment_create(IVS, "Development", "", "dialog-yes-symbolic"); +// yon_iv_segment_create(IVS, "System", "", "dialog-yes-symbolic"); +// dictionary *nd; +// for_dictionaries(nd,IVS){ +// gtk_box_pack_start(GTK_BOX(Box),((IVSegment*)nd->data)->Expander,0,0,0); +// } +// return Box; + +// } + +// GtkWidget *yon_gtk_socket_create_new_with_connect(GtkWidget *container, gpointer data){ +// GtkWidget *socket; +// socket = gtk_socket_new(); +// g_signal_connect(G_OBJECT(socket),"plug-added",G_CALLBACK(yon_on_plug_added),data); +// g_signal_connect(G_OBJECT(socket),"plug-removed",G_CALLBACK(yon_on_plug_removed),data); +// g_signal_connect(G_OBJECT(socket),"destroy",G_CALLBACK(yon_on_plug_removed),data); +// gtk_box_pack_start(GTK_BOX(container),socket,1,1,0); +// return socket; +// }; + +int yon_dictionary_gtk_pack_start_multiple_widgets(dictionary *dict, GtkWidget *destination, gboolean expand, gboolean fill, int padding){ + for (dictionary *dct=dict->first; dct!=NULL;dct=dct->next){ + gtk_box_pack_start(GTK_BOX(destination),(GtkWidget*)dct->data,expand,fill,padding); + } + return 1; +} + +int yon_dictionary_gtk_pack_end_multiple_widgets(dictionary *dict, GtkWidget *destination, gboolean expand, gboolean fill, int padding){ + for (dictionary *dct=dict->first; dct!=NULL;dct=dct->next){ + gtk_box_pack_end(GTK_BOX(destination),(GtkWidget*)dct->data,expand,fill,padding); + } + return 1; +} + +void _yon_ubl_header_setup(GtkWidget *Overlay, GtkWidget *Head, GtkWidget *Image, char *image_path){ + gtk_overlay_add_overlay(GTK_OVERLAY(Overlay),Head); + gtk_image_set_from_file(GTK_IMAGE(Image),image_path); +} + +void _yon_ubl_status_box_render(GtkWidget *StatusBox, GtkWidget *StatusIcon, GtkWidget *StatusLabel, char *IconName, char* StatusText, BACKGROUND_IMAGE_TYPE BackgroundClass){ + GtkIconTheme *ictheme=gtk_icon_theme_get_default(); + GError *err=NULL; + gtk_image_set_from_pixbuf(GTK_IMAGE(StatusIcon),gtk_icon_theme_load_icon_for_scale(ictheme,IconName,25,1,GTK_ICON_LOOKUP_FORCE_SIZE,&err)); + if (err){ + printf("%s\n",err->message); + g_error_free(err); + } + gtk_label_set_text(GTK_LABEL(StatusLabel),StatusText); + if (BackgroundClass==BACKGROUND_IMAGE_SUCCESS_TYPE){ + gtk_style_context_add_class(gtk_widget_get_style_context(StatusBox),"boxInfoMessOK"); + } else if (BackgroundClass==BACKGROUND_IMAGE_FAIL_TYPE){ + gtk_style_context_add_class(gtk_widget_get_style_context(StatusBox),"boxInfoMessError"); + } +} +#endif \ No newline at end of file diff --git a/source/ubl-utils.h b/source/ubl-utils.h new file mode 100644 index 0000000..444fd93 --- /dev/null +++ b/source/ubl-utils.h @@ -0,0 +1,164 @@ +#ifndef UBL_UTILS +#define UBL_UTILS +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DesktopPath "/usr/share/applications/" + +#define for_dictionaries(obj,obj1) for(obj=obj1->first;obj!=NULL;obj=obj->next) + +typedef enum { + DICTIONARY_ACTION_WIDGETS_TYPE, + DICTIONARY_IVGRAPHICALS_TYPE, + DICTIONARY_OTHER_TYPE + +} DICT_TYPE; + + +typedef struct { + char *command; + int *exitcode; +} thread_output; + +typedef struct dictionary { + char *key; + void *data; + struct dictionary *next; + struct dictionary *prev; + struct dictionary *first; + DICT_TYPE data_type; +} dictionary; + +typedef struct apps{ + char *Name; + int Type; + char *Categories; + char *Exec; + char *Icon; + int Pluggable; + int DualPluggable; + } apps; + + +//dictionary functions + +dictionary *yon_dictionary_create_empty(); + +dictionary * yon_dictionary_create_conneced(dictionary *targetdict); + +dictionary *yon_dictionary_get_last(dictionary *dict); + +dictionary *yon_dictionary_switch_places(dictionary *dict,int aim); + +void yon_dictionary_make_first(dictionary *dict); + +void yon_dictionary_make_nth(dictionary *dict, int nth); + +dictionary *yon_dictionary_create_with_data(char *key, void *data); + +dictionary *yon_dictionary_create_with_data_connected(dictionary *dict, char *key, void *data); + +dictionary *yon_dictionary_connect(dictionary *old, dictionary *toconnect); + +dictionary *yon_dictionary_find(dictionary **dict, char *key); + +dictionary *yon_dictionary_rip(dictionary *dict); + +dictionary *yon_dictionary_get_nth(dictionary *dict, int place); + +//char functions + +char *yon_char_get_augumented(char *source, char *append); + +char *yon_char_new(char *chr); + +char *yon_cut(char *source, int size, int startpos); + +char *yon_char_divide(char *source, int dividepos); + +char *yon_char_divide_search(char *source, char* dividepos, int delete_divider); + +char *yon_char_from_int(int int_to_convert); + + + +//parsing functions + +apps *yon_apps_scan_and_parse_desktops(int *sizef); + + +void yon_apps_sort(apps *applist,int size); + + +apps *yon_apps_get_by_name(apps *applist,char *name, int size); + + +//terminal-using functions + + + +int yon_launch_app(char *name); + + +int yon_launch_app_with_arguments(char *name, char *args); + + +int yon_launch(thread_output *thread); + +//Gtk functions + +#ifdef __GTK_H__ + +#define yon_gtk_builder_get_widget(obj,obj2) GTK_WIDGET(gtk_builder_get_object(obj,obj2)) + + +typedef struct { + GtkWidget *Icon; + GtkWidget *Label; + GtkWidget *IconView; + GtkListStore *List; +} expander_icon_view; + + +// GtkWidget *yon_gtk_app_chooser_apps_create(); + +// dictionary *yon_gtk_app_chooser_create(); + +// expander_icon_view yon_gtk_icon_view_expander_create(GtkWidget *pack, ...); + +GtkWidget *yon_gtk_socket_create_new_with_connect(GtkWidget *container, gpointer data); + +int yon_gtk_icon_view_hide_empty(dictionary *icon_view_segment); + +int yon_dictionary_gtk_pack_start_multiple_widgets(dictionary *dict, GtkWidget *destination, gboolean expand, gboolean fill, int padding); +int yon_dictionary_gtk_pack_end_multiple_widgets(dictionary *dict, GtkWidget *destination, gboolean expand, gboolean fill, int padding); + +//uninitialised + +void yon_on_plug_added(GtkSocket* self, gpointer user_data); +void yon_on_plug_removed(GtkSocket* self, gpointer user_data); + + +#endif +typedef enum { + BACKGROUND_IMAGE_SUCCESS_TYPE, + BACKGROUND_IMAGE_FAIL_TYPE +} BACKGROUND_IMAGE_TYPE; +#ifdef __cplusplus +#define yon_ubl_header_setup(overlay,head,image,imag_path) _yon_ubl_header_setup(GTK_WIDGET(overlay.gobj()),GTK_WIDGET(head.gobj()),GTK_WIDGET(image.gobj()),(char*)imag_path) +#define yon_ubl_status_box_render(statusbox, statusicon, statuslabel, iconname, statustext, backgroundclass) _yon_ubl_status_box_render(GTK_WIDGET(statusbox.gobj()), GTK_WIDGET(statusicon.gobj()), GTK_WIDGET(statuslabel.gobj()), (char*)iconname, (char*)statustext, backgroundclass) +#else +#define yon_ubl_header_setup(overlay,head,image,imag_path) _yon_ubl_header_setup(GTK_WIDGET(overlay),GTK_WIDGET(head),GTK_WIDGET(image), (char*)imag_path) +#define yon_ubl_status_box_render(statusbox, statusicon, statuslabel, iconname, statustext, backgroundclass) _yon_ubl_status_box_render(statusbox, statusicon, statuslabel, iconname, statustext, backgroundclass) +#endif + +void _yon_ubl_header_setup(GtkWidget *Overlay, GtkWidget *Head, GtkWidget *Image, char *image_path); +void _yon_ubl_status_box_render(GtkWidget *StatusBox, GtkWidget *StatusIcon, GtkWidget *StatusLabel, char *IconName, char* StatusText, BACKGROUND_IMAGE_TYPE BackgroundClass); +#endif \ No newline at end of file diff --git a/ubl-settings-update-banner.png b/ubl-settings-update-banner.png new file mode 100644 index 0000000..8eb67cb Binary files /dev/null and b/ubl-settings-update-banner.png differ diff --git a/ubl-settings-update.css b/ubl-settings-update.css new file mode 100644 index 0000000..515d75a --- /dev/null +++ b/ubl-settings-update.css @@ -0,0 +1,14 @@ + +.thin { + margin:0px; + padding:0px; +} +.noborder { + border:none; +} +.nobackground { +background:transparent; +} +.nobackground:active { +background:transparent; +} diff --git a/ubl-settings-update.desktop b/ubl-settings-update.desktop new file mode 100644 index 0000000..c67c7c4 --- /dev/null +++ b/ubl-settings-update.desktop @@ -0,0 +1,15 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=ubl-settings-update +Name[ru]=Настройки обновлений +GenericName=ubl-settings-quotas +GenericName[ru]=Настройки обновлений +Comment=ubl-settings-update +Comment[ru]=Приложение для управления настройками обновлений +Type=Application +Exec=ubl-settings-update +Icon=com.ublinux.ubl-settings-update +Terminal=false +X-XfcePluggable=true +X-UBLPluggable=true +Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings; diff --git a/ubl-settings-update.glade b/ubl-settings-update.glade new file mode 100644 index 0000000..2cfba93 --- /dev/null +++ b/ubl-settings-update.glade @@ -0,0 +1,1256 @@ + + + + + + + False + False + True + center + com.ublinux.ubl-settings-update + dialog + True + Update + 1.1 + Copyright © 2022 - 2023, UBSoft LLC + Update confugurator + https://ublinux.ru/ + Project Home Page + Это приложение распространяется без каких-либо гарантий. +Подробнее в <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, версии 2 или позднее</a>. + UBGroup + UBGroup + com.ublinux.ubl-settings-update + True + gpl-2-0 + + + True + False + vertical + 2 + + + False + end + + + False + False + 1 + + + + + + + True + False + True + + + True + False + 5 + 5 + 5 + 5 + 2 + System update + + + + + + + + + + True + False + + + 90 + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 69 + com.ublinux.ubl-settings-update + + + False + True + 0 + + + + + True + False + + + True + False + + + True + False + vertical + + + 255 + True + False + System update parameter configuration + + + + + + + + True + True + 0 + + + + + False + True + 0 + + + + + True + True + 0 + + + + + True + True + 1 + + + + + True + False + process-stop-symbolic + + + True + False + emblem-ok-symbolic + + + False + System update + True + com.ublinux.ubl-settings-update + + + True + False + 5 + 5 + 5 + 5 + vertical + 5 + + + True + False + 5 + + + True + False + Type: + 0 + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + 5 + + + True + False + URI: + 0 + + + False + True + 0 + + + + + True + False + 0 + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + False + Distribution: + 0 + + + False + True + 0 + + + + + True + False + 0 + + + False + True + 1 + + + + + False + True + 1 + + + + + True + False + 5 + + + True + False + Sections: + 0 + + + False + True + 0 + + + + + True + False + 0 + + + False + True + 1 + + + + + False + True + 2 + + + + + False + True + 1 + + + + + True + False + + + True + False + + + True + True + 0 + + + + + True + False + 5 + True + + + Cancel + True + True + True + image1 + + + False + True + 0 + + + + + Save + True + True + True + image2 + + + False + True + 1 + + + + + False + True + end + 1 + + + + + False + True + end + 2 + + + + + + + + + + + + + + + True + False + dropboxstatus-logo + + + True + False + 17 + view-refresh-symbolic + + + Check for updates + True + True + True + end + start + image4 + + + + + + + + + + + True + False + + + True + False + Load from global configuration + + + + + True + False + Load from local configuration + + + + + True + False + False + False + + + True + False + Documentation + True + + + + + True + False + About + + + + + + True + False + + + True + False + Save to global and local documentation + + + + + True + False + Save to global configuration + + + + + True + False + Save to local configuration + + + + + False + 800 + 600 + com.ublinux.ubl-settings-update + + + True + False + vertical + + + True + False + vertical + + + True + False + vertical + + + 81 + True + False + + + True + False + start + gtk-missing-image + + + -1 + + + + + False + True + 0 + + + + + False + True + 1 + + + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + True + True + vertical + + + True + False + + + True + True + 3 + + + True + False + 5 + 5 + 5 + 5 + vertical + 5 + + + Hide icon if no updates found + True + True + False + 0 + True + + + False + True + 0 + + + + + True + False + 5 + + + True + False + Update checking frequency + 0 + + + False + True + 0 + + + + + True + False + + + False + True + 1 + + + + + False + True + 1 + + + + + Download updates automatically + True + True + False + 0 + True + + + False + True + 2 + + + + + + + True + False + General settings + + + False + + + + + True + False + 5 + 5 + 5 + 5 + vertical + 5 + + + True + False + 5 + + + Activate AUR + True + True + False + True + + + False + True + 0 + + + + + Activate UBUR + True + True + False + True + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + True + liststore1 + + + + + + Enabled + + + + 0 + + + + + + + URI + + + + 0 + + + + + + + True + True + 0 + + + + + True + False + center + vertical + 25 + + + True + True + True + + + True + False + True + False + True + up + + + + + + + + + + False + True + 0 + + + + + True + True + True + + + True + False + True + False + True + + + + + + + + + + False + True + 1 + + + + + False + True + 1 + + + + + True + True + 1 + + + + + True + False + 5 + 5 + 5 + + + Create + True + True + True + + + False + True + 0 + + + + + Edit + True + True + True + + + False + True + 1 + + + + + Delete + True + True + True + + + False + True + 2 + + + + + False + True + end + 2 + + + + + 1 + + + + + True + False + Repositories + + + 1 + False + + + + + True + False + 5 + 5 + 5 + 5 + vertical + 5 + + + True + False + 5 + + + True + False + Package manager: + 0 + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + False + Update command: + 0 + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + 5 + + + True + False + Cache clean command: + 0 + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + False + True + 2 + + + + + True + False + 5 + + + + + + Launch package manager + True + True + True + image3 + + + False + True + end + 1 + + + + + False + True + end + 3 + + + + + 2 + + + + + True + False + Extra + + + 2 + False + + + + + -1 + + + + + True + True + 0 + + + + + False + True + 2 + + + + + True + True + 0 + + + + + + + True + False + True + + + True + False + 5 + 5 + 5 + 5 + 2 + System update + + + + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 32 + com.ublinux.ubl-settings-update + + + + + True + True + True + False + True + True + menu2 + none + + + + + + + end + 1 + + + + + True + True + False + True + menu1 + + + True + False + + + True + False + Load + + + False + True + 0 + + + + + True + False + pan-down-symbolic + + + False + True + 1 + + + + + + + 2 + + + + + True + True + False + True + menu3 + + + True + False + + + True + False + Save + + + False + True + 0 + + + + + True + False + pan-down-symbolic + + + False + True + 1 + + + + + + + end + 3 + + + + + + + + + + + + + + diff --git a/ubl-settings-update.pot b/ubl-settings-update.pot new file mode 100644 index 0000000..7ee8f2e --- /dev/null +++ b/ubl-settings-update.pot @@ -0,0 +1,184 @@ +# language translations for ubl-settings-manager package. +# Copyright (C) 2022, UBTech LLC +# This file is distributed under the same license as the ubl-settings-manager package. +# UBLinux Team , 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ubl-settings-manager 1.0\n" +"Report-Msgid-Bugs-To: info@ublinux.com\n" +"POT-Creation-Date: 2023-04-21 12:33+0000\n" +"PO-Revision-Date: 2023-01-01 00:00+0600\n" +"Last-Translator: UBLinux Team \n" +"Language-Team: Russian - UBLinux Team \n" +"Language: Russian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: source/ubl-settings-update.c:16 +msgid "UBlinux System update" +msgstr "" + +#: source/ubl-settings-update.c:18 +msgid "Project Home Page" +msgstr "" + +#: source/ubl-settings-update.c:19 +msgid "Update configurator" +msgstr "" + +#: source/ubl-settings-update.c:46 source/ubl-settings-update.c:111 +#: source/ubl-settings-update.c:113 +msgid "System update" +msgstr "" + +#: source/ubl-settings-update.c:48 +msgid "Type: " +msgstr "" + +#: source/ubl-settings-update.c:49 +msgid "URI: " +msgstr "" + +#: source/ubl-settings-update.c:50 source/ubl-settings-update.c:52 +#: source/ubl-settings-update.c:54 +msgid " " +msgstr "" + +#: source/ubl-settings-update.c:51 +msgid "Distribution: " +msgstr "" + +#: source/ubl-settings-update.c:53 +msgid "Sections: " +msgstr "" + +#: source/ubl-settings-update.c:56 +msgid "Cancel" +msgstr "" + +#: source/ubl-settings-update.c:57 source/ubl-settings-update.c:143 +msgid "Save" +msgstr "" + +#: source/ubl-settings-update.c:115 +msgid "General" +msgstr "" + +#: source/ubl-settings-update.c:116 +msgid "Repositories" +msgstr "" + +#: source/ubl-settings-update.c:117 +msgid "Extra" +msgstr "" + +#: source/ubl-settings-update.c:119 +msgid "Update checking frequency" +msgstr "" + +#: source/ubl-settings-update.c:120 +msgid "Hide icon of no updates found" +msgstr "" + +#: source/ubl-settings-update.c:121 +msgid "Download updates automatically" +msgstr "" + +#: source/ubl-settings-update.c:122 +msgid "Every 1 hour" +msgstr "" + +#: source/ubl-settings-update.c:123 +msgid "Every 2 hours" +msgstr "" + +#: source/ubl-settings-update.c:124 +msgid "Every 3 hours" +msgstr "" + +#: source/ubl-settings-update.c:126 +msgid "Activate AUR" +msgstr "" + +#: source/ubl-settings-update.c:127 +msgid "Activate UBUR" +msgstr "" + +#: source/ubl-settings-update.c:128 +msgid "Create" +msgstr "" + +#: source/ubl-settings-update.c:129 +msgid "Edit" +msgstr "" + +#: source/ubl-settings-update.c:130 +msgid "Delete" +msgstr "" + +#: source/ubl-settings-update.c:131 +msgid "Enabled" +msgstr "" + +#: source/ubl-settings-update.c:132 +msgid "URI" +msgstr "" + +#: source/ubl-settings-update.c:134 +msgid "Package manager: " +msgstr "" + +#: source/ubl-settings-update.c:135 +msgid "Update command: " +msgstr "" + +#: source/ubl-settings-update.c:136 +msgid "Cache clean command: " +msgstr "" + +#: source/ubl-settings-update.c:137 +msgid "Launch package manager" +msgstr "" + +#: source/ubl-settings-update.c:139 +msgid "load" +msgstr "" + +#: source/ubl-settings-update.c:140 +msgid "Load global configuration" +msgstr "" + +#: source/ubl-settings-update.c:141 +msgid "Load local configuration" +msgstr "" + +#: source/ubl-settings-update.c:144 +msgid "Save to global and local configuration" +msgstr "" + +#: source/ubl-settings-update.c:145 +msgid "Save to global configuration" +msgstr "" + +#: source/ubl-settings-update.c:146 +msgid "Save to local configuration" +msgstr "" + +#: source/ubl-settings-update.c:148 +msgid "Documentation" +msgstr "" + +#: source/ubl-settings-update.c:149 +msgid "About" +msgstr "" + +#: source/ubl-settings-update.c:151 +msgid "Check for updates" +msgstr "" + +#: source/ubl-settings-update.c:166 +msgid "System update parameter configuration" +msgstr "" diff --git a/ubl-settings-update_ru.po b/ubl-settings-update_ru.po new file mode 100644 index 0000000..fe04db6 --- /dev/null +++ b/ubl-settings-update_ru.po @@ -0,0 +1,189 @@ +# Russian translations for ubl-settings-manager package. +# Copyright (C) 2022, UBTech LLC +# This file is distributed under the same license as the ubl-settings-manager package. +# UBLinux Team , 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ubl-settings-manager 1.0\n" +"Report-Msgid-Bugs-To: info@ublinux.com\n" +"POT-Creation-Date: 2023-04-21 12:33+0000\n" +"PO-Revision-Date: 2023-01-01 00:00+0600\n" +"Last-Translator: UBLinux Team \n" +"Language-Team: Russian - UBLinux Team \n" +"Language: Russian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: source/ubl-settings-update.c:16 +#, fuzzy +msgid "UBlinux System update" +msgstr "Обновление системы" + +#: source/ubl-settings-update.c:18 +#, fuzzy +msgid "Project Home Page" +msgstr "Домашняя страница проекта" + +#: source/ubl-settings-update.c:19 +#, fuzzy +msgid "Update configurator" +msgstr "Загрузить локальную конфигурацию" + +#: source/ubl-settings-update.c:46 source/ubl-settings-update.c:111 +#: source/ubl-settings-update.c:113 +msgid "System update" +msgstr "Обновление системы" + +#: source/ubl-settings-update.c:48 +msgid "Type: " +msgstr "Тип: " + +#: source/ubl-settings-update.c:49 +msgid "URI: " +msgstr "URI: " + +#: source/ubl-settings-update.c:50 source/ubl-settings-update.c:52 +#: source/ubl-settings-update.c:54 +msgid " " +msgstr " " + +#: source/ubl-settings-update.c:51 +msgid "Distribution: " +msgstr "Дистрибутив: " + +#: source/ubl-settings-update.c:53 +msgid "Sections: " +msgstr "Разделы: " + +#: source/ubl-settings-update.c:56 +msgid "Cancel" +msgstr "Отмена" + +#: source/ubl-settings-update.c:57 source/ubl-settings-update.c:143 +msgid "Save" +msgstr "Сохранить" + +#: source/ubl-settings-update.c:115 +msgid "General" +msgstr "Общие настройки" + +#: source/ubl-settings-update.c:116 +msgid "Repositories" +msgstr "Репозитории" + +#: source/ubl-settings-update.c:117 +msgid "Extra" +msgstr "Дополнительно" + +#: source/ubl-settings-update.c:119 +msgid "Update checking frequency" +msgstr "Частота проверки обновлений" + +#: source/ubl-settings-update.c:120 +msgid "Hide icon of no updates found" +msgstr "Скрыть значок в трее при отсутствии обновлений" + +#: source/ubl-settings-update.c:121 +msgid "Download updates automatically" +msgstr "Автоматически скачивать обновления" + +#: source/ubl-settings-update.c:122 +msgid "Every 1 hour" +msgstr "Каждый час" + +#: source/ubl-settings-update.c:123 +msgid "Every 2 hours" +msgstr "Каждые 2 часа" + +#: source/ubl-settings-update.c:124 +msgid "Every 3 hours" +msgstr "Каждые 3 часа" + +#: source/ubl-settings-update.c:126 +msgid "Activate AUR" +msgstr "Активировать AUR" + +#: source/ubl-settings-update.c:127 +msgid "Activate UBUR" +msgstr "Активировать UBUR" + +#: source/ubl-settings-update.c:128 +msgid "Create" +msgstr "Создать" + +#: source/ubl-settings-update.c:129 +msgid "Edit" +msgstr "Изменить" + +#: source/ubl-settings-update.c:130 +msgid "Delete" +msgstr "Удалить" + +#: source/ubl-settings-update.c:131 +msgid "Enabled" +msgstr "Включен" + +#: source/ubl-settings-update.c:132 +#, fuzzy +msgid "URI" +msgstr "URI" + +#: source/ubl-settings-update.c:134 +msgid "Package manager: " +msgstr "Менеджер пакетов: " + +#: source/ubl-settings-update.c:135 +msgid "Update command: " +msgstr "Команда обновления: " + +#: source/ubl-settings-update.c:136 +msgid "Cache clean command: " +msgstr "Команда очистки кеша пакетов: " + +#: source/ubl-settings-update.c:137 +msgid "Launch package manager" +msgstr "Запустить менеджер пакетов" + +#: source/ubl-settings-update.c:139 +msgid "load" +msgstr "Загрузить" + +#: source/ubl-settings-update.c:140 +msgid "Load global configuration" +msgstr "Загрузить глобальную конфигурацию" + +#: source/ubl-settings-update.c:141 +msgid "Load local configuration" +msgstr "Загрузить локальную конфигурацию" + +#: source/ubl-settings-update.c:144 +msgid "Save to global and local configuration" +msgstr "Сохранить в глобальную и локальную конфигурацию" + +#: source/ubl-settings-update.c:145 +msgid "Save to global configuration" +msgstr "Сохранить в глобальную конфигурацию" + +#: source/ubl-settings-update.c:146 +msgid "Save to local configuration" +msgstr "Сохранить в локальную конфигурацию" + +#: source/ubl-settings-update.c:148 +msgid "Documentation" +msgstr "Справка" + +#: source/ubl-settings-update.c:149 +msgid "About" +msgstr "О программе" + +#: source/ubl-settings-update.c:151 +msgid "Check for updates" +msgstr "Проверить обновления" + +#: source/ubl-settings-update.c:166 +#, fuzzy +msgid "System update parameter configuration" +msgstr "настройка параметров обновления системы"