From 2459a1f5f3bd6aacaec7dca83391f46ab5e050f4 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 14 Mar 2023 11:49:11 +0600 Subject: [PATCH] Returnal of sections management button, removal of 'About System' menu button --- source/ubl-settings-manager.c | 38 +++++++++++++---------------- source/ubl-settings-manager.h | 5 ++-- ubl-settings-manager.glade | 45 +++++++++++++++-------------------- ubl-settings-manager_ru.po | 8 +++++++ 4 files changed, 47 insertions(+), 49 deletions(-) diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 70eb714..221c220 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -122,7 +122,6 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets } } else { - on_about_system(NULL,applist); launch_app(tempapp[0].Exec); gtk_widget_destroy(applist->socketbutton); } @@ -275,8 +274,8 @@ void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *wi int position=gtk_paned_get_position(GTK_PANED(widgets->GnomePaned)); if (position<200) {position=200; gtk_paned_set_position(GTK_PANED(widgets->GnomePaned),200);} main_config.iconSegmentSize=position; - if (position <70) {position=70;} - double pos=((double)position); + // if (position <70) {position=70;} + double pos=((double)position-35); if (pos<70) pos=70; for (dictionary *dict=widgets->ICSys;dict!=NULL;dict=dict->next){ IVGraphicals *IV=(IVGraphicals*)dict->data; @@ -304,7 +303,7 @@ int on_settingsOpen(GtkWidget *button, actionWidgets *widgets){ gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),tmp); gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(*main_config.currentThemeIconSize),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); - gtk_window_present(GTK_WINDOW(widgets->SettingsWindow)); + gtk_window_present(GTK_WINDOW(widgets->SettingsWindow)); }; int on_settings_icon_size_changed(GtkWidget* self, actionWidgets *widgets){ @@ -368,7 +367,7 @@ void on_section_settings_open(GtkButton* self,dictionary *cWidgets){ dict=dict->prev; dict->next=NULL; } - gtk_widget_show(widgets->SectionSettingsWindow); + gtk_window_present(GTK_WINDOW(widgets->SectionSettingsWindow)); } void on_sections_edit(GtkWidget *button, actionWidgets *widgets){ @@ -672,18 +671,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); - gtk_widget_show(widgets->socketbuttonplace); - if (button){ - gtk_widget_hide(widgets->appSettings); - 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))); - }else{ - sprintf(arg,"--socket-id=%d",gtk_socket_get_id(GTK_SOCKET(widgets->socket))); - } - launch_app_with_arguments("ubl-settings-info",arg); -} + void on_theme_selection_changed(GtkWidget *self, actionWidgets *widgets){ int *icsize; @@ -1614,7 +1602,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them gtk_style_context_add_class(gtk_widget_get_style_context(curWidgets->icvpack),"iconview"); curWidgets->socket=GTK_WIDGET(create_socket(curWidgets)); - g_signal_connect(G_OBJECT(curWidgets->MenuItemAboutSystem), "activate", G_CALLBACK(on_about_system),curWidgets); + // 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 all settings")); gtk_window_set_title(GTK_WINDOW(curWidgets->window),_("UBLinux Settings Manager")); @@ -1625,7 +1613,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them } g_signal_connect(G_OBJECT(curWidgets->window), "configure-event", G_CALLBACK(on_resized), widgets); if (strcmp(theme_id,"Gnome")==0){ - on_about_system(NULL,curWidgets); + // on_about_system(NULL,curWidgets); g_signal_connect(G_OBJECT(curWidgets->window), "event-after", G_CALLBACK(on_resized_done), widgets); } @@ -1653,6 +1641,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them curWidgets->settingsCancel=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"settingsCancel")); curWidgets->settingsSubmenuLabelSize=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"settingsSubmenuLabelSize")); curWidgets->settingsSubmenuLabelTheme=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"settingsSubmenuLabelTheme")); + curWidgets->settingsSectionsSettingsButton=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"settingsSectionsSettingsButton")); curWidgets->SectionSettingAddButton=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"SectionSettingsAddButton")); curWidgets->SectionSettingAddNameEntry=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"SectionSettingsAddNameEntry")); curWidgets->SectionSettingAddCategoriesEntry=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"SectionSettingsAddCategoriesEntry")); @@ -1662,6 +1651,8 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them curWidgets->CautionWindow=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"CautionWindow")); curWidgets->CautionUnderstandButton=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"CautionUnderstandButton")); curWidgets->infoWarningWindow=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"windowSettings-infoWarning")); + curWidgets->infoWarningButton=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"buttonSettings-infoWarning")); + curWidgets->infoWarningLabel=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"labelSettings-infoWarning")); curWidgets->applist=applist; curWidgets->appssize=appsize; GtkIconTheme *icthm=gtk_icon_theme_get_default(); @@ -1685,9 +1676,12 @@ 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->infoWarningButton), "clicked", G_CALLBACK(on_info_warning_closed), curWidgets); + g_signal_connect(G_OBJECT(curWidgets->settingsSectionsSettingsButton), "clicked", G_CALLBACK(on_section_settings_open), widgets); } g_signal_connect(G_OBJECT(curWidgets->window), "destroy", G_CALLBACK(yon_main_quit), curWidgets); gtk_label_set_text(GTK_LABEL(curWidgets->LabelTitle),_("UBLinux Settings Manager")); + // gtk_label_set_text(GTK_LABEL(curWidgets->infoWarningLabel),_("Looks like you don't have ubl-settings-info installed on your PC.")); gtk_label_set_text(GTK_LABEL(curWidgets->settingsSubmenuLabelSize),_("Icon size")); gtk_label_set_text(GTK_LABEL(curWidgets->settingsSubmenuLabelTheme),_("Window theme")); gtk_label_set_text(GTK_LABEL(curWidgets->helpHeader),_("Would you like to read documentation in the Web?")); @@ -1699,8 +1693,9 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them gtk_button_set_label(GTK_BUTTON(curWidgets->AlwaysOpenDocumentation),_("Always redirect")); gtk_menu_item_set_label(GTK_MENU_ITEM(curWidgets->MenuItemSettings),_("Settings")); gtk_menu_item_set_label(GTK_MENU_ITEM(curWidgets->MenuItemDocumentation),_("About...")); - gtk_menu_item_set_label(GTK_MENU_ITEM(curWidgets->MenuItemAboutSystem),_("About system")); + // gtk_menu_item_set_label(GTK_MENU_ITEM(curWidgets->MenuItemAboutSystem),_("About system")); gtk_button_set_label(GTK_BUTTON(curWidgets->CautionUnderstandButton),_("Understood")); + gtk_button_set_label(GTK_BUTTON(curWidgets->settingsSectionsSettingsButton),_("Sections management")); return widgets; } @@ -1712,7 +1707,8 @@ int main(int argc, char *argv[]){ } local=setlocale(LC_ALL, ""); textdomain (LocaleName); - actionWidgets *widget=malloc(sizeof(actionWidgets)); + actionWidgets *widget=NULL; + widget=malloc(sizeof(actionWidgets)); dictionary *widgets=yon_dictionary_create_empty(); widgets->data=widget; int *size=malloc(sizeof(int)); diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index 7c471db..df806b5 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -136,7 +136,7 @@ typedef struct { GtkWidget *GnomePaned; GtkWidget *GnomeInfoLabel; GtkWidget *workingwindow; - // GtkWidget *settingsSectionsSettingsButton; + GtkWidget *settingsSectionsSettingsButton; GtkWidget *SectionSettingsWindow; GtkWidget *SectionSettingsPack; dictionary *SettingsSections; @@ -158,6 +158,8 @@ typedef struct { apps *applist; GtkWidget *icvpack; GtkWidget *infoWarningWindow; + GtkWidget *infoWarningButton; + GtkWidget *infoWarningLabel; } actionWidgets; @@ -215,7 +217,6 @@ 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); int launch(thread_output *thread); float yon_time_average(dictionary *times); diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index a657914..16761af 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -123,17 +123,6 @@ - - - True - False - About system - True - - - @@ -353,17 +342,6 @@ - - - True - False - About system - True - - - @@ -563,6 +541,23 @@ 1 + + + button + True + True + True + 5 + 5 + 5 + 5 + + + False + True + 2 + + True @@ -674,7 +669,6 @@ True False center - ubl-settings-manager-banner 3