Browse Source

REPORT-875 设计器切换语言后, 应该给个提示, 是否重启, 就跟装完插件一样.

master
plough 8 years ago
parent
commit
602dfc2de1
  1. 75
      designer_base/src/com/fr/design/actions/file/PreferencePane.java
  2. 4
      designer_base/src/com/fr/design/dialog/BasicDialog.java
  3. 3
      designer_base/src/com/fr/design/locale/designer.properties
  4. 3
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  5. 3
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  6. 3
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties

75
designer_base/src/com/fr/design/actions/file/PreferencePane.java

@ -1,10 +1,13 @@
package com.fr.design.actions.file;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.editor.editor.IntegerEditor;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ibutton.UIButton;
@ -78,6 +81,7 @@ public class PreferencePane extends BasicPane {
getLocaledLanguage("Traditional_Chinese_Language", Locale.TRADITIONAL_CHINESE),
getLocaledLanguage("Korea_Language",Locale.KOREA),
};
private static int designerEnvLanguageIndex; // 打开设置对话框时,设计器使用的语言
//设置是否支持undo
private UICheckBox supportUndoCheckBox;
@ -527,6 +531,7 @@ public class PreferencePane extends BasicPane {
this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(designerEnvManager.getLogLevel()));
this.languageComboBox.setSelectedItem(LANGUAGE[designerEnvManager.getLanguage()]);
designerEnvLanguageIndex = designerEnvManager.getLanguage();
this.pageLengthComboBox.setSelectedIndex(designerEnvManager.getPageLengthUnit());
this.reportLengthComboBox.setSelectedIndex(designerEnvManager.getReportLengthUnit());
@ -621,4 +626,74 @@ public class PreferencePane extends BasicPane {
}
return l;
}
/**
* 显示窗口
*
* @param window 窗口
* @param l 对话框监听器
* @return 对话框
*/
@Override
public BasicDialog showWindow(Window window, DialogActionListener l) {
BasicDialog dg;
if (window instanceof Frame) {
dg = new DIALOG((Frame) window);
} else {
dg = new DIALOG((Dialog) window);
}
if (l != null) {
dg.addDialogActionListener(l);
}
dg.setBasicDialogSize(BasicDialog.DEFAULT);
GUICoreUtils.centerWindow(dg);
dg.setResizable(false);
return dg;
}
private class DIALOG extends BasicDialog {
public DIALOG(Frame parent) {
super(parent, PreferencePane.this);
this.setTitle(PreferencePane.this.title4PopupWindow());
}
public DIALOG(Dialog parent) {
super(parent, PreferencePane.this);
this.setTitle(PreferencePane.this.title4PopupWindow());
}
/**
* 确定操作
*
*/
@Override
public void doOK() {
super.doOK();
if (languageComboBox.getSelectedIndex() != designerEnvLanguageIndex) {
int rv = JOptionPane.showOptionDialog(
null,
Inter.getLocText("FR-Designer-Language_Change_Successful"),
Inter.getLocText("FR-Designer-Plugin_Warning"),
JOptionPane.YES_NO_OPTION,
JOptionPane.INFORMATION_MESSAGE,
null,
new String[]{Inter.getLocText("FR-Designer-Basic_Restart_Designer"), Inter.getLocText("FR-Designer-Basic_Restart_Designer_Later")},
null
);
if (rv == JOptionPane.OK_OPTION) {
RestartHelper.restart();
}
}
}
/**
* Check valid.
*/
public void checkValid() throws Exception {
PreferencePane.this.checkValid();
}
}
}

4
designer_base/src/com/fr/design/dialog/BasicDialog.java

