diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 1582f15..dfe83a4 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -40,7 +40,7 @@ int cmld=0; void on_plug_added(GtkSocket* self, actionWidgets *builder){ gtk_widget_show(builder->socketbutton); gtk_widget_show(builder->ThirdSocket); - printf("Plug has been added!\n"); + // printf("Plug has been added!\n"); gtk_widget_set_vexpand(builder->HideWhileLaunch,0); gtk_widget_hide(builder->HideWhileLaunch); gtk_widget_set_vexpand(GTK_WIDGET(builder->socketplace),1); @@ -57,7 +57,7 @@ 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); - printf("Plug has been removed!\n\n\n"); + // printf("Plug has been removed!\n\n\n"); if(widgets->socketbutton) gtk_widget_destroy(widgets->socketbutton); if(widgets->ThirdSocket) @@ -67,19 +67,19 @@ void on_plug_removed(GtkSocket* self, actionWidgets *widgets){ } void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *applist){ - printf("\n\n\nActivated\n\n\n"); + // printf("\n\n\nActivated\n\n\n"); GtkTreeIter iter; char *name; gtk_tree_model_get_iter(gtk_icon_view_get_model(self),&iter,path); gtk_tree_model_get(gtk_icon_view_get_model(self),&iter,1,&name,-1); apps *tempapp=get_app_by_name(applist->applist,name,applist->appssize); - printf("%s\n",tempapp->Name); + // printf("%s\n",tempapp->Name); if (!tempapp){}else{ char arg[100]; - printf("%s\n",tempapp->Exec); - printf("%d\n",tempapp->Type); - printf("%d\n",tempapp->Pluggable); + // printf("%s\n",tempapp->Exec); + // printf("%d\n",tempapp->Type); + // printf("%d\n",tempapp->Pluggable); memset(arg,0,100); 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",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton))); @@ -184,7 +184,7 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){ else if (main_config.WindowTheme==1) main_config.curThemeName="Gnome"; dictionary *widgetsD=yon_dictionary_find(widgetsDs,main_config.curThemeName); - printf("Saving config...\n"); + // 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); @@ -214,7 +214,7 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){ memset(fromint,0,5); GError *err=NULL; char *login=getlogin(); - if (strcmp(login,"root")==0){ + if (geteuid()==0){ login=main_config.lastUser; } else { main_config.lastUser=login; @@ -653,7 +653,7 @@ void on_resized_done (GtkWidget *window, GdkEvent *event, dictionary *widgetsD){ void on_about_system(GtkWidget *button, actionWidgets *widgets){ 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))); + // 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); } @@ -666,7 +666,7 @@ void launch_app_with_arguments(char *name, char *args){ char *path=yon_char_get_augumented("/bin/",name); path=yon_char_get_augumented(path," "); path=yon_char_get_augumented(path,args); - printf("%s\n",path); + // printf("%s\n",path); pthread_t thread_id; pthread_create(&thread_id, NULL, (void*)launch, path); }; @@ -1491,7 +1491,7 @@ int main(int argc, char *argv[]){ return -1; } local=setlocale(LC_ALL, ""); - printf("%s\n\n\n",bindtextdomain (LocaleName, LocalePath)); + // printf("%s\n\n\n",bindtextdomain (LocaleName, LocalePath)); textdomain (LocaleName); actionWidgets *widget=malloc(sizeof(actionWidgets)); dictionary *widgets=yon_dictionary_create_empty(); @@ -1559,9 +1559,11 @@ int main(int argc, char *argv[]){ main_config.WindowTheme=0; yon_icv_resize_item(widg->ICSys,widg->GnomePaned); } - - 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")); + if (geteuid()==0){ + gtk_widget_set_sensitive(widg->settingsSectionsSettingsButton,1); + } + 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); diff --git a/ubconfig-main.conf b/ubconfig-main.conf index ab0f139..4d5b3a4 100644 --- a/ubconfig-main.conf +++ b/ubconfig-main.conf @@ -1,17 +1,17 @@ [window] WindowPosX=0 WindowPosY=0 -WindowWidth=1920 -WindowHeight=1004 +WindowWidth=800 +WindowHeight=600 WindowTheme=0 IconSize=2 -IconSegmentSize=321 +IconSegmentSize=250 LabelSize=12 LabelDensity=0 User= [sections] -Personal=XFCE; +Personal=X-UBL-SettingsManager;X-UBL-PersonalSettings; Hardware=X-UBL-SettingsManager;X-UBL-HardwareSettings; System=X-UBL-SettingsManager;X-UBL-SystemSettings; Misc= diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index 95ca9bd..8566978 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -629,6 +629,7 @@ Sections management True + False True True 10