Removing repeated code

This commit is contained in:
Akarshit Wal
2015-09-18 13:31:36 +05:30
parent fe5082c2c9
commit 07dbfe908c

View File

@@ -244,7 +244,8 @@ class StatusPanel extends JPanel {
installButton.setEnabled(!panel.getContrib().isInstalled()
&& contributionListing.hasDownloadedLatestList()
&& panel.getContrib().isCompatible(Base.getRevision()));
&& panel.getContrib().isCompatible(Base.getRevision())
&& !panel.isInstallInProgress);
if (installButton.isEnabled()) {
updateLabel.setText(latestVersion + " available");
@@ -268,17 +269,6 @@ class StatusPanel extends JPanel {
updateButton.setText("Update");
}
installButton.setEnabled(!panel.getContrib().isInstalled()
&& contributionListing.hasDownloadedLatestList()
&& panel.getContrib().isCompatible(Base.getRevision())
&& !panel.isInstallInProgress);
if (installButton.isEnabled()) {
updateLabel.setText(currentVersion + " available");
} else {
updateLabel.setText(currentVersion + " installed");
}
removeButton.setEnabled(panel.getContrib().isInstalled()
&& !panel.isRemoveInProgress);
progressBarPanel.add(panel.installProgressBar);