pull/3/head
parent dfb24e9286
commit 07bc962f4b

2
.gitignore vendored

@ -1 +1,3 @@
.vscode/ .vscode/
ubl-settings-usergroups.glade~
ubl-settings-usergroups

@ -25,6 +25,7 @@ all: init build
init: init:
@echo "Initialize ..."; \ @echo "Initialize ..."; \
sed -r "s/(version_application = ).*/\1\"$$(grep 'VERSION' ${FILE_VERSION} | cut -d" " -f2)\";/" -i source/ubl-settings-usergroups.h; \ sed -r "s/(version_application = ).*/\1\"$$(grep 'VERSION' ${FILE_VERSION} | cut -d" " -f2)\";/" -i source/ubl-settings-usergroups.h; \
gcc source/ubl-settings-usergroups.c source/ubl-utils.c -o ubl-settings-usergroups `pkg-config --cflags --libs gtk+-3.0` -g; \
echo "-- Build path: ${CMAKE_BUILD_DIR}" echo "-- Build path: ${CMAKE_BUILD_DIR}"
depend: depend:
@ -116,6 +117,7 @@ install: check uninstall
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/applications/" "${PKGNAME}.desktop" @install -Dm644 -t "${DESTDIR}${PREFIX}/share/applications/" "${PKGNAME}.desktop"
@install -dm755 "${DESTDIR}${PREFIX}/share/${PKGNAME}"/{ui,css,images} @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}/ui/" "${PKGNAME}.glade"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/ui/" "${PKGNAME}-banner.png"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/css/" "${PKGNAME}.css" @install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/css/" "${PKGNAME}.css"
@if [ -z ${DESTDIR} ]; then \ @if [ -z ${DESTDIR} ]; then \
[ -d "${DESTDIR}${PREFIX}/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}${PREFIX}/share/icons/hicolor/" &>/dev/null || true; \ [ -d "${DESTDIR}${PREFIX}/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}${PREFIX}/share/icons/hicolor/" &>/dev/null || true; \

@ -0,0 +1,327 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="24"
height="24"
version="1.1"
viewBox="0 0 24 24"
id="svg25"
sodipodi:docname="checked.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview27"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="14.8125"
inkscape:cx="-4.6919831"
inkscape:cy="9.9578059"
inkscape:window-width="1920"
inkscape:window-height="1027"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg25" />
<defs
id="defs19">
<style
id="current-color-scheme"
type="text/css">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
<style
type="text/css"
id="style3">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
<style
type="text/css"
id="style5">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
<style
type="text/css"
id="style7">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
<style
type="text/css"
id="style9">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
<style
type="text/css"
id="style11">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
<style
type="text/css"
id="style13">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
<style
type="text/css"
id="style15">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
<style
type="text/css"
id="style17">.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background{
color:#eff0f1;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground{
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#3daee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground{
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#3daee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}</style>
</defs>
<path
id="path21"
d="M 12 1 C 5.906 1 1 5.906 1 12 C 1 18.094 5.906 23 12 23 C 18.094 23 23 18.094 23 12 C 23 5.906 18.094 1 12 1 z M 15.480469 8.9042969 C 16.392469 8.8782969 16.860031 9.9850937 16.207031 10.621094 L 11 15.828125 L 8.09375 12.921875 C 7.11175 11.979875 8.5648125 10.525813 9.5078125 11.507812 L 11 13 L 14.792969 9.2070312 A 1 1 0 0 1 15.480469 8.9042969 z "
style="fill:#4d4d4d;fill-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 7.4 KiB

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 24 24"
id="svg2"
version="1.1"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
sodipodi:docname="warning.svg"
width="24"
height="24"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1027"
id="namedview8"
showgrid="false"
inkscape:zoom="18.96875"
inkscape:cx="5.4827018"
inkscape:cy="9.3047776"
inkscape:current-layer="svg2"
inkscape:pagecheckerboard="0"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<path
id="path4136-2"
style="opacity:1;fill:#4d4d4d;fill-opacity:1"
d="M 11.292969 1.0234375 A 11 11.000002 86.311656 0 0 1.0234375 12.707031 A 11 11.000002 86.311656 0 0 12.707031 22.976562 A 11 11.000002 86.311656 0 0 22.976562 11.292969 A 11 11.000002 86.311656 0 0 11.292969 1.0234375 z M 11.996094 6 L 12.003906 6 C 12.556173 6 13 6.4439 13 6.9960938 L 13 14.003906 C 13 14.556325 12.556173 15 12.003906 15 L 11.996094 15 C 11.443827 15 11 14.556325 11 14.003906 L 11 6.9960938 C 11 6.4439 11.443827 6 11.996094 6 z M 12 17 C 12.554 17 13 17.446 13 18 C 13 18.554 12.554 19 12 19 C 11.446 19 11 18.554 11 18 C 11 17.446 11.446 17 12 17 z " />
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -17,7 +17,9 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissin
set(SOURCE_FILES set(SOURCE_FILES
ubl-settings-usergroups.c ubl-settings-usergroups.c
ubl-settings-usergroups.h) ubl-settings-usergroups.h
ubl-utils.c
ubl-utils.h)
set(LIBRARIES set(LIBRARIES
${GTK_LIBRARIES} ${GTK_LIBRARIES}

@ -1,11 +1,131 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "ubl-settings-usergroups.h" #include "ubl-settings-usergroups.h"
int main(int argc, char *argv[]){ void on_close_subwindow(GtkWidget *self){
gtk_init(&argc,&argv); gtk_widget_destroy(gtk_widget_get_toplevel(self));
}
void on_about_open(){
}
void on_open_users(){
GtkBuilder *builder=gtk_builder_new_from_file(glade_path); GtkBuilder *builder=gtk_builder_new_from_file(glade_path);
GtkWidget *window=GTK_WIDGET(gtk_builder_get_object(builder,"MainWindow")); users_window *widgets = malloc (sizeof(users_window));
gtk_widget_show_all(window); widgets->window=yon_gtk_builder_get_widget(builder, "usersEditWindow");
}
void on_open_groups(){
GtkBuilder *builder=gtk_builder_new_from_file(glade_path);
groups_window *widgets = malloc (sizeof(groups_window));
widgets->window=yon_gtk_builder_get_widget(builder, "groupsEditWindow");
widgets->groupsTreeView=yon_gtk_builder_get_widget(builder, "groupsTreeView");
widgets->groupsGroupColumn=GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder, "groupsGroupColumn"));
widgets->groupsEnabledColumn=GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder, "groupsEnabledColumn"));
widgets->groupsCancelButton=yon_gtk_builder_get_widget(builder, "groupsCancelButton");
widgets->groupsOkButton=yon_gtk_builder_get_widget(builder, "groupsOkButton");
widgets->list=GTK_LIST_STORE(gtk_builder_get_object(builder, "liststore2"));
gtk_button_set_label(GTK_BUTTON(widgets->groupsCancelButton),_("Cancel"));
gtk_button_set_label(GTK_BUTTON(widgets->groupsOkButton),_("Ok"));
gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->groupsGroupColumn),_("Group"));
gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->groupsEnabledColumn),_("Enabled"));
g_signal_connect(G_OBJECT(widgets->groupsCancelButton), "clicked", G_CALLBACK(on_close_subwindow),NULL);
gtk_widget_show_all(widgets->window);
}
main_window *setup_main_window(){
main_window *widgets=NULL;
widgets=malloc(sizeof(main_window));
GtkBuilder *builder=gtk_builder_new_from_file(glade_path);
widgets->window=yon_gtk_builder_get_widget(builder,"MainWindow");
GtkListStore *list;
widgets->mainUserGroupsLabel=yon_gtk_builder_get_widget(builder,"mainUserGroupsLabel");
widgets->mainUserGroupsEntry=yon_gtk_builder_get_widget(builder,"mainUserGroupsEntry");
widgets->mainUserGroupsButton=yon_gtk_builder_get_widget(builder,"mainUserGroupsButton");
widgets->mainUserNameLabel=yon_gtk_builder_get_widget(builder,"mainUserNameLabel");
widgets->mainUserNameAdminCheck=yon_gtk_builder_get_widget(builder,"mainUserNameAdminCheck");
widgets->mainUserNameEntry=yon_gtk_builder_get_widget(builder,"mainUserNameEntry");
widgets->mainUserPasswordLabel=yon_gtk_builder_get_widget(builder,"mainUserPasswordLabel");
widgets->mainUserPasswordEntry=yon_gtk_builder_get_widget(builder,"mainUserPasswordEntry");
widgets->mainPasswordHashLabel=yon_gtk_builder_get_widget(builder,"mainPasswordHashLabel");
widgets->mainUserPasswordHashCombo=yon_gtk_builder_get_widget(builder,"mainUserPasswordHashCombo");
widgets->mainUserAutologinLabel=yon_gtk_builder_get_widget(builder,"mainUserAutologinLabel");
widgets->mainUserAutologinCombo=yon_gtk_builder_get_widget(builder,"mainUserAutologinCombo");
widgets->mainUpdateHomeDirLabel=yon_gtk_builder_get_widget(builder,"mainUpdateHomeDirLabel");
widgets->mainUpdateDirCheck=yon_gtk_builder_get_widget(builder,"mainUpdateDirCheck");
widgets->mainLoadUserProgramsLabel=yon_gtk_builder_get_widget(builder,"mainLoadUserProgramsLabel");
widgets->mainLoadUserProgramsEntry=yon_gtk_builder_get_widget(builder,"mainLoadUserProgramsEntry");
widgets->mainUserStringLabel=yon_gtk_builder_get_widget(builder,"mainUserStringLabel");
widgets->mainUserStringEntry=yon_gtk_builder_get_widget(builder,"mainUserStringEntry");
widgets->mainAddButton=yon_gtk_builder_get_widget(builder,"mainAddButton");
widgets->mainEditButton=yon_gtk_builder_get_widget(builder,"mainEditButton");
widgets->mainDeleteButton=yon_gtk_builder_get_widget(builder,"mainDeleteButton");
widgets->mainUIDColumn=GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder,"mainUIDColumn"));
widgets->mainLoginColumn=GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder,"mainLoginColumn"));
widgets->mainPasswordColumn=GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder,"mainPasswordColumn"));
widgets->mainUserNameColumn=GTK_TREE_VIEW_COLUMN(gtk_builder_get_object(builder,"mainUserNameColumn"));
widgets->headerLoadGlobalConfigurationMenuItem=yon_gtk_builder_get_widget(builder,"headerLoadGlobalConfigurationMenuItem");
widgets->headerLoadLocalConfigurationMenuItem=yon_gtk_builder_get_widget(builder,"headerLoadLocalConfigurationMenuItem");
widgets->headerSaveGlobalLocalConfigurationMenuItem=yon_gtk_builder_get_widget(builder,"headerSaveGlobalLocalConfigurationMenuItem");
widgets->headerSaveGlobalConfigurationMenuItem=yon_gtk_builder_get_widget(builder,"headerSaveGlobalConfigurationMenuItem");
widgets->headerSaveLocalConfigurationMenuItem=yon_gtk_builder_get_widget(builder,"headerSaveLocalConfigurationMenuItem");
widgets->headerDocumentationMenuItem=yon_gtk_builder_get_widget(builder,"headerDocumentationMenuItem");
widgets->headerAboutMenuItem=yon_gtk_builder_get_widget(builder,"headerAboutMenuItem");
widgets->mainHeaderConfigLoadLabel=yon_gtk_builder_get_widget(builder,"mainHeaderConfigLoadLabel");
widgets->mainHeaderTitleLabel=yon_gtk_builder_get_widget(builder,"mainHeaderTitleLabel");
widgets->mainHeaderSaveConfigurationLabel=yon_gtk_builder_get_widget(builder,"mainHeaderSaveConfigurationLabel");
widgets->mainStatusBox=yon_gtk_builder_get_widget(builder,"mainStatusBox");
widgets->mainStatusIcon=yon_gtk_builder_get_widget(builder,"mainStatusIcon");
widgets->mainStatusLabel=yon_gtk_builder_get_widget(builder,"mainStatusLabel");
g_signal_connect(G_OBJECT(widgets->mainUserGroupsButton),"clicked", G_CALLBACK(on_open_groups),NULL);
g_signal_connect(G_OBJECT(widgets->window), "destroy", G_CALLBACK(gtk_main_quit), NULL);
gtk_label_set_text(GTK_LABEL(widgets->mainUserGroupsLabel),_("User groups (default)"));
gtk_label_set_text(GTK_LABEL(widgets->mainUserNameLabel),_("User name"));
gtk_button_set_label(GTK_BUTTON(widgets->mainUserNameAdminCheck),_("Administrator"));
gtk_label_set_text(GTK_LABEL(widgets->mainUserPasswordLabel),_("User password"));
gtk_label_set_text(GTK_LABEL(widgets->mainPasswordHashLabel),_("Password hash algorythm"));
gtk_label_set_text(GTK_LABEL(widgets->mainUserAutologinLabel),_("Autologin"));
gtk_label_set_text(GTK_LABEL(widgets->mainUpdateHomeDirLabel),_("Update HOME directory(ies)"));
gtk_button_set_label(GTK_BUTTON(widgets->mainUpdateDirCheck),_("Enabled"));
gtk_label_set_text(GTK_LABEL(widgets->mainLoadUserProgramsLabel),_("Automatically load user programs"));
gtk_label_set_text(GTK_LABEL(widgets->mainUserStringLabel),_("User string"));
gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->mainUIDColumn),_("UID"));
gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->mainLoginColumn),_("Login"));
gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->mainPasswordColumn),_("Password"));
gtk_tree_view_column_set_title(GTK_TREE_VIEW_COLUMN(widgets->mainUserNameColumn),_("User Name"));
gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->headerLoadGlobalConfigurationMenuItem),_("Load from global configuration"));
gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->headerLoadLocalConfigurationMenuItem),_("Load from local configuration"));
gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->headerSaveGlobalLocalConfigurationMenuItem),_("Save to global and local configuration"));
gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->headerSaveGlobalConfigurationMenuItem),_("Save to global configuration"));
gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->headerSaveLocalConfigurationMenuItem),_("Save to local configuration"));
gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->headerDocumentationMenuItem),_("Documentation"));
gtk_menu_item_set_label(GTK_MENU_ITEM(widgets->headerAboutMenuItem),_("About"));
gtk_label_set_text(GTK_LABEL(widgets->mainHeaderConfigLoadLabel),_("Load"));
gtk_label_set_text(GTK_LABEL(widgets->mainHeaderTitleLabel),_("Users and groups"));
gtk_label_set_text(GTK_LABEL(widgets->mainHeaderSaveConfigurationLabel),_("Save"));
GtkWidget *Header = yon_gtk_builder_get_widget(builder,"headBox");
GtkWidget *Image = yon_gtk_builder_get_widget(builder,"mainHeadBackgroundImage");
GtkWidget *Overlay = yon_gtk_builder_get_widget(builder,"mainHeadOverlay");
yon_ubl_header_setup(Overlay,Header,Image,image_path);
widgets->mainUserAutologinCombo;
gtk_widget_show_all(widgets->window);
}
int main(int argc, char *argv[]){
textdomain (LocaleName);
gtk_init(&argc,&argv);
main_window *widgets=setup_main_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(); gtk_main();
} }

