From 21d08ba354ab5545c55039a800595d379d010053 Mon Sep 17 00:00:00 2001 From: Niels Buekers Date: Tue, 20 Feb 2018 08:39:01 +0100 Subject: [PATCH 1/5] indentation --- .../com/vaklinov/zcashui/SendCashPanel.java | 290 +++++++++--------- 1 file changed, 145 insertions(+), 145 deletions(-) diff --git a/src/java/com/vaklinov/zcashui/SendCashPanel.java b/src/java/com/vaklinov/zcashui/SendCashPanel.java index af1c639c..04d0215a 100644 --- a/src/java/com/vaklinov/zcashui/SendCashPanel.java +++ b/src/java/com/vaklinov/zcashui/SendCashPanel.java @@ -75,7 +75,7 @@ * @author Ivan Vaklinov */ public class SendCashPanel - extends WalletTabPanel +extends WalletTabPanel { private ZCashClientCaller clientCaller; private StatusUpdateErrorReporter errorReporter; @@ -104,10 +104,10 @@ public class SendCashPanel public SendCashPanel(ZCashClientCaller clientCaller, - StatusUpdateErrorReporter errorReporter, - ZCashInstallationObserver installationObserver, - BackupTracker backupTracker) - throws IOException, InterruptedException, WalletCallException + StatusUpdateErrorReporter errorReporter, + ZCashInstallationObserver installationObserver, + BackupTracker backupTracker) + throws IOException, InterruptedException, WalletCallException { this.timers = new ArrayList(); this.threads = new ArrayList>(); @@ -128,9 +128,9 @@ public SendCashPanel(ZCashClientCaller clientCaller, JPanel tempPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); tempPanel.add(new JLabel("Send ZCL from: ")); tempPanel.add(new JLabel( - "" + - "* Only addresses with a confirmed balance are shown as sources for sending!" + - " ")); + "" + + "* Only addresses with a confirmed balance are shown as sources for sending!" + + " ")); sendCashPanel.add(tempPanel); balanceAddressCombo = new JComboBox<>(new String[] { "" }); @@ -148,7 +148,7 @@ public SendCashPanel(ZCashClientCaller clientCaller, destinationAddressField = new JTextField(73); tempPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); - tempPanel.add(destinationAddressField); + tempPanel.add(destinationAddressField); sendCashPanel.add(tempPanel); dividerLabel = new JLabel(" "); @@ -159,13 +159,13 @@ public SendCashPanel(ZCashClientCaller clientCaller, tempPanel.add(new JLabel("Memo (optional): ")); tempPanel.add(new JLabel( "" + - "* Memo may be specified only if the destination is a Z (Private) address!" + - " ")); + "* Memo may be specified only if the destination is a Z (Private) address!" + + " ")); sendCashPanel.add(tempPanel); destinationMemoField = new JTextField(73); tempPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); - tempPanel.add(destinationMemoField); + tempPanel.add(destinationMemoField); sendCashPanel.add(tempPanel); dividerLabel = new JLabel(" "); @@ -211,12 +211,12 @@ public SendCashPanel(ZCashClientCaller clientCaller, warningPanel.setLayout(new BorderLayout(7, 3)); JLabel warningL = new JLabel( "" + - " * When sending ZCL from a T (Transparent) address, the remaining unspent balance is sent to another " + - "auto-generated T address. When sending from a Z (Private) address, the remaining unspent balance remains with " + - "the Z address. In both cases, the original sending address cannot be used for sending again until the " + - "transaction is confirmed. The address is temporarily removed from the list! Freshly mined coins may only "+ - "be sent to a Z (Private) address." + - ""); + " * When sending ZCL from a T (Transparent) address, the remaining unspent balance is sent to another " + + "auto-generated T address. When sending from a Z (Private) address, the remaining unspent balance remains with " + + "the Z address. In both cases, the original sending address cannot be used for sending again until the " + + "transaction is confirmed. The address is temporarily removed from the list! Freshly mined coins may only "+ + "be sent to a Z (Private) address." + + ""); warningPanel.add(warningL, BorderLayout.NORTH); sendCashPanel.add(warningPanel); @@ -231,8 +231,8 @@ public SendCashPanel(ZCashClientCaller clientCaller, tempPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); tempPanel.add(new JLabel("Last operation status: ")); - tempPanel.add(operationStatusLabel = new JLabel("N/A")); - operationStatusPanel.add(tempPanel); + tempPanel.add(operationStatusLabel = new JLabel("N/A")); + operationStatusPanel.add(tempPanel); dividerLabel = new JLabel(" "); dividerLabel.setFont(new Font("Helvetica", Font.PLAIN, 6)); @@ -240,9 +240,9 @@ public SendCashPanel(ZCashClientCaller clientCaller, tempPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); tempPanel.add(new JLabel("Progress: ")); - tempPanel.add(operationStatusProhgressBar = new JProgressBar(0, 200)); - operationStatusProhgressBar.setPreferredSize(new Dimension(250, 17)); - operationStatusPanel.add(tempPanel); + tempPanel.add(operationStatusProhgressBar = new JProgressBar(0, 200)); + operationStatusProhgressBar.setPreferredSize(new Dimension(250, 17)); + operationStatusPanel.add(tempPanel); dividerLabel = new JLabel(" "); dividerLabel.setFont(new Font("Helvetica", Font.PLAIN, 13)); @@ -254,7 +254,7 @@ public SendCashPanel(ZCashClientCaller clientCaller, public void actionPerformed(ActionEvent e) { try - { + { SendCashPanel.this.sendCash(); } catch (Exception ex) { @@ -269,30 +269,30 @@ public void actionPerformed(ActionEvent e) JOptionPane.showMessageDialog( SendCashPanel.this.getRootPane().getParent(), "An error occurred when sending ZCL:\n" + - errMessage + "\n\n" + - "Please check that the Zclassic daemon is running and\n" + - "the sending parameters are correct.\n", - "Error Sending ZCL", JOptionPane.ERROR_MESSAGE); + errMessage + "\n\n" + + "Please check that the Zclassic daemon is running and\n" + + "the sending parameters are correct.\n", + "Error Sending ZCL", JOptionPane.ERROR_MESSAGE); } } }); // Update the balances via timer and data gathering thread this.addressBalanceGatheringThread = new DataGatheringThread( - new DataGatheringThread.DataGatherer() - { - public String[][] gatherData() - throws Exception + new DataGatheringThread.DataGatherer() { - long start = System.currentTimeMillis(); - String[][] data = SendCashPanel.this.getAddressPositiveBalanceDataFromWallet(); - long end = System.currentTimeMillis(); - Log.info("Gathering of address/balance table data done in " + (end - start) + "ms." ); + public String[][] gatherData() + throws Exception + { + long start = System.currentTimeMillis(); + String[][] data = SendCashPanel.this.getAddressPositiveBalanceDataFromWallet(); + long end = System.currentTimeMillis(); + Log.info("Gathering of address/balance table data done in " + (end - start) + "ms." ); - return data; - } - }, - this.errorReporter, 10000, true); + return data; + } + }, + this.errorReporter, 10000, true); this.threads.add(addressBalanceGatheringThread); ActionListener alBalancesUpdater = new ActionListener() @@ -319,16 +319,16 @@ public void actionPerformed(ActionEvent e) // Add a popup menu to the destination address field - for convenience JMenuItem paste = new JMenuItem("Paste address"); final JPopupMenu popupMenu = new JPopupMenu(); - popupMenu.add(paste); - paste.addActionListener(new ActionListener() - { + popupMenu.add(paste); + paste.addActionListener(new ActionListener() + { @Override public void actionPerformed(ActionEvent e) { try { String address = (String)Toolkit.getDefaultToolkit().getSystemClipboard(). - getData(DataFlavor.stringFlavor); + getData(DataFlavor.stringFlavor); if ((address != null) && (address.trim().length() > 0)) { SendCashPanel.this.destinationAddressField.setText(address); @@ -343,49 +343,49 @@ public void actionPerformed(ActionEvent e) } }); - this.destinationAddressField.addMouseListener(new MouseAdapter() - { - public void mousePressed(MouseEvent e) - { - if ((!e.isConsumed()) && e.isPopupTrigger()) - { - popupMenu.show(e.getComponent(), e.getPoint().x, e.getPoint().y); - e.consume(); - }; - } - - public void mouseReleased(MouseEvent e) - { - if ((!e.isConsumed()) && e.isPopupTrigger()) - { - mousePressed(e); - } - } - }); + this.destinationAddressField.addMouseListener(new MouseAdapter() + { + public void mousePressed(MouseEvent e) + { + if ((!e.isConsumed()) && e.isPopupTrigger()) + { + popupMenu.show(e.getComponent(), e.getPoint().x, e.getPoint().y); + e.consume(); + }; + } + + public void mouseReleased(MouseEvent e) + { + if ((!e.isConsumed()) && e.isPopupTrigger()) + { + mousePressed(e); + } + } + }); } private void sendCash() - throws WalletCallException, IOException, InterruptedException + throws WalletCallException, IOException, InterruptedException { if (balanceAddressCombo.getItemCount() <= 0) { JOptionPane.showMessageDialog( - SendCashPanel.this.getRootPane().getParent(), - "There are no addresses with a positive balance to send\n" + - "ZCL from!", - "No Funds Available", JOptionPane.ERROR_MESSAGE); + SendCashPanel.this.getRootPane().getParent(), + "There are no addresses with a positive balance to send\n" + + "ZCL from!", + "No Funds Available", JOptionPane.ERROR_MESSAGE); return; } if (this.balanceAddressCombo.getSelectedIndex() < 0) { JOptionPane.showMessageDialog( - SendCashPanel.this.getRootPane().getParent(), - "Please select a source address with a current positive\n" + - "balance to send ZCL from!", - "Select Source Address", JOptionPane.ERROR_MESSAGE); + SendCashPanel.this.getRootPane().getParent(), + "Please select a source address with a current positive\n" + + "balance to send ZCL from!", + "Select Source Address", JOptionPane.ERROR_MESSAGE); return; } @@ -421,25 +421,25 @@ private void sendCash() // Prevent accidental sending to non-ZCL addresses (as seems to be supported by daemon) if (!installationObserver.isOnTestNet()) { - //TODO - ZCL + //TODO - ZCL if (!(destinationAddress.startsWith("zc") || - destinationAddress.startsWith("t1"))) + destinationAddress.startsWith("t1"))) { Object[] options = { "OK" }; JOptionPane.showOptionDialog( - SendCashPanel.this.getRootPane().getParent(), - "The destination address to send ZCL to:\n" + - destinationAddress + "\n"+ - "does not appear to be a valid ZCL address. ZCL addresses start with t1 or zc!", - "Destination Address Invalid", - JOptionPane.DEFAULT_OPTION, - JOptionPane.ERROR_MESSAGE, - null, - options, - options[0]); - - return; // Do not send anything! + SendCashPanel.this.getRootPane().getParent(), + "The destination address to send ZCL to:\n" + + destinationAddress + "\n"+ + "does not appear to be a valid ZCL address. ZCL addresses start with t1 or zc!", + "Destination Address Invalid", + JOptionPane.DEFAULT_OPTION, + JOptionPane.ERROR_MESSAGE, + null, + options, + options[0]); + + return; // Do not send anything! } } @@ -475,8 +475,8 @@ private void sendCash() if (errorMessage != null) { JOptionPane.showMessageDialog( - SendCashPanel.this.getRootPane().getParent(), - errorMessage, "Sending parameters are incorrect", JOptionPane.ERROR_MESSAGE); + SendCashPanel.this.getRootPane().getParent(), + errorMessage, "Sending parameters are incorrect", JOptionPane.ERROR_MESSAGE); return; } @@ -515,20 +515,20 @@ private void sendCash() // Start a data gathering thread specific to the operation being executed - this is done is a separate // thread since the server responds more slowly during JoinSPlits and this blocks he GUI somewhat. final DataGatheringThread opFollowingThread = new DataGatheringThread( - new DataGatheringThread.DataGatherer() - { - public Boolean gatherData() - throws Exception + new DataGatheringThread.DataGatherer() { - long start = System.currentTimeMillis(); - Boolean result = clientCaller.isSendingOperationComplete(operationStatusID); - long end = System.currentTimeMillis(); - Log.info("Checking for operation " + operationStatusID + " status done in " + (end - start) + "ms." ); + public Boolean gatherData() + throws Exception + { + long start = System.currentTimeMillis(); + Boolean result = clientCaller.isSendingOperationComplete(operationStatusID); + long end = System.currentTimeMillis(); + Log.info("Checking for operation " + operationStatusID + " status done in " + (end - start) + "ms." ); - return result; - } - }, - this.errorReporter, 2000, true); + return result; + } + }, + this.errorReporter, 2000, true); // Start a timer to update the progress of the operation operationStatusCounter = 0; @@ -548,7 +548,7 @@ public void actionPerformed(ActionEvent e) opFollowingThread.setSuspended(true); SendCashPanel.this.reportCompleteOperationToTheUser( - amount, sourceAddress, destinationAddress); + amount, sourceAddress, destinationAddress); // Lock the wallet again if (bEncryptedWallet) @@ -573,7 +573,7 @@ public void actionPerformed(ActionEvent e) { // Update the progress operationStatusLabel.setText( - "IN PROGRESS"); + "IN PROGRESS"); operationStatusCounter += 2; int progress = 0; if (operationStatusCounter <= 100) @@ -601,12 +601,12 @@ public void actionPerformed(ActionEvent e) public void prepareForSending(String address) { - destinationAddressField.setText(address); + destinationAddressField.setText(address); } private void updateWalletAddressPositiveBalanceComboBox() - throws WalletCallException, IOException, InterruptedException + throws WalletCallException, IOException, InterruptedException { String[][] newAddressBalanceData = this.addressBalanceGatheringThread.getLastData(); @@ -623,8 +623,8 @@ private void updateWalletAddressPositiveBalanceComboBox() { // Do numeric formatting or else we may get 1.1111E-5 comboBoxItems[i] = - new DecimalFormat("########0.00######").format(Double.valueOf(lastAddressBalanceData[i][0])) + - " - " + lastAddressBalanceData[i][1]; + new DecimalFormat("########0.00######").format(Double.valueOf(lastAddressBalanceData[i][0])) + + " - " + lastAddressBalanceData[i][1]; } int selectedIndex = balanceAddressCombo.getSelectedIndex(); @@ -633,8 +633,8 @@ private void updateWalletAddressPositiveBalanceComboBox() balanceAddressCombo = new JComboBox<>(comboBoxItems); comboBoxParentPanel.add(balanceAddressCombo); if ((balanceAddressCombo.getItemCount() > 0) && - (selectedIndex >= 0) && - (balanceAddressCombo.getItemCount() > selectedIndex)) + (selectedIndex >= 0) && + (balanceAddressCombo.getItemCount() > selectedIndex)) { balanceAddressCombo.setSelectedIndex(selectedIndex); } @@ -646,7 +646,7 @@ private void updateWalletAddressPositiveBalanceComboBox() private String[][] getAddressPositiveBalanceDataFromWallet() - throws WalletCallException, IOException, InterruptedException + throws WalletCallException, IOException, InterruptedException { // Z Addresses - they are OK String[] zAddresses = clientCaller.getWalletZAddresses(); @@ -682,9 +682,9 @@ private String[][] getAddressPositiveBalanceDataFromWallet() if (Double.valueOf(balance) > 0) { tempAddressBalances[count++] = new String[] - { - balance, address - }; + { + balance, address + }; } } @@ -694,9 +694,9 @@ private String[][] getAddressPositiveBalanceDataFromWallet() if (Double.valueOf(balance) > 0) { tempAddressBalances[count++] = new String[] - { - balance, address - }; + { + balance, address + }; } } @@ -708,63 +708,63 @@ private String[][] getAddressPositiveBalanceDataFromWallet() private void reportCompleteOperationToTheUser(String amount, String sourceAddress, String destinationAddress) - throws InterruptedException, WalletCallException, IOException, URISyntaxException + throws InterruptedException, WalletCallException, IOException, URISyntaxException { if (clientCaller.isCompletedOperationSuccessful(operationStatusID)) { operationStatusLabel.setText( - "SUCCESSFUL"); + "SUCCESSFUL"); String TXID = clientCaller.getSuccessfulOperationTXID(operationStatusID); Object[] options = { "OK", "Copy transaction ID", "View on the blockchain" }; int option = JOptionPane.showOptionDialog( - SendCashPanel.this.getRootPane().getParent(), - "Succesfully sent " + amount + " ZCL from address: \n" + - sourceAddress + "\n" + - "to address: \n" + - destinationAddress + "\n\n" + - "Transaction ID: " + TXID, - "ZCL sent successfully", - JOptionPane.DEFAULT_OPTION, - JOptionPane.INFORMATION_MESSAGE, - null, - options, - options[0]); - - if (option == 1) - { - // Copy the transaction ID to clipboard - Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + SendCashPanel.this.getRootPane().getParent(), + "Succesfully sent " + amount + " ZCL from address: \n" + + sourceAddress + "\n" + + "to address: \n" + + destinationAddress + "\n\n" + + "Transaction ID: " + TXID, + "ZCL sent successfully", + JOptionPane.DEFAULT_OPTION, + JOptionPane.INFORMATION_MESSAGE, + null, + options, + options[0]); + + if (option == 1) + { + // Copy the transaction ID to clipboard + Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); clipboard.setContents(new StringSelection(TXID), null); - } else if (option == 2) - { - // Open block explorer + } else if (option == 2) + { + // Open block explorer Log.info("Transaction ID for block explorer is: " + TXID); // TODO: code duplication with transactions table String urlPrefix = "https://zcl-explorer.com/tx/"; if (installationObserver.isOnTestNet()) { - //TODO zcl testnet explorer + //TODO zcl testnet explorer urlPrefix = "https://explorer-testnet.zen-solutions.io/tx/"; } Desktop.getDesktop().browse(new URL(urlPrefix + TXID).toURI()); - } + } - // Call the backup tracker - to remind the user - this.backupTracker.handleNewTransaction(); + // Call the backup tracker - to remind the user + this.backupTracker.handleNewTransaction(); } else { String errorMessage = clientCaller.getOperationFinalErrorMessage(operationStatusID); operationStatusLabel.setText( - "ERROR: " + errorMessage + ""); + "ERROR: " + errorMessage + ""); JOptionPane.showMessageDialog( SendCashPanel.this.getRootPane().getParent(), "An error occurred when sending ZCL:\n" + - errorMessage + "\n\n" + - "Please check that the sending parameters are correct, and try again.\n", - "Error Sending ZCL", JOptionPane.ERROR_MESSAGE); + errorMessage + "\n\n" + + "Please check that the sending parameters are correct, and try again.\n", + "Error Sending ZCL", JOptionPane.ERROR_MESSAGE); } } From a2c5817ec65ae3bb9d2c19dc768ffb0db761d958 Mon Sep 17 00:00:00 2001 From: Niels Buekers Date: Tue, 20 Feb 2018 08:50:32 +0100 Subject: [PATCH 2/5] clean.sh for cleaning mac blockchain folders --- clean.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 clean.sh diff --git a/clean.sh b/clean.sh new file mode 100644 index 00000000..61d8ed26 --- /dev/null +++ b/clean.sh @@ -0,0 +1,18 @@ +#!bin/sh + +echo "This operation will remove your current blockchain." +echo "You will need to redownload it completely." +echo "Only use this in case of a currupted chainstate." + +read -p "Are you sure you want to delete your entire ZCL blockchain? (y/N) " -n 1 -r +echo # (optional) move to a new line +if [[ $REPLY =~ ^[Yy]$ ]] +then + echo "deleting ~/Library/Application Support/Zclassic/blocks" + rm -rf ~/Library/Application Support/Zclassic/blocks + echo "deleting ~/Library/Application Support/Zclassic/chainstate" + rm -rf ~/Library/Application Support/Zclassic/chainstate + echo "success." +else + echo "Aborted." +fi \ No newline at end of file From 75633309749834a43139dca858efcad217199740 Mon Sep 17 00:00:00 2001 From: Niels Buekers Date: Tue, 20 Feb 2018 08:56:56 +0100 Subject: [PATCH 3/5] clean.bat first attempt. needs testing --- clean.bat | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 clean.bat diff --git a/clean.bat b/clean.bat new file mode 100644 index 00000000..a68c53ff --- /dev/null +++ b/clean.bat @@ -0,0 +1,16 @@ +:: some commands found that can be a start for the clean.bat + +@echo off +setlocal +:PROMPT +ECHO "This operation will remove your current blockchain." +ECHO "You will need to redownload it completely." +ECHO "Only use this in case of a currupted chainstate." +SET /P AREYOUSURE=Are you sure (Y/[N])? +IF /I "%AREYOUSURE%" NEQ "Y" GOTO END + +:: @RD /S /Q "C:\Users\%USERNAME%\AppData\Roaming\Zclassic\blocks" +:: @RD /S /Q "C:\Users\%USERNAME%\AppData\Roaming\Zclassic\chainstate" + +:END +endlocal \ No newline at end of file From 2ffbe7f60082197c0092d30b3a767348ac7b9116 Mon Sep 17 00:00:00 2001 From: Niels Buekers Date: Tue, 20 Feb 2018 09:08:15 +0100 Subject: [PATCH 4/5] added description to clean scripts --- clean.bat | 8 ++++++++ clean.sh | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/clean.bat b/clean.bat index a68c53ff..2b525d75 100644 --- a/clean.bat +++ b/clean.bat @@ -1,5 +1,13 @@ :: some commands found that can be a start for the clean.bat +:: ------------------------------------------------------------------ +:: [Niels Buekers] Clean blockchain folders +:: Deletes existing blockchain from user's default +:: installation directory. Should only be used in +:: case of a corrupted chainstate. User will need +:: to redownload entire blockchain if he proceeds. +:: Wallet, peers and config remains untouched. +:: ------------------------------------------------------------------ @echo off setlocal :PROMPT diff --git a/clean.sh b/clean.sh index 61d8ed26..c34b452a 100644 --- a/clean.sh +++ b/clean.sh @@ -1,4 +1,12 @@ #!bin/sh +# ------------------------------------------------------------------ +# [Niels Buekers] Clean blockchain folders +# Deletes existing blockchain from user's default +# installation directory. Should only be used in +# case of a corrupted chainstate. User will need +# to redownload entire blockchain if he proceeds. +# Wallet, peers and config remains untouched. +# ------------------------------------------------------------------ echo "This operation will remove your current blockchain." echo "You will need to redownload it completely." From 537c59381ef4659723a05fb17761566b13071bf1 Mon Sep 17 00:00:00 2001 From: Niels Buekers Date: Tue, 20 Feb 2018 22:36:49 +0100 Subject: [PATCH 5/5] disable multi-export since not working to send from multi-imported --- clean.bat | 4 +- src/java/com/vaklinov/zcashui/ZCashUI.java | 50 +++++++++++++++------- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/clean.bat b/clean.bat index 2b525d75..047cfaea 100644 --- a/clean.bat +++ b/clean.bat @@ -17,8 +17,8 @@ ECHO "Only use this in case of a currupted chainstate." SET /P AREYOUSURE=Are you sure (Y/[N])? IF /I "%AREYOUSURE%" NEQ "Y" GOTO END -:: @RD /S /Q "C:\Users\%USERNAME%\AppData\Roaming\Zclassic\blocks" -:: @RD /S /Q "C:\Users\%USERNAME%\AppData\Roaming\Zclassic\chainstate" + @RD /S /Q "C:\Users\%USERNAME%\AppData\Roaming\Zclassic\blocks" + @RD /S /Q "C:\Users\%USERNAME%\AppData\Roaming\Zclassic\chainstate" :END endlocal \ No newline at end of file diff --git a/src/java/com/vaklinov/zcashui/ZCashUI.java b/src/java/com/vaklinov/zcashui/ZCashUI.java index 116f8148..eee0ea93 100644 --- a/src/java/com/vaklinov/zcashui/ZCashUI.java +++ b/src/java/com/vaklinov/zcashui/ZCashUI.java @@ -94,10 +94,10 @@ public class ZCashUI private JMenuItem menuItemExit; private JMenuItem menuItemAbout; - private JMenuItem menuItemEncrypt; - private JMenuItem menuItemBackup; - private JMenuItem menuItemExportKeys; - private JMenuItem menuItemImportKeys; + //private JMenuItem menuItemEncrypt; + //private JMenuItem menuItemBackup; + //private JMenuItem menuItemExportKeys; + //private JMenuItem menuItemImportKeys; private JMenuItem menuItemShowPrivateKey; private JMenuItem menuItemImportOnePrivateKey; private JMenuItem menuItemOwnIdentity; @@ -120,7 +120,7 @@ public class ZCashUI public ZCashUI(StartupProgressDialog progressDialog) throws IOException, InterruptedException, WalletCallException { - super("Zclassic Desktop GUI Wallet 0.0.1"); + super("Zclassic Desktop GUI Wallet 1.0.0"); if (progressDialog != null) { @@ -198,14 +198,30 @@ public ZCashUI(StartupProgressDialog progressDialog) JMenu wallet = new JMenu("Wallet"); wallet.setMnemonic(KeyEvent.VK_W); - wallet.add(menuItemBackup = new JMenuItem("Backup", KeyEvent.VK_B)); - menuItemBackup.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, accelaratorKeyMask)); - wallet.add(menuItemEncrypt = new JMenuItem("Encrypt", KeyEvent.VK_E)); - menuItemEncrypt.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, accelaratorKeyMask)); + + /* + * Disabled since there is no way of importing the wallet so does not make sense for Avg. Joe to export + */ + /* + * wallet.add(menuItemBackup = new JMenuItem("Backup", KeyEvent.VK_B)); + * menuItemBackup.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, accelaratorKeyMask)); + */ + + //comment out since was disabled in the first place + //wallet.add(menuItemEncrypt = new JMenuItem("Encrypt", KeyEvent.VK_E)); + //menuItemEncrypt.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, accelaratorKeyMask)); + /* + * disable since importing in BULK gives these issues: + * https://github.com/zcash/zcash/issues/2486 + * https://github.com/zcash/zcash/issues/2524 + */ + + /* wallet.add(menuItemExportKeys = new JMenuItem("Export Private Keys", KeyEvent.VK_K)); menuItemExportKeys.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_K, accelaratorKeyMask)); wallet.add(menuItemImportKeys = new JMenuItem("Import Private Keys", KeyEvent.VK_I)); menuItemImportKeys.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, accelaratorKeyMask)); + */ wallet.add(menuItemShowPrivateKey = new JMenuItem("View One Private Key", KeyEvent.VK_P)); menuItemShowPrivateKey.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, accelaratorKeyMask)); wallet.add(menuItemImportOnePrivateKey = new JMenuItem("Import One Private Key", KeyEvent.VK_N)); @@ -245,7 +261,7 @@ public ZCashUI(StartupProgressDialog progressDialog) mb.add(messaging); // TODO: Temporarily disable encryption until further notice - Oct 24 2016 - menuItemEncrypt.setEnabled(false); + //menuItemEncrypt.setEnabled(false); this.setJMenuBar(mb); @@ -279,7 +295,7 @@ public void actionPerformed(ActionEvent e) } } ); - + /* menuItemBackup.addActionListener( new ActionListener() { @@ -290,7 +306,8 @@ public void actionPerformed(ActionEvent e) } } ); - + */ + /* menuItemEncrypt.addActionListener( new ActionListener() { @@ -301,7 +318,8 @@ public void actionPerformed(ActionEvent e) } } ); - + */ + /* menuItemExportKeys.addActionListener( new ActionListener() { @@ -323,7 +341,7 @@ public void actionPerformed(ActionEvent e) } } ); - + */ menuItemShowPrivateKey.addActionListener( new ActionListener() { @@ -435,7 +453,7 @@ public void actionPerformed(ActionEvent e) } } ); - */ + */ // Close operation this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); @@ -508,7 +526,7 @@ public void stateChanged(ChangeEvent e) } } } - ); + ); }