mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 01:07:42 +00:00
Initial commit for new warning label
This commit is contained in:
parent
944208ae7f
commit
70f0cfa42b
@ -120,4 +120,12 @@ public final class TextTranslationService {
|
||||
public boolean hasProvider() {
|
||||
return selectedTranslator.isPresent();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getMaxPayloadSize() {
|
||||
return selectedTranslator.get().getMaxPayloadSize();
|
||||
}
|
||||
}
|
||||
|
@ -5,3 +5,4 @@ TranslationContentPanel.ocrLabel.text=OCR:
|
||||
TranslationOptionsPanel.translationServiceLabel.text=Text translator:
|
||||
TranslationOptionsPanelController.moduleErr=Module Error
|
||||
TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete.
|
||||
TranslationContentPanel.warningLabel.text=
|
||||
|
@ -12,6 +12,7 @@ TranslatedContentViewer.noServiceProvider=Machine Translation software was not f
|
||||
TranslatedContentViewer.textAlreadyIndexed=Please view the original text in the Indexed Text viewer.
|
||||
TranslatedContentViewer.translatingText=Translating text, please wait...
|
||||
TranslatedContentViewer.translationException=Error encountered while attempting translation.
|
||||
TranslatedTextViewer.maxPayloadSize=Up to the first %dKB of text will be translated
|
||||
TranslatedTextViewer.title=Translation
|
||||
TranslatedTextViewer.toolTip=Displays translated file text.
|
||||
TranslationContentPanel.autoDetectOCR=Autodetect language
|
||||
@ -24,3 +25,4 @@ TranslationOptionsPanel.translationDisabled.text=Translation disabled
|
||||
TranslationOptionsPanel.translationServiceLabel.text=Text translator:
|
||||
TranslationOptionsPanelController.moduleErr=Module Error
|
||||
TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete.
|
||||
TranslationContentPanel.warningLabel.text=
|
||||
|
@ -77,6 +77,9 @@ public final class TranslatedTextViewer implements TextViewer {
|
||||
= new ThreadFactoryBuilder().setNameFormat("translation-content-viewer-%d").build();
|
||||
private final ExecutorService executorService = Executors.newSingleThreadExecutor(translationThreadFactory);
|
||||
|
||||
@NbBundle.Messages({
|
||||
"TranslatedTextViewer.maxPayloadSize=Up to the first %dKB of text will be translated"
|
||||
})
|
||||
@Override
|
||||
public void setNode(final Node node) {
|
||||
this.node = node;
|
||||
@ -93,6 +96,9 @@ public final class TranslatedTextViewer implements TextViewer {
|
||||
}
|
||||
}
|
||||
|
||||
int payloadMaxInKB = TextTranslationService.getInstance().getMaxPayloadSize() / 1000;
|
||||
panel.setWarningLabelMsg(String.format(Bundle.TranslatedTextViewer_maxPayloadSize(), payloadMaxInKB));
|
||||
|
||||
//Force a background task.
|
||||
displayDropDownListener.actionPerformed(null);
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jPanel1" alignment="1" pref="628" max="32767" attributes="0"/>
|
||||
<Component id="jPanel1" alignment="1" pref="872" max="32767" attributes="0"/>
|
||||
<Component id="jScrollPane1" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@ -47,7 +47,9 @@
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace pref="204" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="warningLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="422" max="32767" attributes="0"/>
|
||||
<Component id="ShowLabel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="displayTextComboBox" min="-2" pref="150" max="-2" attributes="0"/>
|
||||
@ -70,8 +72,14 @@
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="warningLabel" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="103" alignment="1" groupAlignment="3" attributes="0">
|
||||
<Component id="displayTextComboBox" alignment="3" pref="26" max="32767" attributes="0"/>
|
||||
@ -82,6 +90,8 @@
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="7" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
@ -150,6 +160,16 @@
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="warningLabel">
|
||||
<Properties>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/org/sleuthkit/autopsy/images/warning16.png"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/texttranslation/ui/Bundle.properties" key="TranslationContentPanel.warningLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||
|
@ -88,6 +88,10 @@ public class TranslationContentPanel extends javax.swing.JPanel {
|
||||
}
|
||||
}
|
||||
|
||||
void setWarningLabelMsg(String msg) {
|
||||
warningLabel.setText(msg);
|
||||
}
|
||||
|
||||
@NbBundle.Messages({"TranslationContentPanel.autoDetectOCR=Autodetect language"})
|
||||
final void reset() {
|
||||
display("", ComponentOrientation.LEFT_TO_RIGHT, Font.PLAIN);
|
||||
@ -280,6 +284,7 @@ public class TranslationContentPanel extends javax.swing.JPanel {
|
||||
displayTextComboBox = new javax.swing.JComboBox<>();
|
||||
ocrDropdown = new javax.swing.JComboBox<>();
|
||||
ocrLabel = new javax.swing.JLabel();
|
||||
warningLabel = new javax.swing.JLabel();
|
||||
jScrollPane1 = new javax.swing.JScrollPane();
|
||||
displayTextArea = new javax.swing.JTextArea();
|
||||
|
||||
@ -301,12 +306,17 @@ public class TranslationContentPanel extends javax.swing.JPanel {
|
||||
org.openide.awt.Mnemonics.setLocalizedText(ocrLabel, org.openide.util.NbBundle.getMessage(TranslationContentPanel.class, "TranslationContentPanel.ocrLabel.text")); // NOI18N
|
||||
ocrLabel.setEnabled(false);
|
||||
|
||||
warningLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/warning16.png"))); // NOI18N
|
||||
org.openide.awt.Mnemonics.setLocalizedText(warningLabel, org.openide.util.NbBundle.getMessage(TranslationContentPanel.class, "TranslationContentPanel.warningLabel.text")); // NOI18N
|
||||
|
||||
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||||
jPanel1.setLayout(jPanel1Layout);
|
||||
jPanel1Layout.setHorizontalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap(204, Short.MAX_VALUE)
|
||||
.addContainerGap()
|
||||
.addComponent(warningLabel)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 422, Short.MAX_VALUE)
|
||||
.addComponent(ShowLabel)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(displayTextComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
@ -325,15 +335,20 @@ public class TranslationContentPanel extends javax.swing.JPanel {
|
||||
);
|
||||
jPanel1Layout.setVerticalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGap(9, 9, 9)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(warningLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(displayTextComboBox, javax.swing.GroupLayout.DEFAULT_SIZE, 26, Short.MAX_VALUE)
|
||||
.addComponent(ShowLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(ocrLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addComponent(ocrDropdown))
|
||||
.addGap(7, 7, 7))
|
||||
.addGap(7, 7, 7))))
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
@ -355,7 +370,7 @@ public class TranslationContentPanel extends javax.swing.JPanel {
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 628, Short.MAX_VALUE)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 872, Short.MAX_VALUE)
|
||||
.addComponent(jScrollPane1)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
@ -377,5 +392,6 @@ public class TranslationContentPanel extends javax.swing.JPanel {
|
||||
private javax.swing.JSeparator jSeparator2;
|
||||
private javax.swing.JComboBox<String> ocrDropdown;
|
||||
private javax.swing.JLabel ocrLabel;
|
||||
private javax.swing.JLabel warningLabel;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user