diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index a1449a6..cf3059e 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -19,12 +19,7 @@ set(LIBRARIES ${GTK_LIBRARIES} pthread) -add_custom_target(glade ALL - COMMAND cmake -E copy_directory ${CMAKE_SOURCE_DIR}/ui ${CMAKE_BINARY_DIR}/ui -) -add_custom_target(css ALL - COMMAND cmake -E copy_directory ${CMAKE_SOURCE_DIR}/css ${CMAKE_BINARY_DIR}/css -) + add_executable(ubl-settings-manager ${SOURCE_FILES}) target_link_libraries(ubl-settings-manager ${LIBRARIES}) install(TARGETS ubl-settings-manager DESTINATION bin) \ No newline at end of file diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 9ab6acb..dcce353 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -44,7 +44,8 @@ void on_plug_added(GtkSocket* self, actionWidgets *builder){ gtk_widget_set_vexpand(GTK_WIDGET(builder->socketplace),1); gtk_widget_set_vexpand(GTK_WIDGET(self),1); gtk_widget_show(builder->socketplace); - + if (main_config.WindowTheme==0) + gtk_widget_hide(builder->appSettings); if (builder->ButtonBackToMain!=NULL) gtk_widget_set_sensitive(builder->ButtonBackToMain,1); gtk_widget_show(GTK_WIDGET(self)); } @@ -56,6 +57,7 @@ void on_plug_removed(GtkSocket* self, actionWidgets *widgets){ //printf("Plug has been removed!\n\n\n"); gtk_widget_destroy(widgets->socketbutton); + gtk_widget_show(widgets->appSettings); } void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *applist){ @@ -118,21 +120,29 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets if (tempapp[0].Type==2) if (tempapp->Pluggable==1) if (tempapp->DualPluggable==1){ - char *dualarg=malloc(strlen("--socket-id= --socket-ext-id=")+30); - sprintf(dualarg,"--socket-id=%d --socket-ext-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton))); + char *dualarg=malloc(strlen("--socket-id= --socket-ext-id= --socket-trd-id=")+30); + sprintf(dualarg,"--socket-id=%d --socket-ext-id=%d --socket-trd-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton)),gtk_socket_get_id(GTK_SOCKET(applist->ThirdSocket))); py_launch_app(tempapp[0].Exec,dualarg); - } else + gtk_widget_hide(applist->appSettings); + } else{ py_launch_app(tempapp[0].Exec,arg); + gtk_widget_destroy(applist->socketbutton); + } else py_launch_app(tempapp[0].Exec,""); else if (tempapp[0].Type==1){ if (tempapp->Pluggable==1) if (tempapp->DualPluggable==1){ char *dualarg=malloc(strlen("--socket-id= --socket-ext-id=")+30); - sprintf(dualarg,"--socket-id=%d --socket-ext-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton))); + sprintf(dualarg,"--socket-id=%d --socket-ext-id=%d --socket-trd-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton)),gtk_socket_get_id(GTK_SOCKET(applist->ThirdSocket))); launch_app_with_arguments(tempapp[0].Exec,dualarg); - } else + } else{ launch_app_with_arguments(tempapp[0].Exec,arg); - else launch_app(tempapp[0].Exec); + gtk_widget_destroy(applist->socketbutton); + } + else { + launch_app(tempapp[0].Exec); + gtk_widget_destroy(applist->socketbutton); + } } } @@ -243,6 +253,10 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){ g_key_file_set_string(gfile,"window","IconSize",fromint); sprintf(fromint,"%d",main_config.iconSegmentSize); g_key_file_set_string(gfile,"window","IconSegmentSize",fromint); + sprintf(fromint,"%d",(int)((float)main_config.labelSize/1000)); + g_key_file_set_string(gfile,"window","LabelSize",fromint); + sprintf(fromint,"%d",(int)((float)main_config.labelDensity/1000)); + g_key_file_set_string(gfile,"window","LabelDensity",fromint); 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); @@ -658,23 +672,22 @@ void launch_app_with_arguments(char *name, char *args){ path=yon_char_get_augumented(path,args); printf("%s\n",path); pthread_t thread_id; - pthread_create(&thread_id, NULL, launch, path); + pthread_create(&thread_id, NULL, (void*)launch, path); }; void launch_app(char *name){ char *path=name; pthread_t thread_id; - pthread_create(&thread_id, NULL, launch, path); + pthread_create(&thread_id, NULL, (void*)launch, path); }; void py_launch_app(char *name,char *args){ char *path=malloc(strlen("python ./")+strlen(name)+6+strlen(args)); sprintf(path,"python ./%s.py %s &",name,args); pthread_t thread_id; - pthread_create(&thread_id, NULL, launch, path); + pthread_create(&thread_id, NULL, (void*)launch, path); }; - apps *get_app_by_name(apps *applist,char *name, int size){ for (int i=0;isocketplace),socket,true,true,0); gtk_box_pack_start(GTK_BOX(builder->socketbuttonplace),socketbutton,1,1,0); builder->socketbutton=socketbutton; + + gtk_box_pack_start(GTK_BOX(builder->ThirdSocketPlace),ThirdSocket,1,1,0); + builder->ThirdSocket=ThirdSocket; return socket; }; @@ -803,8 +820,8 @@ apps *find_apps(int *sizef){ tempapp.Icon=g_key_file_get_string(gfile,"Desktop Entry", "Icon",NULL); if (tempapp.Icon==NULL) continue; tempapp.Pluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "Pluggable",NULL); - if (tempapp.Pluggable==NULL) tempapp.Pluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "X-XfcePluggable",NULL); - if (tempapp.Pluggable!=NULL) tempapp.DualPluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "X-UBLPluggable",NULL); + if (!tempapp.Pluggable) tempapp.Pluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "X-XfcePluggable",NULL); + if (tempapp.Pluggable) tempapp.DualPluggable=g_key_file_get_boolean(gfile,"Desktop Entry", "X-UBLPluggable",NULL); if (size==0){ applist=(apps*)malloc(size+1*sizeof(apps)); applist[0].Name=yon_char_new(tempapp.Name); @@ -831,7 +848,6 @@ apps *find_apps(int *sizef){ } } } - //printf("Closing apps configuration...\n"); *sizef=size; return applist; }; @@ -901,6 +917,11 @@ int setup_config(){ main_config.WindowTheme=g_key_file_get_integer(configfile,"window","WindowTheme",NULL); main_config.iconsize=g_key_file_get_integer(configfile,"window","IconSize",NULL); main_config.iconSegmentSize=g_key_file_get_integer(configfile,"window","IconSegmentSize",NULL); + main_config.labelSize=g_key_file_get_integer(configfile,"window","LabelSize",NULL); + main_config.labelDensity=g_key_file_get_integer(configfile,"window","LabelDensity",NULL); + if (main_config.labelSize==0) main_config.labelSize=12; + if (main_config.labelDensity==0) main_config.labelDensity=0; + main_config.labelSize=main_config.labelSize*1000; yon_icon_size_convert(0); gsize length=0; char **a=g_key_file_get_keys(configfile,"sections",&length,NULL); @@ -985,6 +1006,9 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ GtkWidget *box=gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); GtkWidget *iv=gtk_icon_view_new(); GtkWidget *label=gtk_label_new(_(name)); + PangoAttrList *attrs=pango_attr_list_new(); + pango_attr_list_insert(attrs,pango_attr_size_new(main_config.labelSize)); + gtk_label_set_attributes(GTK_LABEL(label),attrs); gtk_widget_set_name(label,"iconlabel"); if (main_config.WindowTheme==1) { gtk_icon_view_set_columns(GTK_ICON_VIEW(iv),1); @@ -1015,7 +1039,6 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ IVG->IV=iv; IVG->label=label; IVG->sep=sep; - return IVG; } @@ -1325,6 +1348,7 @@ void yon_segments_hide(actionWidgets *widgets){ } else return; } } + void yon_dictionary_make_first(dictionary *dict){ for (dictionary *dct=dict->first;dct!=NULL;dct=dct->next){ dct->first=dict; @@ -1332,7 +1356,6 @@ 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){ @@ -1358,7 +1381,10 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them 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->socketbuttonplace=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"socketbuttonplace"))); + curWidgets->Overlay=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"Overlay"))); + curWidgets->ThirdSocketPlace=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"ThirdSocketPlace"))); curWidgets->SettingsSections=NULL; + gtk_style_context_add_class(gtk_widget_get_style_context(curWidgets->icvpack),"iconview"); curWidgets->socket=GTK_WIDGET(create_socket(curWidgets)); curWidgets->MenuItemAboutSystem=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"MenuItemAboutSystem")); @@ -1511,6 +1537,7 @@ int main(int argc, char *argv[]){ load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize); } yon_show_icon_views(widg->ICSys,widg); + gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),widg->workingwindow); theme="Gnome"; main_config.WindowTheme=1; widgets->next=yon_dictionary_create_empty(); diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index 2d6502b..25df934 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -64,7 +64,8 @@ typedef struct { int iconsize; int iconSegmentSize; dictionary *sections; - + int labelSize; + int labelDensity; } config; typedef struct { @@ -137,6 +138,9 @@ typedef struct { GtkWidget *CautionUnderstandButton; GtkWidget *socketbuttonplace; GtkWidget *socketbutton; + GtkWidget *Overlay; + GtkWidget *ThirdSocketPlace; + GtkWidget *ThirdSocket; int appssize; apps *applist; GtkWidget *icvpack; diff --git a/ubconfig-main.conf b/ubconfig-main.conf index 27f06dd..2609f03 100644 --- a/ubconfig-main.conf +++ b/ubconfig-main.conf @@ -6,6 +6,8 @@ WindowHeight=1004 WindowTheme=0 IconSize=2 IconSegmentSize=321 +LabelSize=12 +LabelDensity=0 [sections] Personal=XFCE; diff --git a/ubl-settings-manager.css b/ubl-settings-manager.css index d8e576c..d214062 100644 --- a/ubl-settings-manager.css +++ b/ubl-settings-manager.css @@ -1,50 +1,16 @@ -* { -padding: 1px; - - -} .bannerbackground { background-color: #404040; } -#thinborder { - border:0px; - background-image:none; - background-color: transparent; - color: transparent; - border-style: solid; - border-color:black; - border-bottom-width: 1px; - box-shadow: none; -} #GnomeIcon{ border-style:solid; border-bottom-width: 1px; border-image: linear-gradient(90deg, #aaaaaa 0%, #dcddde 100%); border-image-slice: 1; - - background-color: black; } #iconlabel { font-size:14px; font-weight: bold; -} - GtkIconView.view { - background-color: #000000; - color: #000000; - } - - iconview:disabled { - background-color: rgba(0,0,0,0); } -GtkIconView.view.cell:selected, -GtkIconView.view.cell:selected:focus { - background-color: #bababa; - border-style: solid; - border-radius: 3px; - border-width: 1px; - border-color: #ffffff; -} - diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index 62a5fc9..c835e28 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -114,10 +114,11 @@ - + False - 800 - 600 + 450 + 250 + dialog-question True @@ -127,21 +128,40 @@ True False + + + True + False + start + 20 + 20 + gtk-dialog-question + 6 + + + False + True + 0 + + True False - True vertical - + True False - center - 3 + start + 10 + 5 + Would yo like to read documentation in the Web? + + + @@ -150,188 +170,59 @@ 0 - - - - False - True - 0 - - - - - True - True - 52 - True - True - + True - True - in - 150 - True - - - True - False - - - True - False - 3 - 3 - 3 - 3 - 3 - vertical - - - - - - - + False + start + start + 15 + 10 + You will be redirected to documentation website where documentation is translated and supported by community. + True + - False - True + True + True + 1 - + + Always redirect to online documentation True - False - vertical - - - True - False - vertical - - - True - False - 3 - 3 - 3 - 3 - 3 - 0 - in - - - True - False - 12 - - - True - False - center - center - - - - False - True - 0 - - - - - True - False - - - desklabel - True - False - center - right - 1 - - - False - True - 0 - - - - - False - True - 1 - - - - - - - - - - - - True - True - 0 - - - - - True - True - 0 - - - - - True - False - vertical - - - False - vertical - - - - - - False - True - 0 - - - - - False - True - 1 - - + True + False + end + 5 + 10 + True + - True - True + False + True + 2 + True True - end 1 + True @@ -339,34 +230,20 @@ 0 - - - - - True - False - True - + True False - True - + + Cancel True - False - - - True - False - UBLinux Settings Manager - - - True - True - 0 - - + True + True + + True @@ -375,172 +252,71 @@ - + + Read Online True - False - - - + True + True + + - False + True True 1 - - - True - False - - - True - True - False - True - menu1 - none - False - - - - - - False - True - 0 - - - - - False - True - end - 2 - - - - - - - True - False - ../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg - 5 + + False + True + 1 + - + + True False - 450 - 250 - dialog-question + vertical - + True False + 5 + 5 + 5 + 5 vertical - + True - False - - - True - False - start - 20 - 20 - gtk-dialog-question - 6 - - - False - True - 0 - - + True + in - + True False - vertical - - - True - False - start - 10 - 5 - Would yo like to read documentation in the Web? - - - - - - - False - True - 0 - - + natural - + True False - start - start - 15 - 10 - You will be redirected to documentation website where documentation is translated and supported by community. - True - - - - True - True - 1 - - - - - Always redirect to online documentation - True - True - False - end - 5 - 10 - True + vertical + 2 + + + - - False - True - 2 - - - - True - True - 1 - - True @@ -548,52 +324,29 @@ 0 + + + True + True + 0 + + + + + False + vertical - - True - False - - - Cancel - True - True - True - - - - - True - True - 0 - - - - - Read Online - True - True - True - - - - - True - True - 1 - - - - - False - True - 1 - + + + + False + True + 1 + @@ -645,6 +398,21 @@ + + True + False + + + True + True + 6 + + + True + -1 + + + 1 5 @@ -949,52 +717,340 @@ ../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg 6 - + + True + False + + + True + False + Element 1 + + + + + True + False + Element 2 + + + True + False + + + True + False + Element 3 + + + + + + + + + Element 4 + True + False + image3 + False + + + + + True + False + gtk-ok + + + False + 800 + 600 + + + True + False + vertical + + + True + True + 5 + 5 + 5 + 5 + in + + + True + False + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + vertical + + + + + + False + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 0 + in + + + True + False + 3 + 3 + 5 + 5 + + + True + False + + + True + True + True + center + 3 + image2 + + + False + True + 0 + + + + + True + True + True + False + Section name + name + + + True + True + 1 + + + + + True + False + + + True + False + center + + + True + True + True + 5 + image4 + + + False + True + end + 2 + + + + + True + False + 2 + + + True + True + 5 + 5 + 5 + 10 + False + Identifier + + + True + True + 0 + + + + + True + True + 2 + + + + + True + True + 1 + + + + + True + True + 2 + + + + + + + + + + + + False + True + 1 + + + + + + + + + True + True + 0 + + + + + True + False + + + Close + True + True + True + 5 + 5 + + + False + True + end + 0 + + + + + Save and apply + True + True + True + 17 + 5 + + + False + True + end + 1 + + + + + False + True + 1 + + + + + + + True + False + UBLinux Settings + + + + + + + + + + + Стандартная тема + + + GNOME тема + + + + True False - + True False - Element 1 + Settings of UBL Settings Manager + Settings + True - + True False - Element 2 - - - True - False - - - True - False - Element 3 - - - - + Documentation + True - - Element 4 + True False - image3 - False + About system... + True - - True - False - gtk-ok - - + False 800 600 @@ -1004,169 +1060,192 @@ False vertical - + True - True - 5 - 5 - 5 - 5 - in + False - + True False + True + vertical - + True False - vertical + center + 3 + + + + False + True + 0 + + + + + + False + True + 0 + + + + + True + True + 52 + True + True + + + True + True + in + 150 + True - + True False - 5 - 5 - 5 - 5 - 5 - 5 - vertical - + + True + False + 3 + 3 + 3 + 3 + 3 + vertical + + + + - - False - True - 0 - + + + False + True + + + + + True + False + vertical - + True False - 5 - 5 - 5 - 5 - 0 - in + vertical - + True False - 3 - 3 - 5 - 5 + 3 + 3 + 3 + 3 + 3 + 0 + in - + True False - - - True - True - True - center - 3 - image2 - - - False - True - 0 - - - - - True - True - True - False - Section name - name - - - True - True - 1 - - + 12 True False + center + center - + + + False + True + 0 + + + + True False - center - - - True - True - True - 5 - image4 - - - False - True - end - 2 - - - + + desklabel True False - 2 - - - True - True - 5 - 5 - 5 - 10 - False - Identifier - - - True - True - 0 - - + center + right + 1 - True + False True - 2 + 0 - True + False True 1 - - True - True - 2 - + + + + + True + True + 0 + - - + + + True + True + 0 + + + + + True + False + vertical + + + False + vertical + + + + + + False + True + 0 + @@ -1176,8 +1255,18 @@ + + True + True + + + True + True + end + 1 + @@ -1186,101 +1275,111 @@ 0 - + + + + + True + False + True + True False + True - - Close + True - True - True - 5 - 5 + False + + + True + False + UBLinux Settings Manager + + + True + True + 0 + + - False + True True - end 0 - - Save and apply + True - True - True - 17 - 5 + False + + + False True - end 1 + + + True + False + + + True + True + False + True + menu1 + none + False + + + + + + False + True + 0 + + + + + False + True + end + 2 + + + + + + + True + False + ../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg + 5 + + + + + True + False + vertical + + + - False - True 1 - - - True - False - UBLinux Settings - - - - - - - - - - - Стандартная тема - - - GNOME тема - - - - - True - False - - - True - False - Settings of UBL Settings Manager - Settings - True - - - - - True - False - Documentation - True - - - - - True - False - About system... - True - - False @@ -1519,71 +1618,17 @@ - + True False - vertical - + True - False - 5 - 5 - 5 - 5 - vertical - - - True - True - in - - - True - False - natural - - - True - False - vertical - 2 - - - - - - - - - - True - True - 0 - - - - - True - True - 0 - - - - - False - vertical - - - - + True + 6 - False - True - 1 + -1 @@ -1713,6 +1758,19 @@ 1 + + + True + False + vertical + + + + + + 2 + +