Browse Source

Servers now update titles when relevant formatters are changed

Fixes issue 3156.

Change-Id: Ia1f5a27e1d8af7393767b19843aecfcb15b05948
Reviewed-on: http://gerrit.dmdirc.com/84
Reviewed-by: Shane Mc Cormack <shane@dmdirc.com>
Tested-by: Chris Smith <chris@dmdirc.com>
tags/0.6.3b1
Chris Smith 14 years ago
parent
commit
ae2649c050
1 changed files with 14 additions and 1 deletions
  1. 14
    1
      src/com/dmdirc/Server.java

+ 14
- 1
src/com/dmdirc/Server.java View File

@@ -32,6 +32,7 @@ import com.dmdirc.config.ConfigManager;
32 32
 import com.dmdirc.config.Identity;
33 33
 import com.dmdirc.config.IdentityManager;
34 34
 import com.dmdirc.interfaces.AwayStateListener;
35
+import com.dmdirc.interfaces.ConfigChangeListener;
35 36
 import com.dmdirc.interfaces.InviteListener;
36 37
 import com.dmdirc.logger.ErrorLevel;
37 38
 import com.dmdirc.logger.Logger;
@@ -72,7 +73,8 @@ import javax.net.ssl.TrustManager;
72 73
  *
73 74
  * @author chris
74 75
  */
75
-public class Server extends WritableFrameContainer implements Serializable {
76
+public class Server extends WritableFrameContainer implements
77
+        Serializable, ConfigChangeListener {
76 78
 
77 79
     // <editor-fold defaultstate="collapsed" desc="Properties">
78 80
 
@@ -211,6 +213,9 @@ public class Server extends WritableFrameContainer implements Serializable {
211 213
         if (getConfigManager().getOptionBool(DOMAIN_GENERAL, "showrawwindow")) {
212 214
             addRaw();
213 215
         }
216
+
217
+        getConfigManager().addChangeListener("formatter", "serverName", this);
218
+        getConfigManager().addChangeListener("formatter", "serverTitle", this);
214 219
     }
215 220
 
216 221
     // </editor-fold>
@@ -1148,6 +1153,14 @@ public class Server extends WritableFrameContainer implements Serializable {
1148 1153
         }
1149 1154
     }
1150 1155
 
1156
+    /** {@inheritDoc} */
1157
+    @Override
1158
+    public void configChanged(final String domain, final String key) {
1159
+        if ("formatter".equals(domain)) {
1160
+            updateTitle();
1161
+        }
1162
+    }
1163
+
1151 1164
     // </editor-fold>
1152 1165
 
1153 1166
     // <editor-fold defaultstate="collapsed" desc="Parser callbacks">

Loading…
Cancel
Save