diff --git a/.idea/artifacts/esn_terminal_swing_jar.xml b/.idea/artifacts/esn_terminal_swing_jar.xml index 9d38378..d94912c 100644 --- a/.idea/artifacts/esn_terminal_swing_jar.xml +++ b/.idea/artifacts/esn_terminal_swing_jar.xml @@ -3,7 +3,7 @@ $PROJECT_DIR$/out/artifacts/esn_terminal_swing_jar - + \ No newline at end of file diff --git a/.idea/libraries/esn_api_java_0_7.xml b/.idea/libraries/esn_api_java_0_9.xml similarity index 55% rename from .idea/libraries/esn_api_java_0_7.xml rename to .idea/libraries/esn_api_java_0_9.xml index 5bfc715..e9f8d98 100644 --- a/.idea/libraries/esn_api_java_0_7.xml +++ b/.idea/libraries/esn_api_java_0_9.xml @@ -1,7 +1,7 @@ - + - + diff --git a/config/esn-terminal.conf b/config/esn-terminal.conf deleted file mode 100644 index 94e7554..0000000 --- a/config/esn-terminal.conf +++ /dev/null @@ -1 +0,0 @@ -{"service":"39.100.5.139:3003","users":[{"name":"root","pass":"turtle","last":178},{"name":"rock","pass":"000112rock.,.","last":178}],"store":false,"showMainWindowAtStartup":true,"requestHistoryNotificationsWhenLoginToAAccount":true,"broadcast":true,"broadcastFrameXOnScreen":2020,"broadcastFrameYOnScreen":55,"broadcastFrameW":530,"mainWindowWidth":423,"mainWindowHeight":1011} \ No newline at end of file diff --git a/esn-terminal-swing.iml b/esn-terminal-swing.iml index 71a1296..00b3153 100644 --- a/esn-terminal-swing.iml +++ b/esn-terminal-swing.iml @@ -7,6 +7,6 @@ - + \ No newline at end of file diff --git a/libs/esn-api-java-0.7.jar b/libs/esn-api-java-0.9.jar similarity index 83% rename from libs/esn-api-java-0.7.jar rename to libs/esn-api-java-0.9.jar index 7e36640..1450c84 100644 Binary files a/libs/esn-api-java-0.7.jar and b/libs/esn-api-java-0.9.jar differ diff --git a/src/main/boot/TerminalMain.java b/src/main/boot/TerminalMain.java index b072dd8..5c9e9f0 100644 --- a/src/main/boot/TerminalMain.java +++ b/src/main/boot/TerminalMain.java @@ -27,7 +27,7 @@ public class TerminalMain { public static AddDialog addDialog; public static RemoveDialog removeDialog; public static TrayMgr trayMgr; - public static final String version="1.0"; + public static final String version="1.2"; public static void main(String[] args) throws Exception{ // Debug.debug=true; //load config diff --git a/src/main/gui/setting/Account.java b/src/main/gui/setting/Account.java index 6ff4230..2261c0a 100644 --- a/src/main/gui/setting/Account.java +++ b/src/main/gui/setting/Account.java @@ -9,6 +9,7 @@ import main.util.Out; import packs.PackRespNotification; import packs.PackResult; +import util.Debug; import javax.swing.*; import java.awt.*; @@ -130,9 +131,21 @@ public void sessionLogout(PackResult packResult) { //request notifications pushed after last logout if ((lastID==-1&&TerminalMain.preference.requestHistoryNotificationsWhenLoginToAAccount)){ setLastID(0,name); - session.requestNotifications(0,40); +// session.requestNotifications(0,200); + + + Out.sayWithTimeLn(name+":request recent for new account"); + session.requestRecent(10); }else if (lastID!=-1){ - session.requestNotifications(lastID, 40); +// session.requestNotifications(lastID, 100); +// Debug.debug=true; +// System.out.println("count lastID:"+lastID); + int count=session.countNotifications(lastID,0); +// System.out.println("count"); + Out.sayWithTimeLn(name+":request recent amount:"+count); + Debug.debug=true; + session.requestRecent(count); +// session.requestRecent(100); } @@ -163,6 +176,7 @@ public void dispose(){ public ArrayList entries=new ArrayList<>(); public JButton addAcc=new JButton("+Add"); public JLabel serviceTips=new JLabel(); + public JButton deleteService=new JButton("X"); public ConfigAccount configAccount=new ConfigAccount(); public Account(){ this.setLayout(null); @@ -179,7 +193,9 @@ public Account(){ })); this.add(addAcc); - serviceTips.setBounds(addAcc.getX()+addAcc.getWidth()+10,addAcc.getY(),250,20); + + + serviceTips.setBounds(addAcc.getX()+addAcc.getWidth()+10,addAcc.getY(),207,20); if (TerminalMain.preference!=null&&TerminalMain.preference.service!=null){ serviceTips.setText("Service:"+TerminalMain.preference.service); }else { @@ -187,7 +203,18 @@ public Account(){ } this.add(serviceTips); - + deleteService.setBounds(serviceTips.getX()+serviceTips.getWidth()+8,addAcc.getY(),45,20); + deleteService.addActionListener(e->{ + String newService=javax.swing.JOptionPane.showInputDialog(this,"Please new service address to change to:"); + if (!"".equals(newService)&&newService!=null){ + TerminalMain.preference.service=newService; + TerminalMain.serializePreference(); + this.serviceTips.setText("Service:"+newService); + }else { + javax.swing.JOptionPane.showMessageDialog(this,"Please type service address!"); + } + }); + this.add(deleteService); } public void addAccount(String name,String pass,int selectFrom){ Entry e=new Entry(name,pass,selectFrom);