From eb293d72dc33c129d117b35a71a6185273b688c4 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 10 Mar 2023 10:17:11 +0600 Subject: [PATCH] fixes --- Makefile | 37 +++---- VERSION.md | 2 +- source/ubl-settings-manager.c | 103 ++++++++---------- source/ubl-settings-manager.h | 23 ++-- ...ger.png => ubl-settings-manager-banner.png | Bin ubl-settings-manager.glade | 38 +++++-- 6 files changed, 106 insertions(+), 97 deletions(-) rename ubl-settings-manager.png => ubl-settings-manager-banner.png (100%) diff --git a/Makefile b/Makefile index 993aa57..32ef201 100644 --- a/Makefile +++ b/Makefile @@ -10,9 +10,10 @@ CMAKE_COMMAND = cmake #CMAKE_BUILD_DIR = $(MAKEFILE_PATH)compile CMAKE_SOURCE_DIR = ./source CMAKE_BUILD_DIR = ./compile +DEPENDS = cmake PKGNAME = $(MAKEFILE_DIR) -version_application = -#PKGNAME = check-hostalive +#PKGNAME = ubl-settings-manager +pkgdir = default_target: all @@ -21,10 +22,10 @@ all: init build init: @echo "Initialize ..."; \ version="$$(cat VERSION.md)"; \ - version=$${version:8}; \ - search="s/string version_application.*$&"; \ - replace="string version_application = \"$${version}\";"; \ - sed -i -e "$$search/$$replace/gi" source/ubl-settings-datetime.h; \ + version=$${version:8}; \ + search="s/char *version_application.*$&"; \ + replace="char *version_application = \"$${version}\";"; \ + sed -i -e "$$search/$$replace/gi" source/ubl-settings-manager.h; \ echo "-- Build path: ${CMAKE_BUILD_DIR}" depend: @@ -89,10 +90,13 @@ uninstall: @$(RM) "/usr/share/${PKGNAME}/ui/ublinux-logo.svg" @$(RM) "/usr/share/${PKGNAME}/ui/${PKGNAME}.glade" @$(RM) "/usr/share/${PKGNAME}/css/${PKGNAME}.css" - @$(RM) "/usr/share/${PKGNAME}/ui/${PKGNAME}.png" + @$(RM) "/usr/share/${PKGNAME}/ui/${PKGNAME}-banner.png" @$(RM) "/usr/share/${PKGNAME}/css/${PKGNAME}.css" @$(RM) "/usr/share/${PKGNAME}/css/${PKGNAME}.css" @$(RM) "/usr/share/${PKGNAME}/css/${PKGNAME}.css" + @$(RM) -d "/usr/share/${PKGNAME}/css" + @$(RM) -d "/usr/share/${PKGNAME}/ui" + @$(RM) -d "/usr/share/${PKGNAME}" @$(RM) "/etc/ubconfig-main.conf" @gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null @update-desktop-database --quiet 2>/dev/null @@ -115,22 +119,15 @@ install: check uninstall done @install -Dm644 -t /usr/share/icons/hicolor/scalable/apps/ ${PKGNAME}.svg @install -Dm755 -t /usr/bin/ ${CMAKE_BUILD_DIR}/${PKGNAME} - @install -Dm644 -t /usr/share/applications/ ${PKGNAME}.desktop; \ - if [ ! -d "/usr/share/${PKGNAME}" ]; then \ - mkdir /usr/share/${PKGNAME}; \ - fi; \ - if [ ! -d "/usr/share/${PKGNAME}/ui" ]; then \ - mkdir /usr/share/${PKGNAME}/ui; \ - fi; \ - if [ ! -d "/usr/share/${PKGNAME}/css" ]; then \ - mkdir /usr/share/${PKGNAME}/css; \ - fi + @install -Dm644 -t /usr/share/applications/ ${PKGNAME}.desktop + @install -Dm755 /usr/share/${PKGNAME}/ -d ui + @install -Dm755 /usr/share/${PKGNAME}/ -d css @install -Dm644 -t /usr/share/${PKGNAME}/ui/ ${PKGNAME}.glade @install -Dm644 -t /usr/share/${PKGNAME}/css/ ${PKGNAME}.css @install -Dm644 -t /usr/share/${PKGNAME}/ui/ ublinux-logo.svg - @install -Dm644 -t /etc/ ubconfig-main.conf; \ - chmod 766 /etc/ubconfig-main.conf - @install -Dm644 -t /usr/share/${PKGNAME}/ui/ ${PKGNAME}.png + @install -Dm644 -t /etc/ ubconfig-main.conf + @chmod 766 /etc/ubconfig-main.conf + @install -Dm644 -t /usr/share/${PKGNAME}/ui/ ${PKGNAME}-banner.png @gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null @update-desktop-database --quiet 2>/dev/null @touch /usr/share/applications diff --git a/VERSION.md b/VERSION.md index 323861e..0ca32b7 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -string version_application = "1.1"; +VERSION 1.1 \ No newline at end of file diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 36fffc4..5fc448a 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -82,7 +82,6 @@ void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *appl if (!tempapp){}else{ char arg[100]; memset(arg,0,100); - // printf("%d\n%d\n\n\n\n",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton))); sprintf(arg,"--socket-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton))); if (tempapp[0].Type==1){ @@ -108,7 +107,7 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets applist->socket=create_socket(applist); gtk_tree_model_get_iter(gtk_icon_view_get_model(self),&iter,path); - gtk_tree_model_get(gtk_icon_view_get_model(self),&iter,1,&name,-1); + gtk_tree_model_get(gtk_icon_view_get_model(self),&iter,0,&name,-1); apps *tempapp=get_app_by_name(applist->applist,name,applist->appssize); char arg[100]; @@ -122,7 +121,8 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets //gtk_widget_hide(applist->appSettings); 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))); - launch_app_with_arguments(tempapp[0].Exec,dualarg); + if (launch_app_with_arguments(tempapp[0].Exec,dualarg)==32512) + gtk_widget_show(applist->infoWarningWindow); } else{ launch_app_with_arguments(tempapp[0].Exec,arg); @@ -297,7 +297,8 @@ void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *wi int on_settingsOpen(GtkWidget *button, actionWidgets *widgets){ gtk_window_set_title(GTK_WINDOW(widgets->SettingsWindow),"UBLinux Settings Manager"); gtk_widget_set_size_request(widgets->SettingsWindow,400,250); - gtk_window_set_icon_from_file(GTK_WINDOW(widgets->SettingsWindow),AppIconPath,NULL); + GtkIconTheme *icthm=gtk_icon_theme_get_default(); + gtk_window_set_icon(GTK_WINDOW(widgets->SettingsWindow),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(32),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); gtk_widget_show_all(widgets->SettingsWindow); gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->settingsThemeChooser),main_config.WindowTheme); int sz=1; @@ -309,36 +310,37 @@ int on_settingsOpen(GtkWidget *button, actionWidgets *widgets){ char *tmp=malloc(6); sprintf(tmp,"%dx%d\0",*main_config.currentThemeIconSize,*main_config.currentThemeIconSize); gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),tmp); - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(*main_config.currentThemeIconSize),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); gtk_window_present(GTK_WINDOW(widgets->SettingsWindow)); }; int on_settings_icon_size_changed(GtkWidget* self, actionWidgets *widgets){ int val=(int)gtk_range_get_value(GTK_RANGE(self)); + GtkIconTheme *icthm=gtk_icon_theme_get_default(); if ((int)val==1||(int)val==0){ - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,24,24,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(24),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"24x24"); if (*main_config.currentThemeIconSize!=24) main_config.changed=1; *main_config.currentThemeIconSize=24; } if ((int)val==2){ - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,32,32,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(32),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"32x32"); if (*main_config.currentThemeIconSize!=32) main_config.changed=1; *main_config.currentThemeIconSize=32; } if ((int)val==3){ - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,48,48,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(48),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"48x48"); if (*main_config.currentThemeIconSize!=48) main_config.changed=1; *main_config.currentThemeIconSize=48; } if ((int)val==4){ - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,64,64,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(64),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"64x64"); if (*main_config.currentThemeIconSize!=64) main_config.changed=1; @@ -693,7 +695,6 @@ void on_about_system(GtkWidget *button, actionWidgets *widgets){ void on_theme_selection_changed(GtkWidget *self, actionWidgets *widgets){ int *icsize; - // printf("changed\n"); int curthm=gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->settingsThemeChooser)); // main_config.changed=1; if (curthm==0){ @@ -706,24 +707,25 @@ void on_theme_selection_changed(GtkWidget *self, actionWidgets *widgets){ main_config.currentThemeLabelSize=&main_config.GnomelabelSize; icsize=main_config.currentThemeIconSize; } + GtkIconTheme *icthm=gtk_icon_theme_get_default(); if (*icsize==24 || *icsize==1){ gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"24x24"); - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,24,24,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(24),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); gtk_scale_set_value_pos(GTK_SCALE(widgets->settingsSizeSlider),1.0); *icsize=24; } else if (*icsize==32 || *icsize==2){ gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"32x32"); - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,32,32,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(32),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); gtk_scale_set_value_pos(GTK_SCALE(widgets->settingsSizeSlider),2.0); *icsize=32; } else if (*icsize==48 || *icsize==3){ gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"48x48"); - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,48,48,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(48),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); gtk_scale_set_value_pos(GTK_SCALE(widgets->settingsSizeSlider),3.0); *icsize=48; } else{ gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"64x64"); - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,64,64,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(64),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); gtk_scale_set_value_pos(GTK_SCALE(widgets->settingsSizeSlider),4.0); *icsize=64; } @@ -731,29 +733,44 @@ void on_theme_selection_changed(GtkWidget *self, actionWidgets *widgets){ -void launch(char *command){ - system(command); +int launch(thread_output *thread){ + int a=0; + a=system(thread->command); + *thread->exitcode=a; + return *thread->exitcode; } -void launch_app_with_arguments(char *name, char *args){ +int launch_app_with_arguments(char *name, char *args){ char *path=yon_char_get_augumented("/bin/",name); path=yon_char_get_augumented(path," "); path=yon_char_get_augumented(path,args); pthread_t thread_id; - pthread_create(&thread_id, NULL, (void*)launch, path); + thread_output *thread=malloc(sizeof(thread_output)); + thread->command=path; + thread->exitcode=malloc(sizeof(int)); + pthread_create(&thread_id, NULL, (void*)launch, thread); + return *thread->exitcode; }; -void launch_app(char *name){ +int launch_app(char *name){ char *path=name; + thread_output *thread=malloc(sizeof(thread_output)); + thread->command=path; + thread->exitcode=malloc(sizeof(int)); pthread_t thread_id; - pthread_create(&thread_id, NULL, (void*)launch, path); + pthread_create(&thread_id, NULL, (void*)launch, thread); + return *thread->exitcode; }; -void py_launch_app(char *name,char *args){ +int 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, (void*)launch, path); + thread_output *thread=malloc(sizeof(thread_output)); + thread->command=path; + thread->exitcode=malloc(sizeof(int)); + pthread_create(&thread_id, NULL, (void*)launch, thread); + return *thread->exitcode; }; apps *get_app_by_name(apps *applist,char *name, int size){ @@ -770,34 +787,9 @@ int reload_list(IVGraphicals *section){ int load_apps(IVGraphicals *section, apps *applist, int size){ int catstofind=sizeof(section->categories)/sizeof(char*); int i=0,sz=0; - dictionary *times=yon_dictionary_create_empty(); for (int i=0;icategories)==1){ GError *err=NULL; - // char *path=malloc(strlen(IconPicturesPath)+strlen(applist[i].Icon)+7); - // memset(path,0,strlen(IconPicturesPath)+strlen(applist[i].Icon)+7); - // memcpy(path,IconPicturesPath,strlen(IconPicturesPath)); - // path=yon_char_get_augumented(path,applist[i].Icon); - // GdkPixbuf *pixbuf; - // pixbuf=gdk_pixbuf_new_from_file_at_size(yon_char_get_augumented(path,PictureFormatMain),*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,NULL); - // if (!pixbuf) { - // pixbuf=gdk_pixbuf_new_from_file_at_size(yon_char_get_augumented(path,PictureFormatExtra),*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,NULL); - // if (!pixbuf){ - // GtkWidget *imag=gtk_image_new_from_icon_name(applist[i].Icon,yon_get_icon_size(*main_config.currentThemeIconSize)); - // void *a=GTK_ICON_SIZE_DIALOG; - // pixbuf=gtk_image_get_pixbuf(GTK_IMAGE(imag)); - // // printf("%s\n",applist[i].Icon); - // if (!pixbuf) - // pixbuf=gdk_pixbuf_new_from_file_at_size(ErrIconPicturePath,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,NULL); - // else { - // gdk_pixbuf_scale(pixbuf,pixbuf,0,0,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,0,0,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,GDK_INTERP_NEAREST); - // GValue a = G_VALUE_INIT; - // g_value_init (&a, G_TYPE_STRING); - // g_value_set_string (&a, applist[i].Icon); - // g_object_set_property(G_OBJECT(section->iconRender),"icon-name", &a); - // } - // } - // }; GtkTreeIter iter; gtk_list_store_append(section->LV,&iter); int sz= *main_config.currentThemeIconSize+10; @@ -810,11 +802,9 @@ int load_apps(IVGraphicals *section, apps *applist, int size){ gtk_icon_view_set_columns(GTK_ICON_VIEW(section->IV), -1); gtk_icon_view_set_columns(GTK_ICON_VIEW(section->IV), cols); - yon_time_reg_for_average(times,sz++,clock()); } } - // printf("среднее время на каждую проверку: %f\n",yon_time_average(times)/1000); gtk_icon_view_set_model(GTK_ICON_VIEW(section->IV),GTK_TREE_MODEL(section->LV)); }; @@ -882,7 +872,6 @@ apps *find_apps(int *sizef){ FILE *file; char *path=yon_char_get_augumented(DesktopPath,de->d_name); file=fopen(path,"r"); - //printf("%s\n",path); if (strlen(de->d_name)>9) { char *extension=strstr(path,"."); @@ -1669,13 +1658,14 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them curWidgets->SectionSettingsCloseButton=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"SectionSettingsCloseButton")); curWidgets->CautionWindow=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"CautionWindow")); curWidgets->CautionUnderstandButton=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"CautionUnderstandButton")); + curWidgets->infoWarningWindow=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"windowSettings-infoWarning")); curWidgets->applist=applist; curWidgets->appssize=appsize; - + GtkIconTheme *icthm=gtk_icon_theme_get_default(); gtk_widget_set_size_request(curWidgets->window,800,600); gtk_window_resize(GTK_WINDOW(curWidgets->window),main_config.windowWidth,main_config.windowHeight); - gtk_window_set_icon_from_file(GTK_WINDOW(curWidgets->window),AppIconPath,NULL); - gtk_window_set_icon_from_file(GTK_WINDOW(curWidgets->SectionSettingsWindow),AppIconPath,NULL); + gtk_window_set_icon(GTK_WINDOW(curWidgets->window),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(32),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); + gtk_window_set_icon(GTK_WINDOW(curWidgets->SectionSettingsWindow),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(32),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); g_signal_connect(G_OBJECT(curWidgets->MenuItemDocumentation), "activate", G_CALLBACK(on_ButtonOpenHelp_activated), curWidgets->builder); g_signal_connect(G_OBJECT(curWidgets->MenuItemSettings), "activate", G_CALLBACK(on_settingsOpen), curWidgets); @@ -1736,7 +1726,6 @@ int main(int argc, char *argv[]){ for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){ load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize); } - // printf("\n\n"); yon_show_icon_views(widg->ICSys,widg); yon_icv_resize_item(widg->ICSys,widg->GnomePaned); theme="Main"; @@ -1754,7 +1743,6 @@ int main(int argc, char *argv[]){ for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){ load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize); } - // printf("\n\n"); yon_show_icon_views(widg->ICSys,widg); main_config.WindowTheme=1; main_config.currentThemeIconSize=&main_config.Gnomeiconsize; @@ -1769,7 +1757,6 @@ int main(int argc, char *argv[]){ for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){ load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize); } - // printf("\n\n"); yon_show_icon_views(widg->ICSys,widg); theme="Gnome"; main_config.WindowTheme=1; @@ -1786,7 +1773,6 @@ int main(int argc, char *argv[]){ for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){ load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize); } - // printf("\n\n"); yon_show_icon_views(widg->ICSys,widg); main_config.WindowTheme=0; yon_icv_resize_item(widg->ICSys,widg->GnomePaned); @@ -1812,7 +1798,8 @@ int main(int argc, char *argv[]){ banner = GTK_WIDGET(gtk_builder_get_object(widg->builder,"GnomeInfoLogo")); gtk_image_set_from_pixbuf(GTK_IMAGE(banner),gdk_pixbuf_new_from_file_at_scale(ublinux_logo,512,512,1,NULL)); banner = GTK_WIDGET(gtk_builder_get_object(widg->builder,"settingsIcon")); - gtk_image_set_from_pixbuf(GTK_IMAGE(banner),gdk_pixbuf_new_from_file_at_scale(AppIconPath,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,1,NULL)); + GtkIconTheme *icthm=gtk_icon_theme_get_default(); + gtk_image_set_from_pixbuf(GTK_IMAGE(banner),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(*main_config.currentThemeIconSize),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); GtkCssProvider *css=gtk_css_provider_new(); gtk_css_provider_load_from_path(css,CssPath,NULL); gtk_style_context_add_provider_for_screen(gdk_screen_get_default(), diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index fa2a799..b6bb96f 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -9,20 +9,18 @@ #define CssPath "/usr/share/ubl-settings-manager/css/ubl-settings-manager.css" #define GlobalConfigPath "/etc/ubconfig-main.conf" #define UserConfigPath "/.config/ubl-settings-manager/ubconfig-main.conf" -#define AppIconPath "/usr/share/icons/hicolor/scalable/apps/ubl-settings-manager.svg" -#define AppBannerPath "//usr/share/ubl-settings-manager/ui/ubl-settings-manager.png" +#define AppIconPath "ubl-settings-manager" +#define AppBannerPath "/usr/share/ubl-settings-manager/ui/ubl-settings-manager-banner.png" #define DesktopPath "/usr/share/applications/" #define IconPicturesPath "/usr/share/icons/hicolor/scalable/apps/" #define ErrIconPicturePath "/usr/share/icons/Faenza/emblems/32/emblem-important.png" #define ublinux_logo "/usr/share/ubl-settings-manager/ui/ublinux-logo.svg" -#define PictureFormatMain ".svg" -#define PictureFormatExtra ".png" #define LocalePath "/usr/share/locale" #define LocaleName "ubl-settings-manager" #define LogoPath "/usr/share/icons/hicolor/scalable/apps/ubl-settings-manager.svg" #define ubl_settings_infoPath "ubl-settings-info" #define ubl_settings_infoPathLaunch "ubl-settings-info --socket-id=" - +char *version_application = "1.3"; typedef struct apps{ char *Name; @@ -34,6 +32,11 @@ typedef struct apps{ int DualPluggable; } apps; +typedef struct { + char *command; + int *exitcode; +} thread_output; + typedef struct dictionary { char *key; void *data; @@ -155,7 +158,7 @@ typedef struct { int appssize; apps *applist; GtkWidget *icvpack; - + GtkWidget *infoWarningWindow; } actionWidgets; @@ -176,9 +179,9 @@ void on_ButtonOpenHelp_activated(GtkWidget *button, GtkBuilder *builder); void on_backToSettingsButton_clicked(GtkWidget *button,actionWidgets *sctb); void on_CancelHelpButton_activated(GtkWidget *button,GtkBuilder *builder); void on_ReadHelpButton_activated(GtkWidget *button, GtkBuilder *builder); -void launch_app_with_arguments(char *name, char *args); -void launch_app(char *name); -void py_launch_app(char *name,char *args); +int launch_app_with_arguments(char *name, char *args); +int launch_app(char *name); +int py_launch_app(char *name,char *args); int on_settings_accept(GtkWidget *button, dictionary **widgetsDs); void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *widgets); int on_settingsOpen(GtkWidget *button, actionWidgets *widgets); @@ -215,7 +218,7 @@ int yon_show_icon_views(dictionary *IVS,actionWidgets *widgets); void yon_icon_size_convert(int mode); void on_about_system(GtkWidget *button, actionWidgets *widgets); char *yon_char_new(char *chr); -void launch(char *command); +int launch(thread_output *thread); float yon_time_average(dictionary *times); void yon_time_reg_for_average(dictionary *listofregs, int size, time_t tm); void yon_dictionary_switch_to_last(dictionary **dict); diff --git a/ubl-settings-manager.png b/ubl-settings-manager-banner.png similarity index 100% rename from ubl-settings-manager.png rename to ubl-settings-manager-banner.png diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index 86dc2b0..f66a1f7 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -383,15 +383,17 @@ - - True - False + + Back to settings + True + False + False + False center center - vertical - - - + 10 + 10 + image5 1 @@ -445,6 +447,21 @@ 3 + + + True + False + center + center + vertical + + + + + + 4 + + @@ -985,7 +1002,7 @@ True False center - gtk-missing-image + ubl-settings-manager-banner 3