|
|
|
|
@ -1,21 +1,5 @@
|
|
|
|
|
#ifndef UBL_SETTINGS_MANAGER_MAIN
|
|
|
|
|
#define UBL_SETTINGS_MANAGER_MAIN
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
#include <gtk/gtkx.h>
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
#include <dirent.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <locale.h>
|
|
|
|
|
#include <libintl.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <pthread.h>
|
|
|
|
|
#include<sys/utsname.h>
|
|
|
|
|
#include<sys/sysinfo.h>
|
|
|
|
|
#include <math.h>
|
|
|
|
|
#include <wctype.h>
|
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "ubl-settings-manager.h"
|
|
|
|
|
@ -57,15 +41,15 @@ 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);
|
|
|
|
|
// if(widgets->socketbutton)
|
|
|
|
|
// gtk_widget_destroy(widgets->socketbutton);
|
|
|
|
|
// if(widgets->ThirdSocket)
|
|
|
|
|
// gtk_widget_destroy(widgets->ThirdSocket);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *applist){
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
char *name;
|
|
|
|
|
if (applist->socket){
|
|
|
|
|
gtk_widget_destroy(applist->socket);
|
|
|
|
|
}
|
|
|
|
|
applist->socket=create_socket(applist);
|
|
|
|
|
gtk_tree_model_get_iter(gtk_icon_view_get_model(self),&iter,path);
|
|
|
|
|
gtk_tree_model_get(gtk_icon_view_get_model(self),&iter,0,&name,-1);
|
|
|
|
|
|
|
|
|
|
@ -90,7 +74,7 @@ void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *appl
|
|
|
|
|
void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *applist){
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
char *name;
|
|
|
|
|
if (!applist->socket){}else{
|
|
|
|
|
if (applist->socket){
|
|
|
|
|
gtk_widget_destroy(applist->socket);
|
|
|
|
|
}
|
|
|
|
|
applist->socket=create_socket(applist);
|
|
|
|
|
@ -162,7 +146,7 @@ void on_backToSettingsButton_clicked(GtkWidget *button,actionWidgets *sctb){
|
|
|
|
|
GtkWidget *window=GTK_WIDGET(gtk_builder_get_object(sctb->builder,"HideWhileLaunch"));
|
|
|
|
|
GtkWidget *socketplace=GTK_WIDGET(gtk_builder_get_object(sctb->builder,"socketplace"));
|
|
|
|
|
gtk_widget_destroy(sctb->socket);
|
|
|
|
|
sctb->socket=GTK_WIDGET(create_socket(sctb));
|
|
|
|
|
sctb->socket=NULL;
|
|
|
|
|
GtkWidget *backbutton=sctb->ButtonBackToMain;
|
|
|
|
|
gtk_widget_hide(backbutton);
|
|
|
|
|
};
|
|
|
|
|
@ -511,7 +495,6 @@ void on_sections_add(GtkWidget *button, actionWidgets *widgets){
|
|
|
|
|
SectionSettingSegment *segment=yon_create_section_setting(category_name,category_categories);
|
|
|
|
|
dictionary *newsection = yon_dictionary_get_last(main_config.SettingsSections);
|
|
|
|
|
newsection=yon_dictionary_create_with_data_connected(newsection,category_name,segment);
|
|
|
|
|
// printf("%s\n",category_name);
|
|
|
|
|
dictionary *newsec=yon_dictionary_create_empty();
|
|
|
|
|
newsec=yon_section_new(newsec,category_name,category_categories);
|
|
|
|
|
main_config.sections=yon_dictionary_create_with_data_connected(main_config.sections,category_name,newsec->data);
|
|
|
|
|
@ -652,7 +635,6 @@ void on_reveal_banner(GtkWidget *button, actionWidgets *widgets){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_double_click_changed(GtkWidget *Switch, gboolean state, dictionary *widgetsD){
|
|
|
|
|
// printf("%s\n","SGRBHSDRFJHNSDRJHNSDRJHNDRDJR");
|
|
|
|
|
*main_config.currentDoubleClick=state;
|
|
|
|
|
update_double_clicks(widgetsD);
|
|
|
|
|
}
|
|
|
|
|
@ -670,11 +652,7 @@ void on_about(GtkWidget *button, GtkBuilder *buildr){
|
|
|
|
|
GList *list = gtk_container_get_children(GTK_CONTAINER(AboutButtons));
|
|
|
|
|
gtk_widget_destroy(AboutButtons);
|
|
|
|
|
g_signal_connect(G_OBJECT(About), "activate-link", G_CALLBACK(on_about_link), buildr);
|
|
|
|
|
// gtk_widget_destroy(GTK_WIDGET(g_list_first(list)->next->next));
|
|
|
|
|
// gtk_widget_destroy(GTK_WIDGET(g_list_first(list)->next));
|
|
|
|
|
// gtk_widget_destroy(GTK_WIDGET(g_list_first(list)));
|
|
|
|
|
gtk_about_dialog_set_website_label(GTK_ABOUT_DIALOG(About),_(ABOUT_PROJECT_HOME_PAGE_LABEL));
|
|
|
|
|
// gtk_widget_set_visible(AboutButtons,0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int launch(thread_output *thread){
|
|
|
|
|
@ -905,7 +883,7 @@ int check_categories(apps app, char *catstocheck){
|
|
|
|
|
n_found++;
|
|
|
|
|
while (cat){
|
|
|
|
|
left_cats=cat+1;
|
|
|
|
|
char *fcat=app.Categories;//strstr(app.Categories,";");
|
|
|
|
|
char *fcat=app.Categories;
|
|
|
|
|
cat=strstr(cat+1,";");
|
|
|
|
|
if (!cat) break;
|
|
|
|
|
find_it=yon_cut(left_cats,(strlen(left_cats)-strlen(cat)),0);
|
|
|
|
|
@ -1027,9 +1005,6 @@ int setup_config(){
|
|
|
|
|
main_config.sections->next=NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if (main_config.windowWidth<1024&&main_config.windowHeight<720){
|
|
|
|
|
// main_config.WindowTheme=0;
|
|
|
|
|
// }
|
|
|
|
|
return 1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -1676,10 +1651,8 @@ dictionary *yon_dictionary_get_last(dictionary *dict){
|
|
|
|
|
return dct;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_main_quit(actionWidgets *widgets){
|
|
|
|
|
// GtkWindow *wnd=GTK_WINDOW(widgets->window);
|
|
|
|
|
// gtk_window_get_position(wnd,&main_config.windowPosX,&main_config.windowPosY);
|
|
|
|
|
// gtk_window_get_size(wnd,&main_config.windowWidth,&main_config.windowHeight);
|
|
|
|
|
void yon_main_quit(GtkWidget *,GdkEvent*,actionWidgets *widgets){
|
|
|
|
|
g_signal_handlers_disconnect_by_func(widgets->socket,on_plug_removed,widgets);
|
|
|
|
|
save_config(widgets);
|
|
|
|
|
gtk_main_quit();
|
|
|
|
|
}
|
|
|
|
|
@ -1720,6 +1693,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them
|
|
|
|
|
curWidgets->Revealer=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"Revealer")));
|
|
|
|
|
curWidgets->BackToSettingsLabel=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"BackToSettingsLabel")));
|
|
|
|
|
curWidgets->SettingsSections=main_config.SettingsSections;
|
|
|
|
|
curWidgets->socket=NULL;
|
|
|
|
|
if (main_config.BannerHidden==0){
|
|
|
|
|
gtk_revealer_set_reveal_child(GTK_REVEALER(curWidgets->Revealer),1);
|
|
|
|
|
gtk_menu_button_set_direction(GTK_MENU_BUTTON(curWidgets->BannerRevealer),GTK_ARROW_LEFT);
|
|
|
|
|
@ -1728,7 +1702,6 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them
|
|
|
|
|
gtk_widget_set_sensitive(curWidgets->MenuItemSettings,0);
|
|
|
|
|
}
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(curWidgets->icvpack),"iconview");
|
|
|
|
|
curWidgets->socket=GTK_WIDGET(create_socket(curWidgets));
|
|
|
|
|
if (curWidgets->ButtonBackToMain!=NULL)
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(curWidgets->BackToSettingsLabel),BACK_TO_ALL_SETTINGS_LABEL);
|
|
|
|
|
gtk_window_set_title(GTK_WINDOW(curWidgets->window),UBL_SETTINGS_MANAGER_TITLE);
|
|
|
|
|
@ -1738,10 +1711,6 @@ 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){
|
|
|
|
|
// g_signal_connect(G_OBJECT(curWidgets->window), "event-after", G_CALLBACK(on_resized_done), widgets);
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
if (curWidgets->ButtonBackToMain!=NULL)
|
|
|
|
|
g_signal_connect(G_OBJECT(curWidgets->ButtonBackToMain), "clicked", G_CALLBACK(on_backToSettingsButton_clicked), curWidgets);
|
|
|
|
|
gtk_window_set_title(GTK_WINDOW(curWidgets->window),UBL_SETTINGS_MANAGER_TITLE);
|
|
|
|
|
@ -1808,7 +1777,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them
|
|
|
|
|
g_signal_connect(G_OBJECT(curWidgets->settingsDoubleClickSwitch), "state-set", G_CALLBACK(on_double_click_changed), widgets);
|
|
|
|
|
}
|
|
|
|
|
gtk_widget_hide_on_delete(curWidgets->window);
|
|
|
|
|
g_signal_connect(G_OBJECT(curWidgets->window), "destroy", G_CALLBACK(yon_main_quit), curWidgets);
|
|
|
|
|
g_signal_connect(G_OBJECT(curWidgets->window), "delete-event", G_CALLBACK(yon_main_quit), curWidgets);
|
|
|
|
|
return widgets;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|