From 698cf77eda026c6cc0540845727bca67b813ff82 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 18 Apr 2024 19:06:15 +0600 Subject: [PATCH 1/4] Domain window added, 50%~ is unconfigured --- auth_profile.csv | 25 ++ gresource.xml | 3 + source/CMakeLists.txt | 3 + source/ubl-settings-system.c | 110 +++++ source/ubl-settings-system.h | 61 ++- source/ubl-strings.h | 4 +- ubl-settings-system-connection.glade | 555 ++++++++++++++++++++++++++ ubl-settings-system-domain-view.glade | 72 ++++ ubl-settings-system-domain.glade | 255 ++++++++++++ ubl-settings-system.glade | 59 ++- 10 files changed, 1144 insertions(+), 3 deletions(-) create mode 100644 auth_profile.csv create mode 100644 ubl-settings-system-connection.glade create mode 100644 ubl-settings-system-domain-view.glade create mode 100644 ubl-settings-system-domain.glade diff --git a/auth_profile.csv b/auth_profile.csv new file mode 100644 index 0000000..a306bf0 --- /dev/null +++ b/auth_profile.csv @@ -0,0 +1,25 @@ +AUTH_NAME +wth-altfiles +with-ecryptfs +with-faillock +with-files-access-provider +with-files-domain +with-pamaccess +with-silent-lastlog +with-sudo +with-systemd-homed +with-time +without-nullok +with-fingerprint +with-pam-u2f +with-pam-u2f-2fa +without-nullok +without-pam-u2f-nouserok +with-smartcard +with-smartcard-lock-on-removal +with-smartcard-required +with-mdns4 +with-mdns6 +with-mkhomedir +with-mkhomedir-simple +with-nispwquality diff --git a/gresource.xml b/gresource.xml index a172326..4038613 100644 --- a/gresource.xml +++ b/gresource.xml @@ -3,6 +3,9 @@ ubl-settings-system.glade ubl-settings-system-layouts.glade + ubl-settings-system-domain.glade + ubl-settings-system-connection.glade + ubl-settings-system-domain-view.glade ubl-settings-system.css diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index f969a33..ed45a17 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -30,6 +30,9 @@ add_custom_target(GLADE ubl-settings-system.glade) set(DEPENDFILES ../ubl-settings-system.glade + ../ubl-settings-system-domain.glade + ../ubl-settings-system-connection.glade + ../ubl-settings-system-domain-view.glade ../ubl-settings-system-layouts.glade ../gresource.xml ../ubl-settings-system-banner.png diff --git a/source/ubl-settings-system.c b/source/ubl-settings-system.c index d3811a6..78fb3ab 100644 --- a/source/ubl-settings-system.c +++ b/source/ubl-settings-system.c @@ -438,6 +438,110 @@ void on_language_changed(GtkComboBox *self, main_window *widgets){ } } +domain_info_window *yon_information_window_new(){ + GtkBuilder *builder = gtk_builder_new_from_resource(glade_domain_view_path); + + domain_info_window *window = malloc(sizeof(domain_info_window)); + window->Window = yon_gtk_builder_get_widget(builder,"MainWindow"); + window->DomainOutputLabel = yon_gtk_builder_get_widget(builder,"DomainOutputLabel"); + + return window; +} + +void on_domain_connect(GtkWidget *self, connection_window *window){ + char *adress = (char*)gtk_entry_get_text(GTK_ENTRY(window->AdressEntry)); + if (yon_char_is_empty(adress)){ + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(window->AdressEntry); + return; + } + char *login = (char*)gtk_entry_get_text(GTK_ENTRY(window->LoginEntry)); + char *password = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry)); + char *kerberos = (char*)gtk_entry_get_text(GTK_ENTRY(window->KerberosServerEntry)); + char *dns = (char*)gtk_entry_get_text(GTK_ENTRY(window->DNSEntry)); + char *client = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->ClientCombo)); + char *final = yon_char_unite(!yon_char_is_empty(kerberos)?kerberos_addition_command(kerberos):"",!yon_char_is_empty(kerberos)?" ":"",!yon_char_is_empty(dns)?dns_addition_command(dns):"",!yon_char_is_empty(dns)?" ":"",!yon_char_is_empty(client)?client_addition_command(client):"",!yon_char_is_empty(client)?" ":"",NULL); + + int size; + config_str parsed = yon_config_load(domain_connect_command(adress,login,password,final),&size); + domain_info_window *dialog = yon_information_window_new(); + gtk_widget_show(dialog->Window); + gtk_label_set_text(GTK_LABEL(dialog->DomainOutputLabel),yon_char_parsed_to_string(parsed,size,"\n")); + on_subwindow_close(window->Window); +} + +connection_window *yon_connection_window_new(){ + GtkBuilder *builder = gtk_builder_new_from_resource(glade_connection_path); + connection_window *window = malloc(sizeof(connection_window)); + window->Window = yon_gtk_builder_get_widget(builder,"MainWindow"); + window->AdressEntry = yon_gtk_builder_get_widget(builder,"AdressEntry"); + window->StatusEntry = yon_gtk_builder_get_widget(builder,"StatusEntry"); + window->FindEntry = yon_gtk_builder_get_widget(builder,"FindEntry"); + window->LoginEntry = yon_gtk_builder_get_widget(builder,"LoginEntry"); + window->PasswordEntry = yon_gtk_builder_get_widget(builder,"PasswordEntry"); + window->KerberosServerEntry = yon_gtk_builder_get_widget(builder,"KerberosServerEntry"); + window->DNSEntry = yon_gtk_builder_get_widget(builder,"DNSEntry"); + window->ClientCombo = yon_gtk_builder_get_widget(builder,"ClientCombo"); + window->AdditionalCombo = yon_gtk_builder_get_widget(builder,"AdditionalCombo"); + window->EditButton = yon_gtk_builder_get_widget(builder,"EditButton"); + window->SettingsTree = yon_gtk_builder_get_widget(builder,"SettingsTree"); + window->SaveButton = yon_gtk_builder_get_widget(builder,"SaveButton"); + window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton"); + window->list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1")); + g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); + g_signal_connect(G_OBJECT(window->SaveButton),"clicked",G_CALLBACK(on_domain_connect),window); + return window; +} + +void on_domain_disconnect(GtkWidget *self, domain_window *window){ + char *adress = (char*)gtk_entry_get_text(GTK_ENTRY(window->AdressEntry)); + char *login = (char*)gtk_entry_get_text(GTK_ENTRY(window->LoginEntry)); + char *password = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry)); + if (yon_char_is_empty(adress)){ + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(window->AdressEntry); + return; + } + int size; + config_str parsed = yon_config_load(domain_disconnect_command(adress,login,password),&size); + domain_info_window *dialog = yon_information_window_new(); + gtk_widget_show(dialog->Window); + gtk_label_set_text(GTK_LABEL(dialog->DomainOutputLabel),yon_char_parsed_to_string(parsed,size,"\n")); + on_subwindow_close(window->Window); +} + +domain_window *yon_domain_window_new(){ + GtkBuilder *builder = gtk_builder_new_from_resource(glade_domain_path); + + domain_window *window = malloc(sizeof(domain_window)); + window->Window = yon_gtk_builder_get_widget(builder,"MainWindow"); + window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox"); + window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton"); + window->SaveButton = yon_gtk_builder_get_widget(builder,"SaveButton"); + window->AdressEntry = yon_gtk_builder_get_widget(builder,"AdressEntry"); + window->LoginEntry = yon_gtk_builder_get_widget(builder,"LoginEntry"); + window->PasswordEntry = yon_gtk_builder_get_widget(builder,"PasswordEntry"); + window->DNSEntry = yon_gtk_builder_get_widget(builder,"DNSEntry"); + g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); + g_signal_connect(G_OBJECT(window->SaveButton),"clicked",G_CALLBACK(on_domain_disconnect),window); + + return window; +} + +void on_domain_opened(GtkWidget *self, main_window *widgets){ + if (main_config.domain_connected){ + domain_window *window = yon_domain_window_new(); + yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),TITLE_LABEL,"com.ublinux.ubl-settings-system","DomainWindow"); + + gtk_widget_show(window->Window); + } else { + connection_window *window = yon_connection_window_new(); + yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),TITLE_LABEL,"com.ublinux.ubl-settings-system","ConnectWindow"); + gtk_widget_show(window->Window); + } + +} + // standard functions void config_init(){ @@ -450,6 +554,7 @@ void config_init(){ main_config.lock_load_global=0; main_config.lock_save_global=0; main_config.lock_save_local=0; + main_config.domain_connected=0; } main_window *yon_main_window_complete(main_window *widgets){ @@ -468,6 +573,9 @@ main_window *yon_main_window_complete(main_window *widgets){ widgets->LocaleButton = yon_gtk_builder_get_widget(builder,"getLocalesButton"); widgets->LocaleEntry = yon_gtk_builder_get_widget(builder,"localeEntry"); + widgets->DomainButton = yon_gtk_builder_get_widget(builder,"DomainButton"); + widgets->DomainEntry = yon_gtk_builder_get_widget(builder,"DomainEntry"); + widgets->fontlist = GTK_LIST_STORE(gtk_builder_get_object(builder,"fontlist")); widgets->languagelist = GTK_LIST_STORE(gtk_builder_get_object(builder,"languagelist")); @@ -504,6 +612,8 @@ main_window *yon_main_window_complete(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->LocaleButton),"clicked",G_CALLBACK(on_locale_open),widgets); g_signal_connect(G_OBJECT(widgets->ConsoleFontCombo),"changed",G_CALLBACK(on_console_font_changed),widgets); g_signal_connect(G_OBJECT(widgets->LanguageCombo),"changed",G_CALLBACK(on_language_changed),widgets); + + g_signal_connect(G_OBJECT(widgets->DomainButton),"clicked",G_CALLBACK(on_domain_opened),widgets); gtk_widget_set_size_request(widgets->Window,800,-1); diff --git a/source/ubl-settings-system.h b/source/ubl-settings-system.h index 27e86ef..133bc9b 100644 --- a/source/ubl-settings-system.h +++ b/source/ubl-settings-system.h @@ -20,6 +20,9 @@ #define _(String) gettext(String) #define glade_path "/com/ublinux/ui/ubl-settings-system.glade" +#define glade_domain_path "/com/ublinux/ui/ubl-settings-system-domain.glade" +#define glade_connection_path "/com/ublinux/ui/ubl-settings-system-connection.glade" +#define glade_domain_view_path "/com/ublinux/ui/ubl-settings-system-domain-view.glade" #define glade_locales_path "/com/ublinux/ui/ubl-settings-system-layouts.glade" #define banner_path "/com/ublinux/images/ubl-settings-system-banner.png" #define CssPath "/com/ublinux/css/ubl-settings-system.css" @@ -37,7 +40,7 @@ #define get_id_command "grep '' /etc/machine-id" // #define get_fonts_command "ls /usr/share/kbd/consolefonts/ |grep -v \"README\"|grep -oE \"^[-a-zA-Z0-9_]{3,}.psf\"|sed -e 's/\\.psf//g'" -#define config_get_command(source) yon_char_unite("ubconfig --source ", source, " get system HOSTNAME MACHINEID",NULL), yon_char_unite("ubconfig --source ", source, " get locale CONSOLE_FONT LOCALE LANG",NULL) +#define config_get_command(source) yon_char_unite("ubconfig --source ", source, " get system HOSTNAME MACHINEID",NULL), yon_char_unite("ubconfig --source ", source, " get locale CONSOLE_FONT LOCALE LANG",NULL), yon_char_unite("ubconfig --source ", source, " get [network] DOMAIN",NULL) #define config_get_default_command "" #define config_get_global_only_parameters "" @@ -57,6 +60,18 @@ #define CONSOLE_FONT_get_command "ubconfig --source global get [locale] CONSOLE_FONT" // #define NUMLOCK_get_command "ubconfig --source global get [locale] NUMLOCK" #define LANG_get_command "ubconfig --source global get [locale] LANG" +#define DOMAIN_get_command "ubconfig --source global get [network] DOMAIN" + +#define check_domain_access_command(targeet) yon_char_append("adcli info --domain ",target) +#define get_domain_info_command(target) yon_char_append("ubdomain-client list ",target) +#define domains_seek_command "ubdomain-client discover" +#define domain_connect_command(target,user,password, addition) yon_char_unite("ubdomain-client join",yon_char_is_empty(user)?" --user \"":"",yon_char_is_empty(user)?user:"",yon_char_is_empty(user)?"\"":"",yon_char_is_empty(password)?" --password \"":"",yon_char_is_empty(password)?password:"",yon_char_is_empty(password)?"\"":""," --domain \"",target,"\"", addition,NULL) +#define domain_disconnect_command(target,user,password) yon_char_unite("ubdomain-client join",yon_char_is_empty(user)?" --user \"":"",yon_char_is_empty(user)?user:"",yon_char_is_empty(user)?"\"":"",yon_char_is_empty(password)?" --password \"":"",yon_char_is_empty(password)?password:"",yon_char_is_empty(password)?"\"":""," --domain \"",target,"\"",NULL) +#define kerberos_addition_command(target) yon_char_unite("--domain_server \"",target,"\"",NULL) +#define dns_addition_command(target) yon_char_unite("--dns \"",target,"\"",NULL) +#define client_addition_command(target) yon_char_unite("--domain_client \"",target,"\"",NULL) + +#define domain_info(target) yon_char_append("ubdomain-client discover --domain ",target) typedef char* string; string version_application; @@ -66,6 +81,7 @@ char *local; typedef struct { template_config_fields GtkListStore *localeslist; + int domain_connected; } config; typedef struct { @@ -81,6 +97,9 @@ typedef struct { GtkWidget *LocaleButton; GtkWidget *LocaleEntry; + GtkWidget *DomainEntry; + GtkWidget *DomainButton; + GtkListStore *fontlist; GtkListStore *languagelist; @@ -109,5 +128,45 @@ typedef struct { GtkCellRenderer *ToggleCell; } locals_window; +typedef struct { + GtkWidget *Window; + + GtkWidget *StatusBox; + + GtkWidget *CancelButton; + GtkWidget *SaveButton; + GtkWidget *AdressEntry; + GtkWidget *LoginEntry; + GtkWidget *PasswordEntry; + GtkWidget *DNSEntry; +} domain_window; + +typedef struct { + GtkWidget *Window; + + GtkWidget *StatusBox; + + GtkWidget *CancelButton; + GtkWidget *SaveButton; + GtkWidget *AdressEntry; + GtkWidget *LoginEntry; + GtkWidget *PasswordEntry; + GtkWidget *DNSEntry; + GtkWidget *StatusEntry; + GtkWidget *FindEntry; + GtkWidget *KerberosServerEntry; + GtkWidget *ClientCombo; + GtkWidget *AdditionalCombo; + GtkWidget *EditButton; + GtkWidget *SettingsTree; + GtkListStore *list; +} connection_window; + +typedef struct { + GtkWidget *Window; + + GtkWidget *DomainOutputLabel; +} domain_info_window; + main_window *setup_window(); void on_id_changed(GtkEntry *self, main_window *widgets); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index bf53924..319011f 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -26,4 +26,6 @@ #define INSERT_LABEL _("Insert data") -#define ACCEPT_LABEL _("Accept") \ No newline at end of file +#define ACCEPT_LABEL _("Accept") + +#define EMPTY_IMPORTANT_LABEL _("Important field is empty") \ No newline at end of file diff --git a/ubl-settings-system-connection.glade b/ubl-settings-system-connection.glade new file mode 100644 index 0000000..2b47159 --- /dev/null +++ b/ubl-settings-system-connection.glade @@ -0,0 +1,555 @@ + + + + + + + True + False + gtk-missing-image + + + True + False + gtk-missing-image + + + True + False + document-edit-symbolic + + + + False + True + com.ublinux.ubl-settings-repomanager + + + True + False + vertical + 5 + + + True + False + vertical + + + + + + False + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 5 + vertical + 5 + + + True + False + vertical + + + True + True + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + vertical + 5 + + + True + False + 5 + + + True + False + Domain address: + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + True + True + True + image1 + + + False + True + 2 + + + + + True + True + True + image2 + + + False + True + 3 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + False + Domain administrator name: + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + 5 + + + True + False + Domain administrator password: + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + False + True + 2 + + + + + + + True + False + Main + + + False + + + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + vertical + 5 + + + True + False + 5 + + + True + False + Kerberos/AD domain server: + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + False + DNS server: + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + 5 + + + True + False + Domain connection client + + + False + True + 0 + + + + + True + False + + Default + Sssd client + Winbind client + Samba client + Switch client off or autometically + + + + True + True + 1 + + + + + False + True + 2 + + + + + True + False + 0 + in + + + True + False + 5 + 5 + 5 + + + True + False + vertical + 5 + + + True + False + + Default + Set + + + + False + True + 0 + + + + + True + False + 5 + + + True + False + vertical + 5 + + + True + True + True + image3 + + + + False + True + 0 + + + + + False + True + 0 + + + + + True + False + 0 + in + + + True + True + liststore1 + + + + + + + + True + False + + + + + True + True + 1 + + + + + True + True + 1 + + + + + + + + + True + False + Additional options for autentification profile + + + + + True + True + 4 + + + + + 1 + + + + + True + False + Additional + + + 1 + False + + + + + True + True + 0 + + + + + True + True + 0 + + + + + True + True + 1 + + + + + + + True + False + + + True + False + System configuration + + + + + + + + True + False + 32 + com.ublinux.ubl-settings-system + + + + + Cancel + True + True + True + + + 1 + + + + + Connect + True + True + True + + + end + 2 + + + + + + diff --git a/ubl-settings-system-domain-view.glade b/ubl-settings-system-domain-view.glade new file mode 100644 index 0000000..9e1f1fd --- /dev/null +++ b/ubl-settings-system-domain-view.glade @@ -0,0 +1,72 @@ + + + + + + + False + True + com.ublinux.ubl-settings-repomanager + + + True + False + vertical + 5 + + + True + False + vertical + + + + + + False + True + 0 + + + + + True + False + True + 0 + + + False + True + 1 + + + + + + + True + False + True + + + True + False + Domain information + + + + + + + + True + False + 32 + com.ublinux.ubl-settings-system + + + + + + diff --git a/ubl-settings-system-domain.glade b/ubl-settings-system-domain.glade new file mode 100644 index 0000000..9aa15cb --- /dev/null +++ b/ubl-settings-system-domain.glade @@ -0,0 +1,255 @@ + + + + + + + False + True + com.ublinux.ubl-settings-repomanager + + + True + False + vertical + 5 + + + True + False + vertical + + + + + + False + True + 0 + + + + + True + False + 5 + 5 + 5 + vertical + 5 + + + True + False + vertical + 5 + + + True + False + 5 + + + True + False + Domain adress: + 0 + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + False + Domain administrator password: + 0 + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + 5 + + + True + False + Domain administrator name: + 0 + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + False + True + 2 + + + + + True + False + 5 + + + True + False + DNS server: + 0 + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + False + True + 3 + + + + + False + True + 4 + + + + + True + True + 1 + + + + + + + True + False + + + True + False + System configuration + + + + + + + + True + False + 32 + com.ublinux.ubl-settings-system + + + + + Cancel + True + True + True + + + 1 + + + + + Disconnect + True + True + True + + + end + 2 + + + + + + + diff --git a/ubl-settings-system.glade b/ubl-settings-system.glade index bd5680b..9ee8fda 100644 --- a/ubl-settings-system.glade +++ b/ubl-settings-system.glade @@ -49,6 +49,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. False document-edit-symbolic + + True + False + com.ublinux.libublsettingsui-gtk3.arrows-left-right-symbolic + @@ -120,6 +125,58 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 0 + + + True + False + 5 + + + True + False + Domain adress: + + + False + True + 0 + + + + + True + False + com.ublinux.libublsettingsui-gtk3.cloud-arrow-up-symbolic + + + True + True + 1 + + + + + True + True + True + image3 + + + + False + True + 2 + + + + + False + True + 1 + + True @@ -201,7 +258,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. False True - 1 + 2 From b0ea5cfa6c6cf8e38ce11e54df427730849ebf32 Mon Sep 17 00:00:00 2001 From: YanTheKaller Date: Thu, 18 Apr 2024 17:04:21 +0000 Subject: [PATCH 2/4] Domain windows configured 80-90% --- Makefile | 11 +- auth_profile.csv => auth-profile.csv | 0 ...ettings-system.plug-connected-symbolic.svg | 3313 +++++++++++++++++ ...ings-system.plug-disconnected-symbolic.svg | 3313 +++++++++++++++++ source/ubl-settings-system.c | 129 +- source/ubl-settings-system.h | 26 +- source/ubl-strings.h | 22 +- ubl-settings-system-connection.glade | 16 +- ubl-settings-system-domain-view.glade | 44 +- ubl-settings-system.glade | 7 +- ubl-settings-system.pot | 565 +-- ubl-settings-system_ru.po | 292 +- 12 files changed, 7082 insertions(+), 656 deletions(-) rename auth_profile.csv => auth-profile.csv (100%) create mode 100644 com.ublinux.ubl-settings-system.plug-connected-symbolic.svg create mode 100644 com.ublinux.ubl-settings-system.plug-disconnected-symbolic.svg diff --git a/Makefile b/Makefile index be4d65b..3813ef7 100644 --- a/Makefile +++ b/Makefile @@ -122,15 +122,18 @@ install: check uninstall @sed -e 's+/usr/bin+${PREFIX}/bin+' -e 's+.run+${PKGIDENT}.run+g' ./compile/com.ublinux.${PKGNAME}${PKGIDENT}.policy -i @install -Dm755 -t "${DESTDIR}${PREFIX}/bin/" "${CMAKE_BUILD_DIR}/${PKGNAME}" @install -Dm644 -t "${DESTDIR}${PREFIX}/share/applications/" "${PKGNAME}.desktop" - @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 "${DESTDIR}/usr/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.checked.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.warning.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.plug-connected-symbolic.svg" + @install -Dm644 -t "${DESTDIR}/usr/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.plug-disconnected-symbolic.svg" @install -Dm644 -t "${DESTDIR}/usr/share/polkit-1/actions/" "${CMAKE_BUILD_DIR}/com.ublinux.${PKGNAME}${PKGIDENT}.policy" @install -Dm644 -t "${DESTDIR}/usr/share/${PKGNAME}/csv/" "locales.csv" @install -Dm644 -t "${DESTDIR}/usr/share/${PKGNAME}/csv/" "fonts.csv" + @install -Dm644 -t "${DESTDIR}/usr/share/${PKGNAME}/csv/" "auth-profile.csv" @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}/usr/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}/usr/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; \ + [ -d "${DESTDIR}/usr/share/applications" ] && touch "${DESTDIR}/usr/share/applications" &>/dev/null || true; \ fi @echo "Install: OK" diff --git a/auth_profile.csv b/auth-profile.csv similarity index 100% rename from auth_profile.csv rename to auth-profile.csv diff --git a/com.ublinux.ubl-settings-system.plug-connected-symbolic.svg b/com.ublinux.ubl-settings-system.plug-connected-symbolic.svg new file mode 100644 index 0000000..37681d0 --- /dev/null +++ b/com.ublinux.ubl-settings-system.plug-connected-symbolic.svg @@ -0,0 +1,3313 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + class="success" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.ublinux.ubl-settings-system.plug-disconnected-symbolic.svg b/com.ublinux.ubl-settings-system.plug-disconnected-symbolic.svg new file mode 100644 index 0000000..d32cd9c --- /dev/null +++ b/com.ublinux.ubl-settings-system.plug-disconnected-symbolic.svg @@ -0,0 +1,3313 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + class="success" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/ubl-settings-system.c b/source/ubl-settings-system.c index 78fb3ab..8dbf20f 100644 --- a/source/ubl-settings-system.c +++ b/source/ubl-settings-system.c @@ -443,33 +443,84 @@ domain_info_window *yon_information_window_new(){ domain_info_window *window = malloc(sizeof(domain_info_window)); window->Window = yon_gtk_builder_get_widget(builder,"MainWindow"); - window->DomainOutputLabel = yon_gtk_builder_get_widget(builder,"DomainOutputLabel"); + window->ExecuteTerminal = yon_gtk_builder_get_widget(builder,"ExecuteTerminal"); + window->TerminalScroll = yon_gtk_builder_get_widget(builder,"TerminalScroll"); + yon_gtk_widget_set_scroll_window_for_scroll(window->Window,GTK_SCROLLBAR(window->TerminalScroll)); + GdkRGBA rgba; + vte_terminal_get_color_background_for_draw(VTE_TERMINAL(window->ExecuteTerminal),&rgba); + vte_terminal_set_color_cursor(VTE_TERMINAL(window->ExecuteTerminal),&rgba); + yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),TITLE_LABEL,"com.ublinux.ubl-settings-system","InfoWindow"); return window; } -void on_domain_connect(GtkWidget *self, connection_window *window){ +void on_domain_connect(GtkWidget *self, dictionary *dict){ + main_window *widgets = yon_dictionary_get_data(dict->first,main_window*); + connection_window *window = yon_dictionary_get_data(dict->first->next,connection_window*); char *adress = (char*)gtk_entry_get_text(GTK_ENTRY(window->AdressEntry)); if (yon_char_is_empty(adress)){ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); yon_ubl_status_highlight_incorrect(window->AdressEntry); return; } + g_source_remove(window->timer_id); char *login = (char*)gtk_entry_get_text(GTK_ENTRY(window->LoginEntry)); char *password = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry)); char *kerberos = (char*)gtk_entry_get_text(GTK_ENTRY(window->KerberosServerEntry)); char *dns = (char*)gtk_entry_get_text(GTK_ENTRY(window->DNSEntry)); - char *client = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->ClientCombo)); + char *client = NULL; + if (gtk_combo_box_get_active(GTK_COMBO_BOX(window->ClientCombo))){ + client = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->ClientCombo)); + } char *final = yon_char_unite(!yon_char_is_empty(kerberos)?kerberos_addition_command(kerberos):"",!yon_char_is_empty(kerberos)?" ":"",!yon_char_is_empty(dns)?dns_addition_command(dns):"",!yon_char_is_empty(dns)?" ":"",!yon_char_is_empty(client)?client_addition_command(client):"",!yon_char_is_empty(client)?" ":"",NULL); int size; - config_str parsed = yon_config_load(domain_connect_command(adress,login,password,final),&size); domain_info_window *dialog = yon_information_window_new(); + yon_terminal_integrated_start(dialog->ExecuteTerminal,domain_connect_command(adress,login,password,final),NULL,NULL); + gtk_entry_set_text(GTK_ENTRY(widgets->DomainEntry),adress); gtk_widget_show(dialog->Window); - gtk_label_set_text(GTK_LABEL(dialog->DomainOutputLabel),yon_char_parsed_to_string(parsed,size,"\n")); on_subwindow_close(window->Window); } +void on_status_clicked(GtkWidget *self, connection_window *window){ + domain_info_window *dialog = yon_information_window_new(); + // yon_terminal_integrated_start(dialog->ExecuteTerminal,domain_connect_command(adress,login,password,final),NULL,NULL); + gtk_widget_show(dialog->Window); +} + +void on_find_domains_clicked(GtkWidget *self, connection_window *window){ + domain_info_window *dialog = yon_information_window_new(); + yon_terminal_integrated_start(dialog->ExecuteTerminal,domains_seek_command,NULL,NULL); + gtk_widget_show(dialog->Window); +} + + +void on_main_window_domain_status_clicked(GtkWidget *self, GtkEntryIconPosition icon_pos,GdkEvent* event,main_window *widgets){ + if (icon_pos==GTK_ENTRY_ICON_SECONDARY){ + char *target = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->DomainEntry)); + if (!yon_char_is_empty(target)){ + domain_info_window *window = yon_information_window_new(); + gtk_widget_show(window->Window); + yon_terminal_integrated_start(window->ExecuteTerminal,domain_info(target),NULL,NULL); + } + } +} + +gboolean on_main_window_domain_status_update(connection_window *window){ + const char *target = gtk_entry_get_text(GTK_ENTRY(window->AdressEntry)); + if (!yon_char_is_empty(target)){ + int status = system(domain_check_alive(target)); + if (!status){ + gtk_entry_set_icon_from_icon_name(GTK_ENTRY(window->AdressEntry),GTK_ENTRY_ICON_SECONDARY,domain_connected_icon); + } else { + gtk_entry_set_icon_from_icon_name(GTK_ENTRY(window->AdressEntry),GTK_ENTRY_ICON_SECONDARY,domain_disconnected_icon); + } + } else { + gtk_entry_set_icon_from_icon_name(GTK_ENTRY(window->AdressEntry),GTK_ENTRY_ICON_SECONDARY,domain_disconnected_icon); + } + return 1; +} + connection_window *yon_connection_window_new(){ GtkBuilder *builder = gtk_builder_new_from_resource(glade_connection_path); connection_window *window = malloc(sizeof(connection_window)); @@ -489,11 +540,16 @@ connection_window *yon_connection_window_new(){ window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton"); window->list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1")); g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); - g_signal_connect(G_OBJECT(window->SaveButton),"clicked",G_CALLBACK(on_domain_connect),window); + g_signal_connect(G_OBJECT(window->StatusEntry),"clicked",G_CALLBACK(on_status_clicked),window); + g_signal_connect(G_OBJECT(window->FindEntry),"clicked",G_CALLBACK(on_find_domains_clicked),window); + window->timer_id = g_timeout_add(1000,(GSourceFunc)on_main_window_domain_status_update,window); + return window; } -void on_domain_disconnect(GtkWidget *self, domain_window *window){ +void on_domain_disconnect(GtkWidget *self, dictionary *dict){ + main_window *widgets = yon_dictionary_get_data(dict->first,main_window*); + domain_window *window = yon_dictionary_get_data(dict->first->next,domain_window*); char *adress = (char*)gtk_entry_get_text(GTK_ENTRY(window->AdressEntry)); char *login = (char*)gtk_entry_get_text(GTK_ENTRY(window->LoginEntry)); char *password = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry)); @@ -503,10 +559,11 @@ void on_domain_disconnect(GtkWidget *self, domain_window *window){ return; } int size; - config_str parsed = yon_config_load(domain_disconnect_command(adress,login,password),&size); + // config_str parsed = yon_config_load(domain_disconnect_command(adress,login,password),&size); domain_info_window *dialog = yon_information_window_new(); gtk_widget_show(dialog->Window); - gtk_label_set_text(GTK_LABEL(dialog->DomainOutputLabel),yon_char_parsed_to_string(parsed,size,"\n")); + yon_terminal_integrated_start(dialog->ExecuteTerminal,domain_disconnect_command(adress,login,password),NULL,NULL); + gtk_entry_set_text(GTK_ENTRY(widgets->DomainEntry),adress); on_subwindow_close(window->Window); } @@ -523,7 +580,6 @@ domain_window *yon_domain_window_new(){ window->PasswordEntry = yon_gtk_builder_get_widget(builder,"PasswordEntry"); window->DNSEntry = yon_gtk_builder_get_widget(builder,"DNSEntry"); g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL); - g_signal_connect(G_OBJECT(window->SaveButton),"clicked",G_CALLBACK(on_domain_disconnect),window); return window; } @@ -532,11 +588,49 @@ void on_domain_opened(GtkWidget *self, main_window *widgets){ if (main_config.domain_connected){ domain_window *window = yon_domain_window_new(); yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),TITLE_LABEL,"com.ublinux.ubl-settings-system","DomainWindow"); + char *domain = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->DomainEntry)); + char *password = yon_config_get_by_key(DOMAIN_ADMANGER); + char *login = yon_char_divide_search(password,":",-1); + char *dns = config(DOMAIN_DNS); + if (!yon_char_is_empty(login)) + gtk_entry_set_text(GTK_ENTRY(window->LoginEntry),login); + if (!yon_char_is_empty(password)) + gtk_entry_set_text(GTK_ENTRY(window->PasswordEntry),password); + if (!yon_char_is_empty(domain)) + gtk_entry_set_text(GTK_ENTRY(window->AdressEntry),domain); + if (!yon_char_is_empty(dns)) + gtk_entry_set_text(GTK_ENTRY(window->DNSEntry),dns); + dictionary *dict = NULL; + yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets); + yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window); + g_signal_connect(G_OBJECT(window->SaveButton),"clicked",G_CALLBACK(on_domain_disconnect),dict); gtk_widget_show(window->Window); } else { connection_window *window = yon_connection_window_new(); yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->Window),TITLE_LABEL,"com.ublinux.ubl-settings-system","ConnectWindow"); + char *domain = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->DomainEntry)); + char *dns = config(DOMAIN_DNS); + char *client = yon_config_get_by_key(DOMAIN_CLIENT); + char *kerberos = yon_config_get_by_key(DOMAIN_SERVER); + char *password = yon_config_get_by_key(DOMAIN_ADMANGER); + char *login = yon_char_divide_search(password,":",-1); + if (!yon_char_is_empty(login)) + gtk_entry_set_text(GTK_ENTRY(window->LoginEntry),login); + if (!yon_char_is_empty(password)) + gtk_entry_set_text(GTK_ENTRY(window->PasswordEntry),password); + if (!yon_char_is_empty(domain)) + gtk_entry_set_text(GTK_ENTRY(window->AdressEntry),domain); + if (!yon_char_is_empty(kerberos)) + gtk_entry_set_text(GTK_ENTRY(window->KerberosServerEntry),kerberos); + if (!yon_char_is_empty(dns)) + gtk_entry_set_text(GTK_ENTRY(window->DNSEntry),dns); + if (!yon_char_is_empty(client)) + gtk_combo_box_set_active_id(GTK_COMBO_BOX(window->ClientCombo),client); + dictionary *dict = NULL; + yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets); + yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window); + g_signal_connect(G_OBJECT(window->SaveButton),"clicked",G_CALLBACK(on_domain_connect),dict); gtk_widget_show(window->Window); } @@ -557,6 +651,16 @@ void config_init(){ main_config.domain_connected=0; } +void on_check_domain_connected(main_window *widgets){ + if (!system(domain_connect_check)){ + gtk_entry_set_icon_from_icon_name(GTK_ENTRY(widgets->DomainEntry),GTK_ENTRY_ICON_SECONDARY,domain_connected_icon); + main_config.domain_connected=1; + } else { + gtk_entry_set_icon_from_icon_name(GTK_ENTRY(widgets->DomainEntry),GTK_ENTRY_ICON_SECONDARY,domain_disconnected_icon); + main_config.domain_connected=0; + } +} + main_window *yon_main_window_complete(main_window *widgets){ /* Widgets getting | Получение виджетов */ widgets = yon_remalloc(widgets,sizeof(main_window)); @@ -614,6 +718,8 @@ main_window *yon_main_window_complete(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->LanguageCombo),"changed",G_CALLBACK(on_language_changed),widgets); g_signal_connect(G_OBJECT(widgets->DomainButton),"clicked",G_CALLBACK(on_domain_opened),widgets); + g_signal_connect(G_OBJECT(widgets->DomainEntry),"icon-press",G_CALLBACK(on_main_window_domain_status_clicked),widgets); + g_timeout_add(1000,(GSourceFunc)on_check_domain_connected,widgets); gtk_widget_set_size_request(widgets->Window,800,-1); @@ -646,6 +752,9 @@ main_window *yon_main_window_complete(main_window *widgets){ gtk_widget_set_sensitive(widgets->SaveMenuItem,0); } yon_config_local_load(NULL,widgets); + char *domain = yon_config_get_by_key(DOMAIN); + if (!yon_char_is_empty(domain)) + gtk_entry_set_text(GTK_ENTRY(widgets->DomainEntry),domain); return widgets; } diff --git a/source/ubl-settings-system.h b/source/ubl-settings-system.h index 133bc9b..5f87d3c 100644 --- a/source/ubl-settings-system.h +++ b/source/ubl-settings-system.h @@ -1,8 +1,5 @@ #include #include -#include -#include -#include #include #include #include @@ -10,6 +7,10 @@ #include #include #include +#define VTE_INCLUDE +#include +#include +#include #ifdef WEBKIT_FOUND #include #endif @@ -40,7 +41,7 @@ #define get_id_command "grep '' /etc/machine-id" // #define get_fonts_command "ls /usr/share/kbd/consolefonts/ |grep -v \"README\"|grep -oE \"^[-a-zA-Z0-9_]{3,}.psf\"|sed -e 's/\\.psf//g'" -#define config_get_command(source) yon_char_unite("ubconfig --source ", source, " get system HOSTNAME MACHINEID",NULL), yon_char_unite("ubconfig --source ", source, " get locale CONSOLE_FONT LOCALE LANG",NULL), yon_char_unite("ubconfig --source ", source, " get [network] DOMAIN",NULL) +#define config_get_command(source) yon_char_unite("ubconfig --source ", source, " get system HOSTNAME MACHINEID",NULL), yon_char_unite("ubconfig --source ", source, " get locale CONSOLE_FONT LOCALE LANG",NULL), yon_char_unite("ubconfig --source ", source, " get [network] DOMAIN DOMAIN[admanger] DOMAIN[server] DOMAIN[dns] DOMAIN[client]",NULL) #define config_get_default_command "" #define config_get_global_only_parameters "" @@ -73,6 +74,19 @@ #define domain_info(target) yon_char_append("ubdomain-client discover --domain ",target) +#define domain_connected_icon "com.ublinux.ubl-settings-system.plug-connected-symbolic" +#define domain_disconnected_icon "com.ublinux.ubl-settings-system.plug-disconnected-symbolic" + +#define domain_connect_check "ubdomain-client list|grep -q \"configured\"" + +#define domain_check_alive(target) yon_char_unite("dig +time=1 +tries=1 -t SRV _ldap.tcp.",target," @",target," &>/dev/null",NULL) + +#define DOMAIN "DOMAIN" +#define DOMAIN_ADMANGER "DOMAIN[admanger]" +#define DOMAIN_SERVER "DOMAIN[server]" +#define DOMAIN_DNS "DOMAIN[dns]" +#define DOMAIN_CLIENT "DOMAIN[client]" + typedef char* string; string version_application; @@ -160,12 +174,14 @@ typedef struct { GtkWidget *EditButton; GtkWidget *SettingsTree; GtkListStore *list; + guint timer_id; } connection_window; typedef struct { GtkWidget *Window; - GtkWidget *DomainOutputLabel; + GtkWidget *ExecuteTerminal; + GtkWidget *TerminalScroll; } domain_info_window; main_window *setup_window(); diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 319011f..969e702 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -28,4 +28,24 @@ #define ACCEPT_LABEL _("Accept") -#define EMPTY_IMPORTANT_LABEL _("Important field is empty") \ No newline at end of file +#define EMPTY_IMPORTANT_LABEL _("Important field is empty") + +#define CONNECT_LABEL _("Connect") +#define DISCONNECT_LABEL _("Disconnect") +#define DOMAIN_ADRESS_LABEL _("Domain address") +#define DOMAIN_ADRESS_2_LABEL _("Domain address:") +#define ADMIN_NAME_LABEL _("Domain administrator name:") +#define ADMIN_PASSWORD_LABEL _("Domain administrator password:") +#define MAIN_TAB_LABEL _("Main") +#define ADDITIONAL_TAB_LABEL _("Additional") +#define KERBEROS_LABEL _("Kerberos/AD domain server:") +#define DNS_SERVER_LABEL _("DNS server:") +#define CLIENT_LABEL _("Domain connection client") +#define SSSD_LABEL _("Sssd client") +#define WINDBIND_LABEL _("Winbind client") +#define SAMBA_LABEL _("Samba client") +#define OFF_AUTOMATICALLY_LABEL _("Switch client off or automatically") +#define INFO_LABEL _("Domain information") +#define CONNECTION_LABEL _("Domain connection") +#define CHECK_NAME_LABEL _("Check domain name") +#define LIST_ALL_LABEL _("List all domains") \ No newline at end of file diff --git a/ubl-settings-system-connection.glade b/ubl-settings-system-connection.glade index 2b47159..b104e1c 100644 --- a/ubl-settings-system-connection.glade +++ b/ubl-settings-system-connection.glade @@ -6,12 +6,12 @@ True False - gtk-missing-image + com.ublinux.libublsettingsui-gtk3.important-symbolic True False - gtk-missing-image + com.ublinux.libublsettingsui-gtk3.zoom-symbolic True @@ -20,6 +20,8 @@ + 450 + 400 False True com.ublinux.ubl-settings-repomanager @@ -109,7 +111,11 @@ True True True + Check domain name image1 + False @@ -122,7 +128,11 @@ True True True + List all domains image2 + False @@ -322,6 +332,7 @@ True False + 0 Default Sssd client @@ -345,7 +356,6 @@ - True False 0 in diff --git a/ubl-settings-system-domain-view.glade b/ubl-settings-system-domain-view.glade index 9e1f1fd..4effb5f 100644 --- a/ubl-settings-system-domain-view.glade +++ b/ubl-settings-system-domain-view.glade @@ -2,8 +2,16 @@ + + + 100 + 1 + 10 + + 800 + 600 False True com.ublinux.ubl-settings-repomanager @@ -29,14 +37,42 @@ - + True False - True - 0 + + + True + False + natural + adjustment1 + natural + UTF-8 + True + False + + + True + True + 0 + + + + + True + False + vertical + adjustment1 + + + False + True + 1 + + - False + True True 1 diff --git a/ubl-settings-system.glade b/ubl-settings-system.glade index 9ee8fda..101de1f 100644 --- a/ubl-settings-system.glade +++ b/ubl-settings-system.glade @@ -134,7 +134,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. True False - Domain adress: + Domain address: False @@ -145,8 +145,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. True - False - com.ublinux.libublsettingsui-gtk3.cloud-arrow-up-symbolic + True + com.ublinux.ubl-settings-system.plug-disconnected-symbolic True @@ -159,6 +159,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. True True True + Domain connection image3