Merge pull request 'master' (#34) from Applications/ubl-settings-manager:master into devel

Reviewed-on: YanTheKaller/ubl-settings-manager#34
pull/36/head
commit fcf489e62c

@ -6,47 +6,49 @@ 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
DEPENDS = 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 ..."; \
version="$$(cat VERSION.md)"; \
version=$${version:8}; \
search="s/string version_application.*"; \
replace="string version_application = \"$${version}\";"; \
sed -i -e "$$search/$$replace/gi" source/ubl-settings-manager.h; \
echo "-- Build path: ${CMAKE_BUILD_DIR}"
sed -r "s/(version_application = ).*/\1\"$$(grep 'VERSION' ${FILE_VERSION} | cut -d" " -f2)\";/" -i source/ubl-settings-manager.h; \
echo "-- Build path: ${CMAKE_BUILD_DIR}"
depend:
@echo "Check depends ..."; \
if [ ! -f /bin/cmake ]; then \
echo "-- Depend 'cmake' not found !"; \
exit 1; \
fi; \
@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 -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="/usr"; \
$(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 -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/usr"; \
$(CMAKE_COMMAND) -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}"; \
fi; \
echo "Prepare: OK"
@ -66,65 +68,64 @@ build: depend prepare
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) "/usr/share/icons/hicolor/$${SIZE}/apps/${PKGNAME}.svg"; \
$(RM) "/usr/share/"${pkgname}"/images/${PKGNAME}.png"; \
$(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) "/usr/share/icons/hicolor/$${SIZE}/status/$${FILE_SVG%.*}".{svg,png,jpg}; \
$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}/status/$${FILE_SVG%.*}".{svg,png,jpg}; \
done; \
done
@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="/usr/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \
$(RM) "/usr/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \
done
@$(RM) "/usr/bin/${PKGNAME}"
@$(RM) "/usr/share/applications/${PKGNAME}.desktop"
@$(RM) "/usr/share/icons/hicolor/scalable/apps/ru.ublinux.${PKGNAME}.svg"
@$(RM) "/usr/share/${PKGNAME}/ui/ublinux-logo.svg"
@$(RM) "/usr/share/${PKGNAME}/ui/${PKGNAME}.glade"
@$(RM) "/usr/share/${PKGNAME}/css/${PKGNAME}.css"
@$(RM) "/usr/share/${PKGNAME}/ui/${PKGNAME}-banner.png"
@$(RM) -d "/usr/share/${PKGNAME}/css"
@$(RM) -d "/usr/share/${PKGNAME}/ui"
@$(RM) -d "/usr/share/${PKGNAME}"
@$(RM) "/etc/xdg/${PKGNAME}/${PKGNAME}.conf"
@gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null
@update-desktop-database --quiet 2>/dev/null
@touch /usr/share/applications
@$(RM) "${DESTDIR}${PREFIX}/bin/${PKGNAME}"
@$(RM) "${DESTDIR}${PREFIX}/etc/xdg/${PKGNAME}/${PKGNAME}.conf"
@$(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}"
@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 /usr/share/locale/$${LANG}/LC_MESSAGES; \
install -dm755 "${DESTDIR}${PREFIX}/share/locale/$${LANG}/LC_MESSAGES"; \
FILE_MO=$${FILE_PO##*/}; FILE_MO="$${FILE_MO%_*.po}.mo"; \
PATH_FILE_MO="/usr/share/locale/$${LANG}/LC_MESSAGES/$${FILE_MO}"; \
echo $${FILE_PO}; \
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 /usr/share/icons/hicolor/$${SIZE}x$${SIZE}/apps; \
rsvg-convert -w $${SIZE} -h $${SIZE} -f svg --keep-image-data ru.ublinux.${PKGNAME}.svg -o "/usr/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/ru.ublinux.${PKGNAME}.svg"; \
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 /usr/share/icons/hicolor/scalable/apps
@install -Dm644 -t /usr/share/icons/hicolor/scalable/apps/ ru.ublinux.${PKGNAME}.svg
@install -Dm755 -t /usr/bin/ ${CMAKE_BUILD_DIR}/${PKGNAME}
@install -Dm644 -t /usr/share/applications/ ${PKGNAME}.desktop
@install -Dm755 /usr/share/${PKGNAME}/ -d ui
@install -Dm755 /usr/share/${PKGNAME}/ -d css
@install -Dm644 -t /usr/share/${PKGNAME}/ui/ ${PKGNAME}.glade
@install -Dm644 -t /usr/share/${PKGNAME}/css/ ${PKGNAME}.css
@install -Dm644 -t /usr/share/${PKGNAME}/ui/ ublinux-logo.svg
@install -Dm766 -t /etc/xdg/${PKGNAME}/ ${PKGNAME}.conf
@install -Dm644 -t /usr/share/${PKGNAME}/ui/ ${PKGNAME}-banner.png
@gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null
@update-desktop-database --quiet 2>/dev/null
@touch /usr/share/applications
@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}${PREFIX}/etc/xdg"
@install -Dm744 -t "${DESTDIR}${PREFIX}/etc/xdg/${PKGNAME}/" "${PKGNAME}.conf"
@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 -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/images/" "ublinux-logo.svg"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/images/" "${PKGNAME}-banner.png"
@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:
@ -134,21 +135,24 @@ clean:
echo "Clean: error, compile directory exist ${CMAKE_BUILD_DIR}"; \
else \
echo "Clean: OK"; \
fi; \
version="$$(cat VERSION.md)"; \
version=$${version:8}; \
search="s/string version_application.*"; \
echo $$search; \
replace="string version_application = ;"; \
sed -i -e "$$search/$$replace/gi" source/ubl-settings-manager.h; \
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 "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"

