|
|
@ -4,18 +4,14 @@ |
|
|
|
package com.fr.design.mainframe.bbs; |
|
|
|
package com.fr.design.mainframe.bbs; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.FRContext; |
|
|
|
import com.fr.base.FRContext; |
|
|
|
import com.fr.config.BaseDBEnv; |
|
|
|
|
|
|
|
import com.fr.config.MarketConfig; |
|
|
|
import com.fr.config.MarketConfig; |
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.general.DateUtils; |
|
|
|
import com.fr.general.DateUtils; |
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.stable.EnvChangedListener; |
|
|
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.Dimension; |
|
|
|
import java.awt.Dimension; |
|
|
@ -73,7 +69,6 @@ public class UserInfoPane extends BasicPane { |
|
|
|
this.userInfoLabel = new UserInfoLabel(this); |
|
|
|
this.userInfoLabel = new UserInfoLabel(this); |
|
|
|
|
|
|
|
|
|
|
|
this.markUnSignIn(); |
|
|
|
this.markUnSignIn(); |
|
|
|
addEnvChangedListener(); |
|
|
|
|
|
|
|
autoPushLoginDialog(); |
|
|
|
autoPushLoginDialog(); |
|
|
|
|
|
|
|
|
|
|
|
this.add(userInfoLabel, BorderLayout.CENTER); |
|
|
|
this.add(userInfoLabel, BorderLayout.CENTER); |
|
|
@ -115,11 +110,7 @@ public class UserInfoPane extends BasicPane { |
|
|
|
return StringUtils.EMPTY; |
|
|
|
return StringUtils.EMPTY; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void addEnvChangedListener() { |
|
|
|
public void updateBBSUserInfo(){ |
|
|
|
GeneralContext.addEnvChangedListener(new EnvChangedListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void envChanged() { |
|
|
|
|
|
|
|
if (BaseDBEnv.isDBEnvAvailable()) { |
|
|
|
|
|
|
|
String username = MarketConfig.getInstance().getBbsUsername(); |
|
|
|
String username = MarketConfig.getInstance().getBbsUsername(); |
|
|
|
if (StringUtils.isEmpty(username)) { |
|
|
|
if (StringUtils.isEmpty(username)) { |
|
|
|
markUnSignIn(); |
|
|
|
markUnSignIn(); |
|
|
@ -127,9 +118,6 @@ public class UserInfoPane extends BasicPane { |
|
|
|
markSignIn(username); |
|
|
|
markSignIn(username); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -154,7 +142,7 @@ public class UserInfoPane extends BasicPane { |
|
|
|
return dayNew - dayOld; |
|
|
|
return dayNew - dayOld; |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (ParseException e) { |
|
|
|
} catch (ParseException e) { |
|
|
|
FRContext.getLogger().error(e.getMessage()); |
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
return 1; |
|
|
|
return 1; |
|
|
|
} |
|
|
|
} |
|
|
|