|
|
|
@ -1,5 +1,7 @@
|
|
|
|
#include "libublsettingsui-gtk3.h"
|
|
|
|
#include "libublsettingsui-gtk3.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_confuguration_combo_box_changed(GtkComboBox *self, char *id);
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
typedef struct {
|
|
|
|
char *id;
|
|
|
|
char *id;
|
|
|
|
GtkWidget *Box;
|
|
|
|
GtkWidget *Box;
|
|
|
|
@ -50,7 +52,14 @@ yon_configuration_combo_parameter *yon_configuration_combo_box_parameter_new(cha
|
|
|
|
for (int i=0;parameters[i]&¶meters[i+1];i+=2){
|
|
|
|
for (int i=0;parameters[i]&¶meters[i+1];i+=2){
|
|
|
|
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(parameter->ComboBox),parameters[i],parameters[i+1]);
|
|
|
|
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(parameter->ComboBox),parameters[i],parameters[i+1]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
char *value = NULL;
|
|
|
|
|
|
|
|
yon_window_config_get_parameter("settings",id,&value,YON_TYPE_STRING);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(value)){
|
|
|
|
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(parameter->ComboBox),value);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(parameter->ComboBox),0);
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(parameter->ComboBox),0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(parameter->ComboBox),"changed",G_CALLBACK(on_confuguration_combo_box_changed),id);
|
|
|
|
gtk_widget_show_all(parameter->Box);
|
|
|
|
gtk_widget_show_all(parameter->Box);
|
|
|
|
return parameter;
|
|
|
|
return parameter;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -58,6 +67,7 @@ yon_configuration_combo_parameter *yon_configuration_combo_box_parameter_new(cha
|
|
|
|
typedef struct yon_configuration_parameters {
|
|
|
|
typedef struct yon_configuration_parameters {
|
|
|
|
dictionary_fields(yon_configuration_parameters);
|
|
|
|
dictionary_fields(yon_configuration_parameters);
|
|
|
|
char *label;
|
|
|
|
char *label;
|
|
|
|
|
|
|
|
char *value;
|
|
|
|
enum CONFIGURATION_PARAMETER_TYPE type;
|
|
|
|
enum CONFIGURATION_PARAMETER_TYPE type;
|
|
|
|
} yon_configuration_parameters;
|
|
|
|
} yon_configuration_parameters;
|
|
|
|
|
|
|
|
|
|
|
|
@ -68,7 +78,6 @@ ubl_settings_window *yon_ubl_settings_window_new(){
|
|
|
|
window->WorkZoneBox = yon_gtk_builder_get_widget(builder,"WorkZoneBox");
|
|
|
|
window->WorkZoneBox = yon_gtk_builder_get_widget(builder,"WorkZoneBox");
|
|
|
|
window->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton");
|
|
|
|
window->AcceptButton = yon_gtk_builder_get_widget(builder,"AcceptButton");
|
|
|
|
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
|
|
|
|
window->CancelButton = yon_gtk_builder_get_widget(builder,"CancelButton");
|
|
|
|
g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
|
|
|
|
|
|
|
|
return window;
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -134,15 +143,6 @@ void yon_ubl_settings_window_init(GtkMenu *menu){
|
|
|
|
g_signal_connect(G_OBJECT(menu_item),"activate",G_CALLBACK(__yon_on_ubl_settings_window_open),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(menu_item),"activate",G_CALLBACK(__yon_on_ubl_settings_window_open),NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void *yon_ubl_settings_window_get(char *id){
|
|
|
|
|
|
|
|
yon_configuration_parameters *current = (yon_configuration_parameters*)yon_dictionary_get((dictionary**)&__yon_settings_parameters,id);
|
|
|
|
|
|
|
|
if (current){
|
|
|
|
|
|
|
|
return current->data;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yon_configuration_parameters *yon_configuration_parameter_new()
|
|
|
|
yon_configuration_parameters *yon_configuration_parameter_new()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
yon_configuration_parameters *dict = malloc(sizeof(yon_configuration_parameters));
|
|
|
|
yon_configuration_parameters *dict = malloc(sizeof(yon_configuration_parameters));
|
|
|
|
@ -150,6 +150,8 @@ yon_configuration_parameters *yon_configuration_parameter_new()
|
|
|
|
dict->key = NULL;
|
|
|
|
dict->key = NULL;
|
|
|
|
dict->next = NULL;
|
|
|
|
dict->next = NULL;
|
|
|
|
dict->prev = NULL;
|
|
|
|
dict->prev = NULL;
|
|
|
|
|
|
|
|
dict->data = NULL;
|
|
|
|
|
|
|
|
dict->value = NULL;
|
|
|
|
dict->first = (struct yon_configuration_parameters*)dict;
|
|
|
|
dict->first = (struct yon_configuration_parameters*)dict;
|
|
|
|
dict->data_type = DICTIONARY_OTHER_TYPE;
|
|
|
|
dict->data_type = DICTIONARY_OTHER_TYPE;
|
|
|
|
return dict;
|
|
|
|
return dict;
|
|
|
|
@ -162,6 +164,8 @@ yon_configuration_parameters *yon_configuration_parameter_append(yon_configurati
|
|
|
|
targetdict->next->prev = (struct yon_configuration_parameters*)targetdict;
|
|
|
|
targetdict->next->prev = (struct yon_configuration_parameters*)targetdict;
|
|
|
|
targetdict->next->first = targetdict->first;
|
|
|
|
targetdict->next->first = targetdict->first;
|
|
|
|
targetdict->next->data_type = DICTIONARY_OTHER_TYPE;
|
|
|
|
targetdict->next->data_type = DICTIONARY_OTHER_TYPE;
|
|
|
|
|
|
|
|
targetdict->next->data = NULL;
|
|
|
|
|
|
|
|
targetdict->next->value = NULL;
|
|
|
|
return targetdict->next;
|
|
|
|
return targetdict->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -213,3 +217,21 @@ void yon_configuration_window_add_combo_box_parameter(enum CONFIGURATION_PARAMET
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char *yon_settings_configuration_get(char *id){
|
|
|
|
|
|
|
|
yon_configuration_parameters *cur = (yon_configuration_parameters*)yon_dictionary_get((dictionary**)&__yon_settings_parameters,id);
|
|
|
|
|
|
|
|
if (cur){
|
|
|
|
|
|
|
|
return cur->value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_confuguration_combo_box_changed(GtkComboBox *self, char *id){
|
|
|
|
|
|
|
|
yon_configuration_parameters *cur = (yon_configuration_parameters*)yon_dictionary_get((dictionary**)&__yon_settings_parameters,id);
|
|
|
|
|
|
|
|
if (cur){
|
|
|
|
|
|
|
|
cur->value = yon_char_new((char*)gtk_combo_box_get_active_id(self));
|
|
|
|
|
|
|
|
if (yon_window_config_check_init()){
|
|
|
|
|
|
|
|
yon_window_config_add_instant_parameter(id,"settings",cur->value,YON_TYPE_STRING);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|