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 { ...@@ -91,6 +91,11 @@ public class ZipEntryManager {
@FXML @FXML
private ImageView checkAllImageView; private ImageView checkAllImageView;
@FXML
private Button showReportBtn;
@FXML
private ImageView showReportImageView;
@FXML @FXML
private ListView<ZipEntryNode> entryList; private ListView<ZipEntryNode> entryList;
@FXML @FXML
...@@ -156,6 +161,10 @@ public class ZipEntryManager { ...@@ -156,6 +161,10 @@ public class ZipEntryManager {
Image img = new Image(inStream); Image img = new Image(inStream);
checkAllImageView.setImage(img); checkAllImageView.setImage(img);
} }
try (InputStream inStream = MainWindow.class.getResourceAsStream("icons/error_stat32x32.png")) {
Image img = new Image(inStream);
showReportImageView.setImage(img);
}
} catch (IOException ignored) { } catch (IOException ignored) {
//ignore exceptions //ignore exceptions
} }
...@@ -240,9 +249,29 @@ public class ZipEntryManager { ...@@ -240,9 +249,29 @@ public class ZipEntryManager {
checkAllBtn.setOnAction(e -> { checkAllBtn.setOnAction(e -> {
disableTaskButtons(); disableTaskButtons();
dialog.show(); 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()); cancelBtn.setOnAction(e -> stage.close());
} }
...@@ -312,6 +341,7 @@ public class ZipEntryManager { ...@@ -312,6 +341,7 @@ public class ZipEntryManager {
objectCountValue.setText(unknownValueText); objectCountValue.setText(unknownValueText);
loadBtn.setDisable(true); loadBtn.setDisable(true);
decompressBtn.setDisable(true); decompressBtn.setDisable(true);
showReportBtn.setDisable(true);
} else { } else {
erroneousValue.setText(Localization.getText("ZipEntryManager.no")); erroneousValue.setText(Localization.getText("ZipEntryManager.no"));
...@@ -324,8 +354,10 @@ public class ZipEntryManager { ...@@ -324,8 +354,10 @@ public class ZipEntryManager {
} }
if (entry.getModel().isValidated()) { if (entry.getModel().isValidated()) {
validatedValue.setText(Localization.getText("ZipEntryManager.yes")); validatedValue.setText(Localization.getText("ZipEntryManager.yes"));
showReportBtn.setDisable(false);
} else { } else {
validatedValue.setText(Localization.getText("ZipEntryManager.no")); validatedValue.setText(Localization.getText("ZipEntryManager.no"));
showReportBtn.setDisable(true);
} }
objectCountValue.setText(String.valueOf(entry.getModel().getNumberOfFeatures())); objectCountValue.setText(String.valueOf(entry.getModel().getNumberOfFeatures()));
} }
......
...@@ -40,6 +40,17 @@ ...@@ -40,6 +40,17 @@
preserveRatio="true"/> preserveRatio="true"/>
</graphic> </graphic>
</Button> </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" <Button fx:id="decompressAllBtn" alignment="CENTER" layoutX="70.0" layoutY="15.0"
maxWidth="1.7976931348623157E308" mnemonicParsing="false"> maxWidth="1.7976931348623157E308" mnemonicParsing="false">
<font> <font>
...@@ -50,7 +61,6 @@ ...@@ -50,7 +61,6 @@
preserveRatio="true"/> preserveRatio="true"/>
</graphic> </graphic>
</Button> </Button>
<Separator orientation="VERTICAL" prefHeight="200.0"/>
<Button fx:id="checkAllBtn" alignment="CENTER" layoutX="126.0" layoutY="15.0" <Button fx:id="checkAllBtn" alignment="CENTER" layoutX="126.0" layoutY="15.0"
maxWidth="1.7976931348623157E308" mnemonicParsing="false"> maxWidth="1.7976931348623157E308" mnemonicParsing="false">
<font> <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