Fixes and updates

pull/33/head
parent 41289a9b9b
commit 10ddee279f

@ -443,6 +443,7 @@ 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->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel");
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));
@ -476,6 +477,8 @@ void on_domain_connect(GtkWidget *self, dictionary *dict){
int size;
domain_info_window *dialog = yon_information_window_new();
gtk_window_set_title(GTK_WINDOW(dialog->Window),DOMAIN_CONNECTING_LABEL);
gtk_label_set_text(GTK_LABEL(dialog->HeadLabel),DOMAIN_CONNECTING_LABEL);
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);
@ -484,7 +487,10 @@ void on_domain_connect(GtkWidget *self, dictionary *dict){
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);
char *target = (char*)gtk_entry_get_text(GTK_ENTRY(window->AdressEntry));
if (!yon_char_is_empty(target)){
yon_terminal_integrated_start(dialog->ExecuteTerminal,domain_info(target),NULL,NULL);
}
gtk_widget_show(dialog->Window);
}
@ -521,6 +527,12 @@ gboolean on_main_window_domain_status_update(connection_window *window){
return 1;
}
gboolean yon_update_thread(connection_window *window){
pthread_t thread_id;
pthread_create(&thread_id, NULL, (void *)on_main_window_domain_status_update,window);
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));

@ -67,19 +67,19 @@
#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_disconnect_command(target,user,password) yon_char_unite("ubdomain-client leave",!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)
#define domain_info(target) yon_char_unite("ubdomain-client discover --domain \"",target,"\"",NULL)
#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_check_alive(target) yon_char_unite("timeout --kill-after=0.1 2 dig +time=1 +tries=1 +noall -t SRV _ldap._tcp.",target," @",target," &>/dev/null",NULL)
#define DOMAIN "DOMAIN"
#define DOMAIN_ADMANGER "DOMAIN[admanger]"
@ -180,6 +180,8 @@ typedef struct {
typedef struct {
GtkWidget *Window;
GtkWidget *HeadLabel;
GtkWidget *ExecuteTerminal;
GtkWidget *TerminalScroll;
} domain_info_window;

@ -48,4 +48,6 @@
#define INFO_LABEL _("Domain information")
#define CONNECTION_LABEL _("Domain connection")
#define CHECK_NAME_LABEL _("Check domain name")
#define LIST_ALL_LABEL _("List all domains")
#define LIST_ALL_LABEL _("List all domains")
#define DOMAIN_CONNECTING_LABEL _("Connecting to domain")

@ -166,7 +166,7 @@ msgid "Samba client"
msgstr ""
#: source/ubl-strings.h:47
msgid "Switch client off or autometically"
msgid "Switch client off or automatically"
msgstr ""
#: source/ubl-strings.h:48
@ -184,3 +184,7 @@ msgstr ""
#: source/ubl-strings.h:51
msgid "List all domains"
msgstr ""
#: source/ubl-strings.h:53
msgid "Connecting to domain"
msgstr ""

@ -186,6 +186,10 @@ msgstr "Проверить домен"
msgid "List all domains"
msgstr "Показать все домены"
#: source/ubl-strings.h:53
msgid "Connecting to domain"
msgstr "Подключение к домену"
msgid "Version:"
msgstr "Версия:"

Loading…
Cancel
Save