@ -360,7 +360,7 @@ void on_section_settings_open(GtkButton* self,dictionary *cWidgets){
main_config . SettingsSections - > first - > key = name ;
main_config . SettingsSections - > first - > key = name ;
yon_segments_hide ( widgets ) ;
yon_segments_hide ( widgets ) ;
yon_segment_show ( widgets , ( SectionSettingSegment * ) main_config . SettingsSections - > data ) ;
yon_segment_show ( widgets , ( SectionSettingSegment * ) main_config . SettingsSections - > data ) ;
for ( dictionary * dct = main_config . sections - > first - > next ; dct ! = NULL ; dct = dct - > next ) { // ошибка если меньше двух
for ( dictionary * dct = main_config . sections - > first - > next ; dct ! = NULL ; dct = dct - > next ) {
name = ( ( IconSection * ) dct - > data ) - > section ;
name = ( ( IconSection * ) dct - > data ) - > section ;
categories = ( ( IconSection * ) dct - > data ) - > categories ;
categories = ( ( IconSection * ) dct - > data ) - > categories ;
main_config . SettingsSections = yon_dictionary_create_with_data_connected ( main_config . SettingsSections , name , yon_create_section_setting ( name , categories ) ) ;
main_config . SettingsSections = yon_dictionary_create_with_data_connected ( main_config . SettingsSections , name , yon_create_section_setting ( name , categories ) ) ;
@ -495,7 +495,7 @@ void on_sections_add(GtkWidget *button, actionWidgets *widgets){
SectionSettingSegment * segment = yon_create_section_setting ( category_name , category_categories ) ;
SectionSettingSegment * segment = yon_create_section_setting ( category_name , category_categories ) ;
dictionary * newsection = yon_dictionary_get_last ( main_config . SettingsSections ) ;
dictionary * newsection = yon_dictionary_get_last ( main_config . SettingsSections ) ;
newsection = yon_dictionary_create_with_data_connected ( newsection , category_name , segment ) ;
newsection = yon_dictionary_create_with_data_connected ( newsection , category_name , segment ) ;
printf ( " %s \n " , category_name ) ;
// printf("%s\n",category_name);
dictionary * newsec = yon_dictionary_create_empty ( ) ;
dictionary * newsec = yon_dictionary_create_empty ( ) ;
newsec = yon_section_new ( newsec , category_name , category_categories ) ;
newsec = yon_section_new ( newsec , category_name , category_categories ) ;
main_config . sections = yon_dictionary_create_with_data_connected ( main_config . sections , category_name , newsec - > data ) ;
main_config . sections = yon_dictionary_create_with_data_connected ( main_config . sections , category_name , newsec - > data ) ;
@ -565,29 +565,7 @@ void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widget
main_config . fullscreen = 1 ;
main_config . fullscreen = 1 ;
gtk_revealer_set_reveal_child ( GTK_REVEALER ( widgets - > Revealer ) , ! gtk_revealer_get_child_revealed ( GTK_REVEALER ( widgets - > Revealer ) ) ) ;
gtk_revealer_set_reveal_child ( GTK_REVEALER ( widgets - > Revealer ) , ! gtk_revealer_get_child_revealed ( GTK_REVEALER ( widgets - > Revealer ) ) ) ;
gtk_revealer_set_reveal_child ( GTK_REVEALER ( widgets - > Revealer ) , gtk_revealer_get_child_revealed ( GTK_REVEALER ( widgets - > Revealer ) ) ) ;
gtk_revealer_set_reveal_child ( GTK_REVEALER ( widgets - > Revealer ) , gtk_revealer_get_child_revealed ( GTK_REVEALER ( widgets - > Revealer ) ) ) ;
// if (main_config.WindowTheme==1){
// if (main_config.windowWidth<1240){
// if (stld==0){
// stld=1;
// main_config.WindowTheme=0;
// gtk_window_set_resizable(GTK_WINDOW(window),0);
// gtk_window_get_position(GTK_WINDOW(window),&main_config.windowPosX,&main_config.windowPosY);
// gtk_window_get_size(GTK_WINDOW(window),&main_config.windowWidth,&main_config.windowHeight);
// yon_switch_theme(&widgetsD,yon_dictionary_find(&widgetsD,"Main"));
// *main_config.currentThemeIconSize=24;
// gtk_window_resize(GTK_WINDOW(widgets->window),main_config.windowWidth,main_config.windowHeight);
// gtk_widget_hide(widgets->window);
// }
// }else {
// yon_segments_hide(widgets);
// yon_segments_show(widgets);
// if (stld==1){
// stld=0;
// cmld=0;
// }
// }
// }
}
}
void on_resized_done ( GtkWidget * window , GdkEvent * event , dictionary * widgetsD ) {
void on_resized_done ( GtkWidget * window , GdkEvent * event , dictionary * widgetsD ) {
@ -656,6 +634,7 @@ void on_reveal_banner(GtkWidget *button, actionWidgets *widgets){
}
}
void on_double_click_changed ( GtkWidget * Switch , gboolean state , dictionary * widgetsD ) {
void on_double_click_changed ( GtkWidget * Switch , gboolean state , dictionary * widgetsD ) {
// printf("%s\n","SGRBHSDRFJHNSDRJHNSDRJHNDRDJR");
* main_config . currentDoubleClick = state ;
* main_config . currentDoubleClick = state ;
update_double_clicks ( widgetsD ) ;
update_double_clicks ( widgetsD ) ;
}
}
@ -724,14 +703,23 @@ int reload_list(IVGraphicals *section){
}
}
void update_double_clicks ( dictionary * widgetsD ) {
void update_double_clicks ( dictionary * widgetsD ) {
printf ( " %s \n " , " 1 " ) ;
for ( dictionary * dict = widgetsD - > first ; dict ! = NULL ; dict = dict - > next ) {
for ( dictionary * dict = widgetsD - > first ; dict ! = NULL ; dict = dict - > next ) {
printf ( " %s \n " , " 2 " ) ;
actionWidgets * widgets = ( actionWidgets * ) dict - > data ;
actionWidgets * widgets = ( actionWidgets * ) dict - > data ;
printf ( " %s \n " , " 3 " ) ;
for ( dictionary * ivdct = widgets - > ICSys - > first ; ivdct ! = NULL ; ivdct = ivdct - > next ) {
for ( dictionary * ivdct = widgets - > ICSys - > first ; ivdct ! = NULL ; ivdct = ivdct - > next ) {
printf ( " %s \n " , " 4 " ) ;
IVGraphicals * IV = ( IVGraphicals * ) ivdct - > data ;
IVGraphicals * IV = ( IVGraphicals * ) ivdct - > data ;
if ( strcmp ( dict - > key , " Gnome " ) = = 0 )
printf ( " %s \n " , " 5 " ) ;
if ( strcmp ( dict - > key , " Gnome " ) = = 0 ) {
printf ( " %s \n " , " 6 " ) ;
gtk_icon_view_set_activate_on_single_click ( GTK_ICON_VIEW ( IV - > IV ) , ! main_config . GnomeDoubleClick ) ;
gtk_icon_view_set_activate_on_single_click ( GTK_ICON_VIEW ( IV - > IV ) , ! main_config . GnomeDoubleClick ) ;
else
printf ( " %s \n " , " 7 " ) ;
} else {
gtk_icon_view_set_activate_on_single_click ( GTK_ICON_VIEW ( IV - > IV ) , ! main_config . MainDoubleClick ) ;
gtk_icon_view_set_activate_on_single_click ( GTK_ICON_VIEW ( IV - > IV ) , ! main_config . MainDoubleClick ) ;
printf ( " %s \n " , " 8 " ) ;
}
}
}
}
}
}
}
@ -988,13 +976,15 @@ void save_config(actionWidgets *widgets){
int sz = 1 , szm = 1 ;
int sz = 1 , szm = 1 ;
if ( main_config . Gnomeiconsize = = 64 ) sz = 4 ;
if ( main_config . Gnomeiconsize = = 64 ) sz = 4 ;
if ( main_config . Gnomeiconsize = = 48 ) sz = 3 ;
else if ( main_config . Gnomeiconsize = = 48 ) sz = 3 ;
if ( main_config . Gnomeiconsize = = 32 ) sz = 2 ;
else if ( main_config . Gnomeiconsize = = 32 ) sz = 2 ;
if ( main_config . Gnomeiconsize = = 24 ) sz = 1 ;
else if ( main_config . Gnomeiconsize = = 24 ) sz = 1 ;
else sz = 3 ;
if ( main_config . Mainiconsize = = 64 ) szm = 4 ;
if ( main_config . Mainiconsize = = 64 ) szm = 4 ;
if ( main_config . Mainiconsize = = 48 ) szm = 3 ;
else if ( main_config . Mainiconsize = = 48 ) szm = 3 ;
if ( main_config . Mainiconsize = = 32 ) szm = 2 ;
else if ( main_config . Mainiconsize = = 32 ) szm = 2 ;
if ( main_config . Mainiconsize = = 24 ) szm = 1 ;
else if ( main_config . Mainiconsize = = 24 ) szm = 1 ;
else szm = 3 ;
char * fromint = malloc ( 5 ) ;
char * fromint = malloc ( 5 ) ;
memset ( fromint , 0 , 5 ) ;
memset ( fromint , 0 , 5 ) ;
GError * err = NULL ;
GError * err = NULL ;
@ -1077,11 +1067,8 @@ char *yon_char_divide_search(char *source, char* dividepos, int delete_divider){
void yon_set_default_sections ( dictionary * section ) {
void yon_set_default_sections ( dictionary * section ) {
yon_section_new ( section , " Personal " , " X-UBL-SettingsManager;X-UBL-PersonalSettings; " ) ;
yon_section_new ( section , " Personal " , " X-UBL-SettingsManager;X-UBL-PersonalSettings; " ) ;
section = yon_dictionary_create_conneced ( section ) ;
yon_section_new ( section , " Hardware " , " X-UBL-SettingsManager;X-UBL-HardwareSettings; " ) ;
yon_section_new ( section , " Hardware " , " X-UBL-SettingsManager;X-UBL-HardwareSettings; " ) ;
section = yon_dictionary_create_conneced ( section ) ;
yon_section_new ( section , " System " , " X-UBL-SettingsManager;X-UBL-SystemSettings; " ) ;
yon_section_new ( section , " System " , " X-UBL-SettingsManager;X-UBL-SystemSettings; " ) ;
section = yon_dictionary_create_conneced ( section ) ;
yon_section_new ( section , " Misc " , " X-UBL-SettingsManager;X-UBL-MiscSettings; " ) ;
yon_section_new ( section , " Misc " , " X-UBL-SettingsManager;X-UBL-MiscSettings; " ) ;
}
}
@ -1175,21 +1162,18 @@ void yon_check_path(char *path){
}
}
dictionary * yon_section_new ( dictionary * section , char * section_name , char * categories ) {
dictionary * yon_section_new ( dictionary * section , char * section_name , char * categories ) {
section - > next = NULL ;
IconSection * sct = malloc ( sizeof ( IconSection ) ) ;
IconSection * sct = malloc ( sizeof ( IconSection ) ) ;
dictionary * dict = yon_dictionary_create_empty ( ) ; //malloc(sizeof(dictionary));
sct - > section = section_name ;
sct - > section = section_name ;
sct - > categories = categories ;
sct - > categories = categories ;
if ( ! section - > data & & ! section - > prev ) {
dict - > data = sct ;
section - > data = sct ;
if ( ! section - > data ) {
section - > data = dict - > data ;
section - > first = section ;
section - > first = section ;
section - > key = section_name ;
section - > key = section_name ;
} else {
} else {
dict- > first = section - > first ;
section= yon_dictionary_get_last ( section ) ;
section - > next = dict ;
section - > next = yon_dictionary_create_conneced ( section ) ;
dict- > prev = section ;
section- > next - > data = sct ;
dic t- > key = section_name ;
section- > nex t- > key = section_name ;
section = section - > next ;
section = section - > next ;
}
}
@ -1272,6 +1256,14 @@ dictionary *yon_dictionary_rip(dictionary *dict){
}
}
}
}
dictionary * yon_dictionary_connect ( dictionary * old , dictionary * toconnect ) {
dictionary * dict = yon_dictionary_get_last ( old ) ;
dict - > next = toconnect ;
toconnect - > prev = dict ;
toconnect - > first = dict - > first ;
return toconnect ;
}
void yon_switch_theme ( dictionary * * dict , dictionary * newone ) {
void yon_switch_theme ( dictionary * * dict , dictionary * newone ) {
dictionary * dct = * dict ;
dictionary * dct = * dict ;
actionWidgets * widgets = ( actionWidgets * ) dct - > data ;
actionWidgets * widgets = ( actionWidgets * ) dct - > data ;
@ -1598,8 +1590,9 @@ dictionary *yon_dictionary_switch_places(dictionary *dict,int aim){
}
}
dictionary * yon_dictionary_get_last ( dictionary * dict ) {
dictionary * yon_dictionary_get_last ( dictionary * dict ) {
for ( dictionary * dct = dict ; dct ! = NULL ; dct = dct - > next ) { }
dictionary * dct = NULL ;
return dict ;
for ( dct = dict - > first ; dct - > next ! = NULL ; dct = dct - > next ) { }
return dct ;
}
}
void yon_main_quit ( actionWidgets * widgets ) {
void yon_main_quit ( actionWidgets * widgets ) {