Commit 518dc98c authored by Riegel's avatar Riegel
Browse files

Feat: Add button to show error statistic of ZIP entry

2 merge requests!28Version 3.17.0 Release,!26Add ZIP-archive support
Showing with 43 additions and 1 deletion
+43 -1
......@@ -91,6 +91,11 @@ public class ZipEntryManager {
@FXML
private ImageView checkAllImageView;
@FXML
private Button showReportBtn;
@FXML
private ImageView showReportImageView;
@FXML
private ListView<ZipEntryNode> entryList;
@FXML
......@@ -156,6 +161,10 @@ public class ZipEntryManager {
Image img = new Image(inStream);
checkAllImageView.setImage(img);
}
try (InputStream inStream = MainWindow.class.getResourceAsStream("icons/error_stat32x32.png")) {
Image img = new Image(inStream);
showReportImageView.setImage(img);
}
} catch (IOException ignored) {
//ignore exceptions
}
......@@ -240,9 +249,29 @@ public class ZipEntryManager {
checkAllBtn.setOnAction(e -> {
disableTaskButtons();
dialog.show();
refresh();
});
showReportBtn.setOnAction(e -> {
disableTaskButtons();
setEntryListLocked(true);
try {
controller.loadZipEntry(entryList.getSelectionModel().getSelectedItem().getEntry());
if (currentlyLoadedEntry == -1) {
currentlyLoadedEntry = entryList.getSelectionModel().getSelectedIndex();
}
WriteReportDialog writeDialog = new WriteReportDialog(stage, controller, null);
writeDialog.show();
} catch (IOException ex) {
throw new RuntimeException(ex);
} finally {
controller.loadZipEntry(entryList.getItems().get(currentlyLoadedEntry).getEntry());
setEntryListLocked(false);
refresh();
}
});
showReportBtn.setDisable(true);
cancelBtn.setOnAction(e -> stage.close());
}
......@@ -312,6 +341,7 @@ public class ZipEntryManager {
objectCountValue.setText(unknownValueText);
loadBtn.setDisable(true);
decompressBtn.setDisable(true);
showReportBtn.setDisable(true);
} else {
erroneousValue.setText(Localization.getText("ZipEntryManager.no"));
......@@ -324,8 +354,10 @@ public class ZipEntryManager {
}
if (entry.getModel().isValidated()) {
validatedValue.setText(Localization.getText("ZipEntryManager.yes"));
showReportBtn.setDisable(false);
} else {
validatedValue.setText(Localization.getText("ZipEntryManager.no"));
showReportBtn.setDisable(true);
}
objectCountValue.setText(String.valueOf(entry.getModel().getNumberOfFeatures()));
}
......
......@@ -40,6 +40,17 @@
preserveRatio="true"/>
</graphic>
</Button>
<Button fx:id="showReportBtn" alignment="CENTER" layoutX="70.0" layoutY="15.0"
maxWidth="1.7976931348623157E308" mnemonicParsing="false">
<font>
<Font size="14.0"/>
</font>
<graphic>
<ImageView fx:id="showReportImageView" fitHeight="32.0" fitWidth="32.0" pickOnBounds="true"
preserveRatio="true"/>
</graphic>
</Button>
<Separator orientation="VERTICAL" prefHeight="200.0"/>
<Button fx:id="decompressAllBtn" alignment="CENTER" layoutX="70.0" layoutY="15.0"
maxWidth="1.7976931348623157E308" mnemonicParsing="false">
<font>
......@@ -50,7 +61,6 @@
preserveRatio="true"/>
</graphic>
</Button>
<Separator orientation="VERTICAL" prefHeight="200.0"/>
<Button fx:id="checkAllBtn" alignment="CENTER" layoutX="126.0" layoutY="15.0"
maxWidth="1.7976931348623157E308" mnemonicParsing="false">
<font>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment