1 | /** | | 1 | /** |
2 | * | | 2 | * |
3 | */ | | 3 | */ |
4 | private void initConfiguration() { | | 4 | private void getConfigurationValues() { |
5 | XmlElement gui = MailConfig.getInstance().get("options").getElement( | | 5 | XmlElement markasread = MailConfig.getInstance().get("options").getElement("/options/markasread"); |
6 | "/options/gui"); | | 6 | |
7 | XmlElement messageviewer = gui.getElement("messageviewer"); | | 7 | // listen for configuration changes |
8 | | | 8 | markasread.addObserver(this); |
9 | if (messageviewer == null) { | | 9 | |
10 | messageviewer = gui.addSubElement("messageviewer"); | | 10 | // get interval value |
11 | } | | 11 | String delayString = markasread.getAttribute("delay", "2"); |
12 | | | 12 | delay = Integer.parseInt(delayString); |
13 | messageviewer.addObserver(this); | | 13 | |
14 | | | 14 | // enable timer |
15 | smilies = messageviewer.getElement("smilies"); | | 15 | String enabledString = markasread.getAttribute("enabled", "true"); |
16 | | | 16 | enabled = enabledString.equals("true") ? true : false; |
17 | if (smilies == null) { | | 17 | } |
18 | smilies = messageviewer.addSubElement("smilies"); | | | |
19 | } | | | |
20 | | | | |
21 | // register as configuration change listener | | | |
22 | smilies.addObserver(this); | | | |
23 | | | | |
24 | String enable = smilies.getAttribute("enabled", "true"); | | | |
25 | | | | |
26 | if (enable.equals("true")) { | | | |
27 | enableSmilies = true; | | | |
28 | } else { | | | |
29 | enableSmilies = false; | | | |
30 | } | | | |
31 | | | | |
32 | XmlElement quote = messageviewer.getElement("quote"); | | | |
33 | | | | |
34 | if (quote == null) { | | | |
35 | quote = messageviewer.addSubElement("quote"); | | | |
36 | } | | | |
37 | | | | |
38 | // register as configuration change listener | | | |
39 | quote.addObserver(this); | | | |
40 | | | | |
41 | // register for configuration changes | | | |
42 | Font font = FontProperties.getTextFont(); | | | |
43 | name = font.getName(); | | | |
44 | | | | |
45 | XmlElement options = Config.getInstance().get("options").getElement( | | | |
46 | "/options"); | | | |
47 | XmlElement gui1 = options.getElement("gui"); | | | |
48 | XmlElement fonts = gui1.getElement("fonts"); | | | |
49 | | | | |
50 | if (fonts == null) { | | | |
51 | fonts = gui1.addSubElement("fonts"); | | | |
52 | } | | | |
53 | | | | |
54 | // register interest on configuratin changes | | | |
55 | fonts.addObserver(this); | | | |
56 | | | | |
57 | // XmlElement selectedBrowser = | | | |
58 | // messageviewer.getElement(OptionsItem.SELECTED_BROWSER); | | | |
59 | // selectedBrowser.addObserver(this); | | | |
60 | | | | |
61 | } | | | |