started creating of support for apps with pluggable separate button

pull/8/head
parent 84c7a6e84c
commit 2d666f2d85

@ -68,8 +68,9 @@ void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *appl
if (!tempapp){}else{ if (!tempapp){}else{
char arg[100]; char arg[100];
memset(arg,0,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[0].Type==2)
if (tempapp->Pluggable==1) if (tempapp->Pluggable==1)
py_launch_app(tempapp[0].Exec,arg); 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); apps *tempapp=get_app_by_name(applist->applist,name,applist->appssize);
char arg[100]; char arg[100];
memset(arg,0,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[0].Type==2)
if (tempapp->Pluggable==1) if (tempapp->Pluggable==1)
@ -366,6 +368,7 @@ void on_sections_accept(GtkWidget *button, actionWidgets *widgets){
} }
}; };
void on_sections_cancel(GtkWidget *button, actionWidgets *widgets){ void on_sections_cancel(GtkWidget *button, actionWidgets *widgets){
for (dictionary *dct=widgets->SettingsSections->first;dct!=NULL;dct=dct->next){ for (dictionary *dct=widgets->SettingsSections->first;dct!=NULL;dct=dct->next){
SectionSettingSegment *segment=(SectionSettingSegment*)dct->data; 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){ void on_sections_move_up(GtkWidget *button, actionWidgets *widgets){
for (dictionary *dct=widgets->SettingsSections->first;dct!=NULL;dct=dct->next){ for (dictionary *dct=widgets->SettingsSections->first;dct!=NULL;dct=dct->next){
SectionSettingSegment *segment=(SectionSettingSegment*)dct->data; 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){ void on_sections_add(GtkWidget *button, actionWidgets *widgets){
dictionary *dict=yon_dictionary_create_empty(); dictionary *dict=yon_dictionary_create_empty();
dictionary *dct=NULL; dictionary *dct=NULL;
@ -574,6 +579,7 @@ void on_section_delete(GtkWidget *button, actionWidgets *widgets){
} }
} }
} }
void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widgetsD){ void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widgetsD){
actionWidgets *widgets=(actionWidgets*)widgetsD->data; actionWidgets *widgets=(actionWidgets*)widgetsD->data;
int x,y; 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){ void on_about_system(GtkWidget *button, actionWidgets *widgets){
char *socket_id=malloc(sizeof(gtk_socket_get_id(GTK_SOCKET(widgets->socket)))/sizeof(int)); char arg[100];
sprintf(socket_id,"%d",gtk_socket_get_id(GTK_SOCKET(widgets->socket))); memset(arg,0,100);
socket_id=yon_char_get_augumented(ubl_settings_infoPathLaunch,socket_id); printf("%d\n%d\n\n\n\n",gtk_socket_get_id(GTK_SOCKET(widgets->socket)),gtk_socket_get_id(GTK_SOCKET(widgets->socketbutton)));
socket_id=yon_char_get_augumented(socket_id," &"); 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)));
system(socket_id); launch_app_with_arguments("ubl-settings-info",arg);
} }
void launch_app_with_arguments(char *name, char *args){ 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 *create_socket(actionWidgets *builder){
GtkWidget *socket; GtkWidget *socket;
socket = gtk_socket_new(); 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-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),"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(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->socketplace),socket,true,true,0);
gtk_box_pack_start(GTK_BOX(builder->socketbuttonplace),socketbutton,1,1,0);
builder->socketbutton=socketbutton;
return socket; return socket;
}; };
@ -851,7 +864,6 @@ int check_categories(apps app, char *catstocheck){
int setup_config(){ int setup_config(){
FILE *file; FILE *file;
GError *err=NULL; GError *err=NULL;
printf("1\n");
main_config.sections=malloc(sizeof(dictionary)); main_config.sections=malloc(sizeof(dictionary));
main_config.sections->data=NULL; main_config.sections->data=NULL;
main_config.sections->next=NULL; main_config.sections->next=NULL;
@ -860,9 +872,6 @@ int setup_config(){
GKeyFile *configfile = g_key_file_new(); GKeyFile *configfile = g_key_file_new();
char *pth=malloc(7+strlen(UserConfigPath)+strlen(getlogin())); char *pth=malloc(7+strlen(UserConfigPath)+strlen(getlogin()));
sprintf(pth,"%s%s%s","/home/",getlogin(),UserConfigPath); 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); g_key_file_load_from_file(configfile,pth,G_KEY_FILE_KEEP_TRANSLATIONS,&err);
if (err){ if (err){
g_error_free(err); g_error_free(err);
@ -875,7 +884,6 @@ int setup_config(){
} }
char *foroutput=NULL; char *foroutput=NULL;
char *line=NULL; char *line=NULL;
printf("1\n");
main_config.windowPosX=g_key_file_get_integer(configfile,"window","WindowPosX",NULL); 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.windowPosY=g_key_file_get_integer(configfile,"window","WindowPosY",NULL);
main_config.windowWidth=g_key_file_get_integer(configfile,"window","WindowWidth",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); main_config.iconSegmentSize=g_key_file_get_integer(configfile,"window","IconSegmentSize",NULL);
yon_icon_size_convert(0); yon_icon_size_convert(0);
gsize length=0; gsize length=0;
printf("1\n");
char **a=g_key_file_get_keys(configfile,"sections",&length,NULL); char **a=g_key_file_get_keys(configfile,"sections",&length,NULL);
if (!a){yon_set_default_sections(&main_config.sections);} else { if (!a){yon_set_default_sections(&main_config.sections);} else {
@ -896,12 +903,12 @@ int setup_config(){
main_config.sections->next=NULL; main_config.sections->next=NULL;
} }
printf("1\n");
if (main_config.windowWidth<1024&&main_config.windowHeight<720){ if (main_config.windowWidth<1024&&main_config.windowHeight<720){
main_config.WindowTheme=0; main_config.WindowTheme=0;
} }
return 1; return 1;
}; };
char *yon_cut(char *source, int size, int startpos){ char *yon_cut(char *source, int size, int startpos){
char *cut=NULL; char *cut=NULL;
cut=malloc(size+1); 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_widget_set_name(iv,"GnomeIcon");
gtk_icon_view_set_activate_on_single_click(GTK_ICON_VIEW(iv),1); 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); 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); 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->IV=iv;
IVG->label=label; IVG->label=label;
IVG->sep=sep; IVG->sep=sep;
return IVG; return IVG;
} }
@ -1098,6 +1108,7 @@ dictionary *yon_dictionary_find(dictionary **dict, char *key){
} }
return NULL; return NULL;
} }
void yon_switch_theme(dictionary **dict, dictionary *newone){ void yon_switch_theme(dictionary **dict, dictionary *newone){
dictionary *dct=*dict; dictionary *dct=*dict;
actionWidgets *widgets=(actionWidgets*)dct->data; actionWidgets *widgets=(actionWidgets*)dct->data;
@ -1149,7 +1160,6 @@ void yon_switch_theme(dictionary **dict, dictionary *newone){
} }
void yon_icon_size_convert(int mode){ void yon_icon_size_convert(int mode){
if (mode==0){ if (mode==0){
if (main_config.iconsize==1) main_config.iconsize=24; 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]!=';'){ if (categories[strlen(categories)-1]!=';'){
char *tmp=malloc(strlen(categories)+1); char *tmp=malloc(strlen(categories)+1);
sprintf(tmp,"%s;",categories); sprintf(tmp,"%s;",categories);
printf("\n\n");
categories=realloc(tmp,strlen(tmp)); categories=realloc(tmp,strlen(tmp));
} }
gtk_entry_set_text(GTK_ENTRY(segment->CategoriesEntry),categories); 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->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->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->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; curWidgets->SettingsSections=NULL;
gtk_style_context_add_class(gtk_widget_get_style_context(curWidgets->icvpack),"iconview"); gtk_style_context_add_class(gtk_widget_get_style_context(curWidgets->icvpack),"iconview");
curWidgets->socket=GTK_WIDGET(create_socket(curWidgets)); 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){ if (strcmp(theme_id,"Gnome")==0){
char *socket_id=malloc(sizeof(gtk_socket_get_id(GTK_SOCKET(curWidgets->socket)))/sizeof(int)); on_about_system(NULL,curWidgets);
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);
g_signal_connect(G_OBJECT(curWidgets->window), "configure-event", G_CALLBACK(on_resized), widgets); 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); g_signal_connect(G_OBJECT(curWidgets->window), "event-after", G_CALLBACK(on_resized_done), widgets);

@ -135,6 +135,8 @@ typedef struct {
GtkWidget *GnomeInfoDetailsLabel; GtkWidget *GnomeInfoDetailsLabel;
GtkWidget *CautionWindow; GtkWidget *CautionWindow;
GtkWidget *CautionUnderstandButton; GtkWidget *CautionUnderstandButton;
GtkWidget *socketbuttonplace;
GtkWidget *socketbutton;
int appssize; int appssize;
apps *applist; apps *applist;
GtkWidget *icvpack; GtkWidget *icvpack;

@ -1,55 +1,37 @@
.label { * {
font-size: 13px; padding: 1;
}
.noborder{
border:none;
border-width:0px;
border-radius:0px;
box-shadow: none;
}
.darkborder{
border-width:1px;
border-radius:1px;
} }
.bannerbackground { .bannerbackground {
background-color: #404040; 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-style:solid;
border-bottom-width: 1px; border-bottom-width: 1px;
border-image: linear-gradient(90deg, #aaaaaa 0%, #dcddde 100%); border-image: linear-gradient(90deg, #aaaaaa 0%, #dcddde 100%);
border-image-slice: 1; border-image-slice: 1;
background-color: transparent; background-color: black;
}
#noborders{
border-style:solid;
border: 0px;
} }
#iconlabel { #iconlabel {
font-size:14px; font-size:14px;
font-weight: bold; font-weight: bold;
} }
GtkIconView.view {
#desclabel {
font-size:100%; background-color: #000000;
} color: #000000;
.bold {
color:#1a5fb4;
}
iconview {
background-image:none;
} }
GtkIconView.view.cell:selected,
GtkIconView.view.cell:selected:focus {
background-color: #bababa;
border-style: solid;
border-radius: 10px;
border-width: 3px;
border-color: #ffffff;
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save