|
|
|
|
@ -171,28 +171,12 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){
|
|
|
|
|
|
|
|
|
|
gtk_widget_show(loaderWindow);
|
|
|
|
|
gtk_window_present(GTK_WINDOW(widgets->SettingsWindow));
|
|
|
|
|
gtk_widget_hide(widgets->window);
|
|
|
|
|
if (yon_dictionary_find(&widgetsD,main_config.curThemeName)==NULL){
|
|
|
|
|
dictionary *DCT=yon_dictionary_create_empty();
|
|
|
|
|
widgetsD->next=yon_theme_new(&DCT,widgets->builder,main_config.curThemeName,widgets->applist,widgets->appssize);
|
|
|
|
|
widgetsD->next->prev=widgetsD;
|
|
|
|
|
|
|
|
|
|
yon_switch_theme(widgetsDs,yon_dictionary_find(&widgetsD,main_config.curThemeName));
|
|
|
|
|
widgets=(actionWidgets*)widgetsD->data;
|
|
|
|
|
widgets->ICSys=yon_create_icon_section_list(main_config.sections);
|
|
|
|
|
for (dictionary *cur=widgets->ICSys->first; cur!=NULL;cur=cur->next){
|
|
|
|
|
load_apps((IVGraphicals*)cur->data,widgets->applist,widgets->appssize);
|
|
|
|
|
}
|
|
|
|
|
yon_show_icon_views(widgets->ICSys,widgets);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// gtk_widget_hide(widgets->window);
|
|
|
|
|
yon_switch_theme(widgetsDs,yon_dictionary_find(&widgetsD,main_config.curThemeName));
|
|
|
|
|
if (widgets!=(actionWidgets*)widgetsD->data) widgets=(actionWidgets*)widgetsD->data;
|
|
|
|
|
gtk_window_resize(GTK_WINDOW(widgets->window),main_config.windowWidth,main_config.windowHeight);
|
|
|
|
|
gtk_window_move(GTK_WINDOW(widgets->window),main_config.windowPosX,main_config.windowPosY);
|
|
|
|
|
gtk_widget_show(widgets->window);
|
|
|
|
|
// gtk_widget_show(widgets->window);
|
|
|
|
|
gtk_widget_hide(loaderWindow);
|
|
|
|
|
main_config.WindowTheme=theme;
|
|
|
|
|
// main_config.WindowTheme=theme;
|
|
|
|
|
}
|
|
|
|
|
GKeyFile *gfile=g_key_file_new();
|
|
|
|
|
int sz;
|
|
|
|
|
@ -563,68 +547,8 @@ void on_section_delete(GtkWidget *button, actionWidgets *widgets){
|
|
|
|
|
}
|
|
|
|
|
void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widgetsD){
|
|
|
|
|
actionWidgets *widgets=(actionWidgets*)widgetsD->data;
|
|
|
|
|
gtk_window_get_position(GTK_WINDOW(widgets->window),&main_config.windowPosX,&main_config.windowPosY);
|
|
|
|
|
gtk_window_get_size(GTK_WINDOW(widgets->window),&main_config.windowWidth,&main_config.windowHeight);
|
|
|
|
|
dictionary *dct;
|
|
|
|
|
if (yon_dictionary_find(&widgetsD,"Main")==NULL){
|
|
|
|
|
dct=yon_dictionary_create_empty();
|
|
|
|
|
dictionary *newd=yon_theme_new(&dct,widgets->builder,"Main", widgets->applist,widgets->appssize);
|
|
|
|
|
widgetsD->next=newd;
|
|
|
|
|
newd->prev=widgetsD;
|
|
|
|
|
newd->first=widgetsD;
|
|
|
|
|
actionWidgets *widgetss=(actionWidgets*)widgetsD->data;
|
|
|
|
|
widgetss->ICSys=yon_create_icon_section_list(main_config.sections);
|
|
|
|
|
for (dictionary *cur=widgetss->ICSys->first; cur!=NULL;cur=cur->next){
|
|
|
|
|
load_apps((IVGraphicals*)cur->data,widgetss->applist,widgetss->appssize);
|
|
|
|
|
}
|
|
|
|
|
yon_show_icon_views(widgetss->ICSys,widgetss);
|
|
|
|
|
}
|
|
|
|
|
dictionary *newdd;
|
|
|
|
|
if (yon_dictionary_find(&widgetsD,"Gnome")==NULL){
|
|
|
|
|
newdd=yon_theme_new(&dct,widgets->builder,"Gnome", widgets->applist,widgets->appssize);
|
|
|
|
|
widgetsD->next=newdd;
|
|
|
|
|
newdd->prev=widgetsD;
|
|
|
|
|
newdd->first=widgetsD;
|
|
|
|
|
actionWidgets *widgetss=(actionWidgets*)widgetsD->data;
|
|
|
|
|
widgetss->ICSys=yon_create_icon_section_list(main_config.sections);
|
|
|
|
|
for (dictionary *cur=widgetss->ICSys->first; cur!=NULL;cur=cur->next){
|
|
|
|
|
load_apps((IVGraphicals*)cur->data,widgetss->applist,widgetss->appssize);
|
|
|
|
|
}
|
|
|
|
|
yon_show_icon_views(widgetss->ICSys,widgetss);
|
|
|
|
|
}
|
|
|
|
|
if (main_config.WindowTheme==1){
|
|
|
|
|
printf("\nAaAaAaAa\n");
|
|
|
|
|
actionWidgets *widgetss=(actionWidgets*)widgetsD->data;
|
|
|
|
|
GtkWidget *loaderWindow=GTK_WIDGET(gtk_builder_get_object(widgets->builder,"LoaderWindow"));
|
|
|
|
|
// gtk_window_resize(GTK_WINDOW(widgetss->window),main_config.windowWidth,main_config.windowHeight);
|
|
|
|
|
widgetsD=yon_dictionary_find(&widgetsD,"Gnome");
|
|
|
|
|
if (gtk_widget_get_visible(widgetss->window)==1){
|
|
|
|
|
widgetsD=yon_dictionary_find(&widgetsD,"Gnome");
|
|
|
|
|
gtk_window_resize(GTK_WINDOW(widgetss->window),1025,721);
|
|
|
|
|
if (main_config.windowWidth<1024&&main_config.windowHeight<720){
|
|
|
|
|
gtk_widget_hide(widgetss->window);
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgetss->settingsThemeChooser),0);
|
|
|
|
|
widgetsD=yon_dictionary_find(&widgetsD,"Main");
|
|
|
|
|
actionWidgets *widgetss=(actionWidgets*)widgetsD->data;
|
|
|
|
|
// gtk_window_resize(GTK_WINDOW(widgetss->window),1023,719);
|
|
|
|
|
gtk_widget_show(widgetss->window);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
widgetsD=yon_dictionary_find(&widgetsD,"Main");
|
|
|
|
|
gtk_window_resize(GTK_WINDOW(widgetss->window),1024,720);
|
|
|
|
|
if (main_config.windowWidth>1024&&main_config.windowHeight>720){
|
|
|
|
|
gtk_widget_hide(widgetss->window);
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgetss->settingsThemeChooser),1);
|
|
|
|
|
widgetsD=yon_dictionary_find(&widgetsD,"Gnome");
|
|
|
|
|
actionWidgets *widgetss=(actionWidgets*)widgetsD->data;
|
|
|
|
|
// gtk_window_resize(GTK_WINDOW(widgetss->window),1025,721);
|
|
|
|
|
gtk_widget_show(widgetss->window);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk_window_get_size()
|
|
|
|
|
gtk_window_get_size(GTK_WINDOW(widgets->window),&main_config.windowWidth,&main_config.windowHeight);
|
|
|
|
|
}
|
|
|
|
|
void launch_app_with_arguments(char *name, char *args){
|
|
|
|
|
@ -734,7 +658,6 @@ void sort_apps(apps *applist,int size){
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
apps *find_apps(int *sizef){
|
|
|
|
|
|
|
|
|
|
int size=0;
|
|
|
|
|
struct apps *applist;
|
|
|
|
|
{
|
|
|
|
|
@ -754,7 +677,6 @@ apps *find_apps(int *sizef){
|
|
|
|
|
if (strcmp(extension,".desktop")==0)
|
|
|
|
|
{
|
|
|
|
|
apps tempapp;
|
|
|
|
|
|
|
|
|
|
GKeyFile *gfile=g_key_file_new();
|
|
|
|
|
g_key_file_load_from_file(gfile,path,G_KEY_FILE_KEEP_TRANSLATIONS,NULL);
|
|
|
|
|
char *Type=g_key_file_get_string(gfile,"Desktop Entry", "Type",NULL);
|
|
|
|
|
@ -845,7 +767,6 @@ int check_categories(apps app, char *catstocheck){
|
|
|
|
|
n_found++;
|
|
|
|
|
left_cats=cat+1;
|
|
|
|
|
if (strlen(left_cats)==0 ||strcmp(left_cats,'\0')==0) break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (to_find==n_found) return 1; else return 0;
|
|
|
|
|
}
|
|
|
|
|
@ -1201,7 +1122,40 @@ 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;
|
|
|
|
|
gtk_widget_hide(widgets->window);
|
|
|
|
|
gtk_window_get_position(GTK_WINDOW(widgets->window),&main_config.windowPosX,&main_config.windowPosY);
|
|
|
|
|
gtk_window_get_size(GTK_WINDOW(widgets->window),&main_config.windowWidth,&main_config.windowHeight);
|
|
|
|
|
*dict=newone;
|
|
|
|
|
dct=*dict;
|
|
|
|
|
widgets=(actionWidgets*)dct->data;
|
|
|
|
|
gtk_window_resize(GTK_WINDOW(widgets->window),main_config.windowWidth,main_config.windowHeight);
|
|
|
|
|
gtk_window_move(GTK_WINDOW(widgets->window),main_config.windowPosX,main_config.windowPosY);
|
|
|
|
|
gtk_window_maximize(GTK_WINDOW(widgets->window));
|
|
|
|
|
gtk_widget_show(widgets->window);
|
|
|
|
|
if (strcmp(dct->key,"Gnome")==0){
|
|
|
|
|
int x,y;
|
|
|
|
|
GdkRectangle workarea;
|
|
|
|
|
gdk_monitor_get_workarea(gdk_display_get_monitor(gdk_screen_get_display(gtk_window_get_screen(GTK_WINDOW(widgets->window))),0),&workarea);
|
|
|
|
|
gtk_window_get_size(GTK_WINDOW(widgets->window),&x, &y);
|
|
|
|
|
if (workarea.width<1024&&workarea.height<720||x<1024&&y<720){
|
|
|
|
|
dictionary *founddict=yon_dictionary_find(dict,"Main");
|
|
|
|
|
dct=yon_dictionary_find(dict,"Gnome");
|
|
|
|
|
yon_switch_theme(&dct,founddict);
|
|
|
|
|
main_config.WindowTheme=0;
|
|
|
|
|
main_config.curThemeName="Main";
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->settingsThemeChooser),0);
|
|
|
|
|
} else{
|
|
|
|
|
main_config.WindowTheme=1;
|
|
|
|
|
main_config.curThemeName="Gnome";
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
main_config.WindowTheme=0;
|
|
|
|
|
main_config.curThemeName="Main";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SectionSettingSegment *yon_create_section_setting(char *name, char *categories){
|
|
|
|
|
@ -1373,6 +1327,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");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gtk_window_maximize(GTK_WINDOW(curWidgets->window));
|
|
|
|
|
if (curWidgets->GnomeInfoLabel!=NULL&&curWidgets->GnomeInfoDetailsLabel!=NULL){
|
|
|
|
|
FILE *fp;
|
|
|
|
|
char path[1035];
|
|
|
|
|
@ -1504,34 +1460,71 @@ int main(int argc, char *argv[]){
|
|
|
|
|
bindtextdomain (LocaleName, LocalePath);
|
|
|
|
|
textdomain (LocaleName);
|
|
|
|
|
actionWidgets *widget=malloc(sizeof(actionWidgets));
|
|
|
|
|
dictionary *widgets=malloc(sizeof(dictionary));
|
|
|
|
|
dictionary *widgets=yon_dictionary_create_empty();
|
|
|
|
|
widgets->data=widget;
|
|
|
|
|
widgets->first=widgets;
|
|
|
|
|
widgets->next=NULL;
|
|
|
|
|
widgets->prev=NULL;
|
|
|
|
|
int *size=malloc(sizeof(int));
|
|
|
|
|
apps *applist=find_apps(size);
|
|
|
|
|
sort_apps(applist,*size);
|
|
|
|
|
GtkBuilder *builder=gtk_builder_new_from_file(GladePath);
|
|
|
|
|
actionWidgets *widg=(actionWidgets*)widgets->first->data;
|
|
|
|
|
char *theme;
|
|
|
|
|
if (main_config.WindowTheme==0) theme="Main";
|
|
|
|
|
else if (main_config.WindowTheme==1) theme="Gnome";
|
|
|
|
|
else theme="Main";
|
|
|
|
|
yon_theme_new(&widgets->first, builder,theme,applist,*size);
|
|
|
|
|
widg->applist=applist;
|
|
|
|
|
widg->appssize=*size;
|
|
|
|
|
widg->ICSys=yon_create_icon_section_list(main_config.sections);
|
|
|
|
|
for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){
|
|
|
|
|
load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize);
|
|
|
|
|
if (main_config.WindowTheme==1){ theme="Gnome";
|
|
|
|
|
yon_theme_new(&widgets->first, builder,theme,applist,*size);
|
|
|
|
|
widg->applist=applist;
|
|
|
|
|
widg->appssize=*size;
|
|
|
|
|
widg->ICSys=yon_create_icon_section_list(main_config.sections);
|
|
|
|
|
for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){
|
|
|
|
|
load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize);
|
|
|
|
|
}
|
|
|
|
|
yon_show_icon_views(widg->ICSys,widg);
|
|
|
|
|
theme="Main";
|
|
|
|
|
main_config.WindowTheme=0;
|
|
|
|
|
widgets->next=yon_dictionary_create_empty();
|
|
|
|
|
widgets->next->first=widgets;
|
|
|
|
|
widgets->next->prev=widgets;
|
|
|
|
|
yon_theme_new(&widgets->next, builder,theme,applist,*size);
|
|
|
|
|
widg=(actionWidgets*)widgets->next->data;
|
|
|
|
|
widg->applist=applist;
|
|
|
|
|
widg->appssize=*size;
|
|
|
|
|
widg->ICSys=yon_create_icon_section_list(main_config.sections);
|
|
|
|
|
for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){
|
|
|
|
|
load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize);
|
|
|
|
|
}
|
|
|
|
|
yon_show_icon_views(widg->ICSys,widg);
|
|
|
|
|
main_config.WindowTheme=1;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {theme="Main";
|
|
|
|
|
yon_theme_new(&widgets->first, builder,theme,applist,*size);
|
|
|
|
|
widg->applist=applist;
|
|
|
|
|
widg->appssize=*size;
|
|
|
|
|
widg->ICSys=yon_create_icon_section_list(main_config.sections);
|
|
|
|
|
for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){
|
|
|
|
|
load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize);
|
|
|
|
|
}
|
|
|
|
|
yon_show_icon_views(widg->ICSys,widg);
|
|
|
|
|
theme="Gnome";
|
|
|
|
|
main_config.WindowTheme=1;
|
|
|
|
|
widgets->next=yon_dictionary_create_empty();
|
|
|
|
|
widgets->next->first=widgets;
|
|
|
|
|
widgets->next->prev=widgets;
|
|
|
|
|
yon_theme_new(&widgets->next, builder,theme,applist,*size);
|
|
|
|
|
widg=(actionWidgets*)widgets->next->data;
|
|
|
|
|
widg->applist=applist;
|
|
|
|
|
widg->appssize=*size;
|
|
|
|
|
widg->ICSys=yon_create_icon_section_list(main_config.sections);
|
|
|
|
|
for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){
|
|
|
|
|
load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize);
|
|
|
|
|
}
|
|
|
|
|
yon_show_icon_views(widg->ICSys,widg);
|
|
|
|
|
main_config.WindowTheme=0;
|
|
|
|
|
}
|
|
|
|
|
yon_show_icon_views(widg->ICSys,widg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_widget_show_all(widg->window);
|
|
|
|
|
// hide_if_unfound(GTK_TREE_MODEL(widgets->ModelPersonal),&Personal);
|
|
|
|
|
|
|
|
|
|
GtkCssProvider *css=gtk_css_provider_new();
|
|
|
|
|
gtk_css_provider_load_from_path(css,CssPath,NULL);
|
|
|
|
|
|