Ignore:
Timestamp:
2013-05-10T09:40:24+02:00 (11 years ago)
Author:
zverik
Message:

[josm_geochat] fixed translation and user layer checkbox

Location:
applications/editors/josm/plugins/geochat/src/geochat
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/geochat/src/geochat/GeoChatPanel.java

    r29576 r29581  
    6868        connection.addListener(this);
    6969        connection.checkLogin();
     70        updateTitleAlarm();
    7071    }
    7172
     
    7778            }
    7879        };
    79         String userName = JosmUserIdentityManager.getInstance().getUserName();
     80        String userName = Main.pref.get("geochat.username", JosmUserIdentityManager.getInstance().getUserName());
    8081        if( userName == null )
    8182            userName = "";
     
    171172     */
    172173    protected void updateTitleAlarm() {
    173         int alarmLevel = chatPanes.getNotifyLevel();
     174        int alarmLevel = connection.isLoggedIn() ? chatPanes.getNotifyLevel() : 0;
    174175        if( !isDialogInCollapsedView() && alarmLevel > 1 )
    175176            alarmLevel = 1;
    176         String title = users.isEmpty() ? tr("GeoChat") :
    177                 trn("GeoChat ({0} user)", "GeoChat ({0} users)", users.size(), users.size());
     177
     178        String comment;
     179        if( connection.isLoggedIn() ) {
     180            comment = trn("{0} user", "{0} users", users.size() + 1, users.size() + 1);
     181        } else {
     182            comment = tr("not logged in");
     183        }
     184
     185        String title = tr("GeoChat");
     186        if( comment != null )
     187            title = title + " (" + comment + ")";
    178188        String alarm = alarmLevel <= 0 ? "" : alarmLevel == 1 ? "* " : "!!! ";
    179189        setTitle(alarm + title);
     
    193203
    194204    public void loggedIn( String userName ) {
     205        Main.pref.put("geochat.username", userName);
    195206        if( gcPanel.getComponentCount() == 1 ) {
    196207            gcPanel.remove(0);
     
    198209            gcPanel.add(input, BorderLayout.SOUTH);
    199210        }
     211        updateTitleAlarm();
    200212    }
    201213
     
    214226            }
    215227        }
     228        updateTitleAlarm();
    216229    }
    217230
  • applications/editors/josm/plugins/geochat/src/geochat/GeoChatPopupAdapter.java

    r29576 r29581  
    116116            if( !wasAdded )
    117117                Main.map.mapView.removeTemporaryLayer(panel);
     118            panel.userLayerActive = wasAdded;
    118119            putValue(SELECTED_KEY, Boolean.valueOf(panel.userLayerActive));
    119120            Main.map.mapView.repaint();
Note: See TracChangeset for help on using the changeset viewer.