Skip to content

Commit

Permalink
pref(account):logging operation
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Sep 11, 2021
1 parent 9926cdd commit d612434
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .idea/artifacts/esn_terminal_swing_jar.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion config/esn-terminal.conf

This file was deleted.

2 changes: 1 addition & 1 deletion esn-terminal-swing.iml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="esn-api-java-0.7" level="project" />
<orderEntry type="library" name="esn-api-java-0.9" level="project" />
</component>
</module>
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/boot/TerminalMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 31 additions & 4 deletions src/main/gui/setting/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import main.util.Out;
import packs.PackRespNotification;
import packs.PackResult;
import util.Debug;

import javax.swing.*;
import java.awt.*;
Expand Down Expand Up @@ -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);
}


Expand Down Expand Up @@ -163,6 +176,7 @@ public void dispose(){
public ArrayList<Entry> 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);
Expand All @@ -179,15 +193,28 @@ 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 {
serviceTips.setText("Service address undefined.");
}
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);
Expand Down

0 comments on commit d612434

Please sign in to comment.