From 270640f41d5787a4960167067bba9f8a8ad3febf Mon Sep 17 00:00:00 2001
From: Zayrex <478576442@qq.com>
Date: Mon, 29 Sep 2025 22:07:09 +0800
Subject: [PATCH] =?UTF-8?q?*=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E9=80=9A?=
=?UTF-8?q?=E8=BF=87Cookie=E7=99=BB=E5=BD=95=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../gui/controllers/PixivAccountPaneController.java | 13 +++++++++----
.../acgpicdownload/gui/fxml/PixivAccountPane.fxml | 2 +-
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/main/java/xyz/zcraft/acgpicdownload/gui/controllers/PixivAccountPaneController.java b/src/main/java/xyz/zcraft/acgpicdownload/gui/controllers/PixivAccountPaneController.java
index aadbcc3..c905b3e 100644
--- a/src/main/java/xyz/zcraft/acgpicdownload/gui/controllers/PixivAccountPaneController.java
+++ b/src/main/java/xyz/zcraft/acgpicdownload/gui/controllers/PixivAccountPaneController.java
@@ -144,10 +144,6 @@ public void addAccount(String cookieOrig) throws IOException {
}
}
- public void addAccount() throws IOException {
- addAccount(cookieField.getText());
- }
-
public void delAccount() throws IOException {
if (accountCombo.getSelectedIndex() != -1) {
ConfigManager.getAccounts().remove(accountCombo.getSelectionModel().getSelectedItem());
@@ -237,4 +233,13 @@ public void browserLoginBtnOnAction() {
logger.error("Failed to add account", e);
}
}
+
+ public void addAccountOnAction() {
+ try {
+ addAccount(cookieField.getText());
+ } catch (IOException e) {
+ Notice.showError(ResourceBundleUtil.getString("gui.pixiv.account.addFailed"), gui.mainPane);
+ logger.error("Failed to add account", e);
+ }
+ }
}
diff --git a/src/main/resources/xyz/zcraft/acgpicdownload/gui/fxml/PixivAccountPane.fxml b/src/main/resources/xyz/zcraft/acgpicdownload/gui/fxml/PixivAccountPane.fxml
index c1fc29c..2cad387 100644
--- a/src/main/resources/xyz/zcraft/acgpicdownload/gui/fxml/PixivAccountPane.fxml
+++ b/src/main/resources/xyz/zcraft/acgpicdownload/gui/fxml/PixivAccountPane.fxml
@@ -56,7 +56,7 @@
+ onAction="#addAccountOnAction" text="%gui.pixiv.account.add"/>