mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
* achown.c (get_ownership): Renamed to update_ownership.
* achown.c (update_permissions): Update the permission widgets without accessing WButton->text directly. * achown.c (print_flags): Use update_permissions. * achown.c (chown_info_update): Likewise.
This commit is contained in:
parent
c893d6e029
commit
57c9733937
@ -2,6 +2,11 @@
|
||||
|
||||
* achown.c (get_ownership): Simplified the code. Now it is
|
||||
more independent of the WButton internals.
|
||||
* achown.c (get_ownership): Renamed to update_ownership.
|
||||
* achown.c (update_permissions): Update the permission widgets
|
||||
without accessing WButton->text directly.
|
||||
* achown.c (print_flags): Use update_permissions.
|
||||
* achown.c (chown_info_update): Likewise.
|
||||
|
||||
2005-02-05 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
|
29
src/achown.c
29
src/achown.c
@ -68,12 +68,12 @@ static struct {
|
||||
{ B_CANCEL, NORMAL_BUTTON, 4, 53, N_("&Cancel") },
|
||||
{ B_ENTER, DEFPUSH_BUTTON,4, 40, N_("&Set") },
|
||||
{ B_SKIP, NORMAL_BUTTON, 4, 23, N_("S&kip") },
|
||||
{ B_SETALL, NORMAL_BUTTON, 4, 0, N_("Set &all")},
|
||||
{ B_SETALL, NORMAL_BUTTON, 4, 0, N_("Set &all")},
|
||||
{ B_ENTER, NARROW_BUTTON, 0, 47, ""},
|
||||
{ B_ENTER, NARROW_BUTTON, 0, 29, ""},
|
||||
{ B_ENTER, NARROW_BUTTON, 0, 19, " "},
|
||||
{ B_ENTER, NARROW_BUTTON, 0, 11, " "},
|
||||
{ B_ENTER, NARROW_BUTTON, 0, 3, " "}
|
||||
{ B_ENTER, NARROW_BUTTON, 0, 19, ""},
|
||||
{ B_ENTER, NARROW_BUTTON, 0, 11, ""},
|
||||
{ B_ENTER, NARROW_BUTTON, 0, 3, ""}
|
||||
};
|
||||
|
||||
static WButton *b_att[3]; /* permission */
|
||||
@ -92,7 +92,7 @@ static int current_file;
|
||||
static int single_set;
|
||||
static char *fname;
|
||||
|
||||
static void get_ownership (void)
|
||||
static void update_ownership (void)
|
||||
{
|
||||
button_set_text (b_user, get_owner (sf_stat->st_uid));
|
||||
button_set_text (b_group, get_group (sf_stat->st_gid));
|
||||
@ -137,6 +137,17 @@ static void set_perm_by_flags (char *s, int f_p)
|
||||
}
|
||||
}
|
||||
|
||||
static void update_permissions (void)
|
||||
{
|
||||
char flags[] = "---";
|
||||
set_perm_by_flags (flags, 0);
|
||||
button_set_text (b_att[0], flags);
|
||||
set_perm_by_flags (flags, 3);
|
||||
button_set_text (b_att[1], flags);
|
||||
set_perm_by_flags (flags, 6);
|
||||
button_set_text (b_att[2], flags);
|
||||
}
|
||||
|
||||
static umode_t get_perm (char *s, int base)
|
||||
{
|
||||
umode_t m;
|
||||
@ -187,9 +198,7 @@ static void print_flags (void)
|
||||
addch (ch_flags [i+6]);
|
||||
}
|
||||
|
||||
set_perm_by_flags (b_att[0]->text, 0);
|
||||
set_perm_by_flags (b_att[1]->text, 3);
|
||||
set_perm_by_flags (b_att[2]->text, 6);
|
||||
update_permissions ();
|
||||
|
||||
for (i = 0; i < 15; i++){
|
||||
dlg_move (ch_dlg, BY+1, 35+i);
|
||||
@ -368,9 +377,7 @@ static void chown_info_update (void)
|
||||
printw ("%12o", get_mode ());
|
||||
|
||||
/* permissions */
|
||||
set_perm_by_flags (b_att[0]->text, 0);
|
||||
set_perm_by_flags (b_att[1]->text, 3);
|
||||
set_perm_by_flags (b_att[2]->text, 6);
|
||||
update_permissions ();
|
||||
}
|
||||
|
||||
static void b_setpos (int f_pos) {
|
||||
|
Loading…
Reference in New Issue
Block a user