@ -1,2 +1,96 @@
#include "ubl-utils.h"
#include <gtk/gtk.h>
#include <gtk/gtkx.h>
#include <locale.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <libintl.h>
#define glade_path "/usr/share/ubl-settings-usergroups/ui/ubl-settings-usergroups.glade" #define glade_path "/usr/share/ubl-settings-usergroups/ui/ubl-settings-usergroups.glade"
#define CssPath "/usr/share/ubl-settings-usergroups/css/ubl-settings-usergroups.css"
#define image_path "/usr/share/ubl-settings-usergroups/ui/ubl-settings-usergroups-banner.png"
#define LocalePath "/usr/share/locale"
#define LocaleName "ubl-settings-usergroups"
#define _(String) gettext(String)
typedef struct {
GtkWidget *window;
GtkListStore *list;
GtkWidget *mainUserGroupsLabel;
GtkWidget *mainUserGroupsEntry;
GtkWidget *mainUserGroupsButton;
GtkWidget *mainUserNameLabel;
GtkWidget *mainUserNameAdminCheck;
GtkWidget *mainUserNameEntry;
GtkWidget *mainUserPasswordLabel;
GtkWidget *mainUserPasswordEntry;
GtkWidget *mainPasswordHashLabel;
GtkWidget *mainUserPasswordHashCombo;
GtkWidget *mainUserAutologinLabel;
GtkWidget *mainUserAutologinCombo;
GtkWidget *mainUpdateHomeDirLabel;
GtkWidget *mainUpdateDirCheck;
GtkWidget *mainLoadUserProgramsLabel;
GtkWidget *mainLoadUserProgramsEntry;
GtkWidget *mainUserStringLabel;
GtkWidget *mainUserStringEntry;
GtkWidget *mainAddButton;
GtkWidget *mainEditButton;
GtkWidget *mainDeleteButton;
GtkTreeViewColumn *mainUIDColumn;
GtkTreeViewColumn *mainLoginColumn;
GtkTreeViewColumn *mainPasswordColumn;
GtkTreeViewColumn *mainUserNameColumn;
GtkWidget *headerLoadGlobalConfigurationMenuItem;
GtkWidget *headerLoadLocalConfigurationMenuItem;
GtkWidget *headerSaveGlobalLocalConfigurationMenuItem;
GtkWidget *headerSaveGlobalConfigurationMenuItem;
GtkWidget *headerSaveLocalConfigurationMenuItem;
GtkWidget *headerDocumentationMenuItem;
GtkWidget *headerAboutMenuItem;
GtkWidget *mainHeaderConfigLoadLabel;
GtkWidget *mainHeaderTitleLabel;
GtkWidget *mainHeaderSaveConfigurationLabel;
GtkWidget *mainStatusBox;
GtkWidget *mainStatusIcon;
GtkWidget *mainStatusLabel;
} main_window;
typedef struct {
GtkWidget *window;
GtkWidget *userUIDLabel;
GtkWidget *userUIDEntry;
GtkWidget *userUsernameLabel;
GtkWidget *userUsernameEntry;
GtkWidget *userLoginLabel;
GtkWidget *userLoginEntry;
GtkWidget *userPasswordLabel;
GtkWidget *userPasswordEntry;
GtkWidget *userDefaultPasswordCheck;
GtkWidget *userPasswordHashLabel;
GtkWidget *userPasswordHashCombo;
GtkWidget *userSAMBALabel;
GtkWidget *userCancelButton;
GtkWidget *userAddButton;
} users_window;
typedef struct {
GtkWidget *window;
GtkWidget *groupsTreeView;
GtkTreeViewColumn *groupsEnabledColumn;
GtkTreeViewColumn *groupsGroupColumn;
GtkListStore *list;
GtkWidget *groupsCancelButton;
GtkWidget *groupsOkButton;
} groups_window;

