Browse Source

Add utility method to prefs setting to remove logic from UI

Issue CLIENT-26

Change-Id: Id1c32eb2e1b0b0be8a51563becaed0c1ff443180
Reviewed-on: http://gerrit.dmdirc.com/1834
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
tags/0.6.5rc2
Greg Holmes 13 years ago
parent
commit
9d87edf3b8
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      src/com/dmdirc/config/prefs/PreferencesSetting.java

+ 12
- 0
src/com/dmdirc/config/prefs/PreferencesSetting.java View File

@@ -21,6 +21,7 @@
21 21
  */
22 22
 package com.dmdirc.config.prefs;
23 23
 
24
+import com.dmdirc.config.Identity;
24 25
 import com.dmdirc.config.IdentityManager;
25 26
 import com.dmdirc.util.validators.PermissiveValidator;
26 27
 import com.dmdirc.util.validators.Validator;
@@ -304,4 +305,15 @@ public class PreferencesSetting {
304 305
                 && (validator == null || !validator.validate(current).isFailure());
305 306
     }
306 307
 
308
+    /**
309
+     * Does the specified identify have this value set?
310
+     *
311
+     * @param identity Identity to check
312
+     *
313
+     * @return true iif the setting is present
314
+     */
315
+    public boolean existInIdentity(final Identity identity) {
316
+        return identity.hasOptionString(domain, option);
317
+    }
318
+
307 319
 }

Loading…
Cancel
Save