@ -257,6 +257,10 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){
g_key_file_set_string ( gfile , " window " , " LabelDensity " , fromint ) ;
g_key_file_set_string ( gfile , " window " , " User " , login ) ;
for ( int i = 0 ; i < removalsize ; i + + )
g_key_file_remove_key ( gfile , " sections " , sectionremoval [ i ] , NULL ) ;
removalsize = 0 ;
sectionremoval = NULL ;
for ( dictionary * dict = widgets - > ICSys - > first ; dict ! = NULL ; dict = dict - > next ) {
IVGraphicals * IV = ( IVGraphicals * ) dict - > data ;
g_key_file_set_string ( gfile , " sections " , IV - > sectionName , IV - > categories ) ;
@ -552,36 +556,45 @@ void on_sections_close(GtkWidget *button, actionWidgets *widgets){
gtk_widget_hide ( widgets - > SectionSettingsWindow ) ;
}
void on_sections_save ( GtkWidget * button , actionWidgets * widgets ) {
void on_sections_save ( GtkWidget * button , dictionary * widgetsD ) {
actionWidgets * widgets = ( actionWidgets * ) widgetsD - > data ;
GKeyFile * gfile = g_key_file_new ( ) ;
g_key_file_load_from_file ( gfile , GlobalConfigPath , G_KEY_FILE_NONE , NULL ) ;
main_config . sections = yon_dictionary_create_empty ( ) ;
for ( dictionary * dict = widgets - > SettingsSections ; dict ! = NULL ; dict = dict - > next ) {
SectionSettingSegment * segment = ( SectionSettingSegment * ) dict - > data ;
char * nm = ( char * ) gtk_label_get_text ( GTK_LABEL ( segment - > NameLabel ) ) ;
char * ct = ( char * ) gtk_label_get_text ( GTK_LABEL ( segment - > CategoriesLabel ) ) ;
main_config . sections = yon_section_new ( main_config . sections , nm , ct ) ;
g_key_file_set_string ( gfile , " sections " , nm , ct ) ;
for ( int i = 0 ; i < removalsize ; i + + ) {
g_key_file_remove_key ( gfile , " sections " , sectionremoval [ i ] , NULL ) ;
}
}
main_config . sections - > next = NULL ;
g_key_file_save_to_file ( gfile , GlobalConfigPath , NULL ) ;
for ( dictionary * cur = widgets - > ICSys - > first ; cur ! = NULL ; cur = cur - > next ) {
IVGraphicals * IV = cur - > data ;
gtk_container_remove ( GTK_CONTAINER ( widgets - > icvpack ) , IV - > Box ) ;
}
widgets - > ICSys = yon_create_icon_section_list ( main_config . sections ) ;
for ( dictionary * cur = widgets - > ICSys - > first ; cur ! = NULL ; cur = cur - > next ) {
load_apps ( ( IVGraphicals * ) cur - > data , widgets - > applist , widgets - > appssize ) ;
int curtheme = main_config . WindowTheme ;
for ( dictionary * widgetsd = widgetsD - > first ; widgetsd ! = NULL ; widgetsd = widgetsd - > next ) {
if ( strcmp ( widgetsd - > key , " Gnome " ) = = 0 ) {
main_config . WindowTheme = 1 ;
main_config . currentThemeIconSize = & main_config . Gnomeiconsize ;
main_config . currentThemeLabelSize = & main_config . GnomelabelSize ;
}
else {
main_config . WindowTheme = 0 ;
main_config . currentThemeIconSize = & main_config . Mainiconsize ;
main_config . currentThemeLabelSize = & main_config . MainlabelSize ;
}
widgets = ( actionWidgets * ) widgetsd - > data ;
for ( dictionary * cur = widgets - > ICSys - > first ; cur ! = NULL ; cur = cur - > next ) {
IVGraphicals * IV = cur - > data ;
gtk_container_remove ( GTK_CONTAINER ( widgets - > icvpack ) , IV - > Box ) ;
}
widgets - > ICSys = yon_create_icon_section_list ( main_config . sections ) ;
for ( dictionary * cur = widgets - > ICSys - > first ; cur ! = NULL ; cur = cur - > next ) {
load_apps_with_clear ( ( IVGraphicals * ) cur - > data , widgets - > applist , widgets - > appssize ) ;
}
yon_show_icon_views ( widgets - > ICSys , widgets ) ;
dictionary * yond = yon_dictionary_create_empty ( ) ;
yond - > data = widgets ;
hide_if_unfound ( yond ) ;
}
yon_show_icon_views ( widgets - > ICSys , widgets ) ;
dictionary * yond = yon_dictionary_create_empty ( ) ;
yond - > data = widgets ;
hide_if_unfound ( yond ) ;
main_config . WindowTheme = curtheme ;
}
void on_section_delete ( GtkWidget * button , actionWidgets * widgets ) {
@ -723,7 +736,7 @@ int launch(thread_output *thread){
}
int launch_app_with_arguments ( char * name , char * args ) {
char * path = yon_char_get_augumented ( " / bin/" , name ) ;
char * path = yon_char_get_augumented ( " / usr/ bin/" , name ) ;
path = yon_char_get_augumented ( path , " " ) ;
path = yon_char_get_augumented ( path , args ) ;
pthread_t thread_id ;
@ -1632,7 +1645,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them
g_signal_connect ( G_OBJECT ( curWidgets - > SectionSettingAddButton ) , " clicked " , G_CALLBACK ( on_sections_add ) , curWidgets ) ;
g_signal_connect ( G_OBJECT ( curWidgets - > SectionSettingsClearEntryButton ) , " clicked " , G_CALLBACK ( on_sections_new_clear ) , curWidgets ) ;
g_signal_connect ( G_OBJECT ( curWidgets - > SectionSettingsCloseButton ) , " clicked " , G_CALLBACK ( on_sections_close ) , curWidgets ) ;
g_signal_connect ( G_OBJECT ( curWidgets - > SectionSettingsSaveButton ) , " clicked " , G_CALLBACK ( on_sections_save ) , curW idgets) ;
g_signal_connect ( G_OBJECT ( curWidgets - > SectionSettingsSaveButton ) , " clicked " , G_CALLBACK ( on_sections_save ) , w idgets) ;
g_signal_connect ( G_OBJECT ( curWidgets - > CautionUnderstandButton ) , " clicked " , G_CALLBACK ( on_caution_understand ) , curWidgets ) ;
g_signal_connect ( G_OBJECT ( curWidgets - > settingsSectionsSettingsButton ) , " clicked " , G_CALLBACK ( on_section_settings_open ) , widgets ) ;
}