|
|
|
|
@ -151,13 +151,18 @@ void on_ReadHelpButton_activated(GtkWidget *button, GtkBuilder *builder){
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){
|
|
|
|
|
dictionary *widgetsD=*widgetsDs;
|
|
|
|
|
if (main_config.WindowTheme==0)
|
|
|
|
|
main_config.curThemeName="Main";
|
|
|
|
|
else if (main_config.WindowTheme==1)
|
|
|
|
|
main_config.curThemeName="Gnome";
|
|
|
|
|
dictionary *widgetsD=yon_dictionary_find(widgetsDs,main_config.curThemeName);
|
|
|
|
|
printf("Saving config...\n");
|
|
|
|
|
|
|
|
|
|
actionWidgets *widgets=(actionWidgets*)widgetsD->data;
|
|
|
|
|
|
|
|
|
|
int theme=gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->settingsThemeChooser));
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
if (theme==0)
|
|
|
|
|
main_config.curThemeName="Main";
|
|
|
|
|
else if (theme==1)
|
|
|
|
|
@ -170,13 +175,13 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){
|
|
|
|
|
gtk_window_move(GTK_WINDOW(loaderWindow),main_config.windowPosX,main_config.windowPosY);
|
|
|
|
|
|
|
|
|
|
gtk_widget_show(loaderWindow);
|
|
|
|
|
gtk_window_present(GTK_WINDOW(widgets->SettingsWindow));
|
|
|
|
|
// 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_widget_show(widgets->window);
|
|
|
|
|
gtk_widget_hide(loaderWindow);
|
|
|
|
|
// main_config.WindowTheme=theme;
|
|
|
|
|
gtk_window_present(GTK_WINDOW(widgets->SettingsWindow));
|
|
|
|
|
}
|
|
|
|
|
GKeyFile *gfile=g_key_file_new();
|
|
|
|
|
int sz;
|
|
|
|
|
@ -212,6 +217,7 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){
|
|
|
|
|
|
|
|
|
|
void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *widgets){ /* TODO */
|
|
|
|
|
int position=gtk_paned_get_position(GTK_PANED(widgets->GnomePaned));
|
|
|
|
|
main_config.iconSegmentSize=position;
|
|
|
|
|
if (position <115) position=115;
|
|
|
|
|
double pos=((double)position-(1/(double)position*4)*500)/1.8;
|
|
|
|
|
if (pos<110) pos=110;
|
|
|
|
|
@ -547,10 +553,51 @@ 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_size()
|
|
|
|
|
gtk_window_get_size(GTK_WINDOW(widgets->window),&main_config.windowWidth,&main_config.windowHeight);
|
|
|
|
|
int x,y;
|
|
|
|
|
gtk_window_get_size(GTK_WINDOW(window),&main_config.windowWidth,&main_config.windowHeight);
|
|
|
|
|
if (main_config.windowWidth<1024){
|
|
|
|
|
if (stld==0){
|
|
|
|
|
stld=1;
|
|
|
|
|
char *details=gtk_label_get_label(GTK_LABEL(widgets->GnomeInfoDetailsLabel));
|
|
|
|
|
//gtk_window_set_resizable(GTK_WINDOW(window),0);
|
|
|
|
|
// yon_switch_theme(&widgetsD,yon_dictionary_find(&widgetsD,"Main"));
|
|
|
|
|
details[12]='0';
|
|
|
|
|
details[13]='9';
|
|
|
|
|
printf("SSSSS\n");
|
|
|
|
|
gtk_label_set_markup(GTK_LABEL(widgets->GnomeInfoDetailsLabel),details);
|
|
|
|
|
GtkWidget *logo = gtk_builder_get_object(widgets->builder,"GnomeInfoLogo");
|
|
|
|
|
gtk_image_set_from_pixbuf(GTK_IMAGE(logo),gdk_pixbuf_new_from_file_at_scale(LogoPath,256,256,1,NULL));
|
|
|
|
|
// gtk_window_resize(GTK_WINDOW(widgets->window),main_config.windowWidth,main_config.windowHeight);
|
|
|
|
|
// gtk_widget_hide(widgets->window);
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
if (stld==1){
|
|
|
|
|
stld=0;
|
|
|
|
|
char *details=gtk_label_get_label(GTK_LABEL(widgets->GnomeInfoDetailsLabel));
|
|
|
|
|
details[12]='1';
|
|
|
|
|
details[13]='2';
|
|
|
|
|
printf("SSSSS\n");
|
|
|
|
|
gtk_label_set_markup(GTK_LABEL(widgets->GnomeInfoDetailsLabel),details);
|
|
|
|
|
GtkWidget *logo = gtk_builder_get_object(widgets->builder,"GnomeInfoLogo");
|
|
|
|
|
gtk_image_set_from_pixbuf(GTK_IMAGE(logo),gdk_pixbuf_new_from_file_at_scale(LogoPath,512,512,1,NULL));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_resized_done (GtkWidget *window, GdkEvent *event, dictionary *widgetsD){
|
|
|
|
|
actionWidgets *widgets=(actionWidgets*)widgetsD->data;
|
|
|
|
|
if (event->type==GDK_CONFIGURE){
|
|
|
|
|
int x,y;
|
|
|
|
|
gtk_window_get_size(GTK_WINDOW(window),&x,&y);
|
|
|
|
|
if (x<1024&&y<720){
|
|
|
|
|
gtk_window_set_resizable(GTK_WINDOW(window),1);
|
|
|
|
|
printf("AAAAA\n");
|
|
|
|
|
// gtk_widget_hide(widgets->window);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void launch_app_with_arguments(char *name, char *args){
|
|
|
|
|
char *path=malloc(strlen(name)+strlen(args)+4);
|
|
|
|
|
memset(path,0,strlen(name)+strlen(args)+4);
|
|
|
|
|
@ -1124,16 +1171,13 @@ dictionary *yon_dictionary_find(dictionary **dict, char *key){
|
|
|
|
|
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;
|
|
|
|
|
@ -1143,14 +1187,18 @@ void yon_switch_theme(dictionary **dict, dictionary *newone){
|
|
|
|
|
dictionary *founddict=yon_dictionary_find(dict,"Main");
|
|
|
|
|
dct=yon_dictionary_find(dict,"Gnome");
|
|
|
|
|
yon_switch_theme(&dct,founddict);
|
|
|
|
|
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);
|
|
|
|
|
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";
|
|
|
|
|
gtk_widget_show(widgets->window);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
gtk_widget_show(widgets->window);
|
|
|
|
|
main_config.WindowTheme=0;
|
|
|
|
|
main_config.curThemeName="Main";
|
|
|
|
|
}
|
|
|
|
|
@ -1328,7 +1376,6 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them
|
|
|
|
|
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];
|
|
|
|
|
@ -1360,7 +1407,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them
|
|
|
|
|
line=yon_char_get_augumented(pth,line);
|
|
|
|
|
} else {
|
|
|
|
|
line=path;
|
|
|
|
|
pth="<span size=\"14pt\">\n";
|
|
|
|
|
pth="<span size=\"12pt\">\n";
|
|
|
|
|
line=yon_char_get_augumented(pth,line);
|
|
|
|
|
}
|
|
|
|
|
prevline=yon_char_get_augumented(prevline,line);
|
|
|
|
|
@ -1377,15 +1424,20 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them
|
|
|
|
|
gtk_button_set_label(GTK_BUTTON(curWidgets->ButtonBackToMain),_("Back to settings"));
|
|
|
|
|
gtk_window_set_title(GTK_WINDOW(curWidgets->window),"UBLinux Settings Manager");
|
|
|
|
|
g_signal_connect(G_OBJECT(curWidgets->window), "destroy", G_CALLBACK(gtk_main_quit), NULL);
|
|
|
|
|
if (curWidgets->GnomePaned!=NULL){
|
|
|
|
|
g_signal_connect(G_OBJECT(curWidgets->GnomePaned), "notify::position", G_CALLBACK(on_paned_move), curWidgets);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (strcmp(theme_id,"Gnome")==0){
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (curWidgets->ButtonBackToMain!=NULL)
|
|
|
|
|
g_signal_connect(G_OBJECT(curWidgets->ButtonBackToMain), "clicked", G_CALLBACK(on_backToSettingsButton_clicked), curWidgets);
|
|
|
|
|
curWidgets->LabelTitle=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"LabelTitle"));
|
|
|
|
|
gtk_window_set_title(GTK_WINDOW(curWidgets->window),"UBLinux Settings Manager GNOME");
|
|
|
|
|
if (curWidgets->GnomePaned!=NULL){
|
|
|
|
|
g_signal_connect(G_OBJECT(curWidgets->GnomePaned), "notify::position", G_CALLBACK(on_paned_move), curWidgets);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Standard for all themes
|
|
|
|
|
|
|
|
|
|
curWidgets->settingsThemeChooser=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"settingsThemeChooser"));
|
|
|
|
|
@ -1524,6 +1576,7 @@ int main(int argc, char *argv[]){
|
|
|
|
|
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_window_maximize(GTK_WINDOW(widg->window));
|
|
|
|
|
gtk_widget_show_all(widg->window);
|
|
|
|
|
|
|
|
|
|
GtkCssProvider *css=gtk_css_provider_new();
|
|
|
|
|
|