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"/>