Merge pull request 'master' (#11) from Igor1/ubl-settings-bootloader:master into develop
Reviewed-on: #11pull/16/head
commit
7e2cc70ac2
@ -0,0 +1,5 @@
|
||||
ubl-settings-bootloader.glade~
|
||||
test.cpp
|
||||
.vscode
|
||||
ubl-settings-bootloader
|
||||
ubl-settings-bootloader_ru.po~
|
||||
@ -0,0 +1,162 @@
|
||||
#!/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-bootloader
|
||||
|
||||
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-bootloader.cc; \
|
||||
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/${PKGNAME}/images/logo-background.png"
|
||||
@$(RM) "${DESTDIR}${PREFIX}/share/polkit-1/actions/com.ublinux.pkexec.${PKGNAME}.exec.policy"
|
||||
@$(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 "${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 png --keep-image-data "com.ublinux.${PKGNAME}.svg" -o "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/com.ublinux.${PKGNAME}.png"; \
|
||||
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}${PREFIX}/share/applications"
|
||||
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/applications/" "${PKGNAME}.desktop"
|
||||
@install -dm755 "${DESTDIR}${PREFIX}/share/polkit-1/actions"
|
||||
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/polkit-1/actions/" "com.ublinux.pkexec.${PKGNAME}.exec.policy"
|
||||
@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/" "logo-background.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"
|
||||
@install -Dm644 -t /usr/share/${PKGNAME}/ cmdline-linux.csv
|
||||
@install -Dm644 -t /usr/share/${PKGNAME}/ grub-terminal-input.csv
|
||||
@install -Dm644 -t /usr/share/${PKGNAME}/ grub-terminal-output.csv
|
||||
@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"
|
||||
@ -1,2 +1,44 @@
|
||||
# ubl-settings-bootloader
|
||||
# Настройка загрузчика
|
||||
[RU] Утилита для настройки загрузчика
|
||||
|
||||
Utility for setting the bootloader
|
||||
|
||||

|
||||
|
||||
# Build
|
||||
In order to build ubl-settings-bootloader 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
|
||||
```
|
||||
# Usage
|
||||
```sh
|
||||
$ ubl-settings-bootloader --help
|
||||
GTK settings bootloader for UBLinux
|
||||
|
||||
Usage: ubl-settings-bootloader [OPTIONS...]
|
||||
Options:
|
||||
-h, --help Show this help
|
||||
-V, --version Show package version
|
||||
|
||||
$ ubl-settings-bootloader --version
|
||||
ubl-settings-bootloader version: x.xx
|
||||
```
|
||||
@ -0,0 +1 @@
|
||||
VERSION 1.0
|
||||
|
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 107 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
|
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 123 KiB |
@ -0,0 +1,59 @@
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
project(ubl-settings-bootloader)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
pkg_check_modules(GTK REQUIRED gtkmm-3.0)
|
||||
include_directories(${GTK_INCLUDE_DIRS})
|
||||
link_directories(${GTK_LIBRARY_DIRS})
|
||||
add_definitions(${GTK_CFLAGS_OTHER})
|
||||
|
||||
find_library(WEBKIT_LIBRARIES_FOUND webkit2gtk-4.0 webkit2gtk-web-extension-4.0)
|
||||
|
||||
option(WEBKIT_FOUND "No" OFF)
|
||||
|
||||
find_library(WEBKIT_LIBRARIES_FOUND webkit2gtk-4.0 webkit2gtk-web-extension-4.0)
|
||||
if(WEBKIT_LIBRARIES_FOUND)
|
||||
option(WEBKIT_FOUND "Yes" ON)
|
||||
PKG_CHECK_MODULES(WEBKIT REQUIRED webkit2gtk-4.0 webkit2gtk-web-extension-4.0)
|
||||
include_directories(${WEBKIT_INCLUDE_DIRS})
|
||||
link_directories(${WEBKIT_LIBRARY_DIRS})
|
||||
add_definitions(${WEBKIT_CFLAGS_OTHER})
|
||||
endif()
|
||||
configure_file(ubl-settings-bootloader.h.in ubl-settings-bootloader-cm.h)
|
||||
|
||||
|
||||
|
||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a -g")
|
||||
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-bootloader-cm.h
|
||||
ubl-settings-bootloader.h
|
||||
ubl-settings-bootloader.cc
|
||||
save.h
|
||||
save.cc
|
||||
load.h
|
||||
load.cc
|
||||
my_process.h
|
||||
my_process.cc
|
||||
util.h
|
||||
util.cc
|
||||
ubl-util-standard.h
|
||||
ubl-util-standard.c
|
||||
main.cc)
|
||||
|
||||
set(LIBRARIES
|
||||
${GTK_LIBRARIES}
|
||||
pthread)
|
||||
|
||||
add_executable(ubl-settings-bootloader ${SOURCE_FILES})
|
||||
target_link_libraries(ubl-settings-bootloader PUBLIC ${WEBKIT_LIBRARIES} ${LIBRARIES})
|
||||
target_include_directories(ubl-settings-bootloader PUBLIC
|
||||
"${PROJECT_BINARY_DIR}"
|
||||
${WEBKIT_INCLUDE_DIRS}
|
||||
)
|
||||
install(TARGETS ubl-settings-bootloader DESTINATION bin)
|
||||
@ -0,0 +1,34 @@
|
||||
#include "load.h"
|
||||
|
||||
namespace Lib_Load{
|
||||
void Load::set_count_error(int count_error) {
|
||||
process.set_count_error(count_error);
|
||||
}
|
||||
string Load::get_cmd_error() {
|
||||
return process.get_cmd_error();
|
||||
}
|
||||
map<string, string>& Load::get_load_data(std::map <string, string> &map_temp, string cmd) {
|
||||
string response = "";
|
||||
string key = "";
|
||||
string value = "";
|
||||
response = process.call_all_sections(cmd);
|
||||
vector<string> vec_str_key_value = Utils::split(response, '\n');
|
||||
for (const string ¶m: vec_str_key_value) {
|
||||
if ((param.find("(null)") == std::string::npos) && (param.length() != 0 )) {
|
||||
if (param.find("=") != std::string::npos) {
|
||||
size_t index = param.find("=");
|
||||
key = param.substr(0, index);
|
||||
value = param.substr(index + 1, param.length());
|
||||
Utils::str_replace_all(value, " \"","");
|
||||
Utils::str_replace_all(value, "\"","");
|
||||
map_temp[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map_temp;
|
||||
}
|
||||
int Load::get_count_error() {
|
||||
return process.get_count_error();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
#ifndef LOAD_H
|
||||
#define LOAD_H
|
||||
|
||||
#include "my_process.h"
|
||||
namespace Lib_Load{
|
||||
class Load {
|
||||
|
||||
private:
|
||||
string sections;
|
||||
My_Process::My_Process_call process = My_Process::My_Process_call();
|
||||
public:
|
||||
int get_count_error();
|
||||
void set_count_error(int count_error);
|
||||
string get_cmd_error();
|
||||
map<string, string>& get_load_data(std::map <string, string> &map_temp, string str_flag_load);
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
@ -0,0 +1,94 @@
|
||||
#include "ubl-settings-bootloader.h"
|
||||
|
||||
|
||||
void pars_flag(int index_start, int argc, char* argv[]);
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
string str_argv= "";
|
||||
string str_cmd_argv = "";
|
||||
for (int i=1; i<argc; i++){
|
||||
str_cmd_argv+= to_string(*argv[i]) + " ";
|
||||
}
|
||||
if (argc > 1){
|
||||
str_argv = argv[1];
|
||||
}
|
||||
bindtextdomain("ubl-settings-bootloader", "/usr/share/locale/");
|
||||
bind_textdomain_codeset("ubl-settings-bootloader", "UTF-8");
|
||||
textdomain("ubl-settings-bootloader");
|
||||
if (str_argv.find("--socket-id") != std::string::npos) {
|
||||
auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example.plug");
|
||||
auto builder = Gtk::Builder::create_from_file(path_glade);
|
||||
Glib::init();
|
||||
setlocale(LC_ALL, "");
|
||||
Glib::OptionContext context;
|
||||
|
||||
CmdArgParser parser{
|
||||
"Socket ID",
|
||||
"Command line argument for socket ID communication.",
|
||||
"No help available, sorry"
|
||||
};
|
||||
|
||||
context.set_main_group(parser);
|
||||
context.parse(argc, argv);
|
||||
|
||||
::Window socketID = parser.GetSocketID();
|
||||
|
||||
// Handle plug:
|
||||
SettingsPlug plug{socketID, builder};
|
||||
plug.show();
|
||||
|
||||
app->run(plug);
|
||||
return 0;
|
||||
}
|
||||
else if (str_argv.find("-") != std::string::npos || argc == 1) {
|
||||
int len_argv = 1;
|
||||
auto app = Gtk::Application::create(len_argv, argv, "org.gtkmm.example.plug");
|
||||
auto builder = Gtk::Builder::create_from_file(path_glade);
|
||||
pars_flag(1, argc, argv);
|
||||
MainWindow* wnd = nullptr;
|
||||
builder->get_widget_derived("window", wnd);
|
||||
auto r = app->run(*wnd);
|
||||
delete wnd;
|
||||
return r;
|
||||
}
|
||||
|
||||
}
|
||||
void pars_flag(int index_start, int argc, char* argv[]) {
|
||||
string str_argv = "";
|
||||
for (int i = index_start; i<argc; i++){
|
||||
str_argv = argv[i];
|
||||
if (str_argv == "--help" || str_argv == "-h"){
|
||||
help();
|
||||
exit(1);
|
||||
}
|
||||
else if (str_argv == "--version" || str_argv == "-v"){
|
||||
string version = string(str_version) + version_application + "\n";
|
||||
cout << version.c_str();
|
||||
exit(1);
|
||||
}
|
||||
else if (str_argv == "--lock-help") {
|
||||
flag_lock_help = true;
|
||||
}
|
||||
else if (str_argv == "--lock-save") {
|
||||
flag_save = true;
|
||||
flag_save_local = true;
|
||||
flag_save_global = true;
|
||||
}
|
||||
else if (str_argv == "--lock-save-local"){
|
||||
flag_save_local = true;
|
||||
}
|
||||
else if (str_argv == "--lock-save-global"){
|
||||
flag_save_global = true;
|
||||
}
|
||||
else if (str_argv == "--lock-load-global"){
|
||||
flag_load_global = true;
|
||||
}
|
||||
else{
|
||||
if (index_start == 1){
|
||||
g_print(_(no_recognized));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
#include "my_process.h"
|
||||
#include "util.h"
|
||||
|
||||
namespace My_Process {
|
||||
#define debug false
|
||||
struct Utils::Result<string> My_Process_call::call(string cmd) {
|
||||
this->i_error_old = this->i_error;
|
||||
struct Utils::Result<string> obj_result;
|
||||
string response = Utils::call(cmd);
|
||||
obj_result.response = response;
|
||||
if ((response.find("(null)") == std::string::npos) && (response.length() != 0 )) {
|
||||
if (response.find("=") != std::string::npos) {
|
||||
if (response.find("\n") != std::string::npos) {
|
||||
response = response.substr(response.find("=")+1,response.length());
|
||||
response = response.substr(0,response.find("\n"));
|
||||
obj_result.response = response;
|
||||
obj_result.error = 0;
|
||||
}
|
||||
else {
|
||||
obj_result.error = 1;
|
||||
this->i_error += 1;
|
||||
this->log_mess_error(cmd);
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj_result.error = 2;
|
||||
this->i_error += 1;
|
||||
str_cmd_error = cmd;
|
||||
this->log_mess_error(cmd);
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj_result.error = 3;
|
||||
this->i_error += 1;
|
||||
str_cmd_error = cmd;
|
||||
this->log_mess_error(cmd);
|
||||
}
|
||||
return obj_result;
|
||||
}
|
||||
|
||||
int My_Process::get_count_error() {
|
||||
return this->i_error;
|
||||
}
|
||||
|
||||
void My_Process::set_back_count_error() {
|
||||
this->i_error = this->i_error_old;
|
||||
}
|
||||
|
||||
void My_Process_system::call(string cmd, string thread_str = "") {
|
||||
string cmd_new = cmd + " " + thread_str;
|
||||
int response_cmd = system(cmd_new.c_str());
|
||||
if (response_cmd != 0) {
|
||||
this->i_error += 1;
|
||||
}
|
||||
}
|
||||
|
||||
void My_Process::set_count_error(int count_error) {
|
||||
this->i_error = count_error;
|
||||
this->str_cmd_error = "";
|
||||
}
|
||||
|
||||
void My_Process::log_mess_error(string) {
|
||||
}
|
||||
|
||||
string My_Process::get_cmd_error() {
|
||||
return this->str_cmd_error;
|
||||
}
|
||||
string My_Process_call::call_all_sections(string cmd) {
|
||||
char buffer[PATH_MAX] = {0};
|
||||
std::string result = "";
|
||||
FILE* pipe = popen(cmd.c_str(), "r");
|
||||
if (!pipe) throw std::runtime_error("popen() failed!");
|
||||
try {
|
||||
while (fgets(buffer, sizeof buffer, pipe) != NULL) {
|
||||
result += buffer;
|
||||
}
|
||||
} catch (...) {
|
||||
pclose(pipe);
|
||||
throw;
|
||||
}
|
||||
pclose(pipe);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
#ifndef SAVE_H
|
||||
#define SAVE_H
|
||||
|
||||
#include "util.h"
|
||||
namespace My_Process{
|
||||
class My_Process {
|
||||
public:
|
||||
int i_error = 0;
|
||||
int i_error_old = 0;
|
||||
string str_cmd_error = "";
|
||||
int get_count_error();
|
||||
void set_count_error(int count_error);
|
||||
void set_back_count_error();
|
||||
void log_mess_error(string);
|
||||
string get_cmd_error();
|
||||
};
|
||||
|
||||
|
||||
class My_Process_call: public My_Process {
|
||||
public:
|
||||
struct Utils::Result<string> call(string cmd);
|
||||
string call_all_sections(string cmd);
|
||||
|
||||
};
|
||||
|
||||
class My_Process_system: public My_Process {
|
||||
public:
|
||||
void call(string cmd, string thread_str);
|
||||
|
||||
};
|
||||
}
|
||||
#endif
|
||||
@ -0,0 +1,151 @@
|
||||
#include "save.h"
|
||||
|
||||
namespace Lib_save {
|
||||
|
||||
vector<string> Save::get_error() {
|
||||
return this->vec_errors;
|
||||
}
|
||||
|
||||
bool Save::get_state_save() {
|
||||
return this->flag_no_save;
|
||||
}
|
||||
|
||||
void Save::set_data_global(std::map <string, string> &map_global) {
|
||||
this->map_global = &map_global;
|
||||
}
|
||||
|
||||
void Save::set_data_local(std::map <string, string> &map_local) {
|
||||
this->map_local = &map_local;
|
||||
}
|
||||
|
||||
void Save::set_data_gui(std::map <string, string> &map_gui) {
|
||||
this->map_gui = &map_gui;
|
||||
}
|
||||
|
||||
bool Save::check_save(string flag_save, string key_name) {
|
||||
std::map <string, string>:: iterator iter_map_data;
|
||||
std::map <string, string>:: iterator iter_map_data_old;
|
||||
std::map <string, string> *map_data_old;
|
||||
if (flag_save == "system") {
|
||||
map_data_old = map_local;
|
||||
}
|
||||
else if (flag_save == "global") {
|
||||
map_data_old = map_global;
|
||||
}
|
||||
iter_map_data = (*map_gui).find(key_name);
|
||||
iter_map_data_old = (*map_data_old).find(key_name);
|
||||
if ((*map_local).find(key_name) != (*map_local).end() && (*map_global).find(key_name) != (*map_global).end()) {
|
||||
if ((*map_local)[key_name] != (*map_global)[key_name]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (iter_map_data_old == (*map_data_old).end() && iter_map_data != (*map_gui).end()) {
|
||||
return true;
|
||||
}
|
||||
else if (iter_map_data->second != iter_map_data_old->second) {
|
||||
return true;
|
||||
}
|
||||
else if (iter_map_data->second.length() == 0 && iter_map_data_old->second.length() == 0) {
|
||||
return false;
|
||||
}
|
||||
else if (iter_map_data->second == iter_map_data_old->second) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int Save::get_count_error() {
|
||||
return process.get_count_error();
|
||||
}
|
||||
|
||||
string Save::get_cmd_error() {
|
||||
return process.get_cmd_error();
|
||||
}
|
||||
|
||||
void Save::set_count_error(int count_error) {
|
||||
process.set_count_error(count_error);
|
||||
}
|
||||
|
||||
void Save::set_vec_params(vector<string>& vec_param_names) {
|
||||
this->vec_param_names = &vec_param_names;
|
||||
}
|
||||
|
||||
void Save::save(string sections, string str_flag_save) {
|
||||
string key = "";
|
||||
string value = "";
|
||||
string cmd = "";
|
||||
string str_error = "";
|
||||
this->flag_no_save = true;
|
||||
for (const auto &key: *vec_param_names) {
|
||||
if (map_gui->find(key) != map_gui->end()) {
|
||||
value = (*map_gui)[key];
|
||||
if (this->check_save(str_flag_save, key)) {
|
||||
if (value.length() != 0) {
|
||||
cmd = "ubconfig --target " + str_flag_save + " set " + sections + " " +
|
||||
key + "=\"" + value + "\"";
|
||||
}
|
||||
else if (value.length() == 0) {
|
||||
cmd = "ubconfig --target " + str_flag_save + " remove " + sections + " " + key;
|
||||
}
|
||||
else {
|
||||
cmd = "";
|
||||
}
|
||||
if (cmd.length() != 0) {
|
||||
process.call(cmd, "");
|
||||
this->flag_no_save = false;
|
||||
str_error = process.get_cmd_error();
|
||||
if (str_error.length() != 0) {
|
||||
this->vec_errors.push_back(str_error);
|
||||
str_error = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
void Save::save_one_cmd(string cmd1, string cmd_remove, string str_flag_save) {
|
||||
string key = "";
|
||||
string value = "";
|
||||
string cmd = "";
|
||||
this->flag_no_save = true;
|
||||
cmd = cmd1;
|
||||
string remove = cmd_remove;
|
||||
for (const auto &key: *vec_param_names) {
|
||||
if (map_gui->find(key) != map_gui->end()) {
|
||||
value = (*map_gui)[key];
|
||||
if (this->check_save(str_flag_save, key)) {
|
||||
if (value.length() != 0) {
|
||||
cmd = cmd + key + "=\"" + value + "\" ";
|
||||
}
|
||||
else if (value.length() == 0) {
|
||||
remove = remove + key + " ";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cmd.length() != cmd1.length()) {
|
||||
this->template_save(cmd);
|
||||
}
|
||||
if (cmd_remove.length() != remove.length()) {
|
||||
this->template_save(remove);
|
||||
}
|
||||
}
|
||||
|
||||
void Save::template_save(string cmd) {
|
||||
string str_error = "";
|
||||
process.call(cmd, "");
|
||||
this->flag_no_save = false;
|
||||
str_error = process.get_cmd_error();
|
||||
if (str_error.length() != 0) {
|
||||
this->vec_errors.push_back(str_error);
|
||||
str_error = "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
#ifndef MY_PROCESS_H
|
||||
#define MY_PROCESS_H
|
||||
|
||||
#include "my_process.h"
|
||||
namespace Lib_save {
|
||||
|
||||
class Save {
|
||||
private:
|
||||
std::map <string, string> *map_global;
|
||||
std::map <string, string> *map_local;
|
||||
std::map <string, string> *map_gui;
|
||||
vector<string> vec_errors;
|
||||
vector<string>* vec_param_names;
|
||||
My_Process::My_Process_system process = My_Process::My_Process_system();
|
||||
bool flag_no_save;
|
||||
void template_save(string cmd);
|
||||
public:
|
||||
void set_data_global(std::map <string, string> &map_global);
|
||||
void set_data_local(std::map <string, string> &map_local);
|
||||
void set_data_gui(std::map <string, string> &map_gui);
|
||||
bool check_save(string flag_save, string key_name);
|
||||
bool get_state_save();
|
||||
|
||||
void save_one_cmd(string cmd1, string cmd_remove, string str_flag_save);
|
||||
int get_count_error();
|
||||
string get_cmd_error();
|
||||
void set_count_error(int count_error);
|
||||
void set_vec_params(vector<string>& vec_param_names);
|
||||
void save(string sections, string str_flag_save) ;
|
||||
vector<string> get_error();
|
||||
};
|
||||
}
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1 @@
|
||||
#cmakedefine WEBKIT_FOUND
|
||||
@ -0,0 +1,91 @@
|
||||
#include "ubl-util-standard.h"
|
||||
#ifndef __cplusplus
|
||||
#ifndef UBL_GET_STANDARD_UI
|
||||
#define UBL_GET_STANDARD_UI
|
||||
|
||||
|
||||
inline returnstruct *ubl_make_plugs(GtkWidget *LeftWidget, GtkWidget *RightWidget, int left_plug_id, int right_plug_id){
|
||||
returnstruct *ret=(returnstruct*)malloc(sizeof(returnstruct*));
|
||||
if (left_plug_id>0&&LeftWidget){
|
||||
GtkWidget *plug=gtk_plug_new(left_plug_id);
|
||||
GtkWidget *toplug=LeftWidget;
|
||||
if (gtk_widget_get_parent(GTK_WIDGET(toplug))){
|
||||
g_object_ref(G_OBJECT(toplug));
|
||||
GtkWidget *parent=gtk_widget_get_parent(toplug);
|
||||
gtk_container_remove(GTK_CONTAINER(parent),toplug);
|
||||
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
|
||||
} else
|
||||
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
|
||||
gtk_widget_show(GTK_WIDGET(plug));
|
||||
ret->plugLeft=plug;
|
||||
}
|
||||
if (right_plug_id>0&&RightWidget){
|
||||
GtkWidget *plug=gtk_plug_new(right_plug_id);
|
||||
GtkWidget *toplug=RightWidget;
|
||||
if (gtk_widget_get_parent(GTK_WIDGET(toplug))){
|
||||
g_object_ref(G_OBJECT(toplug));
|
||||
GtkWidget *parent=gtk_widget_get_parent(toplug);
|
||||
gtk_container_remove(GTK_CONTAINER(parent),toplug);
|
||||
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
|
||||
} else
|
||||
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
|
||||
gtk_widget_show(GTK_WIDGET(plug));
|
||||
ret->plugRight=plug;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
|
||||
inline void ubl_make_plugs(Gtk::Widget *LeftWidget, Gtk::Widget *RightWidget, int left_plug_id, int right_plug_id){
|
||||
if (left_plug_id>0&&LeftWidget){
|
||||
GtkWidget *plug=gtk_plug_new(left_plug_id);
|
||||
GtkWidget *toplug=GTK_WIDGET(LeftWidget->gobj());
|
||||
{GdkScreen *screen = gtk_widget_get_screen(plug);
|
||||
gtk_widget_set_app_paintable(plug,TRUE);
|
||||
GdkVisual *colormap = gdk_screen_get_rgba_visual(screen);
|
||||
gtk_widget_set_visual(plug, colormap);}
|
||||
{GdkScreen *screen = gtk_widget_get_screen(toplug);
|
||||
gtk_widget_set_app_paintable(toplug,TRUE);
|
||||
GdkVisual *colormap = gdk_screen_get_rgba_visual(screen);
|
||||
gtk_widget_set_visual(toplug, colormap);}
|
||||
if (gtk_widget_get_parent(GTK_WIDGET(toplug))){
|
||||
g_object_ref(G_OBJECT(toplug));
|
||||
GtkWidget *parent=gtk_widget_get_parent(toplug);
|
||||
gtk_container_remove(GTK_CONTAINER(parent),toplug);
|
||||
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
|
||||
} else
|
||||
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
|
||||
gtk_widget_show(GTK_WIDGET(plug));
|
||||
gtk_style_context_add_class(gtk_widget_get_style_context(plug),"bkim");
|
||||
gtk_style_context_add_class(gtk_widget_get_style_context(toplug),"bkim");
|
||||
gtk_style_context_add_class(gtk_widget_get_style_context(plug),"primary-toolbar");
|
||||
}
|
||||
if (right_plug_id>0&&RightWidget){
|
||||
GtkWidget *plug=gtk_plug_new(right_plug_id);
|
||||
GtkWidget *toplug=GTK_WIDGET(RightWidget->gobj());
|
||||
{GdkScreen *screen = gtk_widget_get_screen(plug);
|
||||
gtk_widget_set_app_paintable(plug,TRUE);
|
||||
GdkVisual *colormap = gdk_screen_get_rgba_visual(screen);
|
||||
gtk_widget_set_visual(plug, colormap);}
|
||||
{GdkScreen *screen = gtk_widget_get_screen(toplug);
|
||||
gtk_widget_set_app_paintable(toplug,TRUE);
|
||||
GdkVisual *colormap = gdk_screen_get_rgba_visual(screen);
|
||||
gtk_widget_set_visual(toplug, colormap);}
|
||||
if (gtk_widget_get_parent(GTK_WIDGET(toplug))){
|
||||
g_object_ref(G_OBJECT(toplug));
|
||||
GtkWidget *parent=gtk_widget_get_parent(toplug);
|
||||
gtk_container_remove(GTK_CONTAINER(parent),toplug);
|
||||
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
|
||||
} else
|
||||
gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug));
|
||||
gtk_widget_show(GTK_WIDGET(plug));
|
||||
gtk_style_context_add_class(gtk_widget_get_style_context(plug),"bkim");
|
||||
gtk_style_context_add_class(gtk_widget_get_style_context(toplug),"bkim");
|
||||
gtk_style_context_add_class(gtk_widget_get_style_context(plug),"primary-toolbar");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -0,0 +1,20 @@
|
||||
#ifndef __cplusplus
|
||||
#include <gtk/gtk.h>
|
||||
#include <gtk/gtkx.h>
|
||||
|
||||
typedef struct {
|
||||
GtkWidget *plugLeft;
|
||||
GtkWidget *plugRight;
|
||||
|
||||
|
||||
} returnstruct;
|
||||
static returnstruct *ubl_make_plugs(GtkWidget *LeftWidget, GtkWidget *RightWidget, int left_plug_id, int right_plug_id);
|
||||
#else
|
||||
#include <gtkmm.h>
|
||||
#include <gtkmm/stock.h>
|
||||
#include <gtkmm/window.h>
|
||||
#include <gtkmm/plug.h>
|
||||
|
||||
|
||||
static void ubl_make_plugs(Gtk::Widget *LeftWidget, Gtk::Widget *RightWidget, int left_plug_id, int right_plug_id);
|
||||
#endif
|
||||
@ -0,0 +1,169 @@
|
||||
#include "util.h"
|
||||
|
||||
namespace Utils {
|
||||
|
||||
array<vector<string>, 5> read_csv(const string& filename) {
|
||||
array<vector<string>, 5> array_vectors;
|
||||
vector<string> vec_option;
|
||||
vector<string> vec_opcision;
|
||||
ifstream file(filename);
|
||||
string line;
|
||||
char delimiter = ',';
|
||||
getline(file, line);
|
||||
while (getline(file, line)) {
|
||||
stringstream stream(line);
|
||||
string option;
|
||||
string opcision;
|
||||
getline(stream, option, delimiter);
|
||||
string line_local = stream.str();
|
||||
if (line_local.find("\"") != string::npos) {
|
||||
string str_delimiter = "\"";
|
||||
vector<int> point = find_all(line_local, str_delimiter);
|
||||
size_t len = point.size();
|
||||
if (len >= 2) {
|
||||
int index_start = point[len-2];
|
||||
int index_end = point[len-1];
|
||||
opcision = line_local.substr(index_start, index_end);
|
||||
index_end = opcision.find("\"");
|
||||
if (opcision.find("\"") != string::npos) {
|
||||
opcision.replace(index_end, opcision.length(), "");
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
opcision = "error";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
getline(stream, opcision, delimiter);
|
||||
}
|
||||
|
||||
|
||||
vec_option.push_back(option);
|
||||
vec_opcision.push_back(opcision);
|
||||
}
|
||||
|
||||
array_vectors[0] = vec_option;
|
||||
array_vectors[1] = vec_opcision;
|
||||
return array_vectors;
|
||||
}
|
||||
|
||||
string call(string cmd) {
|
||||
FILE *fp;
|
||||
int status;
|
||||
char path[PATH_MAX] = {0};
|
||||
fp = popen(cmd.c_str(), "r");
|
||||
if (fp == NULL) {
|
||||
exit(1);
|
||||
}
|
||||
while (fgets(path, PATH_MAX, fp) != NULL) {
|
||||
break;
|
||||
}
|
||||
status = pclose(fp);
|
||||
if (status == -1) {
|
||||
exit(1);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
vector<int> find_all(string &str_ntp, string substr) {
|
||||
size_t index = 0;
|
||||
vector<int> sub_index;
|
||||
while ((index = str_ntp.find(substr, index)) != std::string::npos) {
|
||||
index += substr.length();
|
||||
sub_index.push_back(index);
|
||||
}
|
||||
return sub_index;
|
||||
}
|
||||
|
||||
void str_remove(std::string& source, std::string to_remove) {
|
||||
string::size_type n = to_remove.length();
|
||||
for (string::size_type i = source.find(to_remove);
|
||||
i != string::npos;
|
||||
i = source.find(to_remove))
|
||||
source.erase(i, n);
|
||||
}
|
||||
|
||||
void str_replace_all(std::string& str_base, string str_find, string sReplacement)
|
||||
{
|
||||
size_t pos = 0, fpos;
|
||||
while ((fpos = str_base.find(str_find, pos)) != std::string::npos)
|
||||
{
|
||||
str_base.replace(fpos, str_find.size(), sReplacement);
|
||||
pos = fpos + sReplacement.size();
|
||||
}
|
||||
}
|
||||
std::vector<std::string> split(std::string text, char delim) {
|
||||
std::string line;
|
||||
std::vector<std::string> vec;
|
||||
std::stringstream ss(text);
|
||||
while(std::getline(ss, line, delim)) {
|
||||
vec.push_back(line);
|
||||
}
|
||||
return vec;
|
||||
}
|
||||
unsigned short read_uid_min_max(string filename, string search) {
|
||||
std::string line;
|
||||
int uid = 0;
|
||||
string remove_tab = "\t";
|
||||
string remove_space = " ";
|
||||
std::ifstream in(filename); // окрываем файл для чтения
|
||||
if (in.is_open()){
|
||||
while (getline(in, line)){
|
||||
try{
|
||||
if (line.find(search) != string::npos && (line.find("SYS_"+search) == string::npos)) {
|
||||
str_remove(line, search);
|
||||
str_remove(line, remove_space);
|
||||
str_remove(line, remove_tab);
|
||||
uid = atoi(line.c_str());
|
||||
}
|
||||
}
|
||||
catch (int x) {
|
||||
if (search == "UID_MIN"){
|
||||
uid = 1000;
|
||||
}
|
||||
else{
|
||||
uid = 65534;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (search == "UID_MIN") {
|
||||
uid = 1000;
|
||||
}
|
||||
else{
|
||||
uid = 65534;
|
||||
}
|
||||
}
|
||||
in.close();
|
||||
return uid;
|
||||
|
||||
}
|
||||
|
||||
vector <string> pars_users() {
|
||||
vector <string> vec_users;
|
||||
unsigned short uid_min = read_uid_min_max("/etc/login.defs", "UID_MIN");
|
||||
unsigned short uid_max =read_uid_min_max("/etc/login.defs", "UID_MAX");
|
||||
while (true) {
|
||||
errno = 0;
|
||||
passwd* entry = getpwent();
|
||||
if (!entry) {
|
||||
if (errno) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if ((entry->pw_uid >= uid_min && entry->pw_uid < uid_max) || entry->pw_uid == 0) {
|
||||
vec_users.push_back(string(entry->pw_name));
|
||||
}
|
||||
}
|
||||
endpwent();
|
||||
return vec_users;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
#ifndef UTIL_H
|
||||
#define UTIL_H
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <array>
|
||||
#include <vector>
|
||||
#include <linux/limits.h>
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <array>
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
#include <stdio.h>
|
||||
#include <map>
|
||||
#include <pwd.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace Utils {
|
||||
template<typename Type>
|
||||
struct Result{
|
||||
Type response;
|
||||
int error;
|
||||
};
|
||||
|
||||
struct Passwd {
|
||||
string user;
|
||||
int uid;
|
||||
};
|
||||
|
||||
std::array<std::vector<std::string>, 5> read_csv(const std::string& filename);
|
||||
std::string call(std::string cmd);
|
||||
vector<int> find_all(string &str_ntp, string substr);
|
||||
void str_remove(std::string& source, std::string to_remove);
|
||||
void str_replace_all(string &str_base, string str_find, string str_replace);
|
||||
std::vector<std::string> split(std::string text, char delim);
|
||||
unsigned short read_uid_min_max(string filename, string search);
|
||||
vector <string> pars_users();
|
||||
string read_passwd(string username);
|
||||
int synopsis_show(string str_link);
|
||||
}
|
||||
#endif
|
||||
@ -0,0 +1,149 @@
|
||||
.textHead{
|
||||
text-shadow: 2px 2px @theme_bg_color;
|
||||
color: @theme_text_color;
|
||||
}
|
||||
.boxInfoMessError{
|
||||
background-color: #ea9999;
|
||||
}
|
||||
.boxInfoMessOK{
|
||||
background-color: #f3f0ac;
|
||||
}
|
||||
.bannerbackground {
|
||||
background-color: #404040;
|
||||
}
|
||||
.textHead{
|
||||
text-shadow: 1px 1px #ffffff;
|
||||
}
|
||||
.view_app {
|
||||
background-color: @theme_bg_color;
|
||||
}
|
||||
.view_app.view.cell:selected {
|
||||
background-color:@theme_selected_bg_color;
|
||||
color:@theme_selected_text_color;
|
||||
transition: 10ms ease-out;
|
||||
border-radius: 3px;
|
||||
}
|
||||
#GnomeIcon{
|
||||
border-style:solid;
|
||||
border-bottom-width: 1px;
|
||||
border-image: linear-gradient(90deg, alpha(@theme_text_color,0.4) 55%, alpha(@theme_bg_color, 0) 100%);
|
||||
border-image-slice: 1;
|
||||
}
|
||||
|
||||
#SepIcon{
|
||||
background-color: alpha(@theme_text_color, 0.6);
|
||||
}
|
||||
|
||||
#iconlabel {
|
||||
font-size:14px;
|
||||
font-weight: bold;
|
||||
|
||||
}
|
||||
.roundborder * {
|
||||
border-width:0px;
|
||||
border-radius:5px;
|
||||
}
|
||||
.noborder {
|
||||
border: none;
|
||||
}
|
||||
.menu:hover {
|
||||
border-color:alpha(@theme_text_color, 0.01);
|
||||
}
|
||||
.menu {
|
||||
border-color:alpha(@theme_text_color, 0.01);
|
||||
}
|
||||
.menu:hover >* {
|
||||
border-color:alpha(@theme_text_color, 0.01);
|
||||
}
|
||||
.menuitembottom{
|
||||
margin-top:0px;
|
||||
margin-bottom:3px;
|
||||
}
|
||||
.menuitemmiddle{
|
||||
margin-top:0px;
|
||||
margin-bottom:0px;
|
||||
}
|
||||
|
||||
.menuitemtop{
|
||||
margin-bottom:0px;
|
||||
}
|
||||
.menuitemtop *{
|
||||
margin:2px 2px 0 2px;
|
||||
padding: 5px 10px 3px 5px;
|
||||
}
|
||||
.menuitemmiddle *{
|
||||
margin:0 2px 0 2px;
|
||||
padding: 3px 10px 3px 5px;
|
||||
}
|
||||
.menuitembottom *{
|
||||
margin:0 2px 2px 2px;
|
||||
padding: 3px 10px 5px 5px;
|
||||
}
|
||||
.menuitemtop:hover {
|
||||
background:@theme_bg_color;
|
||||
border-color:inherit;
|
||||
border-left-width:inherit;
|
||||
border-right-width:inherit;
|
||||
}
|
||||
.menuitemmiddle:hover {
|
||||
background:@theme_bg_color;
|
||||
border-color:inherit;
|
||||
border-left-width:inherit;
|
||||
border-right-width:inherit;
|
||||
}
|
||||
.menuitembottom:hover {
|
||||
background:@theme_bg_color;
|
||||
border-color:inherit;
|
||||
border-left-width:inherit;
|
||||
border-right-width:inherit;
|
||||
|
||||
}
|
||||
.menuitemtop:hover* {
|
||||
margin:2px 2px 0 2px;
|
||||
padding: 5px 10px 3px 5px;
|
||||
background:@theme_selected_bg_color;
|
||||
border-radius:2px;
|
||||
}
|
||||
.menuitemmiddle:hover* {
|
||||
margin:0 2px 0 2px;
|
||||
padding: 3px 10px 3px 5px;
|
||||
background:@theme_selected_bg_color;
|
||||
border-radius:2px;
|
||||
}
|
||||
.menuitembottom:hover* {
|
||||
margin:0 2px 2px 2px;
|
||||
padding: 3px 10px 5px 5px;
|
||||
background:@theme_selected_bg_color;
|
||||
border-radius:2px;
|
||||
}
|
||||
|
||||
.workingbg, #workingbg {
|
||||
background-color:@theme_base_color;
|
||||
}
|
||||
.workingbg.view.cell:selected {
|
||||
background-color:@theme_selected_bg_color;
|
||||
}
|
||||
.workingbg.view.cell:hover {
|
||||
background-color:darker(@theme_selected_bg_color);
|
||||
color:@theme_selected_text_color;
|
||||
border-radius:3px;
|
||||
}
|
||||
.bkim {
|
||||
transition: 200ms ease-out;
|
||||
background-image: none;
|
||||
}
|
||||
.noborder{
|
||||
border:none;
|
||||
}
|
||||
|
||||
.bkim{
|
||||
opacity:0.99;
|
||||
border:none;
|
||||
}
|
||||
|
||||
.bkim_no_plug{
|
||||
background-color: transparent;
|
||||
opacity:0.99;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=ubl-settings-bootloader
|
||||
Name[ru]=Настройка загрузчика
|
||||
GenericName=Настройка загрузчика
|
||||
GenericName[ru]=Настройка загрузчика
|
||||
Comment=Bootloader setup application
|
||||
Comment[ru]=Приложение для настройки загрузчика
|
||||
Type=Application
|
||||
Exec=pkexec ubl-settings-bootloader
|
||||
Icon=com.ublinux.ubl-settings-bootloader
|
||||
Terminal=false
|
||||
X-XfcePluggable=true
|
||||
X-UBLPluggable=true
|
||||
Categories=XFCE;GTK;Settings;DesktopSettings;X-UBL-SettingsManager;X-UBL-SystemSettings;
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue