Skip to content

Commit

Permalink
Merge pull request JMRI#12159 from silverailscolo/eb-nb-help-css
Browse files Browse the repository at this point in the history
Decoder indexing dialog
  • Loading branch information
danielb987 authored Jul 6, 2023
2 parents f17eaa8 + 4e3cb96 commit 2e86e0b
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 86 deletions.
2 changes: 1 addition & 1 deletion help/en/html/doc/Technical/GitFAQ.shtml
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ to do that command once to define "arnie" as an alias you can use in "git fetch"
<p>There is a ".gitattributes" file that tells (most) command-line Git implementations
how to handle this properly. Unfortunately, not all IDEs obey the directives in the file.
For example, to get NetBeans on Windows to handle line-ends properly, a specific plugin
must be installed. See the <a href="NetBeans.shtml">NetBeans JMRI page</a> for
must be installed. See the <a href="NetBeans.shtml#windows">NetBeans JMRI help page</a> for
specifics.</p>

<p>If a file with changed line-ends is accidentally committed and forwarded in a
Expand Down
2 changes: 1 addition & 1 deletion help/en/html/doc/Technical/NetBeans.shtml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
track individual changes on files that you commit.</p>

<p>If you are using <a href="githubdesktopintro.shtml">GitHub Desktop</a>
to manage your copy of the JMRI code, create Pull Requests etc. then this will
to manage your copy of the JMRI code, create Pull Requests etc. then this will
take care of properly convert line endings to the correct format.
There is no need to change anything within NetBeans.</p>

Expand Down
3 changes: 1 addition & 2 deletions java/src/jmri/jmrit/decoderdefn/DecoderFile.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ WrongContent = The file doesn't contain a decoder definition.
CopyError1 = File couldn't be copied
CopyError2 = Error while copying file

DecoderProgressMessage = Recreating decoder index...

DecoderProgressMessage = Recreating decoder index{0}
9 changes: 3 additions & 6 deletions java/src/jmri/jmrit/decoderdefn/DecoderFile_ca.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# DecoderFile.properties
# DecoderFile_ca.properties
#
# Catalan Translation: Joan de Castro ([email protected]) 20/09/2014
# Default properties for the jmri.jmrit.decoderdefn tools
# Translation: Joan de Castro ([email protected]) 20/09/2014
# Catalan properties for the jmri.jmrit.decoderdefn tools

InputURL = URL per a importar:
CompleteOK = Completat correctament
Expand All @@ -11,6 +11,3 @@ ParseError = Aquest fitxer no cont\u00e9 XML v\u00e0lid.
WrongContent = El fitxer no cont\u00e9 una definici\u00f3 de dec\u00f2der.
CopyError1 = El fitxer no es pot copiar
CopyError2 = Error al copiar el fitxer



4 changes: 2 additions & 2 deletions java/src/jmri/jmrit/decoderdefn/DecoderFile_cs.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# DecoderFile.properties
# DecoderFile_cs.properties
#
# Translation: Petr Sidlo
#
# Default properties for the jmri.jmrit.decoderdefn tools
# Czech properties for the jmri.jmrit.decoderdefn tools

InputURL = URL importu:
CompleteOK = Dokon\u010deno OK
Expand Down
6 changes: 2 additions & 4 deletions java/src/jmri/jmrit/decoderdefn/DecoderFile_da.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DecoderFile.properties
# DecoderFile_da.properties
#
# Default properties for the jmri.jmrit.decoderdefn tools
# Danish properties for the jmri.jmrit.decoderdefn tools

InputURL = URL to import:
CompleteOK = Completed OK
Expand All @@ -10,5 +10,3 @@ ParseError = The file doesn't contain valid XML.
WrongContent = The file doesn't contain a decoder definition.
CopyError1 = File couldn't be copied
CopyError2 = Error while copying file


4 changes: 3 additions & 1 deletion java/src/jmri/jmrit/decoderdefn/DecoderFile_de.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DecoderFile.properties
# DecoderFile_de.properties
# by Simon Ginsburg
# German properties for the jmri.jmrit.decoderdefn tools

Expand All @@ -10,3 +10,5 @@ ParseError = Dieses Dokument verf\u00fcgt nicht \u00fcber ein g\u00fcltiges XML
WrongContent = Dieses Dokument verf\u00fcgt nicht \u00fcber eine g\u00fcltigen Decoder Definitionen.
CopyError1 = Dieses Dokument konnte nicht kopiert werden
CopyError2 = Fehler beim Kopieren aufgetreten

DecoderProgressMessage = Decoder Index neu aufbauen{0}
4 changes: 1 addition & 3 deletions java/src/jmri/jmrit/decoderdefn/DecoderFile_fr.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DecoderFile_fr.properties
#
# Default properties for the jmri.jmrit.decoderdefn tools
# French properties for the jmri.jmrit.decoderdefn tools
#
# Translated by Herv\u00e9 BLOREC <[email protected]> le 2013-8-26

Expand All @@ -12,5 +12,3 @@ ParseError = Ce Fichier ne contient pas d'XML valide.
WrongContent = Ce Fichier ne contient pas une d\u00e9finition de d\u00e9codeur.
CopyError1 = Fichier ne peut pas \u00eatre copi\u00e9
CopyError2 = Erreur durant la copie du fichier


7 changes: 2 additions & 5 deletions java/src/jmri/jmrit/decoderdefn/DecoderFile_it.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# DecoderFile.properties
# DecoderFile_it.properties
#
# Default properties for the jmri.jmrit.decoderdefn tools
# Italian properties for the jmri.jmrit.decoderdefn tools
#
# Traduzione in italiano a cura di Mario De Prisco


InputURL = URL da importare:
CompleteOK = Completato OK

Expand All @@ -13,5 +12,3 @@ ParseError = Il File non contiene un XML valido.
WrongContent = Il file non contiene una definizione di decoder.
CopyError1 = Il file non pu\u00F2 essere copiato
CopyError2 = Errore durante la copia del file


Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DecoderFile.properties
# DecoderFile_ja_JP.properties
#
# Japanese properties for the jmri.jmrit.decoderdefn tools
# Translated by Sakae Akanuma <[email protected]>
Expand Down
14 changes: 14 additions & 0 deletions java/src/jmri/jmrit/decoderdefn/DecoderFile_nl.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# DecoderFile_nl.properties
#
# Dutch properties for the jmri.jmrit.decoderdefn tools

InputURL = Importeer URL:
CompleteOK = Voltooid

MalformedURL = Deze URL is geen correct format
ParseError = Het bestand bevat geen correcte XML.
WrongContent = Het bestand bevat geen decoderdefinitie.
CopyError1 = Kopiëren bestand mislukt
CopyError2 = Fout tijdens kopiëren van bestand

DecoderProgressMessage = Decoder-index opnieuw opbouwen{0}
16 changes: 9 additions & 7 deletions java/src/jmri/jmrit/decoderdefn/DecoderIndexFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ public static void forceCreationOfNewIndex(boolean increment) {
}
}
} else {
log.error("Could not access decoder definition directory {}{}", XmlFile.xmlDir(),DecoderFile.fileLocation);
log.error("Could not access decoder definition directory {}{}", XmlFile.xmlDir(), DecoderFile.fileLocation);
}
// copy the decoder entries to the final array
String[] sbox = al.toArray(new String[al.size()]);
Expand Down Expand Up @@ -459,7 +459,8 @@ public static void forceCreationOfNewIndex(boolean increment) {
}

// Create a dialog with a progress bar and a cancel button
String message = Bundle.getMessage("DecoderProgressMessage"); // NOI18N
String message = Bundle.getMessage("DecoderProgressMessage", "..."); // NOI18N
String title = Bundle.getMessage("DecoderProgressMessage", "");
String cancel = Bundle.getMessage("ButtonCancel"); // NOI18N
// HACK: add long blank space to message to make dialog wider.
JOptionPane pane = new JOptionPane(message + " \t",
Expand All @@ -470,13 +471,13 @@ public static void forceCreationOfNewIndex(boolean increment) {
JProgressBar pb = new JProgressBar(0, sbox.length);
pb.setValue(0);
pane.add(pb, 1);
JDialog dialog = pane.createDialog(null, message);
JDialog dialog = pane.createDialog(null, title);

ThreadingUtil.newThread(() -> {
try {
index.writeFile(DECODER_INDEX_FILE_NAME,
InstanceManager.getDefault(DecoderIndexFile.class), sbox, pane, pb);
// catch all exceptions, so progess dialog will close
// catch all exceptions, so progress dialog will close
} catch (Exception e) {
// TODO: show message in progress dialog?
log.error("Error writing new decoder index file: {}", e.getMessage());
Expand All @@ -499,9 +500,7 @@ public static void forceCreationOfNewIndex(boolean increment) {
* @throws java.io.IOException if unable to read decoder index file
*/
void readFile(String name) throws org.jdom2.JDOMException, java.io.IOException {
if (log.isDebugEnabled()) {
log.debug("readFile {}",name);
}
log.debug("readFile {}", name);

// read file, find root
Element root = rootFromName(name);
Expand Down Expand Up @@ -851,6 +850,7 @@ protected static String defaultDecoderIndexFilename() {
public static class Initializer extends AbstractInstanceInitializer {

@Override
@Nonnull
public <T> Object getDefault(Class<T> type) {
if (type.equals(DecoderIndexFile.class)) {
// create and load
Expand Down Expand Up @@ -881,10 +881,12 @@ public <T> Object getDefault(Class<T> type) {
}

@Override
@Nonnull
public Set<Class<?>> getInitalizes() {
Set<Class<?>> set = super.getInitalizes();
set.add(DecoderIndexFile.class);
return set;
}
}

}
Loading

0 comments on commit 2e86e0b

Please sign in to comment.