From 84c7a6e84ce604aee5280281daea2ca038cdb3af Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 9 Feb 2023 17:46:56 +0600 Subject: [PATCH 01/10] Localisation fixes --- source/ubl-settings-manager.c | 6 ++-- source/ubl-settings-manager.h | 4 +-- ubl-settings-manager_ru.po | 58 +++++++++++++++++++++++------------ 3 files changed, 44 insertions(+), 24 deletions(-) diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index f5cfe91..6e40155 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -531,7 +531,9 @@ void on_sections_save(GtkWidget *button, actionWidgets *widgets){ load_apps((IVGraphicals*)cur->data,widgets->applist,widgets->appssize); } yon_show_icon_views(widgets->ICSys,widgets); - //hide_if_unfound(widgets); + dictionary *yond=yon_dictionary_create_empty(); + yond->data=widgets; + hide_if_unfound(yond); } @@ -1438,7 +1440,7 @@ int main(int argc, char *argv[]){ return -1; } local=setlocale(LC_ALL, ""); - bindtextdomain (LocaleName, LocalePath); + printf("%s\n\n\n",bindtextdomain (LocaleName, LocalePath)); textdomain (LocaleName); actionWidgets *widget=malloc(sizeof(actionWidgets)); dictionary *widgets=yon_dictionary_create_empty(); diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index 6caf2c1..394f7c2 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -17,8 +17,8 @@ #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 "/home/superadmin/Документы/ubl-settings-manager/ub-settings-manager/ubl-info/ubl-settings-info" -#define ubl_settings_infoPathLaunch "/home/superadmin/Документы/ubl-settings-manager/ub-settings-manager/ubl-info/ubl-settings-info --socket-id=" +#define ubl_settings_infoPath "ubl-settings-info" +#define ubl_settings_infoPathLaunch "ubl-settings-info --socket-id=" typedef struct apps{ diff --git a/ubl-settings-manager_ru.po b/ubl-settings-manager_ru.po index 422642f..19df6c7 100644 --- a/ubl-settings-manager_ru.po +++ b/ubl-settings-manager_ru.po @@ -8,80 +8,98 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-31 11:50+0000\n" +"POT-Creation-Date: 2023-02-09 16:45+0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ubl-settings-manager.c:1373 +#: ubl-settings-manager.c:1338 msgid "Back to settings" msgstr "Назад" -#: ubl-settings-manager.c:1451 +#: ubl-settings-manager.c:1418 msgid "UBLinux Settings Manager" msgstr "Настройки UBLinux" -#: ubl-settings-manager.c:1452 +#: ubl-settings-manager.c:1419 msgid "Icon size" msgstr "Размер иконок" -#: ubl-settings-manager.c:1453 +#: ubl-settings-manager.c:1420 msgid "Window theme" msgstr "Выбор темы" -#: ubl-settings-manager.c:1454 +#: ubl-settings-manager.c:1421 msgid "Would you like to read documentation in the Web?" msgstr "Вы хотите прочитать руководство в сети?" -#: ubl-settings-manager.c:1455 -msgid "You will be redirected to documentation site, where user help pages are " +#: ubl-settings-manager.c:1422 +msgid "" +"You will be redirected to documentation site, where user help pages are " "translated and supported by community." msgstr "Вы будете перенаправлены на сайт с документацией, где страницы помощи переводятся и поддерживаются сообществом." -#: ubl-settings-manager.c:1456 +#: ubl-settings-manager.c:1423 msgid "Read online" msgstr "Прочитать онлайн" -#: ubl-settings-manager.c:1457 +#: ubl-settings-manager.c:1424 msgid "Cancel" msgstr "Отменить" -#: ubl-settings-manager.c:1458 +#: ubl-settings-manager.c:1425 msgid "Close" msgstr "Закрыть" -#: ubl-settings-manager.c:1459 +#: ubl-settings-manager.c:1426 msgid "Save and apply" msgstr "Сохранить и применить" -#: ubl-settings-manager.c:1460 +#: ubl-settings-manager.c:1427 msgid "Always redirect" msgstr "Всегда перенаправлять" -#: ubl-settings-manager.c:1461 +#: ubl-settings-manager.c:1428 msgid "Settings" msgstr "Настройки" -#: ubl-settings-manager.c:1462 +#: ubl-settings-manager.c:1429 msgid "About..." +msgstr "О программе" + +#: ubl-settings-manager.c:1430 +msgid "About system" msgstr "О системе" -#: ubl-settings-manager.c:1463 +#: ubl-settings-manager.c:1431 msgid "Understood" msgstr "Понятно" -#: ubl-settings-manager.c:1464 +#: ubl-settings-manager.c:1432 msgid "Section management" msgstr "Точная настройка" -#: ubl-settings-manager.c:1538 +#: ubl-settings-manager.c:1508 msgid "Standard theme" msgstr "Основная тема" -#: ubl-settings-manager.c:1539 +#: ubl-settings-manager.c:1509 msgid "GNOME theme" msgstr "GNOME тема" + +msgid "Personal" +msgstr "Личные" + +msgid "Hardware" +msgstr "Оборудование" + +msgid "System" +msgstr "Система" + +msgid "Misc" +msgstr "Прочее" + From 2d666f2d85fac7d88b3a7f236e7cd21297a0e8d2 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 13 Feb 2023 18:06:10 +0600 Subject: [PATCH 02/10] started creating of support for apps with pluggable separate button --- source/ubl-settings-manager.c | 50 +- source/ubl-settings-manager.h | 2 + ubl-settings-manager.css | 60 +- ubl-settings-manager.glade | 1297 +++++++++++++++++---------------- 4 files changed, 725 insertions(+), 684 deletions(-) diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 6e40155..06f20aa 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -68,8 +68,9 @@ void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *appl if (!tempapp){}else{ char arg[100]; memset(arg,0,100); - sprintf(arg,"--socket-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket))); - + 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 --socket-ext-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton))); + if (tempapp[0].Type==2) if (tempapp->Pluggable==1) py_launch_app(tempapp[0].Exec,arg); @@ -101,7 +102,8 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets apps *tempapp=get_app_by_name(applist->applist,name,applist->appssize); char arg[100]; memset(arg,0,100); - sprintf(arg,"--socket-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket))); + 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 --socket-ext-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton))); if (tempapp[0].Type==2) if (tempapp->Pluggable==1) @@ -366,6 +368,7 @@ void on_sections_accept(GtkWidget *button, actionWidgets *widgets){ } }; + void on_sections_cancel(GtkWidget *button, actionWidgets *widgets){ for (dictionary *dct=widgets->SettingsSections->first;dct!=NULL;dct=dct->next){ SectionSettingSegment *segment=(SectionSettingSegment*)dct->data; @@ -389,6 +392,7 @@ void on_sections_cancel(GtkWidget *button, actionWidgets *widgets){ } }; + void on_sections_move_up(GtkWidget *button, actionWidgets *widgets){ for (dictionary *dct=widgets->SettingsSections->first;dct!=NULL;dct=dct->next){ SectionSettingSegment *segment=(SectionSettingSegment*)dct->data; @@ -478,6 +482,7 @@ void on_sections_delete(GtkWidget *button, actionWidgets *widgets){ } } }; + void on_sections_add(GtkWidget *button, actionWidgets *widgets){ dictionary *dict=yon_dictionary_create_empty(); dictionary *dct=NULL; @@ -574,6 +579,7 @@ 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; @@ -615,11 +621,11 @@ void on_resized_done (GtkWidget *window, GdkEvent *event, dictionary *widgetsD){ } void on_about_system(GtkWidget *button, actionWidgets *widgets){ - char *socket_id=malloc(sizeof(gtk_socket_get_id(GTK_SOCKET(widgets->socket)))/sizeof(int)); - sprintf(socket_id,"%d",gtk_socket_get_id(GTK_SOCKET(widgets->socket))); - socket_id=yon_char_get_augumented(ubl_settings_infoPathLaunch,socket_id); - socket_id=yon_char_get_augumented(socket_id," &"); - system(socket_id); + char arg[100]; + memset(arg,0,100); + printf("%d\n%d\n\n\n\n",gtk_socket_get_id(GTK_SOCKET(widgets->socket)),gtk_socket_get_id(GTK_SOCKET(widgets->socketbutton))); + sprintf(arg,"--socket-id=%d --socket-ext-id=%d",gtk_socket_get_id(GTK_SOCKET(widgets->socket)),gtk_socket_get_id(GTK_SOCKET(widgets->socketbutton))); + launch_app_with_arguments("ubl-settings-info",arg); } void launch_app_with_arguments(char *name, char *args){ @@ -708,10 +714,17 @@ int hide_if_unfound(dictionary *widgetsD){ GtkWidget *create_socket(actionWidgets *builder){ GtkWidget *socket; socket = gtk_socket_new(); + GtkWidget *socketbutton=gtk_socket_new(); g_signal_connect(G_OBJECT(socket),"plug-added",G_CALLBACK(on_plug_added),builder); g_signal_connect(G_OBJECT(socket),"plug-removed",G_CALLBACK(on_plug_removed),builder); g_signal_connect(G_OBJECT(socket),"destroy",G_CALLBACK(on_plug_removed),builder); + + g_signal_connect(G_OBJECT(socketbutton),"plug-added",G_CALLBACK(on_plug_added),builder); + g_signal_connect(G_OBJECT(socketbutton),"plug-removed",G_CALLBACK(on_plug_removed),builder); + g_signal_connect(G_OBJECT(socketbutton),"destroy",G_CALLBACK(on_plug_removed),builder); gtk_box_pack_start(GTK_BOX(builder->socketplace),socket,true,true,0); + gtk_box_pack_start(GTK_BOX(builder->socketbuttonplace),socketbutton,1,1,0); + builder->socketbutton=socketbutton; return socket; }; @@ -851,7 +864,6 @@ int check_categories(apps app, char *catstocheck){ int setup_config(){ FILE *file; GError *err=NULL; - printf("1\n"); main_config.sections=malloc(sizeof(dictionary)); main_config.sections->data=NULL; main_config.sections->next=NULL; @@ -860,9 +872,6 @@ int setup_config(){ GKeyFile *configfile = g_key_file_new(); char *pth=malloc(7+strlen(UserConfigPath)+strlen(getlogin())); sprintf(pth,"%s%s%s","/home/",getlogin(),UserConfigPath); - printf("%s\n",getlogin()); - printf("%s\n",pth); - printf("%s\n",GlobalConfigPath); g_key_file_load_from_file(configfile,pth,G_KEY_FILE_KEEP_TRANSLATIONS,&err); if (err){ g_error_free(err); @@ -875,7 +884,6 @@ int setup_config(){ } char *foroutput=NULL; char *line=NULL; - printf("1\n"); main_config.windowPosX=g_key_file_get_integer(configfile,"window","WindowPosX",NULL); main_config.windowPosY=g_key_file_get_integer(configfile,"window","WindowPosY",NULL); main_config.windowWidth=g_key_file_get_integer(configfile,"window","WindowWidth",NULL); @@ -885,7 +893,6 @@ int setup_config(){ main_config.iconSegmentSize=g_key_file_get_integer(configfile,"window","IconSegmentSize",NULL); yon_icon_size_convert(0); gsize length=0; - printf("1\n"); char **a=g_key_file_get_keys(configfile,"sections",&length,NULL); if (!a){yon_set_default_sections(&main_config.sections);} else { @@ -896,12 +903,12 @@ int setup_config(){ main_config.sections->next=NULL; } - printf("1\n"); if (main_config.windowWidth<1024&&main_config.windowHeight<720){ main_config.WindowTheme=0; } return 1; }; + char *yon_cut(char *source, int size, int startpos){ char *cut=NULL; cut=malloc(size+1); @@ -974,6 +981,8 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ 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); + } else { + gtk_widget_set_name(iv,"Icon"); } GtkWidget *sep=gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); @@ -995,6 +1004,7 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ IVG->IV=iv; IVG->label=label; IVG->sep=sep; + return IVG; } @@ -1098,6 +1108,7 @@ dictionary *yon_dictionary_find(dictionary **dict, char *key){ } return NULL; } + void yon_switch_theme(dictionary **dict, dictionary *newone){ dictionary *dct=*dict; actionWidgets *widgets=(actionWidgets*)dct->data; @@ -1149,7 +1160,6 @@ void yon_switch_theme(dictionary **dict, dictionary *newone){ } - void yon_icon_size_convert(int mode){ if (mode==0){ if (main_config.iconsize==1) main_config.iconsize=24; @@ -1185,7 +1195,6 @@ SectionSettingSegment *yon_create_section_setting(char *name, char *categories){ if (categories[strlen(categories)-1]!=';'){ char *tmp=malloc(strlen(categories)+1); sprintf(tmp,"%s;",categories); - printf("\n\n"); categories=realloc(tmp,strlen(tmp)); } gtk_entry_set_text(GTK_ENTRY(segment->CategoriesEntry),categories); @@ -1330,6 +1339,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them 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->socketbuttonplace=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"socketbuttonplace"))); curWidgets->SettingsSections=NULL; gtk_style_context_add_class(gtk_widget_get_style_context(curWidgets->icvpack),"iconview"); curWidgets->socket=GTK_WIDGET(create_socket(curWidgets)); @@ -1344,11 +1354,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them } if (strcmp(theme_id,"Gnome")==0){ - char *socket_id=malloc(sizeof(gtk_socket_get_id(GTK_SOCKET(curWidgets->socket)))/sizeof(int)); - sprintf(socket_id,"%d",gtk_socket_get_id(GTK_SOCKET(curWidgets->socket))); - socket_id=yon_char_get_augumented(ubl_settings_infoPathLaunch,socket_id); - socket_id=yon_char_get_augumented(socket_id," &"); - system(socket_id); + on_about_system(NULL,curWidgets); g_signal_connect(G_OBJECT(curWidgets->window), "configure-event", G_CALLBACK(on_resized), widgets); g_signal_connect(G_OBJECT(curWidgets->window), "event-after", G_CALLBACK(on_resized_done), widgets); diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index 394f7c2..d87b897 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -135,6 +135,8 @@ typedef struct { GtkWidget *GnomeInfoDetailsLabel; GtkWidget *CautionWindow; GtkWidget *CautionUnderstandButton; + GtkWidget *socketbuttonplace; + GtkWidget *socketbutton; int appssize; apps *applist; GtkWidget *icvpack; diff --git a/ubl-settings-manager.css b/ubl-settings-manager.css index 05d6eb1..0da2d4f 100644 --- a/ubl-settings-manager.css +++ b/ubl-settings-manager.css @@ -1,55 +1,37 @@ -.label { - font-size: 13px; -} -.noborder{ - border:none; - border-width:0px; - border-radius:0px; - box-shadow: none; -} -.darkborder{ - border-width:1px; - border-radius:1px; +* { +padding: 1; + + } .bannerbackground { background-color: #404040; } -.elseps { - border-style:solid; - border-bottom-width: 1px; - border-image: linear-gradient(90deg, #aaaaaa 0%, #dcddde 100%); - border-image-slice: 1; - -} -#Icon { - background-color: transparent; - color: transparent; -} -iconview#GnomeIcon{ + + +#GnomeIcon{ border-style:solid; border-bottom-width: 1px; border-image: linear-gradient(90deg, #aaaaaa 0%, #dcddde 100%); border-image-slice: 1; - background-color: transparent; -} -#noborders{ - border-style:solid; - border: 0px; + background-color: black; } - #iconlabel { font-size:14px; font-weight: bold; } - - #desclabel { - font-size:100%; - } - .bold { - color:#1a5fb4; - } - iconview { - background-image:none; + GtkIconView.view { + + background-color: #000000; + color: #000000; } + GtkIconView.view.cell:selected, +GtkIconView.view.cell:selected:focus { + background-color: #bababa; + border-style: solid; + border-radius: 10px; + border-width: 3px; + border-color: #ffffff; +} + diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index 16cf32d..62a5fc9 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -114,11 +114,10 @@ - + False - 450 - 250 - dialog-question + 800 + 600 True @@ -128,40 +127,21 @@ True False - - - True - False - start - 20 - 20 - gtk-dialog-question - 6 - - - False - True - 0 - - True False + True vertical - + True False - start - 10 - 5 - Would yo like to read documentation in the Web? - - - + center + 3 @@ -170,59 +150,188 @@ 0 + + + + False + True + 0 + + + + + True + True + 52 + True + True - + True - False - start - start - 15 - 10 - You will be redirected to documentation website where documentation is translated and supported by community. - True - + True + in + 150 + True + + + True + False + + + True + False + 3 + 3 + 3 + 3 + 3 + vertical + + + + + + + - True - True - 1 + False + True - - Always redirect to online documentation + True - True - False - end - 5 - 10 - 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 + + - False - True - 2 + True + True - True True + end 1 - True @@ -230,22 +339,231 @@ 0 - + + + + + True + False + True + True False + True - - Cancel + True - True - True - - - - + False + + + True + False + UBLinux Settings Manager + + + True + True + 0 + + + + + True + True + 0 + + + + + True + False + + + + + + False + 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 + 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 + Would yo like to read documentation in the Web? + + + + + + + False + True + 0 + + + + + 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 + + + + False + True + 2 + + + + + + True + True + 1 + + + + + + True + True + 0 + + + + + True + False + + + Cancel + True + True + True + + + + True True 0 @@ -585,386 +903,98 @@ end 1 - - - - True - True - 0 - - - - - False - True - 4 - - - - - - - True - False - UBLinux Settings - - - - - 1 - 1 - 10 - - - True - False - gtk-go-back - - - True - False - gtk-undelete - - - 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 - - - - - 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 True - end 0 - - - Save and apply - True - True - True - 17 - 5 - - - False - True - end - 1 - - False True - 1 + 4 - + True False UBLinux Settings - - - - - - - - Стандартная тема - - - GNOME тема - - + + 1 + 1 + 10 - + + True + False + gtk-go-back + + + True + False + gtk-undelete + + + True + False + ../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg + 6 + + True False - + True False - Settings of UBL Settings Manager - Settings - True + Element 1 - + True False - Documentation - True + Element 2 + + + True + False + + + True + False + Element 3 + + + + - + + Element 4 True False - About system... - True + image3 + False - + + True + False + gtk-ok + + False 800 600 @@ -974,192 +1004,169 @@ False vertical - + True - False + True + 5 + 5 + 5 + 5 + in - + True False - True - vertical - + True False - center - 3 - - - - False - True - 0 - - - - - - False - True - 0 - - - - - True - True - 52 - True - True - - - True - True - in - 150 - True + vertical - + 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 - vertical + 5 + 5 + 5 + 5 + 0 + in - + True False - 3 - 3 - 3 - 3 - 3 - 0 - in + 3 + 3 + 5 + 5 - + True False - 12 - + True - False + True + True center - center - - - - False - True - 0 - - + 3 + image2 + + + False + True + 0 + + + + + True + True + True + False + Section name + name + + + True + True + 1 + + + + + True + False - + True False + center - - desklabel + True - False - center - right - 1 + True + True + 5 + image4 False True - 0 + end + 2 + + + + + True + False + 2 + + + True + True + 5 + 5 + 5 + 10 + False + Identifier + + + True + True + 0 + + + + + True + True + 2 - False + True True 1 + + True + True + 2 + - - - - - True - True - 0 - - - - True - True - 0 - - - - - True - False - vertical - - - False - vertical - - - - - - False - True - 0 - + + @@ -1169,18 +1176,8 @@ - - True - True - - - True - True - end - 1 - @@ -1189,59 +1186,99 @@ 0 - - - - - True - False - True - + True False - True - + + Close True - False - UBLinux Settings Manager + True + True + 5 + 5 - True + False True + end 0 - + + Save and apply True True - False True - menu1 - none - False - - - + 17 + 5 False True + end 1 + + False + True + 1 + - - - True - False - ../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg - 5 - - + + + + + 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 @@ -1319,10 +1356,6 @@ - - - True @@ -1539,9 +1562,6 @@ 0 - True @@ -1573,9 +1593,6 @@ 1 - True @@ -1596,10 +1613,21 @@ False True - + True False - UBLinux Settings Manager + + + True + False + UBLinux Settings Manager + + + True + True + 0 + + True @@ -1608,14 +1636,9 @@ - + True - True - False - True - menu1 - none - False + False @@ -1626,6 +1649,38 @@ 1 + + + True + False + vertical + + + True + True + False + True + menu1 + none + False + + + + + + False + True + 0 + + + + + False + True + end + 2 + + @@ -1660,10 +1715,6 @@ - From 9289033a7be42fa7c8c46ab5a8fa6b7d1013fa76 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 17 Feb 2023 11:44:10 +0600 Subject: [PATCH 03/10] header button implementation --- source/CMakeLists.txt | 4 +- source/ubl-settings-manager.c | 132 +++++++++++++++++++--------------- source/ubl-settings-manager.h | 5 +- ubl-settings-manager.css | 23 ++++-- 4 files changed, 99 insertions(+), 65 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 8459f65..a1449a6 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -8,8 +8,8 @@ include_directories(${GTK_INCLUDE_DIRS}) link_directories(${GTK_LIBRARY_DIRS}) add_definitions(${GTK_CFLAGS_OTHER}) -#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always") +#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a -g") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -g") set(SOURCE_FILES ubl-settings-manager.c diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 06f20aa..9ab6acb 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -54,6 +54,7 @@ void on_plug_removed(GtkSocket* self, actionWidgets *widgets){ gtk_widget_set_vexpand(widgets->socketplace,0); gtk_widget_set_vexpand(widgets->HideWhileLaunch,1); //printf("Plug has been removed!\n\n\n"); + gtk_widget_destroy(widgets->socketbutton); } @@ -65,19 +66,33 @@ void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *appl gtk_tree_model_get(gtk_icon_view_get_model(self),&iter,1,&name,-1); apps *tempapp=get_app_by_name(applist->applist,name,applist->appssize); + printf("%s\n",tempapp->Name); if (!tempapp){}else{ char arg[100]; + printf("%s\n",tempapp->Exec); + printf("%d\n",tempapp->Type); + printf("%d\n",tempapp->Pluggable); 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 --socket-ext-id=%d",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==2) if (tempapp->Pluggable==1) - py_launch_app(tempapp[0].Exec,arg); + 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))); + launch_app_with_arguments(tempapp[0].Exec,dualarg); + } else + py_launch_app(tempapp[0].Exec,arg); else py_launch_app(tempapp[0].Exec,""); else if (tempapp[0].Type==1){ if (tempapp->Pluggable==1) - launch_app_with_arguments(tempapp[0].Exec,arg); + 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))); + launch_app_with_arguments(tempapp[0].Exec,dualarg); + } else + launch_app_with_arguments(tempapp[0].Exec,arg); else launch_app(tempapp[0].Exec); } } @@ -90,11 +105,7 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets gtk_widget_destroy(applist->socket); } applist->socket=create_socket(applist); - char *socket_id=malloc(sizeof(gtk_socket_get_id(GTK_SOCKET(applist->socket)))/sizeof(int)); - sprintf(socket_id,"%d",gtk_socket_get_id(GTK_SOCKET(applist->socket))); - socket_id=yon_char_get_augumented("../ubl-info/ubl-info-bin --socket-id=",socket_id); - socket_id=yon_char_get_augumented(socket_id," &"); - system(socket_id); + on_about_system(NULL,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); @@ -102,17 +113,26 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets apps *tempapp=get_app_by_name(applist->applist,name,applist->appssize); 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 --socket-ext-id=%d",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))); if (tempapp[0].Type==2) - if (tempapp->Pluggable==1) - py_launch_app(tempapp[0].Exec,arg); - else py_launch_app(tempapp[0].Exec,""); - else if (tempapp[0].Type==1){ - if (tempapp->Pluggable==1) - launch_app_with_arguments(tempapp[0].Exec,arg); - else launch_app(tempapp[0].Exec); + 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))); + py_launch_app(tempapp[0].Exec,dualarg); + } else + py_launch_app(tempapp[0].Exec,arg); + 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))); + launch_app_with_arguments(tempapp[0].Exec,dualarg); + } else + launch_app_with_arguments(tempapp[0].Exec,arg); + else launch_app(tempapp[0].Exec); } } @@ -121,7 +141,7 @@ void on_item_selection_changed(GtkIconView *IV, actionWidgets *widgets){ dictionary *next=widgets->ICSys->first; for (dictionary *dct=next;dct!=NULL;dct=dct->next){ IVGraphicals *IVG=(IVGraphicals*)dct->data; - if (IVG->IV!=IV) + if (GTK_ICON_VIEW(IVG->IV)!=GTK_ICON_VIEW(IV)) if (gtk_icon_view_get_selected_items(GTK_ICON_VIEW(IVG->IV))>0) gtk_icon_view_unselect_all(GTK_ICON_VIEW(IVG->IV)); } @@ -311,7 +331,7 @@ void on_section_settings_open(GtkButton* self,dictionary *cWidgets){ SectionSettingSegment *Sgm=yon_create_section_setting(IV->sectionName,IV->categories); yon_segment_show(widgets,Sgm); dict->data=Sgm; - dict->key=gtk_label_get_text(GTK_LABEL(Sgm->NameLabel)); + dict->key=(char*)gtk_label_get_text(GTK_LABEL(Sgm->NameLabel)); dict->next=malloc(sizeof(dictionary)); dict->next->prev=dict; dict->next->first=dict->first; @@ -628,25 +648,30 @@ void on_about_system(GtkWidget *button, actionWidgets *widgets){ launch_app_with_arguments("ubl-settings-info",arg); } +void launch(char *command){ + system(command); +} + 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); - memcpy(path,name,strlen(name)); - memcpy(path+strlen(name)," ",1); - strcat(args," &"); - strcat(path,args); - system(("/usr/bin/%s",path)); + char *path=yon_char_get_augumented("/bin/",name); + path=yon_char_get_augumented(path," "); + path=yon_char_get_augumented(path,args); + printf("%s\n",path); + pthread_t thread_id; + pthread_create(&thread_id, NULL, launch, path); }; void launch_app(char *name){ - char *path=yon_char_get_augumented(name," &"); - system(path); + char *path=name; + pthread_t thread_id; + pthread_create(&thread_id, NULL, 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); - system(path); + pthread_t thread_id; + pthread_create(&thread_id, NULL, launch, path); }; @@ -654,7 +679,6 @@ apps *get_app_by_name(apps *applist,char *name, int size){ for (int i=0;ifirst;dct!=NULL;dct=dct->next){ IVGraphicals *iv=dct->data; @@ -1343,7 +1361,8 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them 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")); + g_signal_connect(G_OBJECT(curWidgets->MenuItemAboutSystem), "activate", G_CALLBACK(on_about_system),curWidgets); 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"); @@ -1419,7 +1438,6 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them 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); g_signal_connect(G_OBJECT(curWidgets->CautionUnderstandButton), "clicked", G_CALLBACK(on_caution_understand), curWidgets); - g_signal_connect(G_OBJECT(curWidgets->MenuItemAboutSystem), "activate", G_CALLBACK(on_about_system),curWidgets); } gtk_label_set_text(GTK_LABEL(curWidgets->LabelTitle),_("UBLinux Settings Manager")); gtk_label_set_text(GTK_LABEL(curWidgets->settingsSubmenuLabelSize),_("Icon size")); diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index d87b897..2d6502b 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -28,7 +28,7 @@ typedef struct apps{ char *Exec; char *Icon; int Pluggable; - + int DualPluggable; } apps; typedef struct dictionary { @@ -198,4 +198,7 @@ void yon_dictionary_make_first(dictionary *dict); dictionary *yon_create_icon_section_list(dictionary *sections); 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); #endif \ No newline at end of file diff --git a/ubl-settings-manager.css b/ubl-settings-manager.css index 0da2d4f..d8e576c 100644 --- a/ubl-settings-manager.css +++ b/ubl-settings-manager.css @@ -1,5 +1,5 @@ * { -padding: 1; +padding: 1px; } @@ -7,7 +7,16 @@ padding: 1; 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; @@ -26,12 +35,16 @@ background-color: #404040; background-color: #000000; color: #000000; } - GtkIconView.view.cell:selected, + + 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: 10px; - border-width: 3px; + border-radius: 3px; + border-width: 1px; border-color: #ffffff; } From 8ff33c6e754f15b82ab8c3d318201e7531602b02 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 17 Feb 2023 17:46:52 +0600 Subject: [PATCH 04/10] Third socket for rendering widgets in left part of header --- source/CMakeLists.txt | 7 +- source/ubl-settings-manager.c | 59 +- source/ubl-settings-manager.h | 6 +- ubconfig-main.conf | 2 + ubl-settings-manager.css | 34 - ubl-settings-manager.glade | 1340 +++++++++++++++++---------------- 6 files changed, 750 insertions(+), 698 deletions(-) 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 + + From d8c39ae0c42b67887302e6c19f2c973f244adbf7 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 17 Feb 2023 17:52:03 +0600 Subject: [PATCH 05/10] memory leak fixed --- source/ubl-settings-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index dcce353..7d3bf37 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -132,7 +132,7 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets else if (tempapp[0].Type==1){ if (tempapp->Pluggable==1) if (tempapp->DualPluggable==1){ - char *dualarg=malloc(strlen("--socket-id= --socket-ext-id=")+30); + 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); } else{ From 0d1401b5dfca3f53607358d8977c07dcfb00d056 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 17 Feb 2023 18:14:38 +0600 Subject: [PATCH 06/10] Fixed main theme not showing left socketed button --- source/ubl-settings-manager.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 7d3bf37..3bea26a 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -56,6 +56,7 @@ void on_plug_removed(GtkSocket* self, actionWidgets *widgets){ gtk_widget_set_vexpand(widgets->HideWhileLaunch,1); //printf("Plug has been removed!\n\n\n"); gtk_widget_destroy(widgets->socketbutton); + gtk_widget_destroy(widgets->ThirdSocket); gtk_widget_show(widgets->appSettings); } @@ -81,8 +82,8 @@ void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *appl 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))); launch_app_with_arguments(tempapp[0].Exec,dualarg); } else py_launch_app(tempapp[0].Exec,arg); @@ -90,8 +91,8 @@ void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *appl 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))); + 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); } else launch_app_with_arguments(tempapp[0].Exec,arg); From 89fc843c1d3327721f2e8b0ba7a2d3a1fbab8187 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 20 Feb 2023 11:58:44 +0600 Subject: [PATCH 07/10] Fixed sockets for embedded apps optional buttons in header --- source/ubl-settings-manager.c | 78 +++++++++++++++++------------------ source/ubl-settings-manager.h | 1 + ubconfig-main.conf | 1 + ubl-settings-manager.css | 5 +++ ubl-settings-manager.glade | 10 +++++ 5 files changed, 56 insertions(+), 39 deletions(-) diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 3bea26a..0df89ab 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -38,7 +38,9 @@ int cmld=0; void on_plug_added(GtkSocket* self, actionWidgets *builder){ - //printf("Plug has been added!\n"); + gtk_widget_show(builder->socketbutton); + gtk_widget_show(builder->ThirdSocket); + 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); @@ -51,18 +53,21 @@ void on_plug_added(GtkSocket* self, actionWidgets *builder){ } void on_plug_removed(GtkSocket* self, actionWidgets *widgets){ + gtk_widget_show(widgets->appSettings); gtk_widget_show(widgets->HideWhileLaunch); 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"); + if(widgets->socketbutton) gtk_widget_destroy(widgets->socketbutton); + if(widgets->ThirdSocket) gtk_widget_destroy(widgets->ThirdSocket); gtk_widget_show(widgets->appSettings); } 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); @@ -79,16 +84,7 @@ void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *appl 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==2) - if (tempapp->Pluggable==1) - if (tempapp->DualPluggable==1){ - 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); - } else - py_launch_app(tempapp[0].Exec,arg); - else py_launch_app(tempapp[0].Exec,""); - else if (tempapp[0].Type==1){ + if (tempapp[0].Type==1){ if (tempapp->Pluggable==1) if (tempapp->DualPluggable==1){ char *dualarg=malloc(strlen("--socket-id= --socket-ext-id= --socket-trd-id=")+30); @@ -108,7 +104,6 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets gtk_widget_destroy(applist->socket); } applist->socket=create_socket(applist); - on_about_system(NULL,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); @@ -118,29 +113,22 @@ 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==2) - if (tempapp->Pluggable==1) - if (tempapp->DualPluggable==1){ - 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); - 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[0].Type==1){ + if (tempapp->Pluggable==1){ + if (tempapp->DualPluggable==1){ - 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); - } else{ - launch_app_with_arguments(tempapp[0].Exec,arg); - gtk_widget_destroy(applist->socketbutton); - } + 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); + } + else{ + launch_app_with_arguments(tempapp[0].Exec,arg); + gtk_widget_destroy(applist->socketbutton); + } + } else { + on_about_system(NULL,applist); launch_app(tempapp[0].Exec); gtk_widget_destroy(applist->socketbutton); } @@ -225,6 +213,12 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){ char *fromint=malloc(5); memset(fromint,0,5); GError *err=NULL; + char *login=getlogin(); + if (strcmp(login,"root")==0){ + login=main_config.lastUser; + } else { + main_config.lastUser=login; + } char *pth=malloc(7+strlen(UserConfigPath)+strlen(getlogin())); sprintf(pth,"%s%s%s","/home/",getlogin(),UserConfigPath); g_key_file_load_from_file(gfile,pth,G_KEY_FILE_NONE,&err); @@ -258,6 +252,7 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){ 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); + g_key_file_set_string(gfile,"window","User",login); 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); @@ -758,13 +753,17 @@ GtkWidget *create_socket(actionWidgets *builder){ g_signal_connect(G_OBJECT(socket),"plug-removed",G_CALLBACK(on_plug_removed),builder); g_signal_connect(G_OBJECT(socket),"destroy",G_CALLBACK(on_plug_removed),builder); - g_signal_connect(G_OBJECT(socketbutton),"plug-added",G_CALLBACK(on_plug_added),builder); - g_signal_connect(G_OBJECT(socketbutton),"plug-removed",G_CALLBACK(on_plug_removed),builder); - g_signal_connect(G_OBJECT(socketbutton),"destroy",G_CALLBACK(on_plug_removed),builder); + // g_signal_connect(G_OBJECT(socketbutton),"plug-added",G_CALLBACK(on_plug_added),builder); + // g_signal_connect(G_OBJECT(socketbutton),"plug-removed",G_CALLBACK(on_plug_removed),builder); + // g_signal_connect(G_OBJECT(socketbutton),"destroy",G_CALLBACK(on_plug_removed),builder); + + // g_signal_connect(G_OBJECT(ThirdSocket),"plug-added",G_CALLBACK(on_plug_added),builder); + // g_signal_connect(G_OBJECT(ThirdSocket),"plug-removed",G_CALLBACK(on_plug_removed),builder); + // g_signal_connect(G_OBJECT(ThirdSocket),"destroy",G_CALLBACK(on_plug_removed),builder); + gtk_box_pack_start(GTK_BOX(builder->socketplace),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; @@ -920,6 +919,7 @@ int setup_config(){ 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); + main_config.lastUser=g_key_file_get_string(configfile,"window","User",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; diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index 25df934..92f3100 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -66,6 +66,7 @@ typedef struct { dictionary *sections; int labelSize; int labelDensity; + char *lastUser; } config; typedef struct { diff --git a/ubconfig-main.conf b/ubconfig-main.conf index 2609f03..ab0f139 100644 --- a/ubconfig-main.conf +++ b/ubconfig-main.conf @@ -8,6 +8,7 @@ IconSize=2 IconSegmentSize=321 LabelSize=12 LabelDensity=0 +User= [sections] Personal=XFCE; diff --git a/ubl-settings-manager.css b/ubl-settings-manager.css index d214062..437117d 100644 --- a/ubl-settings-manager.css +++ b/ubl-settings-manager.css @@ -14,3 +14,8 @@ background-color: #404040; font-weight: bold; } +.roundborder * { + border-style:solid; + border-width:1px; + border-radius:5px; +} diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index c835e28..d8c980b 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -1684,9 +1684,14 @@ True False + center + center + False @@ -1762,10 +1767,15 @@ True False + center + center vertical + 2 From 4d3e77a1aa9529c3f2b78adc32110c7938891207 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 20 Feb 2023 12:43:55 +0600 Subject: [PATCH 08/10] Gnome style minor fixes --- source/ubl-settings-manager.c | 5 ++- ubl-settings-manager.glade | 58 ++++++++++++++++++++++------------- 2 files changed, 40 insertions(+), 23 deletions(-) diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 0df89ab..1582f15 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -1511,6 +1511,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),GTK_WIDGET(gtk_builder_get_object(builder,"GnomeScroll"))); yon_icv_resize_item(widg->ICSys,widg->GnomePaned); theme="Main"; main_config.WindowTheme=0; @@ -1526,6 +1527,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); main_config.WindowTheme=1; } @@ -1538,7 +1540,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); + gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),GTK_WIDGET(gtk_builder_get_object(builder,"GnomeScroll"))); theme="Gnome"; main_config.WindowTheme=1; widgets->next=yon_dictionary_create_empty(); @@ -1553,6 +1555,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->icvpack); main_config.WindowTheme=0; yon_icv_resize_item(widg->ICSys,widg->GnomePaned); } diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index d8c980b..95ca9bd 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -114,6 +114,34 @@ + + True + True + in + 150 + True + + + True + False + + + True + False + 3 + 3 + 3 + 3 + 3 + vertical + + + + + + + + False 450 @@ -1104,32 +1132,18 @@ True True - + True - True - in - 150 - True + False - + True - False - - - True - False - 3 - 3 - 3 - 3 - 3 - vertical - - - - - + True + 6 + + -1 + From f4839b9cacb44aa6ff05af1b99541dd520f2cedd Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 20 Feb 2023 12:46:24 +0600 Subject: [PATCH 09/10] Cmake editing --- source/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index cf3059e..318ac88 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -8,8 +8,8 @@ include_directories(${GTK_INCLUDE_DIRS}) link_directories(${GTK_LIBRARY_DIRS}) add_definitions(${GTK_CFLAGS_OTHER}) -#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a -g") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -g") +#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always") set(SOURCE_FILES ubl-settings-manager.c From 991a54b929019b30299d3c7e0ed439c30d70c845 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 20 Feb 2023 14:58:37 +0600 Subject: [PATCH 10/10] Interface edits --- source/ubl-settings-manager.c | 32 +++++++++++++++++--------------- ubconfig-main.conf | 8 ++++---- ubl-settings-manager.glade | 1 + 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 1582f15..dfe83a4 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -40,7 +40,7 @@ int cmld=0; void on_plug_added(GtkSocket* self, actionWidgets *builder){ gtk_widget_show(builder->socketbutton); gtk_widget_show(builder->ThirdSocket); - 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); @@ -57,7 +57,7 @@ void on_plug_removed(GtkSocket* self, actionWidgets *widgets){ gtk_widget_show(widgets->HideWhileLaunch); 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"); if(widgets->socketbutton) gtk_widget_destroy(widgets->socketbutton); if(widgets->ThirdSocket) @@ -67,19 +67,19 @@ void on_plug_removed(GtkSocket* self, actionWidgets *widgets){ } 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); gtk_tree_model_get(gtk_icon_view_get_model(self),&iter,1,&name,-1); apps *tempapp=get_app_by_name(applist->applist,name,applist->appssize); - printf("%s\n",tempapp->Name); + // printf("%s\n",tempapp->Name); if (!tempapp){}else{ char arg[100]; - printf("%s\n",tempapp->Exec); - printf("%d\n",tempapp->Type); - printf("%d\n",tempapp->Pluggable); + // printf("%s\n",tempapp->Exec); + // printf("%d\n",tempapp->Type); + // printf("%d\n",tempapp->Pluggable); 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))); @@ -184,7 +184,7 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){ else if (main_config.WindowTheme==1) main_config.curThemeName="Gnome"; dictionary *widgetsD=yon_dictionary_find(widgetsDs,main_config.curThemeName); - printf("Saving config...\n"); + // printf("Saving config...\n"); actionWidgets *widgets=(actionWidgets*)widgetsD->data; int theme=gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->settingsThemeChooser)); gtk_window_get_position(GTK_WINDOW(widgets->window),&main_config.windowPosX,&main_config.windowPosY); @@ -214,7 +214,7 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){ memset(fromint,0,5); GError *err=NULL; char *login=getlogin(); - if (strcmp(login,"root")==0){ + if (geteuid()==0){ login=main_config.lastUser; } else { main_config.lastUser=login; @@ -653,7 +653,7 @@ void on_resized_done (GtkWidget *window, GdkEvent *event, dictionary *widgetsD){ void on_about_system(GtkWidget *button, actionWidgets *widgets){ char arg[100]; memset(arg,0,100); - printf("%d\n%d\n\n\n\n",gtk_socket_get_id(GTK_SOCKET(widgets->socket)),gtk_socket_get_id(GTK_SOCKET(widgets->socketbutton))); + // printf("%d\n%d\n\n\n\n",gtk_socket_get_id(GTK_SOCKET(widgets->socket)),gtk_socket_get_id(GTK_SOCKET(widgets->socketbutton))); sprintf(arg,"--socket-id=%d --socket-ext-id=%d",gtk_socket_get_id(GTK_SOCKET(widgets->socket)),gtk_socket_get_id(GTK_SOCKET(widgets->socketbutton))); launch_app_with_arguments("ubl-settings-info",arg); } @@ -666,7 +666,7 @@ void 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); - printf("%s\n",path); + // printf("%s\n",path); pthread_t thread_id; pthread_create(&thread_id, NULL, (void*)launch, path); }; @@ -1491,7 +1491,7 @@ int main(int argc, char *argv[]){ return -1; } local=setlocale(LC_ALL, ""); - printf("%s\n\n\n",bindtextdomain (LocaleName, LocalePath)); + // printf("%s\n\n\n",bindtextdomain (LocaleName, LocalePath)); textdomain (LocaleName); actionWidgets *widget=malloc(sizeof(actionWidgets)); dictionary *widgets=yon_dictionary_create_empty(); @@ -1559,9 +1559,11 @@ int main(int argc, char *argv[]){ main_config.WindowTheme=0; yon_icv_resize_item(widg->ICSys,widg->GnomePaned); } - - gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widg->settingsThemeChooser),NULL,_("Standard theme")); - gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widg->settingsThemeChooser),NULL,_("GNOME theme")); + if (geteuid()==0){ + gtk_widget_set_sensitive(widg->settingsSectionsSettingsButton,1); + } + gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widg->settingsThemeChooser),NULL,_("Standard theme")); + gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widg->settingsThemeChooser),NULL,_("GNOME theme")); widg=(actionWidgets*)widgets->data; gtk_window_maximize(GTK_WINDOW(widg->window)); gtk_widget_show_all(widg->window); diff --git a/ubconfig-main.conf b/ubconfig-main.conf index ab0f139..4d5b3a4 100644 --- a/ubconfig-main.conf +++ b/ubconfig-main.conf @@ -1,17 +1,17 @@ [window] WindowPosX=0 WindowPosY=0 -WindowWidth=1920 -WindowHeight=1004 +WindowWidth=800 +WindowHeight=600 WindowTheme=0 IconSize=2 -IconSegmentSize=321 +IconSegmentSize=250 LabelSize=12 LabelDensity=0 User= [sections] -Personal=XFCE; +Personal=X-UBL-SettingsManager;X-UBL-PersonalSettings; Hardware=X-UBL-SettingsManager;X-UBL-HardwareSettings; System=X-UBL-SettingsManager;X-UBL-SystemSettings; Misc= diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index 95ca9bd..8566978 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -629,6 +629,7 @@ Sections management True + False True True 10