diff --git a/designer/src/com/fr/design/mainframe/bbs/LoginDialog.java b/designer/src/com/fr/design/mainframe/bbs/LoginDialog.java index 1d1926bf9e..b5fe200ea1 100644 --- a/designer/src/com/fr/design/mainframe/bbs/LoginDialog.java +++ b/designer/src/com/fr/design/mainframe/bbs/LoginDialog.java @@ -15,7 +15,7 @@ import java.awt.*; * Created by zhaohehe on 16/7/26. */ public class LoginDialog extends UIDialog { - private static final Dimension DEFAULT_SHOP = new Dimension(404, 234); + private static final Dimension DEFAULT_SHOP = new Dimension(404, 204); public LoginDialog(Frame frame, BasicPane pane) { super(frame); diff --git a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java index a2e0946c53..7be5f1fc27 100644 --- a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -54,7 +54,7 @@ public class UserInfoLabel extends UILabel{ private UserInfoPane userInfoPane; private BBSLoginDialog bbsLoginDialog; - + public UserInfoPane getUserInfoPane() { return userInfoPane; } @@ -101,9 +101,19 @@ public class UserInfoLabel extends UILabel{ LoginWebBridge.getHelper().setUILabel(UserInfoLabel.this); QQLoginWebBridge.getHelper().setLoginlabel(); qqdlg.setVisible(true); + clearLoingInformation(); + updateInfoPane(); } }); + } + private void clearLoingInformation(){ + DesignerEnvManager.getEnvManager().setBBSName(StringUtils.EMPTY); + DesignerEnvManager.getEnvManager().setBBSPassword(StringUtils.EMPTY); + } + + private void updateInfoPane(){ + userInfoPane.markUnSignIn(); } /** @@ -117,9 +127,7 @@ public class UserInfoLabel extends UILabel{ if(!FRContext.isChineseEnv()){ return; } - String lastBBSNewsTime = DesignerEnvManager.getEnvManager().getLastShowBBSNewsTime(); - try { String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); if (ComparatorUtils.equals(lastBBSNewsTime, today)) { @@ -129,25 +137,20 @@ public class UserInfoLabel extends UILabel{ } catch (InterruptedException e) { FRContext.getLogger().error(e.getMessage()); } - HttpClient hc = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.popup")); if (!hc.isServerAlive()){ return; } - String res = hc.getResponseText(); if (res.indexOf(BBSConstants.UPDATE_KEY) == -1){ return; } - try { BBSDialog bbsLabel = new BBSDialog(DesignerContext.getDesignerFrame()); bbsLabel.showWindow(SiteCenter.getInstance().acquireUrlByKind("bbs.popup")); DesignerEnvManager.getEnvManager().setLastShowBBSNewsTime(DateUtils.DATEFORMAT2.format(new Date())); } catch (Throwable e) { - } - } }); showBBSThread.start(); @@ -259,6 +262,7 @@ public class UserInfoLabel extends UILabel{ @Override public void mouseClicked(MouseEvent e) { + userName = DesignerEnvManager.getEnvManager().getBBSName(); if(StringUtils.isNotEmpty(userName)) { UIPopupMenu menu = new UIPopupMenu(); menu.setOnlyText(true); @@ -295,5 +299,4 @@ public class UserInfoLabel extends UILabel{ } } }; - } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/extra/LoginPane.java b/designer_base/src/com/fr/design/extra/LoginPane.java index c8c231b24b..41a2ce8ce4 100644 --- a/designer_base/src/com/fr/design/extra/LoginPane.java +++ b/designer_base/src/com/fr/design/extra/LoginPane.java @@ -4,6 +4,7 @@ import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; import com.fr.design.RestartHelper; import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.frpane.UITabbedPane; import com.fr.general.ComparatorUtils; import com.fr.general.IOUtils; import com.fr.general.Inter; @@ -53,6 +54,7 @@ public class LoginPane extends BasicPane { } } } else { + initTraditionalStore(); } } @@ -91,7 +93,6 @@ public class LoginPane extends BasicPane { @Override protected void done() { - try { if (get()) { IOUtils.unzip(new File(StableUtils.pathJoin(PluginHelper.DOWNLOAD_PATH, PluginHelper.TEMP_FILE)), StableUtils.getInstallHome()); @@ -112,7 +113,6 @@ public class LoginPane extends BasicPane { } catch (InterruptedException | ExecutionException e) { FRContext.getLogger().error(e.getMessage(), e); } - } }.execute(); } @@ -140,4 +140,13 @@ public class LoginPane extends BasicPane { } }.execute(); } + + private void initTraditionalStore() { + UITabbedPane tabbedPane = new UITabbedPane(); + add(tabbedPane, BorderLayout.CENTER); + PluginInstalledPane installedPane = new PluginInstalledPane(); + tabbedPane.addTab(installedPane.tabTitle(), installedPane); + tabbedPane.addTab(Inter.getLocText("FR-Designer-Plugin_Update"), new PluginUpdatePane(tabbedPane)); + tabbedPane.addTab(Inter.getLocText("FR-Designer-Plugin_All_Plugins"), new PluginFromStorePane(tabbedPane)); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/extra/LoginWebBridge.java b/designer_base/src/com/fr/design/extra/LoginWebBridge.java index 5149676937..855ed447ad 100644 --- a/designer_base/src/com/fr/design/extra/LoginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/LoginWebBridge.java @@ -28,7 +28,7 @@ public class LoginWebBridge { private static final String LOGININ = "0"; private static final String LOGIN_INFO_EMPTY = "-1"; private static final String DISCONNECTED = "-2"; - private static final String UNKNOWN_ERROR = "-3"; + private static final String LOGININFO_ERROR = "-3"; private static final int TIME_OUT = 10000; private static com.fr.design.extra.LoginWebBridge helper; @@ -115,7 +115,7 @@ public class LoginWebBridge { loginSuccess(username); return LOGININ; }else { - return UNKNOWN_ERROR; + return LOGININFO_ERROR; } } diff --git a/designer_base/src/com/fr/design/extra/LoginWebPane.java b/designer_base/src/com/fr/design/extra/LoginWebPane.java index f31889c28c..b49db6ace7 100644 --- a/designer_base/src/com/fr/design/extra/LoginWebPane.java +++ b/designer_base/src/com/fr/design/extra/LoginWebPane.java @@ -31,7 +31,7 @@ public class LoginWebPane extends JFXPanel { LoginWebPane.this.setScene(scene); WebView webView = new WebView(); webEngine = webView.getEngine(); - webEngine.load("file:///" + installHome + "/scripts/store/web/login.html"); + webEngine.load("file:///" + installHome + "/scripts/qqLogin/web/login.html"); webEngine.setOnAlert(new EventHandler>() { @Override public void handle(WebEvent event) { diff --git a/designer_base/src/com/fr/design/extra/QQLoginWebBridge.java b/designer_base/src/com/fr/design/extra/QQLoginWebBridge.java index a038d56ce0..3ee043493f 100644 --- a/designer_base/src/com/fr/design/extra/QQLoginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/QQLoginWebBridge.java @@ -3,10 +3,13 @@ package com.fr.design.extra; import com.fr.design.DesignerEnvManager; import com.fr.design.dialog.UIDialog; import com.fr.design.gui.ilable.UILabel; +import com.fr.general.SiteCenter; import javafx.scene.web.WebEngine; import org.json.JSONObject; import javax.swing.*; +import java.awt.*; +import java.net.URI; /** * Created by lp on 2016/8/10. @@ -100,6 +103,10 @@ public class QQLoginWebBridge { }else if (status.equals(LOGINFAILED)){ //账号没有QQ授权 closeQQWindow(); + try { + Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("bbs.default"))); + }catch (Exception exp) { + } } } } diff --git a/designer_base/src/com/fr/design/extra/QQLoginWebPane.java b/designer_base/src/com/fr/design/extra/QQLoginWebPane.java index 9644f06663..229e92f12b 100644 --- a/designer_base/src/com/fr/design/extra/QQLoginWebPane.java +++ b/designer_base/src/com/fr/design/extra/QQLoginWebPane.java @@ -29,7 +29,7 @@ public class QQLoginWebPane extends JFXPanel { QQLoginWebPane.this.setScene(scene); WebView webView = new WebView(); webEngine = webView.getEngine(); - webEngine.load("file:///" + installHome + "/scripts/store/web/qqLogin.html"); + webEngine.load("file:///" + installHome + "/scripts/qqLogin/web/qqLogin.html"); webEngine.setOnAlert(new EventHandler>() { @Override public void handle(WebEvent event) { diff --git a/designer_base/src/com/fr/design/extra/exe/GetLoginInfoExecutor.java b/designer_base/src/com/fr/design/extra/exe/GetLoginInfoExecutor.java index 79fb20dce5..6258d02331 100644 --- a/designer_base/src/com/fr/design/extra/exe/GetLoginInfoExecutor.java +++ b/designer_base/src/com/fr/design/extra/exe/GetLoginInfoExecutor.java @@ -2,6 +2,7 @@ package com.fr.design.extra.exe; import com.fr.design.DesignerEnvManager; import com.fr.design.extra.Process; +import com.fr.stable.StringUtils; /** * Created by lp on 2016/8/16. @@ -26,7 +27,7 @@ public class GetLoginInfoExecutor implements Executor { @Override public void run(Process process) { String username = DesignerEnvManager.getEnvManager().getBBSName(); - if (username == null) { + if (StringUtils.isEmpty(username)) { }else { result = username; } @@ -34,4 +35,4 @@ public class GetLoginInfoExecutor implements Executor { } }; } -} +} \ No newline at end of file