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