@ -13,6 +13,8 @@
# include <pthread.h>
# include <sys/utsname.h>
# include <sys/sysinfo.h>
# include <math.h>
# include <wctype.h>
# include "ubl-settings-manager.h"
@ -35,7 +37,7 @@ int cmld=0;
void on_plug_added ( GtkSocket * self , actionWidgets * builder ) {
printf ( " Plug has been added! \n " ) ;
//printf("Plug has been added!\n");
gtk_widget_set_vexpand ( builder - > HideWhileLaunch , 0 ) ;
gtk_widget_hide ( builder - > HideWhileLaunch ) ;
gtk_widget_set_vexpand ( GTK_WIDGET ( builder - > socketplace ) , 1 ) ;
@ -47,18 +49,15 @@ void on_plug_added(GtkSocket* self, actionWidgets *builder){
}
void on_plug_removed ( GtkSocket * self , actionWidgets * widgets ) {
//gtk_box_pack_start(GTK_BOX(widgets->workingwindow),widgets->HideWhileLaunch,TRUE,TRUE,10);
gtk_widget_show ( widgets - > HideWhileLaunch ) ;
//gtk_widget_hide(widgets->socketplace);
gtk_widget_set_vexpand ( widgets - > socketplace , 0 ) ;
gtk_widget_set_vexpand ( widgets - > HideWhileLaunch , 1 ) ;
printf ( " Plug has been removed! \n \n \n " ) ;
//printf("Plug has been removed!\n\n\n");
}
void on_Item_activated ( GtkIconView * self , GtkTreePath * path , actionWidgets * applist ) {
printf ( " \n \n \n Activated \n \n \n " ) ;
//printf("\n\n\nActivated\n\n\n");
GtkTreeIter iter ;
char * name ;
gtk_tree_model_get_iter ( gtk_icon_view_get_model ( self ) , & iter , path ) ;
@ -97,11 +96,11 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets
memset ( arg , 0 , 100 ) ;
sprintf ( arg , " --socket-id=%d " , gtk_socket_get_id ( GTK_SOCKET ( applist - > socket ) ) ) ;
if ( tempapp [ 0 ] . Type = = 1 )
if ( tempapp [ 0 ] . Type = = 2 )
if ( tempapp - > Pluggable = = 1 )
py_launch_app ( tempapp [ 0 ] . Exec , arg ) ;
else py_launch_app ( tempapp [ 0 ] . Exec , " " ) ;
else {
else if ( tempapp [ 0 ] . Type = = 1 ) {
if ( tempapp - > Pluggable = = 1 )
launch_app_with_arguments ( tempapp [ 0 ] . Exec , arg ) ;
else launch_app ( tempapp [ 0 ] . Exec ) ;
@ -151,11 +150,12 @@ void on_ReadHelpButton_activated(GtkWidget *button, GtkBuilder *builder){
gtk_widget_hide ( window ) ;
} ;
int on_settings_accept ( GtkWidget * button , dictionary * widgetsD ) {
int on_settings_accept ( GtkWidget * button , dictionary * * widgetsDs ) {
dictionary * widgetsD = * widgetsDs ;
printf ( " Saving config... \n " ) ;
actionWidgets * widgets = ( actionWidgets * ) widgetsD - > data ;
gtk_window_get_size ( GTK_WINDOW ( widgets - > window ) , & main_config . windowWidth , & main_config . windowHeight ) ;
gtk_window_get_position ( GTK_WINDOW ( widgets - > window ) , & main_config . windowPosX , & main_config . windowPosY ) ;
int theme = gtk_combo_box_get_active ( GTK_COMBO_BOX ( widgets - > settingsThemeChooser ) ) ;
if ( theme = = 0 )
@ -173,9 +173,11 @@ int on_settings_accept(GtkWidget *button, dictionary *widgetsD){
gtk_window_present ( GTK_WINDOW ( widgets - > SettingsWindow ) ) ;
gtk_widget_hide ( widgets - > window ) ;
if ( yon_dictionary_find ( & widgetsD , main_config . curThemeName ) = = NULL ) {
widgetsD - > next = yon_theme_new ( yon_dictionary_create_empty ( ) , widgets - > builder , main_config . curThemeName , widgets - > applist , widgets - > appssize ) ;
dictionary * DCT = yon_dictionary_create_empty ( ) ;
widgetsD - > next = yon_theme_new ( & DCT , widgets - > builder , main_config . curThemeName , widgets - > applist , widgets - > appssize ) ;
widgetsD - > next - > prev = widgetsD ;
yon_switch_theme ( & widgetsD , yon_dictionary_find ( & widgetsD , main_config . curThemeName ) ) ;
yon_switch_theme ( widgetsDs , yon_dictionary_find ( & widgetsD , main_config . curThemeName ) ) ;
widgets = ( actionWidgets * ) widgetsD - > data ;
widgets - > ICSys = yon_create_icon_section_list ( main_config . sections ) ;
for ( dictionary * cur = widgets - > ICSys - > first ; cur ! = NULL ; cur = cur - > next ) {
@ -184,8 +186,10 @@ int on_settings_accept(GtkWidget *button, dictionary *widgetsD){
yon_show_icon_views ( widgets - > ICSys , widgets ) ;
}
yon_switch_theme ( & widgetsD , yon_dictionary_find ( & widgetsD , main_config . curThemeName ) ) ;
yon_switch_theme ( widgetsD s , yon_dictionary_find ( & widgetsD , main_config . curThemeName ) ) ;
if ( widgets ! = ( actionWidgets * ) widgetsD - > data ) widgets = ( actionWidgets * ) widgetsD - > data ;
gtk_window_resize ( GTK_WINDOW ( widgets - > window ) , main_config . windowWidth , main_config . windowHeight ) ;
gtk_window_move ( GTK_WINDOW ( widgets - > window ) , main_config . windowPosX , main_config . windowPosY ) ;
gtk_widget_show ( widgets - > window ) ;
gtk_widget_hide ( loaderWindow ) ;
main_config . WindowTheme = theme ;
@ -224,12 +228,13 @@ int on_settings_accept(GtkWidget *button, dictionary *widgetsD){
void on_paned_move ( GtkPaned * self , GtkScrollType * scroll_type , actionWidgets * widgets ) { /* TODO */
int position = gtk_paned_get_position ( GTK_PANED ( widgets - > GnomePaned ) ) ;
printf ( " Paned moved to %d \n " , position ) ;
position - = 70 ;
if ( position < 115 ) position = 115 ;
double pos = ( ( double ) position - ( 1 / ( double ) position * 4 ) * 500 ) / 1.8 ;
if ( pos < 110 ) pos = 110 ;
//printf("Paned moved to %f\n",pos);
for ( dictionary * dict = widgets - > ICSys ; dict ! = NULL ; dict = dict - > next ) {
IVGraphicals * IV = ( IVGraphicals * ) dict - > data ;
gtk_icon_view_set_item_width ( GTK_ICON_VIEW ( IV - > IV ) , position ) ;
gtk_icon_view_set_item_width ( GTK_ICON_VIEW ( IV - > IV ) , pos ) ;
}
@ -556,7 +561,72 @@ void on_section_delete(GtkWidget *button, actionWidgets *widgets){
}
}
}
void on_resized ( GtkWidget * window , GdkEventConfigure * event , dictionary * widgetsD ) {
actionWidgets * widgets = ( actionWidgets * ) widgetsD - > data ;
gtk_window_get_position ( GTK_WINDOW ( widgets - > window ) , & main_config . windowPosX , & main_config . windowPosY ) ;
gtk_window_get_size ( GTK_WINDOW ( widgets - > window ) , & main_config . windowWidth , & main_config . windowHeight ) ;
dictionary * dct ;
if ( yon_dictionary_find ( & widgetsD , " Main " ) = = NULL ) {
dct = yon_dictionary_create_empty ( ) ;
dictionary * newd = yon_theme_new ( & dct , widgets - > builder , " Main " , widgets - > applist , widgets - > appssize ) ;
widgetsD - > next = newd ;
newd - > prev = widgetsD ;
newd - > first = widgetsD ;
actionWidgets * widgetss = ( actionWidgets * ) widgetsD - > data ;
widgetss - > ICSys = yon_create_icon_section_list ( main_config . sections ) ;
for ( dictionary * cur = widgetss - > ICSys - > first ; cur ! = NULL ; cur = cur - > next ) {
load_apps ( ( IVGraphicals * ) cur - > data , widgetss - > applist , widgetss - > appssize ) ;
}
yon_show_icon_views ( widgetss - > ICSys , widgetss ) ;
}
dictionary * newdd ;
if ( yon_dictionary_find ( & widgetsD , " Gnome " ) = = NULL ) {
newdd = yon_theme_new ( & dct , widgets - > builder , " Gnome " , widgets - > applist , widgets - > appssize ) ;
widgetsD - > next = newdd ;
newdd - > prev = widgetsD ;
newdd - > first = widgetsD ;
actionWidgets * widgetss = ( actionWidgets * ) widgetsD - > data ;
widgetss - > ICSys = yon_create_icon_section_list ( main_config . sections ) ;
for ( dictionary * cur = widgetss - > ICSys - > first ; cur ! = NULL ; cur = cur - > next ) {
load_apps ( ( IVGraphicals * ) cur - > data , widgetss - > applist , widgetss - > appssize ) ;
}
yon_show_icon_views ( widgetss - > ICSys , widgetss ) ;
}
if ( main_config . WindowTheme = = 1 ) {
printf ( " \n AaAaAaAa \n " ) ;
actionWidgets * widgetss = ( actionWidgets * ) widgetsD - > data ;
GtkWidget * loaderWindow = GTK_WIDGET ( gtk_builder_get_object ( widgets - > builder , " LoaderWindow " ) ) ;
// gtk_window_resize(GTK_WINDOW(widgetss->window),main_config.windowWidth,main_config.windowHeight);
widgetsD = yon_dictionary_find ( & widgetsD , " Gnome " ) ;
if ( gtk_widget_get_visible ( widgetss - > window ) = = 1 ) {
widgetsD = yon_dictionary_find ( & widgetsD , " Gnome " ) ;
gtk_window_resize ( GTK_WINDOW ( widgetss - > window ) , 1025 , 721 ) ;
if ( main_config . windowWidth < 1024 & & main_config . windowHeight < 720 ) {
gtk_widget_hide ( widgetss - > window ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgetss - > settingsThemeChooser ) , 0 ) ;
widgetsD = yon_dictionary_find ( & widgetsD , " Main " ) ;
actionWidgets * widgetss = ( actionWidgets * ) widgetsD - > data ;
// gtk_window_resize(GTK_WINDOW(widgetss->window),1023,719);
gtk_widget_show ( widgetss - > window ) ;
}
} else {
widgetsD = yon_dictionary_find ( & widgetsD , " Main " ) ;
gtk_window_resize ( GTK_WINDOW ( widgetss - > window ) , 1024 , 720 ) ;
if ( main_config . windowWidth > 1024 & & main_config . windowHeight > 720 ) {
gtk_widget_hide ( widgetss - > window ) ;
gtk_combo_box_set_active ( GTK_COMBO_BOX ( widgetss - > settingsThemeChooser ) , 1 ) ;
widgetsD = yon_dictionary_find ( & widgetsD , " Gnome " ) ;
actionWidgets * widgetss = ( actionWidgets * ) widgetsD - > data ;
// gtk_window_resize(GTK_WINDOW(widgetss->window),1025,721);
gtk_widget_show ( widgetss - > window ) ;
}
}
} else {
}
gtk_window_get_size ( GTK_WINDOW ( widgets - > window ) , & main_config . windowWidth , & main_config . windowHeight ) ;
}
void launch_app_with_arguments ( char * name , char * args ) {
char * path = malloc ( strlen ( name ) + strlen ( args ) + 4 ) ;
memset ( path , 0 , strlen ( name ) + strlen ( args ) + 4 ) ;
@ -920,6 +990,9 @@ int setup_config(){
main_config . sections - > next = NULL ;
}
if ( main_config . windowWidth < 1024 & & main_config . windowHeight < 720 ) {
main_config . WindowTheme = 0 ;
}
} ;
@ -1013,6 +1086,7 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){
if ( main_config . WindowTheme = = 1 ) {
gtk_icon_view_set_columns ( GTK_ICON_VIEW ( iv ) , 1 ) ;
gtk_widget_set_name ( iv , " GnomeIcon " ) ;
gtk_icon_view_set_activate_on_single_click ( GTK_ICON_VIEW ( iv ) , 1 ) ;
gtk_icon_view_set_item_orientation ( GTK_ICON_VIEW ( iv ) , GTK_ORIENTATION_HORIZONTAL ) ;
}
@ -1087,6 +1161,13 @@ dictionary *yon_section_new(dictionary *section, char *section_name, char *categ
return section ;
}
void yon_icv_resize_item ( dictionary * icdict , GtkWidget * paned ) {
for ( dictionary * dict = icdict - > first ; dict ! = NULL ; dict = dict - > next ) {
IVGraphicals * icv = ( IVGraphicals * ) dict - > data ;
gtk_icon_view_set_item_width ( GTK_ICON_VIEW ( icv - > IV ) , gtk_paned_get_position ( GTK_PANED ( paned ) ) ) ;
}
}
char * yon_char_get_augumented ( char * source , char * append ) {
int size = strlen ( source ) + strlen ( append ) + 1 ;
char * final = malloc ( size ) ;
@ -1100,7 +1181,10 @@ int yon_show_icon_views(dictionary *IVS,actionWidgets *widgets){
IVGraphicals * iv = dct - > data ;
gtk_widget_show_all ( iv - > Box ) ;
gtk_box_pack_start ( GTK_BOX ( widgets - > icvpack ) , iv - > Box , FALSE , FALSE , 0 ) ;
if ( main_config . WindowTheme = = 0 )
g_signal_connect ( G_OBJECT ( iv - > IV ) , " item-activated " , G_CALLBACK ( on_Item_activated ) , widgets ) ;
else if ( main_config . WindowTheme = = 1 )
g_signal_connect ( G_OBJECT ( iv - > IV ) , " item-activated " , G_CALLBACK ( on_gnome_Item_activated ) , widgets ) ;
g_signal_connect ( G_OBJECT ( iv - > IV ) , " selection-changed " , G_CALLBACK ( on_item_selection_changed ) , widgets ) ;
}
@ -1193,34 +1277,12 @@ SectionSettingSegment *yon_create_section_setting(char *name, char *categories){
gtk_widget_set_margin_top ( segment - > DragButtonBox , 3 ) ;
gtk_widget_set_margin_end ( segment - > DragUpButton , 3 ) ;
// gtk_widget_set_halign(segment->ElemBox,GTK_ALIGN_FILL);
// gtk_widget_set_halign(segment->NameBox,GTK_ALIGN_START);
// gtk_widget_set_halign(segment->CategoriesBox,GTK_ALIGN_START);
gtk_widget_set_halign ( segment - > NameEntry , GTK_ALIGN_START ) ;
gtk_widget_set_halign ( segment - > NameLabel , GTK_ALIGN_END ) ;
// gtk_widget_set_halign(segment->CategoriesEntry,GTK_ALIGN_START);
// gtk_widget_set_halign(segment->CategoriesLabel,GTK_ALIGN_START);
// gtk_widget_set_halign(segment->EditButtonAccept,GTK_ALIGN_END);
// gtk_widget_set_halign(segment->EditButtonBox,GTK_ALIGN_END);
// gtk_widget_set_halign(segment->EditButtonCancel,GTK_ALIGN_END);
// gtk_widget_set_halign(segment->ButtonEdit,GTK_ALIGN_END);
// gtk_widget_set_valign(segment->ElemBox,GTK_ALIGN_CENTER);
// gtk_widget_set_valign(segment->NameBox,GTK_ALIGN_CENTER);
// gtk_widget_set_valign(segment->CategoriesBox,GTK_ALIGN_CENTER);
// gtk_widget_set_valign(segment->NameEntry,GTK_ALIGN_START);
// gtk_widget_set_valign(segment->NameLabel,GTK_ALIGN_START);
// gtk_widget_set_valign(segment->CategoriesEntry,GTK_ALIGN_CENTER);
// gtk_widget_set_valign(segment->CategoriesLabel,GTK_ALIGN_CENTER);
gtk_widget_set_valign ( segment - > OptionBox , GTK_ALIGN_CENTER ) ;
gtk_label_set_xalign ( GTK_LABEL ( segment - > NameLabel ) , 0 ) ;
gtk_label_set_xalign ( GTK_LABEL ( segment - > CategoriesLabel ) , 0 ) ;
// gtk_widget_set_hexpand(segment->ElemBox,1);
// gtk_widget_set_hexpand(segment->NameEntry,1);
// gtk_widget_set_hexpand(segment->NameLabel,1);
// gtk_widget_set_hexpand(segment->CategoriesEntry,1);
// gtk_widget_set_hexpand(segment->CategoriesLabel,1);
gtk_widget_set_vexpand ( segment - > ElemBox , 0 ) ;
gtk_widget_set_vexpand ( segment - > NameBox , 0 ) ;
@ -1271,9 +1333,6 @@ void yon_segments_hide(actionWidgets *widgets){
for ( dictionary * dict = widgets - > SettingsSections - > first ; dict ! = NULL ; dict = dict - > next ) {
SectionSettingSegment * sgm = ( SectionSettingSegment * ) dict - > data ;
if ( sgm ! = NULL ) {
//GKeyFile *gfile=g_key_file_new();
//g_key_file_load_from_file(gfile,".config/ubconfig-main/ubconfig-main.conf",G_KEY_FILE_NONE,NULL);
//g_key_file_set_string(gfile,"sections",gtk_label_get_text(GTK_LABEL(sgm->NameLabel)),gtk_label_get_text(GTK_LABEL(sgm->CategoriesLabel)));
g_object_ref ( G_OBJECT ( sgm - > MainFrame ) ) ;
gtk_container_remove ( GTK_CONTAINER ( widgets - > SectionSettingsPack ) , sgm - > MainFrame ) ;
} else return ;
@ -1285,11 +1344,15 @@ void yon_dictionary_make_first(dictionary *dict){
}
}
void yon_small_window_theme_change ( actionWidgets * widgets ) {
}
dictionary * yon_theme_new ( dictionary * * widgetss , GtkBuilder * builder , char * theme_id , apps * applist , int appsize ) {
dictionary * yon_theme_new ( dictionary * widgets , GtkBuilder * builder , char * theme_id , apps * applist , int appsize ) {
dictionary * widgets = * widgetss ;
actionWidgets * curWidgets = ( actionWidgets * ) widgets - > data ;
if ( ! curWidgets ) {
if ( curWidgets = = NULL ) {
curWidgets = malloc ( sizeof ( actionWidgets ) ) ;
widgets - > data = curWidgets ;
}
@ -1306,31 +1369,59 @@ dictionary *yon_theme_new(dictionary *widgets, GtkBuilder *builder, char *theme_
curWidgets - > icvpack = GTK_WIDGET ( gtk_builder_get_object ( curWidgets - > builder , yon_char_get_augumented ( theme_id , " icvpack " ) ) ) ;
curWidgets - > GnomePaned = GTK_WIDGET ( gtk_builder_get_object ( curWidgets - > builder , yon_char_get_augumented ( theme_id , " Paned " ) ) ) ;
curWidgets - > GnomeInfoLabel = GTK_WIDGET ( gtk_builder_get_object ( curWidgets - > builder , yon_char_get_augumented ( theme_id , " InfoLabel " ) ) ) ;
curWidgets - > GnomeInfoDetailsLabel = GTK_WIDGET ( gtk_builder_get_object ( curWidgets - > builder , yon_char_get_augumented ( theme_id , " InfoDetailsLabel " ) ) ) ;
curWidgets - > SettingsSections = NULL ;
gtk_style_context_add_class ( gtk_widget_get_style_context ( curWidgets - > icvpack ) , " iconview " ) ;
if ( curWidgets - > GnomeInfoLabel ! = NULL ) {
struct utsname sysinfos ;
uname ( & sysinfos ) ;
printf ( " System Name = %s \n " , sysinfos . sysname ) ;
printf ( " Node Name = %s \n " , sysinfos . nodename ) ;
printf ( " Version = %s \n " , sysinfos . version ) ;
printf ( " Release = %s \n " , sysinfos . release ) ;
printf ( " Machine = %s \n " , sysinfos . machine ) ;
struct sysinfo info ;
sysinfo ( & info ) ;
char lbl [ 2000 ] ;
memset ( lbl , 0 , 2000 ) ;
sprintf ( lbl , " Система: %s \n Ядро: %s %s %s \n Время работы: % \n \n Оперативная память: %f/%f " , sysinfos . sysname , sysinfos . machine , sysinfos . sysname , sysinfos . release , info . uptime / 60 / 60 , info . totalram / 1024 / 1024 , info . freeram / 1024 / 1024 ) ;
gtk_label_set_text ( GTK_LABEL ( curWidgets - > GnomeInfoLabel ) , lbl ) ;
printf ( " \n \n %d \n \n " , info . totalram / 1024 / 1024 ) ;
printf ( " \n \n %d \n \n " , info . freeram / 1024 / 1024 ) ;
if ( curWidgets - > GnomeInfoLabel ! = NULL & & curWidgets - > GnomeInfoDetailsLabel ! = NULL ) {
FILE * fp ;
char path [ 1035 ] ;
char * loc = setlocale ( LC_ALL , NULL ) ;
if ( strcmp ( loc , " ru_RU.UTF-8 " ) = = 0 )
fp = popen ( " screenfetch -N -n | sed 's/OS:/Система:/' | sed 's/Kernel:/Ядро:/g' | sed 's/Uptime:/Время работы:/g' | \
sed ' s / Packages : / У с т а н о в л е н о п а к е т о в : / g ' | sed ' s / Shell : / О б о л о ч к а : / g ' | sed ' s / Resolution : / Р а з р е ш е н и е : / g ' | sed ' s / DE : / С р е д а р а б о ч е г о с т о л а : / g ' | \
sed ' s / WM : / О к о н н ы й м е н е д ж е р : / g ' | sed ' s / WM Theme : / Т е м а о к о н н о г о м е н е д ж е р а : / g ' | sed ' s / GTK Theme : / Т е м а GTK : / g ' | sed ' s / Icon Theme : / Т е м а з н а ч к о в : / g ' | sed ' s / Font : / Ш р и ф т : / g ' | \
sed ' s / Disk : / Д и с к : / g ' | sed ' s / RAM : / О п е р а т и в н а я п а м я т ь : / g ' " , " r " );
else fp = popen ( " screenfetch -n -w -N " , " r " ) ;
if ( fp = = NULL ) {
printf ( " Failed to run command \n " ) ;
exit ( 1 ) ;
}
char * line = NULL ;
line = " " ;
char * prevline = " " ;
char * pth ;
char * preph = " " ;
line = " " ;
while ( fgets ( path , sizeof ( path ) , fp ) ! = NULL ) {
line = strstr ( path , " : " ) ;
if ( line ! = NULL ) {
int size = strlen ( path ) - strlen ( line ) ;
pth = yon_cut ( path , size , 0 ) ;
pth = yon_char_get_augumented ( " <span color='#1a5fb4'> " , pth ) ;
pth = yon_char_get_augumented ( pth , " </span> " ) ;
line = yon_char_get_augumented ( pth , line ) ;
} else {
line = path ;
pth = " <span size= \" 14pt \" > \n " ;
line = yon_char_get_augumented ( pth , line ) ;
}
prevline = yon_char_get_augumented ( prevline , line ) ;
} ;
prevline = yon_char_get_augumented ( prevline , " </span> " ) ; ;
gtk_label_set_text ( GTK_LABEL ( curWidgets - > GnomeInfoDetailsLabel ) , prevline ) ;
// gtk_label_set_text(GTK_LABEL(curWidgets->GnomeInfoLabel),pth);
gtk_label_set_markup ( GTK_LABEL ( curWidgets - > GnomeInfoDetailsLabel ) , prevline ) ; ;
// gtk_label_set_markup (GTK_LABEL(curWidgets->GnomeInfoLabel), pth);;
}
if ( curWidgets - > ButtonBackToMain ! = NULL )
gtk_button_set_label ( GTK_BUTTON ( curWidgets - > ButtonBackToMain ) , _ ( " Back to settings " ) ) ;
gtk_window_set_title ( GTK_WINDOW ( curWidgets - > window ) , " UBLinux Settings Manager " ) ;
g_signal_connect ( G_OBJECT ( curWidgets - > window ) , " destroy " , G_CALLBACK ( gtk_main_quit ) , NULL ) ;
g_signal_connect ( G_OBJECT ( curWidgets - > window ) , " configure-event " , G_CALLBACK ( on_resized ) , widgets ) ;
if ( curWidgets - > ButtonBackToMain ! = NULL )
g_signal_connect ( G_OBJECT ( curWidgets - > ButtonBackToMain ) , " clicked " , G_CALLBACK ( on_backToSettingsButton_clicked ) , curWidgets ) ;
curWidgets - > LabelTitle = GTK_WIDGET ( gtk_builder_get_object ( curWidgets - > builder , " LabelTitle " ) ) ;
@ -1376,20 +1467,21 @@ dictionary *yon_theme_new(dictionary *widgets, GtkBuilder *builder, char *theme_
gtk_window_set_icon_from_file ( GTK_WINDOW ( curWidgets - > SectionSettingsWindow ) , AppIconPath , NULL ) ;
// hide_if_unfound(GTK_TREE_MODEL(curWidgets);
if ( gnld = = 0 ) {
gnld = 1 ;
g_signal_connect ( G_OBJECT ( curWidgets - > MenuItemDocumentation ) , " activate " , G_CALLBACK ( on_ButtonOpenHelp_activated ) , curWidgets - > builder ) ;
g_signal_connect ( G_OBJECT ( curWidgets - > CancelHelpButton ) , " clicked " , G_CALLBACK ( on_CancelHelpButton_activated ) , curWidgets - > builder ) ;
g_signal_connect ( G_OBJECT ( curWidgets - > ReadHelpButton ) , " clicked " , G_CALLBACK ( on_ReadHelpButton_activated ) , curWidgets - > builder ) ;
g_signal_connect ( G_OBJECT ( curWidgets - > MenuItemSettings ) , " activate " , G_CALLBACK ( on_settingsOpen ) , curWidgets ) ;
g_signal_connect ( G_OBJECT ( curWidgets - > settingsSizeSlider ) , " value-changed " , G_CALLBACK ( on_settings_icon_size_changed ) , curWidgets ) ;
g_signal_connect ( G_OBJECT ( curWidgets - > settingsCancel ) , " clicked " , G_CALLBACK ( on_settings_cancel ) , curWidgets ) ;
g_signal_connect ( G_OBJECT ( curWidgets - > settingsAccept ) , " clicked " , G_CALLBACK ( on_settings_accept ) , widget s) ;
g_signal_connect ( G_OBJECT ( curWidgets - > settingsAccept ) , " clicked " , G_CALLBACK ( on_settings_accept ) , widget s s) ;
g_signal_connect ( G_OBJECT ( curWidgets - > settingsSectionsSettingsButton ) , " clicked " , G_CALLBACK ( on_section_settings_open ) , widgets ) ;
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 ) , curWidgets ) ;
// сделать функцию для сигналов окна секций, секции для настроек в словарь
} // сделать функцию для сигналов окна секций, секции для настроек в словарь
gtk_label_set_text ( GTK_LABEL ( curWidgets - > LabelTitle ) , _ ( " UBLinux Settings Manager " ) ) ;
gtk_label_set_text ( GTK_LABEL ( curWidgets - > settingsSubmenuLabelSize ) , _ ( " Icon size " ) ) ;
gtk_label_set_text ( GTK_LABEL ( curWidgets - > settingsSubmenuLabelTheme ) , _ ( " Window theme " ) ) ;
@ -1426,7 +1518,7 @@ int main(int argc, char *argv[]){
if ( main_config . WindowTheme = = 0 ) theme = " Main " ;
else if ( main_config . WindowTheme = = 1 ) theme = " Gnome " ;
else theme = " Main " ;
yon_theme_new ( widgets - > first , builder , theme , applist , * size ) ;
yon_theme_new ( & widgets - > first , builder , theme , applist , * size ) ;
widg - > applist = applist ;
widg - > appssize = * size ;
widg - > ICSys = yon_create_icon_section_list ( main_config . sections ) ;