|
|
|
|
@ -68,7 +68,8 @@ 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)
|
|
|
|
|
@ -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);
|
|
|
|
|
|
|
|
|
|
|