From 99f867497366ccdc669424d3a463d114cda6eb2d Mon Sep 17 00:00:00 2001 From: YanTheKaller Date: Tue, 24 Jan 2023 11:59:28 +0000 Subject: [PATCH 1/9] updated info on GNOME theme --- ubl-settings-manager.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ubl-settings-manager.c b/ubl-settings-manager.c index a367bb5..0a0a634 100644 --- a/ubl-settings-manager.c +++ b/ubl-settings-manager.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "ubl-settings-manager.h" @@ -1321,7 +1322,9 @@ dictionary *yon_theme_new(dictionary *widgets, GtkBuilder *builder, char *theme_ 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); + double mind=(double)(info.uptime/60/60)/60*100; + int minutes=mind; + sprintf(lbl,"Система: %s\nЯдро: %s %s %s\nВремя работы: %d ч. %d мин. \n\nОперативная память: %d MiB/%d MiB",sysinfos.sysname,sysinfos.machine,sysinfos.sysname,sysinfos.release,info.uptime/60/60,minutes,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); From 8d04baf493d97aa5c7b896f63413c469b4457e31 Mon Sep 17 00:00:00 2001 From: YanTheKaller Date: Wed, 25 Jan 2023 04:17:34 +0000 Subject: [PATCH 2/9] Glade theme info update, paned fixes --- ubl-settings-manager.c | 19 ++++++++++++++----- ui/ubl-settings-manager.glade | 16 +++++++++------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/ubl-settings-manager.c b/ubl-settings-manager.c index 0a0a634..7d01ca2 100644 --- a/ubl-settings-manager.c +++ b/ubl-settings-manager.c @@ -225,12 +225,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); } @@ -1014,6 +1015,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_item_orientation(GTK_ICON_VIEW(iv),GTK_ORIENTATION_HORIZONTAL); } @@ -1088,6 +1090,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); @@ -1322,9 +1331,9 @@ dictionary *yon_theme_new(dictionary *widgets, GtkBuilder *builder, char *theme_ sysinfo(&info); char lbl[2000]; memset(lbl,0,2000); - double mind=(double)(info.uptime/60/60)/60*100; + double mind=(double)info.uptime/60; // 13=x*60/100 int minutes=mind; - sprintf(lbl,"Система: %s\nЯдро: %s %s %s\nВремя работы: %d ч. %d мин. \n\nОперативная память: %d MiB/%d MiB",sysinfos.sysname,sysinfos.machine,sysinfos.sysname,sysinfos.release,info.uptime/60/60,minutes,info.totalram/1024/1024,info.freeram/1024/1024); + sprintf(lbl,"Система: UBLinux\nЯдро: %s %s %s\nВремя работы: %d ч. %d мин. \n\nОперативная память: %d MiB/%d MiB",sysinfos.machine,sysinfos.sysname,sysinfos.release,info.uptime/60/60,minutes,info.freeram/1024/1024,info.totalram/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); diff --git a/ui/ubl-settings-manager.glade b/ui/ubl-settings-manager.glade index b087e6d..be387c2 100644 --- a/ui/ubl-settings-manager.glade +++ b/ui/ubl-settings-manager.glade @@ -321,7 +321,7 @@ 64 True False - ../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg + ../../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg False @@ -988,7 +988,8 @@ True False - gtk-missing-image + 50 + ../../../../../../../usr/share/icons/ubmanager-cockpit.svg False @@ -998,12 +999,13 @@ + iconlabel True False fsdfhsdftj True - 0 - 0 + 0.15000000596046448 + 0.5 True @@ -1127,7 +1129,7 @@ True False - ../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg + ../../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg 5 @@ -1317,7 +1319,7 @@ True False - ../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg + ../../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg 5 @@ -1521,7 +1523,7 @@ True False - ../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg + ../../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg 5 From 80bb999a56ca3810109825c4aebac25ca524807a Mon Sep 17 00:00:00 2001 From: YanTheKaller Date: Wed, 25 Jan 2023 04:44:37 +0000 Subject: [PATCH 3/9] Glade theme improvements --- ubl-settings-manager.c | 57 +++++++++++++----------------------------- 1 file changed, 18 insertions(+), 39 deletions(-) diff --git a/ubl-settings-manager.c b/ubl-settings-manager.c index 7d01ca2..b4903ba 100644 --- a/ubl-settings-manager.c +++ b/ubl-settings-manager.c @@ -36,7 +36,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); @@ -54,12 +54,12 @@ void on_plug_removed(GtkSocket* self, actionWidgets *widgets){ //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\nActivated\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); @@ -98,11 +98,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); @@ -153,7 +153,7 @@ void on_ReadHelpButton_activated(GtkWidget *button, GtkBuilder *builder){ }; int on_settings_accept(GtkWidget *button, dictionary *widgetsD){ - printf("Saving config...\n"); + //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); @@ -228,7 +228,7 @@ void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *wi 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); + //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),pos); @@ -1015,7 +1015,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); } @@ -1110,7 +1110,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); - g_signal_connect(G_OBJECT(iv->IV),"item-activated",G_CALLBACK(on_Item_activated),widgets); + 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); } @@ -1203,34 +1206,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); @@ -1281,9 +1262,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; @@ -1331,12 +1309,13 @@ dictionary *yon_theme_new(dictionary *widgets, GtkBuilder *builder, char *theme_ sysinfo(&info); char lbl[2000]; memset(lbl,0,2000); - double mind=(double)info.uptime/60; // 13=x*60/100 + double mind=(double)info.uptime/60; + while(mind>60) mind-=60; int minutes=mind; - sprintf(lbl,"Система: UBLinux\nЯдро: %s %s %s\nВремя работы: %d ч. %d мин. \n\nОперативная память: %d MiB/%d MiB",sysinfos.machine,sysinfos.sysname,sysinfos.release,info.uptime/60/60,minutes,info.freeram/1024/1024,info.totalram/1024/1024); + sprintf(lbl,"Система: UBLinux\nЯдро: %s %s %s\nВремя работы: %d ч. %d мин. \n\nОперативная память: %d MiB/%d MiB\nЗапущенные процессы: %d\nСредняя загруженность процессора за 15 минут: %d%%\n",sysinfos.machine,sysinfos.sysname,sysinfos.release,info.uptime/60/60,minutes,info.freeram/1024/1024,info.totalram/1024/1024,info.procs,info.loads[2]/1000); 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); + //printf("\n\n%d\n\n",info.totalram/1024/1024); + //printf("\n\n%d\n\n",info.freeram/1024/1024); } if (curWidgets->ButtonBackToMain!=NULL) From 2bdff6b98066bc780a091a39ceb9fa7633b9a38e Mon Sep 17 00:00:00 2001 From: YanTheKaller Date: Wed, 25 Jan 2023 04:47:47 +0000 Subject: [PATCH 4/9] Glade theme improvements --- ui/forTest.glade~ | 39 - ui/ubl-settings-manager backup 1.glade~ | 1589 ----------------------- ui/ubl-settings-manager backup.glade~ | 1468 --------------------- 3 files changed, 3096 deletions(-) delete mode 100644 ui/forTest.glade~ delete mode 100644 ui/ubl-settings-manager backup 1.glade~ delete mode 100644 ui/ubl-settings-manager backup.glade~ diff --git a/ui/forTest.glade~ b/ui/forTest.glade~ deleted file mode 100644 index 18e3af5..0000000 --- a/ui/forTest.glade~ +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - False - - - True - False - vertical - - - - - - True - False - - - True - False - label - - - - - True - True - 1 - - - - - - - - - diff --git a/ui/ubl-settings-manager backup 1.glade~ b/ui/ubl-settings-manager backup 1.glade~ deleted file mode 100644 index d77501d..0000000 --- a/ui/ubl-settings-manager backup 1.glade~ +++ /dev/null @@ -1,1589 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - 450 - 250 - dialog-question - - - True - False - vertical - - - True - False - - - True - False - start - 20 - 20 - gtk-dialog-question - 6 - - - False - True - 0 - - - - - True - False - vertical - - - True - False - start - 10 - 5 - Вы хотите прочитать руководство в сети? - - - - - - - False - True - 0 - - - - - True - False - start - start - 15 - Вы будете перенаправлены на сайт с документацией, где страницы помощи переводятся и -поддерживаются сообществом. - - - - True - True - 1 - - - - - Всегда перенаправлять на онлайн-документацию - True - True - False - end - 5 - 10 - True - - - - False - True - 2 - - - - - - True - True - 1 - - - - - - True - True - 0 - - - - - True - False - - - Отменить - True - True - True - - - - - True - True - 0 - - - - - Прочитать онлайн - True - True - True - - - - - True - True - 1 - - - - - False - True - 1 - - - - - - - False - 800 - 600 - - - True - False - vertical - - - True - False - - - True - False - vertical - - - True - False - center - ../images/side_img_ubc_v_dark_grad_down.png - 3 - - - - False - True - 0 - - - - - - False - True - 0 - - - - - True - False - vertical - - - True - False - 2 - 2 - 2 - 2 - 2 - 2 - - - True - True - in - - - True - False - natural - - - - - - - - - - True - True - 0 - - - - - - True - True - 0 - - - - - True - False - vertical - - - - - - - False - True - 1 - - - - - True - True - 1 - - - - - - True - True - 0 - - - - - - - True - False - - - True - False - True - - - True - False - UBLinux Settings Manager - - - True - True - 0 - - - - - True - True - False - True - menu1 - none - False - - - - - - False - True - 1 - - - - - - - True - False - ../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg - 5 - - - - - - - - True - False - emblem-danger - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 5 - 2 - 1 - 1 - - - False - 440 - 250 - - - True - False - vertical - - - True - False - 5 - 5 - 5 - 2 - 0 - in - - - True - False - 12 - - - True - False - - - True - False - vertical - - - True - False - 5 - 32x32 - - - False - True - 0 - - - - - True - True - 10 - 10 - 10 - 10 - adjustment1 - 5 - 0 - 0 - False - - - True - True - 1 - - - - - True - True - 0 - - - - - 64 - 64 - True - False - ../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg - - - False - True - 1 - - - - - - - - - True - False - Рамер иконок - - - - - True - True - 1 - - - - - True - False - 5 - 5 - 2 - 5 - 0 - in - - - True - False - 12 - - - True - False - vertical - - - True - False - 0 - - Стандартная тема - GNOME тема - - - - False - True - 0 - - - - - - - - - True - False - Выбор темы - - - - - True - True - 2 - - - - - True - False - - - True - False - 5 - 5 - - - Закрыть без сохранения - 200 - True - True - True - 2 - - - False - True - 0 - - - - - Сохранить и перезагрузить - 200 - True - True - True - 2 - - - False - True - end - 1 - - - - - True - True - 0 - - - - - False - True - 4 - - - - - - - 1 - 1 - 10 - - - True - False - gtk-go-back - - - True - False - ../../../../../../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 - - - - - - - - - - - Стандартная тема - - - GNOME тема - - - - - True - False - - - True - False - Параметры UBL Settings Manager - Параметры - True - - - - - True - False - О программе... - True - - - - - False - 800 - 600 - - - True - False - vertical - - - True - False - - - True - False - True - vertical - - - True - False - center - ../images/side_img_ubc_v_dark_grad_down.png - 3 - - - - False - True - 0 - - - - - - False - True - 0 - - - - - True - True - in - 150 - True - - - True - False - - - True - False - 3 - 3 - 3 - 3 - vertical - - - True - False - start - Личные - - - False - True - 0 - - - - - True - False - - - False - True - 1 - - - - - True - True - 0 - horizontal - GnomeModelPersonal - 1 - 6 - 0 - 0 - True - - - - False - False - 2 - - - - - True - False - start - Оборудование - - - False - True - 3 - - - - - True - False - - - False - True - 4 - - - - - True - True - 0 - horizontal - GnomeModelHardware - 1 - 6 - 0 - 0 - True - - - - False - False - 5 - - - - - True - False - start - Система - - - False - True - 6 - - - - - True - False - - - False - True - 7 - - - - - True - True - 0 - horizontal - GnomeModelSystem - 1 - 6 - 0 - 0 - True - - - - False - False - 8 - - - - - True - False - start - Прочее - - - False - True - 9 - - - - - True - False - - - False - True - 10 - - - - - True - True - 0 - horizontal - GnomeModelMisc - 1 - 6 - 0 - 0 - True - - - - False - False - 11 - - - - - - - - - False - True - 1 - - - - - True - False - vertical - - - True - False - vertical - - - True - False - 3 - 3 - 3 - 3 - 0 - in - - - True - False - 12 - - - True - False - gtk-missing-image - 6 - - - - - - - - - - True - True - 0 - - - - - True - True - 0 - - - - - True - False - vertical - - - True - False - vertical - - - - - - False - True - 0 - - - - - False - True - 1 - - - - - True - True - 3 - - - - - True - True - 0 - - - - - - - True - False - True - - - True - False - True - - - True - False - UBLinux Settings Manager - - - True - True - 0 - - - - - True - True - False - True - menu1 - none - False - - - - - - False - True - 1 - - - - - - - True - False - ../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg - 5 - - - - - - - False - 800 - 600 - - - True - False - vertical - - - True - False - - - True - False - vertical - - - True - False - center - ../images/side_img_ubc_v_dark_grad_down.png - 3 - - - - False - True - 0 - - - - - - False - True - 0 - - - - - True - False - vertical - - - True - False - 2 - 2 - 2 - 2 - 2 - 2 - - - True - True - in - - - True - False - natural - - - True - False - vertical - - - True - False - start - 1 - 1 - Личные - - - - - - - False - True - 0 - - - - - True - False - 5 - 5 - - - - False - True - 1 - - - - - True - False - vertical - - - - - - False - True - 2 - - - - - True - False - start - 1 - 1 - Оборудование - - - - - - - False - True - 3 - - - - - True - False - 5 - 5 - - - - False - True - 4 - - - - - True - False - vertical - - - - - - False - True - 5 - - - - - True - False - start - 1 - 1 - Система - - - - - - - False - True - 6 - - - - - True - False - 5 - 5 - - - - False - True - 7 - - - - - True - False - vertical - - - - - - False - True - 8 - - - - - True - False - start - 1 - 1 - Прочее - - - - - - - False - True - 9 - - - - - True - False - 5 - 5 - - - - False - True - 10 - - - - - True - False - vertical - - - - - - False - True - 11 - - - - - - - - - - - - True - True - 0 - - - - - - True - True - 0 - - - - - True - False - vertical - - - - - - - False - True - 1 - - - - - True - True - 1 - - - - - - True - True - 0 - - - - - - - True - False - True - - - True - False - True - - - True - False - UBLinux Settings Manager - - - True - True - 0 - - - - - True - True - False - True - menu1 - none - False - - - - - - False - True - 1 - - - - - - - True - False - ../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg - 5 - - - - - Все настройки - True - False - True - False - False - False - 10 - 10 - image1 - - - - - 1 - - - - - - - diff --git a/ui/ubl-settings-manager backup.glade~ b/ui/ubl-settings-manager backup.glade~ deleted file mode 100644 index 25cb799..0000000 --- a/ui/ubl-settings-manager backup.glade~ +++ /dev/null @@ -1,1468 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - 450 - 250 - dialog-question - - - True - False - vertical - - - True - False - - - True - False - start - 20 - 20 - gtk-dialog-question - 6 - - - False - True - 0 - - - - - True - False - vertical - - - True - False - start - 10 - 5 - Вы хотите прочитать руководство в сети? - - - - - - - False - True - 0 - - - - - True - False - start - start - 15 - Вы будете перенаправлены на сайт с документацией, где страницы помощи переводятся и -поддерживаются сообществом. - - - - True - True - 1 - - - - - Всегда перенаправлять на онлайн-документацию - True - True - False - end - 5 - 10 - True - - - - False - True - 2 - - - - - - True - True - 1 - - - - - - True - True - 0 - - - - - True - False - - - Отменить - True - True - True - - - - - True - True - 0 - - - - - Прочитать онлайн - True - True - True - - - - - True - True - 1 - - - - - False - True - 1 - - - - - - - True - False - emblem-danger - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 5 - 2 - 1 - 1 - - - False - 440 - 250 - - - True - False - vertical - - - True - False - 5 - 5 - 5 - 2 - 0 - in - - - True - False - 12 - - - True - False - - - True - False - vertical - - - True - False - 5 - 32x32 - - - False - True - 0 - - - - - True - True - 10 - 10 - 10 - 10 - adjustment1 - 5 - 0 - 0 - False - - - True - True - 1 - - - - - True - True - 0 - - - - - 64 - 64 - True - False - ../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg - - - False - True - 1 - - - - - - - - - True - False - Рамер иконок - - - - - True - True - 1 - - - - - True - False - 5 - 5 - 2 - 5 - 0 - in - - - True - False - 12 - - - True - False - vertical - - - True - False - 0 - - Стандартная тема - GNOME тема - - - - False - True - 0 - - - - - - - - - True - False - Выбор темы - - - - - True - True - 2 - - - - - True - False - - - True - False - 5 - 5 - - - Закрыть без сохранения - 200 - True - True - True - 2 - - - False - True - 0 - - - - - Сохранить и перезагрузить - 200 - True - True - True - 2 - - - False - True - end - 1 - - - - - True - True - 0 - - - - - False - True - 4 - - - - - - - 1 - 1 - 10 - - - True - False - gtk-go-back - - - True - False - ../../../../../../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 - - - - - - - - - - - Стандартная тема - - - GNOME тема - - - - - True - False - - - True - False - Параметры UBL Settings Manager - Параметры - True - - - - - True - False - О программе... - True - - - - - False - 800 - 600 - - - True - False - vertical - - - True - False - - - True - False - True - vertical - - - True - False - center - ../images/side_img_ubc_v_dark_grad_down.png - 3 - - - - False - True - 0 - - - - - - False - True - 0 - - - - - True - True - in - 150 - True - - - True - False - - - True - False - 3 - 3 - 3 - 3 - vertical - - - True - False - start - Личные - - - False - True - 0 - - - - - True - False - - - False - True - 1 - - - - - True - True - 0 - horizontal - GnomeModelPersonal - 1 - 6 - 0 - 0 - True - - - - False - False - 2 - - - - - True - False - start - Оборудование - - - False - True - 3 - - - - - True - False - - - False - True - 4 - - - - - True - True - 0 - horizontal - GnomeModelHardware - 1 - 6 - 0 - 0 - True - - - - False - False - 5 - - - - - True - False - start - Система - - - False - True - 6 - - - - - True - False - - - False - True - 7 - - - - - True - True - 0 - horizontal - GnomeModelSystem - 1 - 6 - 0 - 0 - True - - - - False - False - 8 - - - - - True - False - start - Прочее - - - False - True - 9 - - - - - True - False - - - False - True - 10 - - - - - True - True - 0 - horizontal - GnomeModelMisc - 1 - 6 - 0 - 0 - True - - - - False - False - 11 - - - - - - - - - False - True - 1 - - - - - True - False - vertical - - - True - False - vertical - - - True - False - 3 - 3 - 3 - 3 - 0 - in - - - True - False - 12 - - - True - False - gtk-missing-image - 6 - - - - - - - - - - True - True - 0 - - - - - True - True - 0 - - - - - True - False - vertical - - - True - False - vertical - - - - - - False - True - 0 - - - - - False - True - 1 - - - - - True - True - 3 - - - - - True - True - 0 - - - - - - - True - False - True - - - True - False - True - - - True - False - UBLinux Settings Manager - - - True - True - 0 - - - - - True - True - False - True - menu1 - none - False - - - - - - False - True - 1 - - - - - - - True - False - ../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg - 5 - - - - - - - False - 800 - 600 - - - True - False - vertical - - - True - False - - - True - False - vertical - - - True - False - center - ../images/side_img_ubc_v_dark_grad_down.png - 3 - - - - False - True - 0 - - - - - - False - True - 0 - - - - - True - False - vertical - - - True - False - 2 - 2 - 2 - 2 - 2 - 2 - - - True - True - in - - - True - False - natural - - - True - False - vertical - - - True - False - start - 1 - 1 - Личные - - - - - - - False - True - 0 - - - - - True - False - 5 - 5 - - - - False - True - 1 - - - - - True - False - vertical - - - True - True - 6 - queue - natural - ModelPersonal - 75 - 10 - 20 - True - - - - - False - True - 0 - - - - - False - True - 2 - - - - - True - False - start - 1 - 1 - Оборудование - - - - - - - False - True - 3 - - - - - True - False - 5 - 5 - - - - False - True - 4 - - - - - True - False - vertical - - - True - True - 6 - queue - natural - ModelHardware - 75 - 0 - 20 - True - - - - - False - True - 0 - - - - - False - True - 5 - - - - - True - False - start - 1 - 1 - Система - - - - - - - False - True - 6 - - - - - True - False - 5 - 5 - - - - False - True - 7 - - - - - True - False - vertical - - - True - True - 6 - queue - natural - ModelSystem - 75 - 0 - 0 - True - - - - - False - True - 0 - - - - - False - True - 8 - - - - - True - False - start - 1 - 1 - Прочее - - - - - - - False - True - 9 - - - - - True - False - 5 - 5 - - - - False - True - 10 - - - - - True - False - vertical - - - True - True - 10 - 6 - queue - natural - ModelMisc - 75 - 0 - 0 - True - - - - - False - True - 0 - - - - - False - True - 11 - - - - - - - - - - - - True - True - 0 - - - - - - True - True - 0 - - - - - True - False - vertical - - - - - - - False - True - 1 - - - - - True - True - 1 - - - - - - True - True - 0 - - - - - - - True - False - True - - - True - False - True - - - True - False - UBLinux Settings Manager - - - True - True - 0 - - - - - True - True - False - True - menu1 - none - False - - - - - - False - True - 1 - - - - - - - True - False - ../../../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg - 5 - - - - - Все настройки - True - False - True - False - False - False - 10 - 10 - image1 - - - - - 1 - - - - - - - From 609da7ed75381e766f031680a2db073a44699305 Mon Sep 17 00:00:00 2001 From: YanTheKaller Date: Thu, 26 Jan 2023 04:43:57 +0000 Subject: [PATCH 5/9] Added localisation for PC characteristics on Gnome theme --- ubl-settings-manager.c | 72 ++++++++++++++++++++++------------- ubl-settings-manager.h | 2 +- ui/ubl-settings-manager.glade | 51 ++++++++++++++++++++----- 3 files changed, 89 insertions(+), 36 deletions(-) diff --git a/ubl-settings-manager.c b/ubl-settings-manager.c index b4903ba..7add2dc 100644 --- a/ubl-settings-manager.c +++ b/ubl-settings-manager.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "ubl-settings-manager.h" @@ -48,10 +49,7 @@ 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"); @@ -414,7 +412,7 @@ void on_sections_move_up(GtkWidget *button, actionWidgets *widgets){ }; void on_sections_move_down(GtkWidget *button, actionWidgets *widgets){ -for (dictionary *dct=widgets->SettingsSections->first;dct!=NULL;dct=dct->next){ + for (dictionary *dct=widgets->SettingsSections->first;dct!=NULL;dct=dct->next){ SectionSettingSegment *segment=(SectionSettingSegment*)dct->data; if (segment!=NULL){ if (button==segment->DragDownButton){ @@ -453,7 +451,7 @@ for (dictionary *dct=widgets->SettingsSections->first;dct!=NULL;dct=dct->next){ }; void on_sections_delete(GtkWidget *button, actionWidgets *widgets){ -for (dictionary *dct=widgets->SettingsSections->first;dct!=NULL;dct=dct->next){ + for (dictionary *dct=widgets->SettingsSections->first;dct!=NULL;dct=dct->next){ SectionSettingSegment *segment=(SectionSettingSegment*)dct->data; if (segment!=NULL){ if (button==segment->DragDownButton){ @@ -463,7 +461,7 @@ for (dictionary *dct=widgets->SettingsSections->first;dct!=NULL;dct=dct->next){ gtk_container_remove(GTK_CONTAINER(widgets->SectionSettingsPack),segment->MainFrame); } } -} + } }; void on_sections_add(GtkWidget *button, actionWidgets *widgets){ dictionary *dict=yon_dictionary_create_empty(); @@ -1274,7 +1272,6 @@ void yon_dictionary_make_first(dictionary *dict){ } - dictionary *yon_theme_new(dictionary *widgets, GtkBuilder *builder, char *theme_id, apps *applist, int appsize){ actionWidgets *curWidgets=(actionWidgets*)widgets->data; if (!curWidgets) { @@ -1294,28 +1291,51 @@ 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); - double mind=(double)info.uptime/60; - while(mind>60) mind-=60; - int minutes=mind; - sprintf(lbl,"Система: UBLinux\nЯдро: %s %s %s\nВремя работы: %d ч. %d мин. \n\nОперативная память: %d MiB/%d MiB\nЗапущенные процессы: %d\nСредняя загруженность процессора за 15 минут: %d%%\n",sysinfos.machine,sysinfos.sysname,sysinfos.release,info.uptime/60/60,minutes,info.freeram/1024/1024,info.totalram/1024/1024,info.procs,info.loads[2]/1000); - 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=NULL; + char *pth; + char *preph=""; + line=""; + while (fgets(path, sizeof(path),fp)!=NULL){ + preph=pth; + prevline=line; + line=strstr(path,": "); + if (line!=NULL){ + int size=strlen(path)-strlen(line); + pth=yon_cut(path,size,0); + // pth=_(pth);;;; + pth=yon_char_get_augumented(preph,pth); + pth=yon_char_get_augumented(pth,"\n"); + } else { + line=path; + pth="\n"; + } + line=yon_char_get_augumented(prevline,line); + }; + prevline=line; + gtk_label_set_text(GTK_LABEL(curWidgets->GnomeInfoDetailsLabel),prevline); + gtk_label_set_text(GTK_LABEL(curWidgets->GnomeInfoLabel),pth); + } if (curWidgets->ButtonBackToMain!=NULL) diff --git a/ubl-settings-manager.h b/ubl-settings-manager.h index fb15281..3897726 100644 --- a/ubl-settings-manager.h +++ b/ubl-settings-manager.h @@ -126,7 +126,7 @@ typedef struct { GtkWidget *SectionSettingsClearEntryButton; GtkWidget *SectionSettingsSaveButton; GtkWidget *SectionSettingsCloseButton; - + GtkWidget *GnomeInfoDetailsLabel; int appssize; apps *applist; GtkWidget *icvpack; diff --git a/ui/ubl-settings-manager.glade b/ui/ubl-settings-manager.glade index be387c2..9ab54e6 100644 --- a/ui/ubl-settings-manager.glade +++ b/ui/ubl-settings-manager.glade @@ -935,7 +935,6 @@ True False 3 - 3 3 3 3 @@ -988,7 +987,9 @@ True False - 50 + end + 100 + 50 ../../../../../../../usr/share/icons/ubmanager-cockpit.svg @@ -998,17 +999,49 @@ - - iconlabel + True False - fsdfhsdftj - True - 0.15000000596046448 - 0.5 + + + True + False + center + label: + right + 1 + 0 + + + + + + + False + True + 0 + + + + + True + False + center + label + 0 + + + + + + False + True + 1 + + - True + False True 1 From f0e8c123c5253d3472c6c33ef63ba970ad9af733 Mon Sep 17 00:00:00 2001 From: YanTheKaller Date: Thu, 26 Jan 2023 12:07:39 +0000 Subject: [PATCH 6/9] Gnome information improved --- ubl-settings-manager.c | 69 ++++++++++++++++++++++++++++------- ui/ubl-settings-manager.glade | 32 ++++++++++------ 2 files changed, 77 insertions(+), 24 deletions(-) diff --git a/ubl-settings-manager.c b/ubl-settings-manager.c index 7add2dc..9431df3 100644 --- a/ubl-settings-manager.c +++ b/ubl-settings-manager.c @@ -556,7 +556,45 @@ void on_section_delete(GtkWidget *button, actionWidgets *widgets){ } } } - +void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widgetsD){ + actionWidgets *widgets=(actionWidgets*)widgetsD->data; + int x,y; + gtk_window_get_size(GTK_WINDOW(widgets->window),&x,&y); + printf("worked\n%d - %d\n",x,y); + if (main_config.WindowTheme!=0) + if (x<1024&&y<720){ + actionWidgets *widgets=(actionWidgets*)widgetsD->data; + main_config.WindowTheme=0; + main_config.iconsize=24; + gtk_combo_box_set_active (widgets->settingsThemeChooser,0); + on_settings_accept(window,widgetsD); + // main_config.curThemeName="Main"; + // GtkWidget *loaderWindow=GTK_WIDGET(gtk_builder_get_object(widgets->builder,"LoaderWindow")); + // gtk_window_resize(GTK_WINDOW(loaderWindow),main_config.windowWidth,main_config.windowHeight); + // gtk_window_move(GTK_WINDOW(loaderWindow),main_config.windowPosX,main_config.windowPosY); + + // gtk_widget_show(loaderWindow); + // 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); + // widgetsD->next->prev=widgetsD; + // yon_switch_theme(&widgetsD,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){ + // load_apps((IVGraphicals*)cur->data,widgets->applist,widgets->appssize); + // } + // yon_show_icon_views(widgets->ICSys,widgets); + + // } + // yon_switch_theme(&widgetsD,yon_dictionary_find(&widgetsD,main_config.curThemeName)); + // if (widgets!=(actionWidgets*)widgetsD->data) widgets=(actionWidgets*)widgetsD->data; + // gtk_widget_show(widgets->window); + // gtk_widget_hide(loaderWindow); + + } +} 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 +958,9 @@ int setup_config(){ main_config.sections->next=NULL; } + if (main_config.windowWidth<1024&&main_config.windowHeight<720){ + main_config.WindowTheme=0; + } }; @@ -1293,7 +1334,6 @@ dictionary *yon_theme_new(dictionary *widgets, GtkBuilder *builder, char *theme_ 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&&curWidgets->GnomeInfoDetailsLabel!=NULL){ @@ -1312,36 +1352,39 @@ dictionary *yon_theme_new(dictionary *widgets, GtkBuilder *builder, char *theme_ } char *line=NULL; line=""; - char *prevline=NULL; + char *prevline=""; char *pth; char *preph=""; line=""; while (fgets(path, sizeof(path),fp)!=NULL){ - preph=pth; - prevline=line; + line=strstr(path,": "); if (line!=NULL){ int size=strlen(path)-strlen(line); pth=yon_cut(path,size,0); - // pth=_(pth);;;; - pth=yon_char_get_augumented(preph,pth); - pth=yon_char_get_augumented(pth,"\n"); + pth=yon_char_get_augumented("",pth); + pth=yon_char_get_augumented(pth,""); + line=yon_char_get_augumented(pth,line); } else { line=path; - pth="\n"; + pth="\n"; + line=yon_char_get_augumented(pth,line); } - line=yon_char_get_augumented(prevline,line); + prevline=yon_char_get_augumented(prevline,line); + }; - prevline=line; + prevline=yon_char_get_augumented(prevline,"");; gtk_label_set_text(GTK_LABEL(curWidgets->GnomeInfoDetailsLabel),prevline); - gtk_label_set_text(GTK_LABEL(curWidgets->GnomeInfoLabel),pth); - + // 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")); diff --git a/ui/ubl-settings-manager.glade b/ui/ubl-settings-manager.glade index 9ab54e6..c0c0b91 100644 --- a/ui/ubl-settings-manager.glade +++ b/ui/ubl-settings-manager.glade @@ -235,6 +235,20 @@ + + True + True + in + + + True + False + + + + + + 1 5 @@ -967,6 +981,7 @@ True False + 3 3 3 3 @@ -983,14 +998,14 @@ True False + center + center True False end - 100 - 50 - ../../../../../../../usr/share/icons/ubmanager-cockpit.svg + ../../../../../Загрузки/Telegram Desktop/ublinux-dark-glow.png False @@ -1004,17 +1019,12 @@ False + desklabel True False center - label: right 1 - 0 - - - - False @@ -1024,13 +1034,13 @@ + desclabel True False center label - 0 - + From 4fa3f86bb05478ef45564daac8715878dbc29f54 Mon Sep 17 00:00:00 2001 From: YanTheKaller Date: Fri, 27 Jan 2023 08:05:02 +0000 Subject: [PATCH 7/9] Fixed second theme not hiding --- ubl-settings-manager.c | 88 +++++++++++++++-------------------- ubl-settings-manager.h | 4 +- ui/ubl-settings-manager.glade | 2 +- 3 files changed, 41 insertions(+), 53 deletions(-) diff --git a/ubl-settings-manager.c b/ubl-settings-manager.c index 9431df3..400b561 100644 --- a/ubl-settings-manager.c +++ b/ubl-settings-manager.c @@ -150,8 +150,10 @@ void on_ReadHelpButton_activated(GtkWidget *button, GtkBuilder *builder){ gtk_widget_hide(window); }; -int on_settings_accept(GtkWidget *button, dictionary *widgetsD){ - //printf("Saving config...\n"); +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); @@ -172,9 +174,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){ @@ -183,8 +187,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(widgetsDs,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; @@ -564,35 +570,14 @@ void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widget if (main_config.WindowTheme!=0) if (x<1024&&y<720){ actionWidgets *widgets=(actionWidgets*)widgetsD->data; - main_config.WindowTheme=0; + //main_config.WindowTheme=0; main_config.iconsize=24; - gtk_combo_box_set_active (widgets->settingsThemeChooser,0); - on_settings_accept(window,widgetsD); - // main_config.curThemeName="Main"; - // GtkWidget *loaderWindow=GTK_WIDGET(gtk_builder_get_object(widgets->builder,"LoaderWindow")); - // gtk_window_resize(GTK_WINDOW(loaderWindow),main_config.windowWidth,main_config.windowHeight); - // gtk_window_move(GTK_WINDOW(loaderWindow),main_config.windowPosX,main_config.windowPosY); - - // gtk_widget_show(loaderWindow); - // 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); - // widgetsD->next->prev=widgetsD; - // yon_switch_theme(&widgetsD,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){ - // load_apps((IVGraphicals*)cur->data,widgets->applist,widgets->appssize); - // } - // yon_show_icon_views(widgets->ICSys,widgets); - - // } - // yon_switch_theme(&widgetsD,yon_dictionary_find(&widgetsD,main_config.curThemeName)); - // if (widgets!=(actionWidgets*)widgetsD->data) widgets=(actionWidgets*)widgetsD->data; - // gtk_widget_show(widgets->window); - // gtk_widget_hide(loaderWindow); - + gtk_combo_box_set_active (GTK_COMBO_BOX(widgets->settingsThemeChooser),0); + if (widgetsD->next==NULL) + widgetsD=widgetsD->prev; + else + widgetsD=widgetsD->next; + on_settings_accept(window,&widgetsD); } } void launch_app_with_arguments(char *name, char *args){ @@ -1313,9 +1298,11 @@ void yon_dictionary_make_first(dictionary *dict){ } -dictionary *yon_theme_new(dictionary *widgets, GtkBuilder *builder, char *theme_id, apps *applist, int appsize){ +dictionary *yon_theme_new(dictionary **widgetss, 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; } @@ -1430,20 +1417,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); - - 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), widgets); - 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); - // сделать функцию для сигналов окна секций, секции для настроек в словарь + 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), widgetss); + 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")); @@ -1480,7 +1468,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); diff --git a/ubl-settings-manager.h b/ubl-settings-manager.h index 3897726..ce98718 100644 --- a/ubl-settings-manager.h +++ b/ubl-settings-manager.h @@ -154,7 +154,7 @@ 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 on_settings_accept(GtkWidget *button, dictionary *widgetsD); +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); int on_settings_icon_size_changed(GtkWidget* self, actionWidgets *widgets); @@ -169,7 +169,7 @@ void sort_apps(apps *applist,int size); apps *find_apps(int *sizef); int check_categories(apps app, char *catstocheck); int setup_config(); -dictionary *yon_theme_new(dictionary *widgets, GtkBuilder *builder, char *theme_id, apps *applist, int appsize); +dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *theme_id, apps *applist, int appsize); char *yon_char_get_augumented(char *source, char *append); char *yon_cut(char *source, int size, int startpos); int yon_set_sections(IconSection *section); diff --git a/ui/ubl-settings-manager.glade b/ui/ubl-settings-manager.glade index c0c0b91..c083a7a 100644 --- a/ui/ubl-settings-manager.glade +++ b/ui/ubl-settings-manager.glade @@ -1005,7 +1005,7 @@ True False end - ../../../../../Загрузки/Telegram Desktop/ublinux-dark-glow.png + ../../../../../Загрузки/Telegram Desktop/ublinux-dark-glow-sc.svg False From df3a33d40aea9f4604f6bc249a1b53537582191f Mon Sep 17 00:00:00 2001 From: YanTheKaller Date: Fri, 27 Jan 2023 11:49:59 +0000 Subject: [PATCH 8/9] Switching to main theme while low resolution implemented --- ubl-settings-manager.c | 84 +++++++++++++++++++++++++++++++++--------- 1 file changed, 67 insertions(+), 17 deletions(-) diff --git a/ubl-settings-manager.c b/ubl-settings-manager.c index 400b561..119978d 100644 --- a/ubl-settings-manager.c +++ b/ubl-settings-manager.c @@ -155,8 +155,7 @@ int on_settings_accept(GtkWidget *button, dictionary **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) @@ -564,21 +563,69 @@ void on_section_delete(GtkWidget *button, actionWidgets *widgets){ } void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widgetsD){ actionWidgets *widgets=(actionWidgets*)widgetsD->data; - int x,y; - gtk_window_get_size(GTK_WINDOW(widgets->window),&x,&y); - printf("worked\n%d - %d\n",x,y); - if (main_config.WindowTheme!=0) - if (x<1024&&y<720){ - actionWidgets *widgets=(actionWidgets*)widgetsD->data; - //main_config.WindowTheme=0; - main_config.iconsize=24; - gtk_combo_box_set_active (GTK_COMBO_BOX(widgets->settingsThemeChooser),0); - if (widgetsD->next==NULL) - widgetsD=widgetsD->prev; - else - widgetsD=widgetsD->next; - on_settings_accept(window,&widgetsD); + 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("\nAaAaAaAa\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); @@ -1297,6 +1344,9 @@ 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){ @@ -1354,7 +1404,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them line=yon_char_get_augumented(pth,line); } else { line=path; - pth="\n"; + pth="\n"; line=yon_char_get_augumented(pth,line); } prevline=yon_char_get_augumented(prevline,line); From ddf7e9e75a4db473993f585dc4bb476b5f7f90f8 Mon Sep 17 00:00:00 2001 From: YanTheKaller Date: Fri, 27 Jan 2023 11:53:35 +0000 Subject: [PATCH 9/9] Changed Gnome Theme information panel picture --- images/ublinux-dark-glow-sc.svg | 241 ++++++++++++++++++++++++++++++++ ui/ubl-settings-manager.glade | 2 +- 2 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 images/ublinux-dark-glow-sc.svg diff --git a/images/ublinux-dark-glow-sc.svg b/images/ublinux-dark-glow-sc.svg new file mode 100644 index 0000000..d44113c --- /dev/null +++ b/images/ublinux-dark-glow-sc.svg @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/ubl-settings-manager.glade b/ui/ubl-settings-manager.glade index c083a7a..8ca4371 100644 --- a/ui/ubl-settings-manager.glade +++ b/ui/ubl-settings-manager.glade @@ -1005,7 +1005,7 @@ True False end - ../../../../../Загрузки/Telegram Desktop/ublinux-dark-glow-sc.svg + ../images/ublinux-dark-glow-sc.svg False