Changeset 1489 for trunk


Ignore:
Timestamp:
12/04/19 17:09:27 (4 years ago)
Author:
bnemhaus
Message:

Frames now can report if they are an encryptable frame. A frame is encryptable if it has a encryption label and is not a credentials frame.

Frame.getGroupFrame() now does some additional sanity checking to avoid needless frame loads.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/Frame.java

    r1488 r1489  
    4242
    4343import org.expeditee.actions.Simple;
     44import org.expeditee.auth.AuthenticatorBrowser;
    4445import org.expeditee.auth.mail.gui.MailBay;
    4546import org.expeditee.core.Colour;
     
    213214        public boolean isReadOnly() {
    214215                return !_frameName.hasPermission(UserAppliedPermission.full) && !_protectionChanged;
     216        }
     217       
     218        public boolean isEncryptableFrame() {
     219                boolean hasEncryptionLabel = this.getEncryptionLabel() != null;
     220                boolean isProfileFrame = this.getPath().equals(FrameIO.PROFILE_PATH);
     221                boolean isCredentialsFrame = isProfileFrame && this.getNumber() == AuthenticatorBrowser.CREDENTIALS_FRAME;
     222                return hasEncryptionLabel && !isCredentialsFrame;
    215223        }
    216224
     
    30313039                if (this._groupFrame != null) {
    30323040                        return this._groupFrame;
    3033                 } else {
     3041                } else if (this._groupFrameName != null){
    30343042                        this._groupFrame = FrameIO.LoadFrame(this._groupFrameName + 1, FrameIO.GROUP_PATH);
    30353043                        return this._groupFrame;
     3044                } else {
     3045                        return null;
    30363046                }
    30373047        }
Note: See TracChangeset for help on using the changeset viewer.