Skip to content

Commit

Permalink
1,修改编译配置:递增程序版本号;
Browse files Browse the repository at this point in the history
2,修复一个日志打印
  • Loading branch information
zhanlan123 committed Apr 6, 2023
1 parent 17a51a5 commit 5a6e868
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 16 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
val releaseVersion = "1.3"
val developmentVersion = "1.3"
val releaseVersion = "1.4"
val developmentVersion = "1.4"

version = if( java.lang.Boolean.getBoolean( "release" ) ) releaseVersion else developmentVersion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import javax.swing.text.Document;
import java.awt.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.event.*;
import java.io.File;
Expand Down Expand Up @@ -244,12 +243,16 @@ private void initSelectSetting() {
}
if (operationSave.getPrivateKeySelectMode() == 1) {
selectPrivateKeyCheckBox.setSelected(true);
btnSavePrivateKeyInfoButton.setText("修改");
inputPrivateKeyTextArea.setEnabled(false);
if (operationSave.getSelectPrivateKeySelectIndex() >= selectPrivateKeyInfoComboBox.getItemCount()) {
operationSave.setSelectPrivateKeySelectIndex(0);
}
selectPrivateKeyInfoComboBox.setSelectedIndex(operationSave.getSelectPrivateKeySelectIndex());
} else {
inputPrivateKeyCheckBox.setSelected(true);
btnSavePrivateKeyInfoButton.setText("保存");
inputPrivateKeyTextArea.setEnabled(true);
if (!operationSave.getInputPrivateKeyInfo().isEmpty()) {
inputPrivateKeyTextArea.setText(operationSave.getInputPrivateKeyInfo());
}
Expand Down Expand Up @@ -508,27 +511,40 @@ private void addLogPrivateKeyView() {
btnSavePrivateKeyInfoButton = new JButton("保存");
btnSavePrivateKeyInfoButton.setFont(commonFont);
btnSavePrivateKeyInfoButton.addActionListener(e -> {
if (privateKeyMode == 1) {
btnSavePrivateKeyInfoOperation();
});
contentPane.add(btnSavePrivateKeyInfoButton, "wrap, width 100:100:100");
}

/**
* 保存或者修改密钥操作
*/
private void btnSavePrivateKeyInfoOperation() {
if (privateKeyMode == 1) {
if (btnSavePrivateKeyInfoButton.getText().equals("修改")) {
btnSavePrivateKeyInfoButton.setText("保存");
inputPrivateKeyTextArea.setEnabled(true);
} else {
String inputPrivateKeyInfo = inputPrivateKeyTextArea.getText().trim();
if (inputPrivateKeyInfo.length() > 0) {
addDecodePrivateKey(privateKeyInfo.getPrivateKeyName(), inputPrivateKeyInfo);
btnSavePrivateKeyInfoButton.setText("修改");
inputPrivateKeyTextArea.setEnabled(false);
LogUtil.ei("更新密钥成功!");
} else {
LogUtil.ei("密钥不能为空!");
}
} else if (privateKeyMode == 2){
String inputPrivateKeyInfo = inputPrivateKeyTextArea.getText().trim();
if (inputPrivateKeyInfo.length() > 0) {
showSaveDialog("名称", "请输入密钥名称", inputPrivateKeyInfo);
} else {
LogUtil.ei("密钥不能为空!");
}
}
} else if (privateKeyMode == 2){
String inputPrivateKeyInfo = inputPrivateKeyTextArea.getText().trim();
if (inputPrivateKeyInfo.length() > 0) {
showSaveDialog("名称", "请输入密钥名称", inputPrivateKeyInfo);
} else {
LogUtil.ei("请选择密钥模式!");
LogUtil.ei("密钥不能为空!");
}

});
contentPane.add(btnSavePrivateKeyInfoButton, "wrap, width 100:100:100");
} else {
LogUtil.ei("请选择密钥模式!");
}
}

private final PrivateKeyInfo privateKeyInfo = new PrivateKeyInfo();
Expand Down Expand Up @@ -576,18 +592,22 @@ private void addLogPrivateKeyView() {

private void selectPrivateKeyOperation() {
privateKeyMode = 1;
btnSavePrivateKeyInfoButton.setText("修改");
inputPrivateKeyCheckBox.setSelected(false);
inputPrivateKeyTextArea.setText("");
inputPrivateKeyTextArea.setText(privateKeyInfo.getPrivateKeyValue());
inputPrivateKeyTextArea.setEnabled(false);
selectPrivateKeyInfoComboBox.setEnabled(true);
btnDeletePrivateKeyInfoButton.setEnabled(true);
}

private void inputPrivateKeyOperation() {
privateKeyMode = 2;
btnSavePrivateKeyInfoButton.setText("保存");
selectPrivateKeyCheckBox.setSelected(false);
selectPrivateKeyInfoComboBox.setEnabled(false);
btnDeletePrivateKeyInfoButton.setEnabled(false);
inputPrivateKeyTextArea.setEnabled(true);
}

private void noSelectJude() {
Expand Down Expand Up @@ -805,7 +825,7 @@ public void actionPerformed(ActionEvent e) {
}
}
if (!saveLogFileTemp.getAbsolutePath().equals(saveLogPath)) {
LogUtil.ei("保存到默认地址:" + saveLogPath);
LogUtil.ei("保存到地址:" + saveLogPath);
}
File saveLogFile = new File(saveLogPath);
if (!saveLogFile.exists()) {
Expand Down

0 comments on commit 5a6e868

Please sign in to comment.