Merge pull request 'master' (#28) from YanTheKaller/libublsettings-gtk3:master into master

Reviewed-on: #28
master v1.26
Dmitry Razumov 1 year ago
commit fff16800ab

@ -290,22 +290,14 @@ void yon_terminal_integrated_start_shell(GtkWidget *terminal, char* command, voi
int yon_window_config_load(char *path){
if(__yon_window_config_target_window){
if (!access(path,0)){
if (access(path,0)){
yon_file_create_full_path(path,0644);
}
__yon_window_config_file = g_key_file_new();
__yon_window_config_path=yon_char_new(path);
chmod(__yon_window_config_path,0777);
if (!g_key_file_load_from_file(__yon_window_config_file,__yon_window_config_path,G_KEY_FILE_NONE,NULL)){
struct stat st;
int size;
config_str conf = yon_char_parse(yon_char_new(__yon_window_config_path),&size,"/");
char *path = yon_char_unite(conf[0],"/",conf[1],"/",conf[2],"/",conf[3],"/",conf[4],"/",NULL);
if (stat(path, &st) == -1) {
mkdir(path, 0777);
}
FILE *fp;
fp=fopen(__yon_window_config_path,"w");
chmod(__yon_window_config_path,0777);
fclose(fp);
g_key_file_load_from_file(__yon_window_config_file,__yon_window_config_path,G_KEY_FILE_NONE,NULL);
}
__yon_main_window_config.x = g_key_file_get_integer(__yon_window_config_file,"window","WindowPosX",NULL);
@ -344,9 +336,6 @@ void yon_terminal_integrated_start_shell(GtkWidget *terminal, char* command, voi
pthread_create(&tid,NULL,(void *)_yon_maximize,NULL);
return 1;
}
} else {
// g_warning("config file were not loaded properly");
}
return 0;
}
@ -695,6 +684,22 @@ int yon_gtk_list_store_find_text(GtkListStore *list, GtkTreeIter *iter, int seek
}
return 0;
}
void yon_on_cell_renderer_toggle_toggled_for_list_store(GtkWidget *self, gchar *path,GtkWidget *tree){
GtkTreePath *path_converted = gtk_tree_path_new_from_string(path);
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(tree));
GtkTreeIter iter;
gtk_tree_model_get_iter(model,&iter,path_converted);
int last = yon_char_find_last(path,':');
char *col = path+last+1;
int status;
gtk_tree_model_get(model,&iter,atoi(col),&status,-1);
gtk_list_store_set(GTK_LIST_STORE(model),&iter,atoi(col),!status,-1);
}
void yon_cell_renderer_toggle_set_toggle(GtkCellRendererToggle *target,GtkWidget *tree){
g_return_if_fail(GTK_IS_CELL_RENDERER_TOGGLE(target));
g_signal_connect(G_OBJECT(target),"toggled",G_CALLBACK(yon_on_cell_renderer_toggle_toggled_for_list_store),tree);
}
void yon_gtk_toggle_button_set_inactive_from_toggle(GtkToggleButton *self, GtkToggleButton *target){
if (gtk_toggle_button_get_active(self)){

@ -252,6 +252,8 @@ int yon_dictionary_gtk_pack_end_multiple_widgets(GtkBox *destination, gboolean e
int yon_gtk_list_store_find_text(GtkListStore *list, GtkTreeIter *iter, int seek_column, char *value);
void yon_cell_renderer_toggle_set_toggle(GtkCellRendererToggle *target,GtkWidget *tree);
void yon_gtk_toggle_button_set_inactive_from_toggle(GtkToggleButton *self, GtkToggleButton *target);
void yon_gtk_toggle_button_set_inactive_from_entry(GtkEntry *self, GtkToggleButton *target);

Loading…
Cancel
Save