Ticket #6987: FilePermissionView.patch
File FilePermissionView.patch, 3.9 KB (added by , 13 years ago) |
---|
-
FilePermissionsView.cpp
54 54 : BView(rect, "FilePermissionsView", B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW), 55 55 fModel(model) 56 56 { 57 BString kOwner(B_TRANSLATE("Owner")); 58 BString kGroup(B_TRANSLATE("Group")); 59 BString kOther(B_TRANSLATE("Other")); 60 BString kRead(B_TRANSLATE("Read")); 61 BString kWrite(B_TRANSLATE("Write")); 62 BString kExecute(B_TRANSLATE("Execute")); 63 57 64 // Constants for the column labels: "User", "Group" and "Other". 58 65 const float kColumnLabelMiddle = 77, kColumnLabelTop = 6, kColumnLabelSpacing = 37, 59 66 kColumnLabelBottom = 20, kColumnLabelWidth = 35, kAttribFontHeight = 10; 60 67 61 68 BStringView *strView; 62 69 63 strView = new BStringView(BRect(kColumnLabelMiddle - k ColumnLabelWidth/ 2,64 kColumnLabelTop, kColumnLabelMiddle + k ColumnLabelWidth/ 2, kColumnLabelBottom),65 "", B_TRANSLATE("Owner"));70 strView = new BStringView(BRect(kColumnLabelMiddle - kOwner.Length() / 2, 71 kColumnLabelTop, kColumnLabelMiddle + kOwner.Length() / 2, kColumnLabelBottom), 72 "", kOwner.String()); 66 73 AddChild(strView); 67 74 strView->SetAlignment(B_ALIGN_CENTER); 68 75 strView->SetFontSize(kAttribFontHeight); 69 76 70 strView = new BStringView(BRect(kColumnLabelMiddle - k ColumnLabelWidth/ 277 strView = new BStringView(BRect(kColumnLabelMiddle - kGroup.Length() / 2 71 78 + kColumnLabelSpacing, kColumnLabelTop, 72 kColumnLabelMiddle + k ColumnLabelWidth/ 2 + kColumnLabelSpacing,73 kColumnLabelBottom), "", B_TRANSLATE("Group"));79 kColumnLabelMiddle + kGroup.Length() / 2 + kColumnLabelSpacing, 80 kColumnLabelBottom), "", kGroup.String()); 74 81 AddChild(strView); 75 82 strView->SetAlignment(B_ALIGN_CENTER); 76 83 strView->SetFontSize(kAttribFontHeight); 77 84 78 strView = new BStringView(BRect(kColumnLabelMiddle - k ColumnLabelWidth/ 285 strView = new BStringView(BRect(kColumnLabelMiddle - kOther.Length() / 2 79 86 + 2 * kColumnLabelSpacing, kColumnLabelTop, 80 kColumnLabelMiddle + k ColumnLabelWidth/ 2 + 2 * kColumnLabelSpacing,81 kColumnLabelBottom), "", B_TRANSLATE("Other"));87 kColumnLabelMiddle + kOther.Length() / 2 + 2 * kColumnLabelSpacing, 88 kColumnLabelBottom), "", kOther.String()); 82 89 AddChild(strView); 83 90 strView->SetAlignment(B_ALIGN_CENTER); 84 91 strView->SetFontSize(kAttribFontHeight); … … 90 97 91 98 strView = new BStringView(BRect(kRowLabelLeft, kRowLabelTop, kRowLabelRight, 92 99 kRowLabelTop + kRowLabelHeight), 93 "", B_TRANSLATE("Read"));100 "", kRead.String()); 94 101 AddChild(strView); 95 102 strView->SetAlignment(B_ALIGN_RIGHT); 96 103 strView->SetFontSize(kAttribFontHeight); … … 98 105 strView = new BStringView(BRect(kRowLabelLeft, kRowLabelTop 99 106 + kRowLabelVerticalSpacing, kRowLabelRight, kRowLabelTop 100 107 + kRowLabelVerticalSpacing + kRowLabelHeight), 101 "", B_TRANSLATE("Write"));108 "", kWrite.String()); 102 109 AddChild(strView); 103 110 strView->SetAlignment(B_ALIGN_RIGHT); 104 111 strView->SetFontSize(kAttribFontHeight); … … 106 113 strView = new BStringView(BRect(kRowLabelLeft, kRowLabelTop 107 114 + 2 * kRowLabelVerticalSpacing, kRowLabelRight, kRowLabelTop 108 115 + 2 * kRowLabelVerticalSpacing + kRowLabelHeight), 109 "", B_TRANSLATE("Execute"));116 "", kExecute.String()); 110 117 AddChild(strView); 111 118 strView->SetAlignment(B_ALIGN_RIGHT); 112 119 strView->SetFontSize(kAttribFontHeight); … … 138 145 139 146 strView = new BStringView(BRect(kTextControlLeft, kTextControlTop, 140 147 kTextControlRight, kTextControlTop + kTextControlHeight), "", 141 B_TRANSLATE("Owner"));148 kOwner.String()); 142 149 strView->SetAlignment(B_ALIGN_CENTER); 143 150 strView->SetFontSize(kAttribFontHeight); 144 151 AddChild(strView); … … 153 160 kTextControlTop + 5 + 2 * kTextControlSpacing, 154 161 kTextControlRight, 155 162 kTextControlTop + 2 + 2 * kTextControlSpacing + kTextControlHeight), 156 "", B_TRANSLATE("Group"));163 "", kGroup.String()); 157 164 strView->SetAlignment(B_ALIGN_CENTER); 158 165 strView->SetFontSize(kAttribFontHeight); 159 166 AddChild(strView);