|
|
|
|
@ -528,28 +528,38 @@ void on_root_access(GtkWidget *, GtkWidget *window){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_root_button_setup(template_main_window *widgets, config_str args, int args_size){
|
|
|
|
|
void yon_root_button_init(GtkWidget *root_item,GtkWindow *window){
|
|
|
|
|
g_signal_connect(G_OBJECT(root_item),"activate", G_CALLBACK(on_root_access),window);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GtkWidget *yon_root_button_new(config_str args, int args_size){
|
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
|
arg_size=args_size;
|
|
|
|
|
arg_target=args;
|
|
|
|
|
GtkWidget *root_item = gtk_menu_item_new();
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(root_item),"menuitemtop");
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(widgets->DocumentationMenuItem),"menuitemmiddle");
|
|
|
|
|
gtk_style_context_remove_class(gtk_widget_get_style_context(widgets->DocumentationMenuItem),"menuitemtop");
|
|
|
|
|
GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5);
|
|
|
|
|
GtkWidget *root_label = gtk_label_new(ROOT_CHECK_LABEL);
|
|
|
|
|
GtkWidget *root_check = gtk_check_button_new();
|
|
|
|
|
gtk_menu_shell_prepend(GTK_MENU_SHELL(gtk_widget_get_parent(widgets->DocumentationMenuItem)),root_item);
|
|
|
|
|
gtk_box_pack_start(GTK_BOX(box),root_label,1,1,0);
|
|
|
|
|
gtk_box_pack_start(GTK_BOX(box),root_check,0,0,0);
|
|
|
|
|
gtk_container_add(GTK_CONTAINER(root_item),box);
|
|
|
|
|
gtk_widget_show_all(root_item);
|
|
|
|
|
g_signal_connect(G_OBJECT(root_item),"activate", G_CALLBACK(on_root_access),widgets->Window);
|
|
|
|
|
if (getuid()==0) {
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(root_check),1);
|
|
|
|
|
gtk_widget_set_sensitive(root_item,0);
|
|
|
|
|
}
|
|
|
|
|
textdomain(template_app_information.app_locale);
|
|
|
|
|
return root_item;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_root_button_setup(template_main_window *widgets, config_str args, int args_size){
|
|
|
|
|
GtkWidget *root_item = yon_root_button_new(args,args_size);
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(widgets->DocumentationMenuItem),"menuitemmiddle");
|
|
|
|
|
gtk_style_context_remove_class(gtk_widget_get_style_context(widgets->DocumentationMenuItem),"menuitemtop");
|
|
|
|
|
gtk_menu_shell_prepend(GTK_MENU_SHELL(gtk_widget_get_parent(widgets->DocumentationMenuItem)),root_item);
|
|
|
|
|
g_signal_connect(G_OBJECT(root_item),"activate", G_CALLBACK(on_root_access),widgets->Window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void __yon_config_init(){
|
|
|
|
|
|