|
|
|
@ -4,7 +4,7 @@ config main_config;
|
|
|
|
|
|
|
|
|
|
|
|
//functions
|
|
|
|
//functions
|
|
|
|
|
|
|
|
|
|
|
|
void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
int yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
yon_config_clean();
|
|
|
|
yon_config_clean();
|
|
|
|
if (!yon_char_is_empty(config_get_default_command))
|
|
|
|
if (!yon_char_is_empty(config_get_default_command))
|
|
|
|
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
|
|
|
|
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
|
|
|
|
@ -15,8 +15,12 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
yon_config_load_config(type,config_get_command("system"),NULL);
|
|
|
|
yon_config_load_config(type,config_get_command("system"),NULL);
|
|
|
|
} else if (type==YON_CONFIG_CUSTOM){
|
|
|
|
} else if (type==YON_CONFIG_CUSTOM){
|
|
|
|
char *path;
|
|
|
|
char *path;
|
|
|
|
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,OPEN_LABEL,GTK_RESPONSE_ACCEPT,NULL);
|
|
|
|
GtkWidget *dialog = gtk_file_chooser_dialog_new(template_app_information.app_title,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,OPEN_LABEL,GTK_RESPONSE_ACCEPT,NULL);
|
|
|
|
GtkFileFilter *filter = gtk_file_filter_new();
|
|
|
|
textdomain(LocaleName);
|
|
|
|
|
|
|
|
yon_gtk_window_setup(GTK_WINDOW(dialog),NULL,TITLE_LABEL,main_icon,"LoadWindow");
|
|
|
|
|
|
|
|
GtkFileFilter *filter = gtk_file_filter_new();
|
|
|
|
|
|
|
|
gtk_file_filter_set_name(filter,"*.ini");
|
|
|
|
gtk_file_filter_add_pattern(filter,"*.ini");
|
|
|
|
gtk_file_filter_add_pattern(filter,"*.ini");
|
|
|
|
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter);
|
|
|
|
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter);
|
|
|
|
gtk_widget_show(dialog);
|
|
|
|
gtk_widget_show(dialog);
|
|
|
|
@ -24,15 +28,17 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
if (response == GTK_RESPONSE_ACCEPT){
|
|
|
|
if (response == GTK_RESPONSE_ACCEPT){
|
|
|
|
char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
|
|
|
|
char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
|
|
|
|
if (!yon_char_is_empty(file)){
|
|
|
|
if (!yon_char_is_empty(file)){
|
|
|
|
path=file;
|
|
|
|
path=yon_char_unite("'",file,"'",NULL);
|
|
|
|
|
|
|
|
main_config.custom_load_path = path;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
gtk_widget_destroy(dialog);
|
|
|
|
return;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yon_config_load_config(type,config_get_command(path),NULL);
|
|
|
|
yon_config_load_config(type,config_get_command(path),NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -196,6 +202,8 @@ void yon_config_global_local_save(){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void yon_config_custom_load(GtkWidget *self, main_window *widgets){
|
|
|
|
void yon_config_custom_load(GtkWidget *self, main_window *widgets){
|
|
|
|
|
|
|
|
if (!yon_load_proceed(YON_CONFIG_CUSTOM))
|
|
|
|
|
|
|
|
return;
|
|
|
|
g_signal_handlers_block_by_func(G_OBJECT(widgets->IDEntry),G_CALLBACK(on_id_changed),widgets);
|
|
|
|
g_signal_handlers_block_by_func(G_OBJECT(widgets->IDEntry),G_CALLBACK(on_id_changed),widgets);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->HostnameEntry),"");
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->HostnameEntry),"");
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),"");
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),"");
|
|
|
|
@ -207,7 +215,6 @@ void yon_config_custom_load(GtkWidget *self, main_window *widgets){
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),*rtn);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->IDEntry),*rtn);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->ConsoleFontCombo),0);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->ConsoleFontCombo),0);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LanguageCombo),0);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LanguageCombo),0);
|
|
|
|
yon_load_proceed(YON_CONFIG_CUSTOM);
|
|
|
|
|
|
|
|
char *hostname = yon_config_get_by_key(hostname_parameter);
|
|
|
|
char *hostname = yon_config_get_by_key(hostname_parameter);
|
|
|
|
if (!yon_char_is_empty(hostname)){
|
|
|
|
if (!yon_char_is_empty(hostname)){
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->HostnameEntry),hostname);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->HostnameEntry),hostname);
|
|
|
|
@ -518,7 +525,7 @@ void on_status_clicked(GtkWidget *self, connection_window *window){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_find_domains_clicked(GtkWidget *self, connection_window *window){
|
|
|
|
void on_find_domains_clicked(GtkWidget *self, main_window *window){
|
|
|
|
yon_debug_output("%s\n",domains_seek_command);
|
|
|
|
yon_debug_output("%s\n",domains_seek_command);
|
|
|
|
domain_info_window *dialog = yon_information_window_new();
|
|
|
|
domain_info_window *dialog = yon_information_window_new();
|
|
|
|
yon_terminal_integrated_start(dialog->ExecuteTerminal,domains_seek_command);
|
|
|
|
yon_terminal_integrated_start(dialog->ExecuteTerminal,domains_seek_command);
|
|
|
|
@ -559,7 +566,7 @@ gboolean on_main_window_domain_status_update(connection_window *window){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// gboolean yon_update_thread(GtkWidget *self, GdkEvent *event, connection_window *window){
|
|
|
|
// gboolean yon_update_thread(GtkWidget *self, GdkEvent *event, connection_window *window){
|
|
|
|
gboolean yon_update_thread(connection_window *window){
|
|
|
|
gboolean yon_update_thread(GtkWidget *self, connection_window *window){
|
|
|
|
if (!update_thread_buzy){
|
|
|
|
if (!update_thread_buzy){
|
|
|
|
update_thread_buzy=1;
|
|
|
|
update_thread_buzy=1;
|
|
|
|
pthread_t thread_id;
|
|
|
|
pthread_t thread_id;
|
|
|
|
@ -567,9 +574,6 @@ gboolean on_main_window_domain_status_update(connection_window *window){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void remove_checking(GtkWidget *self, connection_window *window){
|
|
|
|
|
|
|
|
g_source_remove(window->timer_id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connection_window *yon_connection_window_new(){
|
|
|
|
connection_window *yon_connection_window_new(){
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_connection_path);
|
|
|
|
GtkBuilder *builder = gtk_builder_new_from_resource(glade_connection_path);
|
|
|
|
@ -578,7 +582,6 @@ connection_window *yon_connection_window_new(){
|
|
|
|
window->AdressEntry = yon_gtk_builder_get_widget(builder,"AdressEntry");
|
|
|
|
window->AdressEntry = yon_gtk_builder_get_widget(builder,"AdressEntry");
|
|
|
|
window->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel");
|
|
|
|
window->HeadLabel = yon_gtk_builder_get_widget(builder,"HeadLabel");
|
|
|
|
window->StatusEntry = yon_gtk_builder_get_widget(builder,"StatusEntry");
|
|
|
|
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->LoginEntry = yon_gtk_builder_get_widget(builder,"LoginEntry");
|
|
|
|
window->PasswordEntry = yon_gtk_builder_get_widget(builder,"PasswordEntry");
|
|
|
|
window->PasswordEntry = yon_gtk_builder_get_widget(builder,"PasswordEntry");
|
|
|
|
window->KerberosServerEntry = yon_gtk_builder_get_widget(builder,"KerberosServerEntry");
|
|
|
|
window->KerberosServerEntry = yon_gtk_builder_get_widget(builder,"KerberosServerEntry");
|
|
|
|
@ -589,14 +592,11 @@ connection_window *yon_connection_window_new(){
|
|
|
|
window->SettingsTree = yon_gtk_builder_get_widget(builder,"SettingsTree");
|
|
|
|
window->SettingsTree = yon_gtk_builder_get_widget(builder,"SettingsTree");
|
|
|
|
window->SaveButton = yon_gtk_builder_get_widget(builder,"SaveButton");
|
|
|
|
window->SaveButton = yon_gtk_builder_get_widget(builder,"SaveButton");
|
|
|
|
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
|
|
|
|
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
|
|
|
|
|
|
|
|
window->CheckButton = yon_gtk_builder_get_widget(builder,"CheckButton");
|
|
|
|
window->list = GTK_LIST_STORE(gtk_builder_get_object(builder,"liststore1"));
|
|
|
|
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->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(window->StatusEntry),"clicked",G_CALLBACK(on_status_clicked),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);
|
|
|
|
g_signal_connect(G_OBJECT(window->CheckButton),"clicked",G_CALLBACK(yon_update_thread),window);
|
|
|
|
g_signal_connect(G_OBJECT(window->Window),"destroy",G_CALLBACK(remove_checking),window);
|
|
|
|
|
|
|
|
// g_signal_connect(G_OBJECT(window->AdressEntry),"focus-out-event",G_CALLBACK(yon_update_thread),window);
|
|
|
|
|
|
|
|
// yon_update_thread(NULL,NULL,window);
|
|
|
|
|
|
|
|
window->timer_id = g_timeout_add(1000,(GSourceFunc)yon_update_thread,window);
|
|
|
|
|
|
|
|
return window;
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -724,6 +724,26 @@ void on_check_domain_connected(GtkWidget *self, main_window *widgets){
|
|
|
|
gtk_entry_set_icon_tooltip_markup(GTK_ENTRY(widgets->DomainEntry),GTK_ENTRY_ICON_SECONDARY,DOMAIN_DISCONNECTED_LABEL);
|
|
|
|
gtk_entry_set_icon_tooltip_markup(GTK_ENTRY(widgets->DomainEntry),GTK_ENTRY_ICON_SECONDARY,DOMAIN_DISCONNECTED_LABEL);
|
|
|
|
main_config.domain_connected=0;
|
|
|
|
main_config.domain_connected=0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
YON_CONFIG_TYPE type;
|
|
|
|
|
|
|
|
switch(main_config.load_mode){
|
|
|
|
|
|
|
|
case 0: type=YON_CONFIG_GLOBAL;
|
|
|
|
|
|
|
|
yon_config_load_config(type,yon_config_parameter_prepare_command(DOMAIN_get_command,"global",NULL,NULL), yon_config_parameter_prepare_command(HOSTNAME_get_command,"global",NULL,NULL),NULL);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1: type=YON_CONFIG_LOCAL;
|
|
|
|
|
|
|
|
yon_config_load_config(type,yon_config_parameter_prepare_command(DOMAIN_get_command,"system",NULL,NULL), yon_config_parameter_prepare_command(HOSTNAME_get_command,"system",NULL,NULL),NULL);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3: type=YON_CONFIG_CUSTOM;
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(main_config.custom_load_path))
|
|
|
|
|
|
|
|
yon_config_load_config(type,yon_config_parameter_prepare_command(DOMAIN_get_command,main_config.custom_load_path,NULL,NULL), yon_config_parameter_prepare_command(HOSTNAME_get_command,main_config.custom_load_path,NULL,NULL),NULL);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
char *hostname = yon_config_get_by_key(hostname_parameter);
|
|
|
|
|
|
|
|
char *domain = yon_config_get_by_key(DOMAIN);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(hostname))
|
|
|
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->HostnameEntry),hostname);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(domain))
|
|
|
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->DomainEntry),domain);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
@ -742,6 +762,7 @@ main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
widgets->LocaleButton = yon_gtk_builder_get_widget(builder,"getLocalesButton");
|
|
|
|
widgets->LocaleButton = yon_gtk_builder_get_widget(builder,"getLocalesButton");
|
|
|
|
widgets->LocaleEntry = yon_gtk_builder_get_widget(builder,"localeEntry");
|
|
|
|
widgets->LocaleEntry = yon_gtk_builder_get_widget(builder,"localeEntry");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
widgets->FindButton = yon_gtk_builder_get_widget(builder,"FindButton");
|
|
|
|
widgets->DomainButton = yon_gtk_builder_get_widget(builder,"DomainButton");
|
|
|
|
widgets->DomainButton = yon_gtk_builder_get_widget(builder,"DomainButton");
|
|
|
|
widgets->DomainEntry = yon_gtk_builder_get_widget(builder,"DomainEntry");
|
|
|
|
widgets->DomainEntry = yon_gtk_builder_get_widget(builder,"DomainEntry");
|
|
|
|
|
|
|
|
|
|
|
|
@ -787,6 +808,8 @@ main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->DomainEntry),"focus-out-event",G_CALLBACK(on_domain_address_save),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->DomainEntry),"focus-out-event",G_CALLBACK(on_domain_address_save),NULL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->FindButton),"clicked",G_CALLBACK(on_find_domains_clicked),widgets);
|
|
|
|
|
|
|
|
|
|
|
|
gtk_widget_set_size_request(widgets->Window,800,440);
|
|
|
|
gtk_widget_set_size_request(widgets->Window,800,440);
|
|
|
|
|
|
|
|
|
|
|
|
// g_timeout_add(1000,(GSourceFunc)on_check_domain_connected,widgets);
|
|
|
|
// g_timeout_add(1000,(GSourceFunc)on_check_domain_connected,widgets);
|
|
|
|
|