Enlightenment CVS committal

Author  : chaos
Project : e17
Module  : proto

Dir     : e17/proto/entropy/src/dialogs


Modified Files:
        etk_properties_dialog.c 


Log Message:
* Correct permissions parsing

===================================================================
RCS file: /cvs/e/e17/proto/entropy/src/dialogs/etk_properties_dialog.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- etk_properties_dialog.c     4 Apr 2006 11:56:00 -0000       1.4
+++ etk_properties_dialog.c     5 Apr 2006 02:10:54 -0000       1.5
@@ -31,11 +31,15 @@
        Etk_Widget* icon;
        Etk_Widget* label;
        Etk_Widget* pvbox;
+       char* perms;
 
        /*First up, add a reference to this file*/
        printf("Adding reference to '%s/%s'- > %s\n", file->path, 
file->filename, file->md5);
        entropy_core_file_cache_add_reference(file->md5);
 
+       /*Retrieve file permissions*/
+       perms = entropy_generic_file_display_permissions_parse(file);
+
        dialog = entropy_malloc(sizeof(Entropy_Etk_Properties_Dialog));
        dialog->file = file;
 
@@ -52,18 +56,18 @@
        etk_box_pack_start(ETK_BOX(vbox), notebook, ETK_TRUE, ETK_TRUE, 0);
 
        /*Main page*/
-       ivbox = etk_vbox_new(ETK_TRUE,0);       
+       ivbox = etk_vbox_new(ETK_FALSE,0);      
        etk_notebook_page_append(ETK_NOTEBOOK(notebook), "General", ivbox);
 
-       hbox = etk_hbox_new(ETK_TRUE,0);
-       etk_box_pack_end(ETK_BOX(ivbox), hbox, ETK_FALSE, ETK_FALSE, 0);
+       hbox = etk_hbox_new(ETK_FALSE,0);
+       etk_box_pack_start(ETK_BOX(ivbox), hbox, ETK_FALSE, ETK_FALSE, 0);
 
        if (file->thumbnail) {
                icon = 
etk_image_new_from_file(file->thumbnail->thumbnail_filename);
                etk_box_pack_start(ETK_BOX(hbox), icon, ETK_FALSE, ETK_FALSE, 
0);
        }
 
-       pvbox = etk_vbox_new(ETK_TRUE,0);
+       pvbox = etk_vbox_new(ETK_FALSE,0);
        etk_box_pack_start(ETK_BOX(hbox), pvbox , ETK_FALSE, ETK_FALSE, 0);
 
        label = etk_label_new(file->path);
@@ -74,8 +78,66 @@
        /*------------------*/
 
        /*Permissions*/
-       ivbox = etk_vbox_new(ETK_TRUE,0);       
+       ivbox = etk_vbox_new(ETK_FALSE,0);      
        etk_notebook_page_append(ETK_NOTEBOOK(notebook), "Permissions", ivbox);
+
+       /*User*/
+       label = etk_label_new("User");
+       etk_box_pack_start(ETK_BOX(ivbox), label, ETK_FALSE, ETK_FALSE, 0);
+
+       hbox = etk_hbox_new(ETK_FALSE,0);
+       etk_box_pack_start(ETK_BOX(ivbox), hbox, ETK_FALSE, ETK_FALSE, 0);
+
+       button = etk_check_button_new_with_label("Read");
+       if (perms && perms[1] == 'r') etk_button_clicked(ETK_BUTTON(button));
+       etk_box_pack_start(ETK_BOX(hbox), button, ETK_FALSE, ETK_FALSE, 0);
+
+       button = etk_check_button_new_with_label("Write");
+       if (perms && perms[2] == 'w') etk_button_clicked(ETK_BUTTON(button));
+       etk_box_pack_start(ETK_BOX(hbox), button, ETK_FALSE, ETK_FALSE, 0);
+
+       button = etk_check_button_new_with_label("Execute");
+       if (perms && perms[3] == 'x') etk_button_clicked(ETK_BUTTON(button));
+       etk_box_pack_start(ETK_BOX(hbox), button, ETK_FALSE, ETK_FALSE, 0);
+
+       /*Group*/
+       label = etk_label_new("Group");
+       etk_box_pack_start(ETK_BOX(ivbox), label, ETK_FALSE, ETK_FALSE, 0);
+
+       hbox = etk_hbox_new(ETK_FALSE,0);
+       etk_box_pack_start(ETK_BOX(ivbox), hbox, ETK_FALSE, ETK_FALSE, 0);
+
+       button = etk_check_button_new_with_label("Read");
+       if (perms && perms[4] == 'r') etk_button_clicked(ETK_BUTTON(button));
+       etk_box_pack_start(ETK_BOX(hbox), button, ETK_FALSE, ETK_FALSE, 0);
+
+       button = etk_check_button_new_with_label("Write");
+       if (perms && perms[5] == 'w') etk_button_clicked(ETK_BUTTON(button));
+       etk_box_pack_start(ETK_BOX(hbox), button, ETK_FALSE, ETK_FALSE, 0);
+
+       button = etk_check_button_new_with_label("Execute");
+       if (perms && perms[6] == 'x') etk_button_clicked(ETK_BUTTON(button));
+       etk_box_pack_start(ETK_BOX(hbox), button, ETK_FALSE, ETK_FALSE, 0);
+
+       /*Other*/
+       label = etk_label_new("Other");
+       etk_box_pack_start(ETK_BOX(ivbox), label, ETK_FALSE, ETK_FALSE, 0);
+
+       hbox = etk_hbox_new(ETK_FALSE,0);
+       etk_box_pack_start(ETK_BOX(ivbox), hbox, ETK_FALSE, ETK_FALSE, 0);
+
+       button = etk_check_button_new_with_label("Read");
+       if (perms && perms[7] == 'r') etk_button_clicked(ETK_BUTTON(button));
+       etk_box_pack_start(ETK_BOX(hbox), button, ETK_FALSE, ETK_FALSE, 0);
+
+       button = etk_check_button_new_with_label("Write");
+       if (perms && perms[8] == 'w') etk_button_clicked(ETK_BUTTON(button));
+       etk_box_pack_start(ETK_BOX(hbox), button, ETK_FALSE, ETK_FALSE, 0);
+
+       button = etk_check_button_new_with_label("Execute");
+       if (perms && perms[9] == 'x') etk_button_clicked(ETK_BUTTON(button));
+       etk_box_pack_start(ETK_BOX(hbox), button, ETK_FALSE, ETK_FALSE, 0);
+       
        /*---------------------*/
 
        hbox = etk_hbox_new(ETK_TRUE,0);
@@ -90,6 +152,7 @@
        button = etk_button_new_with_label("Cancel");
        etk_box_pack_start(ETK_BOX(hbox), button, ETK_FALSE, ETK_FALSE, 0);
        
-       
+
+       entropy_free(perms);
        etk_widget_show_all(dialog->window);
 }




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to