@ -1,2 +1,28 @@
# ubl-settings-manager
# Выполнить
# 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)

Before

Width:  |  Height:  |  Size: 210 KiB

After

Width:  |  Height:  |  Size: 210 KiB

@ -9,7 +9,11 @@ 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 -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-manager.c

@ -11,17 +11,17 @@
#define CssPath "/usr/share/ubl-settings-manager/css/ubl-settings-manager.css"
#define GlobalConfigPath "/etc/xdg/ubl-settings-manager/ubl-settings-manager.conf"
#define UserConfigPath "/.config/ubl-settings-manager/ubl-settings-manager.conf"
#define AppIconPath "ru.ublinux.ubl-settings-manager"
#define AppBannerPath "/usr/share/ubl-settings-manager/ui/ubl-settings-manager-banner.png"
#define AppIconPath "com.ublinux.ubl-settings-manager"
#define AppBannerPath "/usr/share/ubl-settings-manager/images/ubl-settings-manager-banner.png"
#define DesktopPath "/usr/share/applications/"
#define IconPicturesPath "/usr/share/icons/hicolor/scalable/apps/"
#define ublinux_logo "/usr/share/ubl-settings-manager/ui/ublinux-logo.svg"
#define ublinux_logo "/usr/share/ubl-settings-manager/images/ublinux-logo.svg"
#define LocalePath "/usr/share/locale"
#define LocaleName "ubl-settings-manager"
#define ubl_settings_infoPath "ubl-settings-info"
#define ubl_settings_infoPathLaunch "ubl-settings-info --socket-id="
typedef char* string;
string version_application = ;
string version_application = "1.2";
typedef struct apps{

@ -8,7 +8,7 @@ Comment=ubl-settings-manager
Comment[ru]=Приложение для управления настройками UBLinux
Type=Application
Exec=ubl-settings-manager
Icon=ru.ublinux.ubl-settings-manager
Icon=com.ublinux.ubl-settings-manager
Terminal=false
X-XfcePluggable=false
Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;

@ -456,7 +456,7 @@
<property name="height-request">64</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">ru.ublinux.ubl-settings-manager</property>
<property name="icon-name">com.ublinux.ubl-settings-manager</property>
</object>
<packing>
<property name="expand">False</property>
@ -627,7 +627,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixel-size">32</property>
<property name="icon-name">ru.ublinux.ubl-settings-manager</property>
<property name="icon-name">com.ublinux.ubl-settings-manager</property>
<property name="icon_size">5</property>
</object>
</child>
@ -800,7 +800,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixel-size">32</property>
<property name="icon-name">ru.ublinux.ubl-settings-manager</property>
<property name="icon-name">com.ublinux.ubl-settings-manager</property>
<property name="icon_size">5</property>
</object>
</child>
@ -1202,7 +1202,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixel-size">32</property>
<property name="icon-name">ru.ublinux.ubl-settings-manager</property>
<property name="icon-name">com.ublinux.ubl-settings-manager</property>
<property name="icon_size">5</property>
</object>
</child>
@ -1455,7 +1455,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixel-size">32</property>
<property name="icon-name">ru.ublinux.ubl-settings-manager</property>
<property name="icon-name">com.ublinux.ubl-settings-manager</property>
<property name="icon_size">5</property>
</object>
</child>
@ -1885,7 +1885,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixel-size">32</property>
<property name="icon-name">ru.ublinux.ubl-settings-manager</property>
<property name="icon-name">com.ublinux.ubl-settings-manager</property>
<property name="icon_size">5</property>
</object>
</child>
@ -1971,7 +1971,7 @@
<property name="website-label" translatable="yes">Project Home Page</property>
<property name="authors">UBGroup</property>
<property name="artists">UBGroup</property>
<property name="logo-icon-name">ru.ublinux.ubl-settings-manager</property>
<property name="logo-icon-name">com.ublinux.ubl-settings-manager</property>
<property name="license-type">gpl-2-0</property>
<child internal-child="vbox">
<object class="GtkBox">

@ -1,20 +1,20 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# 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 <info@ublinux.com>, 2022
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-03-17 18:00+0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Project-Id-Version: ubl-settings-manager 1.0\n"
"Report-Msgid-Bugs-To: info@ublinux.com\n"
"POT-Creation-Date: 2023-01-01 00:00+0600\n"
"PO-Revision-Date: 2023-01-01 00:00+0600\n"
"Last-Translator: UBLinux Team <info@ublinux.com>\n"
"Language-Team: UBLinux Team <info@ublinux.com>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: source/ubl-settings-manager.c:632

@ -1,18 +1,18 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# 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 <info@ublinux.com>, 2022
#
#, fuzzy
msgid "translateinfo\n"
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-03-16 12:28+0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"Project-Id-Version: ubl-settings-manager 1.0\n"
"Report-Msgid-Bugs-To: info@ublinux.com\n"
"POT-Creation-Date: 2023-01-01 00:00+0600\n"
"PO-Revision-Date: 2023-01-01 00:00+0600\n"
"Last-Translator: UBLinux Team <info@ublinux.com>\n"
"Language-Team: Russian - UBLinux Team <info@ublinux.com>\n"
"Language: Russian\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

Loading…
Cancel
Save