@ -39,11 +39,11 @@ public abstract class BasicDialog extends UIDialog {
super(parent, pane, isNeedButtonPane);
}
protected void setBasicDialogSize(Dimension d) {
public void setBasicDialogSize(Dimension d) {
super.setSize(d.width, d.height);
}
protected void setBasicDialogSize(int w, int h) {
public void setBasicDialogSize(int w, int h) {
super.setSize(w, h);
}

3
designer_base/src/com/fr/design/locale/designer.properties

@ -1,4 +1,4 @@
# generated time: 星期四 十一月 24 12:02:51 CST 2016
# generated time: \u661F\u671F\u56DB \u5341\u4E00\u6708 24 12:02:51 CST 2016
FR-Designer-BBSLogin_Account=
FR-Designer-BBSLogin_Connection-Failure=
FR-Designer-BBSLogin_Connection-Failure-Tip=
@ -471,3 +471,4 @@ FR-Designer_Mobile-ToolBar=toolbar
FR-Designer_WLayout-Absolute-ToolTips=
FR-Designer_Reset=
FR-Designer_Add_all=
FR-Designer-Language_Change_Successful=

3
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -1,4 +1,4 @@
# generated time: 星期四 十一月 24 12:02:51 CST 2016
# generated time: \u661F\u671F\u56DB \u5341\u4E00\u6708 24 12:02:51 CST 2016
FR-Designer-BBSLogin_Account=User name
FR-Designer-BBSLogin_Connection-Failure=Connection failure, check your network status
FR-Designer-BBSLogin_Connection-Failure-Tip=Tip
@ -470,3 +470,4 @@ FR-Designer_Mobile-ToolBar=toolbar
FR-Designer_WLayout-Absolute-ToolTips=Freestyle layout, add control in any position of the layout
FR-Designer_Reset=reset
FR-Designer_Add_all=Add all
FR-Designer-Language_Change_Successful=New language setting will be enabled when designer is restarted

3
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -1,4 +1,4 @@
# generated time: 星期四 十一月 24 12:02:51 CST 2016
# generated time: \u661F\u671F\u56DB \u5341\u4E00\u6708 24 12:02:51 CST 2016
FR-Designer-BBSLogin_Account=\u7528\u6237\u540D
FR-Designer-BBSLogin_Connection-Failure=\u7F51\u7EDC\u8FDE\u63A5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u5F53\u524D\u7F51\u7EDC\u72B6\u6001
FR-Designer-BBSLogin_Connection-Failure-Tip=\u63D0\u793A
@ -474,3 +474,4 @@ FR-Designer_Mobile-Refresh=\u5237\u65B0
FR-Designer_WLayout-Absolute-ToolTips=\u81EA\u7531\u5F0F\u5E03\u5C40\uFF0C\u53EF\u4EE5\u5728\u5E03\u5C40\u5185\u4EFB\u610F\u4F4D\u7F6E\u6DFB\u52A0\u63A7\u4EF6
FR-Designer_Reset=\u53D6\u6D88\u5220\u9664
FR-Designer_Add_all=\u5168\u90E8\u6DFB\u52A0
FR-Designer-Language_Change_Successful=\u65B0\u7684\u8BED\u8A00\u8BBE\u7F6E\u5C06\u5728\u91CD\u65B0\u542F\u52A8\u8BBE\u8BA1\u5668\u65F6\u88AB\u542F\u7528

3
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -1,4 +1,4 @@
# generated time: 星期四 十一月 24 12:02:51 CST 2016
# generated time: \u661F\u671F\u56DB \u5341\u4E00\u6708 24 12:02:51 CST 2016
FR-Designer-BBSLogin_Account=\u767B\u5165\u5E33\u865F
FR-Designer-BBSLogin_Connection-Failure=\u767B\u5165\u9023\u63A5\u5931\u6557\uFF0C\u8ACB\u6AA2\u67E5\u7576\u524D\u7DB2\u8DEF\u72C0\u614B
FR-Designer-BBSLogin_Connection-Failure-Tip=\u9023\u7DDA\u5931\u6557\u63D0\u793A
@ -463,3 +463,4 @@ FR-Designer_Mobile-ToolBar=\u5DE5\u5177\u6B04
FR-Designer_WLayout-Absolute-ToolTips=\u81EA\u7531\u5F0F\u5E03\u5C40\uFF0C\u53EF\u4EE5\u5728\u5E03\u5C40\u5167\u4EFB\u610F\u4F4D\u7F6E\u65B0\u589E\u63A7\u5236\u9805
FR-Designer_Reset=
FR-Designer_Add_all=\u5168\u90E8\u65B0\u589E
FR-Designer-Language_Change_Successful=\u65B0\u7684\u8A9E\u8A00\u8A2D\u5B9A\u5C07\u5728\u91CD\u65B0\u555F\u52D5\u8A2D\u8A08\u5668\u6642\u88AB\u555F\u7528

Loading…
Cancel
Save