|
|
|
|
@ -296,6 +296,21 @@ void yon_config_global_save(){
|
|
|
|
|
void yon_config_custom_save(){
|
|
|
|
|
template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_CUSTOM,config_get_command("system"),NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_domain_address_save(GtkEntry *self){
|
|
|
|
|
char *adress = (char*)gtk_entry_get_text(self);
|
|
|
|
|
if (!yon_char_is_empty(adress)){
|
|
|
|
|
yon_config_register(DOMAIN,DOMAIN_get_command,adress);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_gtk_windget_set_sensitive_from_entry_emptiness(GtkEntry *self, GtkWidget *target){
|
|
|
|
|
if (yon_char_is_empty(gtk_entry_get_text(self))){
|
|
|
|
|
gtk_widget_set_sensitive(target,0);
|
|
|
|
|
} else {
|
|
|
|
|
gtk_widget_set_sensitive(target,1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_locale_toggle(GtkCellRendererToggle *self,GtkTreePath* path,GtkTreeViewColumn* column,locals_window *window){
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
@ -443,6 +458,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 +492,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 +502,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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -501,7 +522,7 @@ void on_main_window_domain_status_clicked(GtkWidget *self, GtkEntryIconPosition
|
|
|
|
|
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);
|
|
|
|
|
yon_terminal_integrated_start(window->ExecuteTerminal,get_domain_info_command,NULL,NULL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -521,6 +542,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));
|
|
|
|
|
@ -654,9 +681,11 @@ void config_init(){
|
|
|
|
|
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);
|
|
|
|
|
gtk_button_set_label(GTK_BUTTON(widgets->DomainButton),DOMAIN_DISCONNECT_LABEL);
|
|
|
|
|
main_config.domain_connected=1;
|
|
|
|
|
} else {
|
|
|
|
|
gtk_entry_set_icon_from_icon_name(GTK_ENTRY(widgets->DomainEntry),GTK_ENTRY_ICON_SECONDARY,domain_disconnected_icon);
|
|
|
|
|
gtk_button_set_label(GTK_BUTTON(widgets->DomainButton),DOMAIN_CONNECT_LABEL);
|
|
|
|
|
main_config.domain_connected=0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -719,6 +748,10 @@ main_window *yon_main_window_complete(main_window *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_signal_connect(G_OBJECT(widgets->DomainEntry),"changed",G_CALLBACK(yon_gtk_windget_set_sensitive_from_entry_emptiness),widgets->DomainButton);
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->DomainEntry),"focus-out-event",G_CALLBACK(on_domain_address_save),NULL);
|
|
|
|
|
|
|
|
|
|
g_timeout_add(1000,(GSourceFunc)on_check_domain_connected,widgets);
|
|
|
|
|
|
|
|
|
|
gtk_widget_set_size_request(widgets->Window,800,-1);
|
|
|
|
|
|