@ -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;i<nth;i++){if (dct==NULL) return; else dct=dct->next;}
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;i<place; i++)
if(dict)
dict=dict->next;
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;i<size;i++)
{
for (int j=1;j<size;j++)
{
if (strcmp(applist[j].Name,applist[j-1].Name)<0){
tmp=applist[j];
applist[j]=applist[j-1];
applist[j-1]=tmp;
};
}
};
}
};
apps *yon_apps_get_by_name(apps *applist,char *name, int size){
for (int i=0;i<size;i++){
if (strcmp(applist[i].Name,name)==0) return &applist[i];
}
return NULL;
};
//terminal-using functions
int yon_launch_app(char *name){
char *path=name;
thread_output *thread=malloc(sizeof(thread_output));
thread->command=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

@ -0,0 +1,164 @@
#ifndef UBL_UTILS
#define UBL_UTILS
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
#include <dirent.h>
#include <locale.h>
#include <gtk/gtk.h>
#include <gtk/gtkx.h>
#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

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

@ -20,7 +20,7 @@
<property name="version">1.0</property> <property name="version">1.0</property>
<property name="copyright" translatable="yes">Copyright © 2023 - UBSoft Software LLC</property> <property name="copyright" translatable="yes">Copyright © 2023 - UBSoft Software LLC</property>
<property name="comments" translatable="yes">Settings for users and groups</property> <property name="comments" translatable="yes">Settings for users and groups</property>
<property name="website">https://ublinux.ru/</property> <property name="website">https://wiki.ublinux.ru/ru/Программное_обеспечениерограммы_и_утилиты/Все/ubl-settings-usergroups</property>
<property name="website-label" translatable="yes">Project Home Page</property> <property name="website-label" translatable="yes">Project Home Page</property>
<property name="license" translatable="yes">Это приложение распространяется без каких-либо гарантий. <property name="license" translatable="yes">Это приложение распространяется без каких-либо гарантий.
Подробнее в &lt;a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html"&gt;GNU General Public License, версии 2 или позднее&lt;/a&gt;.</property> Подробнее в &lt;a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html"&gt;GNU General Public License, версии 2 или позднее&lt;/a&gt;.</property>
@ -120,17 +120,6 @@
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
@ -172,7 +161,9 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="icon-name">process-stop-symbolic</property> <property name="icon-name">process-stop-symbolic</property>
</object> </object>
<object class="GtkWindow"> <object class="GtkWindow" id="usersEditWindow">
<property name="width-request">450</property>
<property name="height-request">250</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="modal">True</property> <property name="modal">True</property>
<property name="icon-name">com.ublinux.ubl-settings-usergroups</property> <property name="icon-name">com.ublinux.ubl-settings-usergroups</property>
@ -192,7 +183,7 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="spacing">5</property> <property name="spacing">5</property>
<child> <child>
<object class="GtkLabel" id="label8"> <object class="GtkLabel" id="userUIDLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">UID</property> <property name="label" translatable="yes">UID</property>
@ -205,7 +196,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry"> <object class="GtkEntry" id="userUIDEntry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="placeholder-text" translatable="yes">1000</property> <property name="placeholder-text" translatable="yes">1000</property>
@ -229,7 +220,7 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="spacing">5</property> <property name="spacing">5</property>
<child> <child>
<object class="GtkLabel" id="label9"> <object class="GtkLabel" id="userUsernameLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Username</property> <property name="label" translatable="yes">Username</property>
@ -242,7 +233,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry"> <object class="GtkEntry" id="userUsernameEntry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
</object> </object>
@ -265,7 +256,7 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="spacing">5</property> <property name="spacing">5</property>
<child> <child>
<object class="GtkLabel" id="label10"> <object class="GtkLabel" id="userLoginLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Login</property> <property name="label" translatable="yes">Login</property>
@ -278,7 +269,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry"> <object class="GtkEntry" id="userLoginEntry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
</object> </object>
@ -301,7 +292,7 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="spacing">5</property> <property name="spacing">5</property>
<child> <child>
<object class="GtkLabel" id="label11"> <object class="GtkLabel" id="userPasswordLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Password</property> <property name="label" translatable="yes">Password</property>
@ -314,7 +305,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry"> <object class="GtkEntry" id="userPasswordEntry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
</object> </object>
@ -332,11 +323,12 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkCheckButton"> <object class="GtkCheckButton" id="userDefaultPasswordCheck">
<property name="label" translatable="yes">Default password</property> <property name="label" translatable="yes">Default password</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">False</property> <property name="receives-default">False</property>
<property name="xalign">0</property>
<property name="draw-indicator">True</property> <property name="draw-indicator">True</property>
</object> </object>
<packing> <packing>
@ -351,7 +343,7 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="spacing">5</property> <property name="spacing">5</property>
<child> <child>
<object class="GtkLabel" id="label12"> <object class="GtkLabel" id="userPasswordHashLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Password hash algorythm</property> <property name="label" translatable="yes">Password hash algorythm</property>
@ -364,7 +356,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkComboBoxText"> <object class="GtkComboBoxText" id="userPasswordHashCombo">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
</object> </object>
@ -382,11 +374,12 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkCheckButton"> <object class="GtkCheckButton" id="userSAMBALabel">
<property name="label" translatable="yes">Sync with SAMBA user</property> <property name="label" translatable="yes">Sync with SAMBA user</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">False</property> <property name="receives-default">False</property>
<property name="xalign">0</property>
<property name="draw-indicator">True</property> <property name="draw-indicator">True</property>
</object> </object>
<packing> <packing>
@ -411,7 +404,7 @@
<property name="spacing">5</property> <property name="spacing">5</property>
<property name="homogeneous">True</property> <property name="homogeneous">True</property>
<child> <child>
<object class="GtkButton"> <object class="GtkButton" id="userCancelButton">
<property name="label" translatable="yes">Cancel</property> <property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
@ -425,7 +418,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton"> <object class="GtkButton" id="userAddButton">
<property name="label" translatable="yes">Add</property> <property name="label" translatable="yes">Add</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
@ -459,10 +452,10 @@
</object> </object>
<object class="GtkSizeGroup" id="labels"> <object class="GtkSizeGroup" id="labels">
<widgets> <widgets>
<widget name="label8"/> <widget name="userUIDLabel"/>
<widget name="label9"/> <widget name="userUsernameLabel"/>
<widget name="label10"/> <widget name="userLoginLabel"/>
<widget name="label11"/> <widget name="userPasswordLabel"/>
</widgets> </widgets>
</object> </object>
<object class="GtkListStore" id="liststore1"> <object class="GtkListStore" id="liststore1">
@ -485,7 +478,9 @@
<column type="gboolean"/> <column type="gboolean"/>
</columns> </columns>
</object> </object>
<object class="GtkWindow"> <object class="GtkWindow" id="groupsEditWindow">
<property name="width-request">300</property>
<property name="height-request">400</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="modal">True</property> <property name="modal">True</property>
<property name="icon-name">com.ublinux.ubl-settings-usergroups</property> <property name="icon-name">com.ublinux.ubl-settings-usergroups</property>
@ -495,7 +490,7 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<child> <child>
<object class="GtkTreeView"> <object class="GtkTreeView" id="groupsTreeView">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="model">liststore2</property> <property name="model">liststore2</property>
@ -503,7 +498,7 @@
<object class="GtkTreeSelection"/> <object class="GtkTreeSelection"/>
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn"> <object class="GtkTreeViewColumn" id="groupsEnabledColumn">
<property name="title" translatable="yes">Enabled</property> <property name="title" translatable="yes">Enabled</property>
<child> <child>
<object class="GtkCellRendererToggle"/> <object class="GtkCellRendererToggle"/>
@ -514,7 +509,7 @@
</object> </object>
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn"> <object class="GtkTreeViewColumn" id="groupsGroupColumn">
<property name="title" translatable="yes">Group</property> <property name="title" translatable="yes">Group</property>
<child> <child>
<object class="GtkCellRendererText"/> <object class="GtkCellRendererText"/>
@ -526,7 +521,7 @@
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
@ -542,8 +537,8 @@
<property name="spacing">5</property> <property name="spacing">5</property>
<property name="homogeneous">True</property> <property name="homogeneous">True</property>
<child> <child>
<object class="GtkButton"> <object class="GtkButton" id="groupsCancelButton">
<property name="label" translatable="yes">button</property> <property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">True</property> <property name="receives-default">True</property>
@ -555,8 +550,8 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton"> <object class="GtkButton" id="groupsOkButton">
<property name="label" translatable="yes">button</property> <property name="label" translatable="yes">Ok</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">True</property> <property name="receives-default">True</property>
@ -582,7 +577,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<child> <child>
<object class="GtkMenuItem"> <object class="GtkMenuItem" id="headerLoadGlobalConfigurationMenuItem">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Load from global configuration</property> <property name="label" translatable="yes">Load from global configuration</property>
@ -590,7 +585,7 @@
</object> </object>
</child> </child>
<child> <child>
<object class="GtkMenuItem"> <object class="GtkMenuItem" id="headerLoadLocalConfigurationMenuItem">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Load from local configuration</property> <property name="label" translatable="yes">Load from local configuration</property>
@ -602,7 +597,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<child> <child>
<object class="GtkMenuItem"> <object class="GtkMenuItem" id="headerSaveGlobalLocalConfigurationMenuItem">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Save to global and local configuration</property> <property name="label" translatable="yes">Save to global and local configuration</property>
@ -610,7 +605,7 @@
</object> </object>
</child> </child>
<child> <child>
<object class="GtkMenuItem"> <object class="GtkMenuItem" id="headerSaveGlobalConfigurationMenuItem">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Save to global configuration</property> <property name="label" translatable="yes">Save to global configuration</property>
@ -618,7 +613,7 @@
</object> </object>
</child> </child>
<child> <child>
<object class="GtkMenuItem"> <object class="GtkMenuItem" id="headerSaveLocalConfigurationMenuItem">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Save to local configuration</property> <property name="label" translatable="yes">Save to local configuration</property>
@ -630,7 +625,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<child> <child>
<object class="GtkMenuItem"> <object class="GtkMenuItem" id="headerDocumentationMenuItem">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Documentation</property> <property name="label" translatable="yes">Documentation</property>
@ -638,7 +633,7 @@
</object> </object>
</child> </child>
<child> <child>
<object class="GtkMenuItem"> <object class="GtkMenuItem" id="headerAboutMenuItem">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">About</property> <property name="label" translatable="yes">About</property>
@ -761,6 +756,7 @@
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="spacing">5</property>
<child> <child>
<object class="GtkBox" id="box1"> <object class="GtkBox" id="box1">
<property name="visible">True</property> <property name="visible">True</property>
@ -768,10 +764,11 @@
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">5</property> <property name="spacing">5</property>
<child> <child>
<object class="GtkLabel" id="label1"> <object class="GtkLabel" id="mainUserGroupsLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">User groups (default)</property> <property name="label" translatable="yes">User groups (default)</property>
<property name="single-line-mode">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
</object> </object>
<packing> <packing>
@ -781,10 +778,11 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="label2"> <object class="GtkLabel" id="mainUserNameLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">User name</property> <property name="label" translatable="yes">User name</property>
<property name="single-line-mode">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
</object> </object>
<packing> <packing>
@ -794,10 +792,11 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="label3"> <object class="GtkLabel" id="mainUserPasswordLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">User password</property> <property name="label" translatable="yes">User password</property>
<property name="single-line-mode">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
</object> </object>
<packing> <packing>
@ -807,10 +806,11 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="label4"> <object class="GtkLabel" id="mainPasswordHashLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Password hash algorythm:</property> <property name="label" translatable="yes">Password hash algorythm:</property>
<property name="single-line-mode">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
</object> </object>
<packing> <packing>
@ -820,10 +820,11 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="label5"> <object class="GtkLabel" id="mainUserAutologinLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Autologin</property> <property name="label" translatable="yes">Autologin</property>
<property name="single-line-mode">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
</object> </object>
<packing> <packing>
@ -833,10 +834,11 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="label6"> <object class="GtkLabel" id="mainUpdateHomeDirLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Update HOME directory(ies)</property> <property name="label" translatable="yes">Update HOME directory(ies)</property>
<property name="single-line-mode">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
</object> </object>
<packing> <packing>
@ -846,10 +848,11 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="label7"> <object class="GtkLabel" id="mainLoadUserProgramsLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Automatically load user programs</property> <property name="label" translatable="yes">Automatically load user programs</property>
<property name="single-line-mode">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
</object> </object>
<packing> <packing>
@ -877,7 +880,7 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="spacing">5</property> <property name="spacing">5</property>
<child> <child>
<object class="GtkEntry"> <object class="GtkEntry" id="mainUserGroupsEntry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
</object> </object>
@ -888,7 +891,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton"> <object class="GtkButton" id="mainUserGroupsButton">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">True</property> <property name="receives-default">True</property>
@ -916,7 +919,7 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="spacing">5</property> <property name="spacing">5</property>
<child> <child>
<object class="GtkCheckButton"> <object class="GtkCheckButton" id="mainUserNameAdminCheck">
<property name="label" translatable="yes">Administrator</property> <property name="label" translatable="yes">Administrator</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
@ -930,7 +933,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry"> <object class="GtkEntry" id="mainUserNameEntry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
</object> </object>
@ -948,7 +951,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="entry1"> <object class="GtkEntry" id="mainUserPasswordEntry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
</object> </object>
@ -959,7 +962,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkComboBoxText" id="comboboxtext1"> <object class="GtkComboBoxText" id="mainUserPasswordHashCombo">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
</object> </object>
@ -970,7 +973,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkComboBoxText" id="comboboxtext2"> <object class="GtkComboBoxText" id="mainUserAutologinCombo">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
</object> </object>
@ -981,7 +984,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="checkbutton1"> <object class="GtkCheckButton" id="mainUpdateDirCheck">
<property name="label" translatable="yes">Enabled</property> <property name="label" translatable="yes">Enabled</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
@ -996,7 +999,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="entry2"> <object class="GtkEntry" id="mainLoadUserProgramsEntry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
</object> </object>
@ -1032,10 +1035,11 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="spacing">5</property> <property name="spacing">5</property>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel" id="mainUserStringLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">User string:</property> <property name="label" translatable="yes">User string:</property>
<property name="single-line-mode">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1044,7 +1048,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry"> <object class="GtkEntry" id="mainUserStringEntry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
</object> </object>
@ -1067,7 +1071,7 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="spacing">5</property> <property name="spacing">5</property>
<child> <child>
<object class="GtkTreeView"> <object class="GtkTreeView" id="mainUserViewTreeView">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="model">liststore1</property> <property name="model">liststore1</property>
@ -1075,22 +1079,22 @@
<object class="GtkTreeSelection"/> <object class="GtkTreeSelection"/>
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn"> <object class="GtkTreeViewColumn" id="mainUIDColumn">
<property name="title" translatable="yes">UID</property> <property name="title" translatable="yes">UID</property>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn"> <object class="GtkTreeViewColumn" id="mainLoginColumn">
<property name="title" translatable="yes">Login</property> <property name="title" translatable="yes">Login</property>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn"> <object class="GtkTreeViewColumn" id="mainPasswordColumn">
<property name="title" translatable="yes">Password</property> <property name="title" translatable="yes">Password</property>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn"> <object class="GtkTreeViewColumn" id="mainUserNameColumn">
<property name="title" translatable="yes">User Name</property> <property name="title" translatable="yes">User Name</property>
</object> </object>
</child> </child>
@ -1105,10 +1109,11 @@
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="valign">center</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">5</property> <property name="spacing">5</property>
<child> <child>
<object class="GtkButton"> <object class="GtkButton" id="mainAddButton">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">True</property> <property name="receives-default">True</property>
@ -1124,7 +1129,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton"> <object class="GtkButton" id="mainEditButton">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">True</property> <property name="receives-default">True</property>
@ -1140,7 +1145,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton"> <object class="GtkButton" id="mainDeleteButton">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">True</property> <property name="receives-default">True</property>
@ -1164,14 +1169,14 @@
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
@ -1371,20 +1376,20 @@
<object class="GtkSizeGroup"> <object class="GtkSizeGroup">
<property name="mode">vertical</property> <property name="mode">vertical</property>
<widgets> <widgets>
<widget name="label1"/> <widget name="mainUserGroupsLabel"/>
<widget name="label2"/> <widget name="mainUserNameLabel"/>
<widget name="label3"/> <widget name="mainUserPasswordLabel"/>
<widget name="label4"/> <widget name="mainPasswordHashLabel"/>
<widget name="label5"/> <widget name="mainUserAutologinLabel"/>
<widget name="label6"/> <widget name="mainUpdateHomeDirLabel"/>
<widget name="label7"/> <widget name="mainLoadUserProgramsLabel"/>
<widget name="box2"/> <widget name="box2"/>
<widget name="box3"/> <widget name="box3"/>
<widget name="entry1"/> <widget name="mainUserPasswordEntry"/>
<widget name="comboboxtext1"/> <widget name="mainUserPasswordHashCombo"/>
<widget name="comboboxtext2"/> <widget name="mainUserAutologinCombo"/>
<widget name="checkbutton1"/> <widget name="mainUpdateDirCheck"/>
<widget name="entry2"/> <widget name="mainLoadUserProgramsEntry"/>
</widgets> </widgets>
</object> </object>
</interface> </interface>

@ -0,0 +1,114 @@
# 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.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-04-06 09:45+0000\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"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: source/ubl-settings-usergroups.c:50
msgid "User groups (default)"
msgstr ""
#: source/ubl-settings-usergroups.c:51
msgid "User name"
msgstr ""
#: source/ubl-settings-usergroups.c:52
msgid "Administrator"
msgstr ""
#: source/ubl-settings-usergroups.c:53
msgid "User password"
msgstr ""
#: source/ubl-settings-usergroups.c:54
msgid "Password hash algorythm"
msgstr ""
#: source/ubl-settings-usergroups.c:55
msgid "Autologin"
msgstr ""
#: source/ubl-settings-usergroups.c:56
msgid "Update HOME directory(ies)"
msgstr ""
#: source/ubl-settings-usergroups.c:57
msgid "Enabled"
msgstr ""
#: source/ubl-settings-usergroups.c:58
msgid "Automatically load user programs"
msgstr ""
#: source/ubl-settings-usergroups.c:59
msgid "User string"
msgstr ""
#: source/ubl-settings-usergroups.c:60
msgid "UID"
msgstr ""
#: source/ubl-settings-usergroups.c:61
msgid "Login"
msgstr ""
#: source/ubl-settings-usergroups.c:62
msgid "Password"
msgstr ""
#: source/ubl-settings-usergroups.c:63
msgid "User Name"
msgstr ""
#: source/ubl-settings-usergroups.c:64
msgid "Load from global configuration"
msgstr ""
#: source/ubl-settings-usergroups.c:65
msgid "Load from local configuration"
msgstr ""
#: source/ubl-settings-usergroups.c:66
msgid "Save to global and local configuration"
msgstr ""
#: source/ubl-settings-usergroups.c:67
msgid "Save to global configuration"
msgstr ""
#: source/ubl-settings-usergroups.c:68
msgid "Save to local configuration"
msgstr ""
#: source/ubl-settings-usergroups.c:69
msgid "Documentation"
msgstr ""
#: source/ubl-settings-usergroups.c:70
msgid "About"
msgstr ""
#: source/ubl-settings-usergroups.c:71
msgid "Load"
msgstr ""
#: source/ubl-settings-usergroups.c:72
msgid "Users and groups"
msgstr ""
#: source/ubl-settings-usergroups.c:73
msgid "Save"
msgstr ""

@ -0,0 +1,121 @@
# 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: ubl-settings-manager 1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-04-06 09:45+0000\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=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: source/ubl-settings-usergroups.c:50
#, fuzzy
msgid "User groups (default)"
msgstr "Группы пользователей (По умолчанию)"
#: source/ubl-settings-usergroups.c:51
#, fuzzy
msgid "User name"
msgstr "Имя пользователя"
#: source/ubl-settings-usergroups.c:52
msgid "Administrator"
msgstr "Администратор"
#: source/ubl-settings-usergroups.c:53
#, fuzzy
msgid "User password"
msgstr "Пароль пользователя"
#: source/ubl-settings-usergroups.c:54
#, fuzzy
msgid "Password hash algorythm"
msgstr "Алгоритм хэширования пароля"
#: source/ubl-settings-usergroups.c:55
#, fuzzy
msgid "Autologin"
msgstr "Автоматический логин пользователя"
#: source/ubl-settings-usergroups.c:56
msgid "Update HOME directory(ies)"
msgstr "Обновлять каталог(и) HOME"
#: source/ubl-settings-usergroups.c:57
msgid "Enabled"
msgstr "Включено"
#: source/ubl-settings-usergroups.c:58
#, fuzzy
msgid "Automatically load user programs"
msgstr "Автозагрузка программ пользователей"
#: source/ubl-settings-usergroups.c:59
#, fuzzy
msgid "User string"
msgstr "Строка пользователей"
#: source/ubl-settings-usergroups.c:60
msgid "UID"
msgstr "UID"
#: source/ubl-settings-usergroups.c:61
msgid "Login"
msgstr "Логин"
#: source/ubl-settings-usergroups.c:62
msgid "Password"
msgstr "Пароль"
#: source/ubl-settings-usergroups.c:63
msgid "User Name"
msgstr "Имя пользователя"
#: source/ubl-settings-usergroups.c:64
msgid "Load from global configuration"
msgstr "Загрузить из глобальной конфигурации"
#: source/ubl-settings-usergroups.c:65
msgid "Load from local configuration"
msgstr "Загрузить из локальной конфигурации"
#: source/ubl-settings-usergroups.c:66
msgid "Save to global and local configuration"
msgstr "Сохранить в глобальную и локальную конфигурации"
#: source/ubl-settings-usergroups.c:67
msgid "Save to global configuration"
msgstr "Сохранить в глобальную конфигурацию"
#: source/ubl-settings-usergroups.c:68
msgid "Save to local configuration"
msgstr "Сохранить в локальную конфигурацию"
#: source/ubl-settings-usergroups.c:69
msgid "Documentation"
msgstr "Справка"
#: source/ubl-settings-usergroups.c:70
msgid "About"
msgstr "О программе"
#: source/ubl-settings-usergroups.c:71
msgid "Load"
msgstr "Загрузить"
#: source/ubl-settings-usergroups.c:72
msgid "Users and groups"
msgstr "Пользователи и группы"
#: source/ubl-settings-usergroups.c:73
msgid "Save"
msgstr "Сохранить"
Loading…
Cancel
Save