diff --git a/build.gradle b/build.gradle
index 7f3e900..14e9caf 100644
--- a/build.gradle
+++ b/build.gradle
@@ -72,8 +72,8 @@ dependencies {
compile 'com.googlecode.ajui:ajui:1.0.0'
compile 'org.daisy.dotify:dotify.api:4.1.1'
- compile 'org.daisy.streamline:streamline-api:1.0.1'
- compile 'org.daisy.dotify:dotify.common:4.1.0'
+ compile 'org.daisy.streamline:streamline-api:1.1.0'
+ compile 'org.daisy.dotify:dotify.common:4.2.0'
compile ('org.daisy.streamline:streamline-engine:1.1.0') {
exclude module: 'streamline-api'
}
diff --git a/src/META-INF/services/org.daisy.streamline.api.config.UserConfigurationsProvider b/src/META-INF/services/org.daisy.streamline.api.config.UserConfigurationsProvider
new file mode 100644
index 0000000..3557503
--- /dev/null
+++ b/src/META-INF/services/org.daisy.streamline.api.config.UserConfigurationsProvider
@@ -0,0 +1 @@
+application.ui.impl.template.UserConfigurationsImpl
\ No newline at end of file
diff --git a/src/application/common/FeatureSwitch.java b/src/application/common/FeatureSwitch.java
index bab358f..83e9f47 100644
--- a/src/application/common/FeatureSwitch.java
+++ b/src/application/common/FeatureSwitch.java
@@ -22,7 +22,12 @@ public enum FeatureSwitch {
/**
* When on, the progress indicator in the Dotify panel uses progress values reported from the task system
*/
- REPORT_PROGRESS("on".equalsIgnoreCase(System.getProperty("application.feature.report-progress", "off")));
+ REPORT_PROGRESS("on".equalsIgnoreCase(System.getProperty("application.feature.report-progress", "off"))),
+ /**
+ * When on, the template dialog is opened on import
+ */
+ TEMPLATE_DIALOG_ON_IMPORT("on".equalsIgnoreCase(System.getProperty("application.feature.template-dialog-on-import", "on"))),
+ ;
private final boolean on;
FeatureSwitch(boolean on) {
diff --git a/src/application/common/Singleton.java b/src/application/common/Singleton.java
new file mode 100644
index 0000000..4d30064
--- /dev/null
+++ b/src/application/common/Singleton.java
@@ -0,0 +1,19 @@
+package application.common;
+
+import org.daisy.streamline.api.config.ConfigurationsCatalog;
+import org.daisy.streamline.api.config.ConfigurationsCatalogService;
+
+public enum Singleton {
+ INSTANCE;
+ public static Singleton getInstance() {
+ return Singleton.INSTANCE;
+ }
+
+ private ConfigurationsCatalogService configsCatalog;
+ public synchronized ConfigurationsCatalogService getConfigurationsCatalog() {
+ if (configsCatalog==null) {
+ configsCatalog = ConfigurationsCatalog.newInstance();
+ }
+ return configsCatalog;
+ }
+}
diff --git a/src/application/l10n/Messages.java b/src/application/l10n/Messages.java
index 0b2648c..35c6010 100644
--- a/src/application/l10n/Messages.java
+++ b/src/application/l10n/Messages.java
@@ -19,6 +19,7 @@ public enum Messages {
APPLICATION_ENVIRONMENT("application-environment"),
BUTTON_OK("button-ok"),
BUTTON_SELECT("button-select"),
+ BUTTON_DELETE("button-delete"),
EMBOSS_WINDOW_TITLE("emboss-window-title"),
/**
* The file is invalid and cannot be embossed.
@@ -83,6 +84,7 @@ public enum Messages {
TITLE_EXPORT_DIALOG("title-export-dialog"),
TITLE_SAVE_AS_DIALOG("title-save-as-dialog"),
TITLE_TEMPLATES_DIALOG("title-templates-dialog"),
+ TITLE_SAVE_TEMPLATES_DIALOG("title-save-template-dialog"),
LABEL_BRAILLE_FONT("label-braille-font"),
LABEL_TEXT_FONT("label-text-font"),
LABEL_TRANSLATION("label-translation"),
@@ -100,7 +102,7 @@ public enum Messages {
LABEL_SETUP_INVALID("label-setup-invalid"),
LABEL_CREATE_TEST_DOCUMENT("label-create-test-document"),
LABEL_PAPER_DIMENSIONS("label-paper-dimensions"),
- LABEL_NONE("label-none"),
+ LABEL_EMPTY("label-empty"),
LABEL_HEIGHT("label-height"),
LABEL_WIDTH("label-width"),
LABEL_ROLL_SIZE("label-roll-size"),
@@ -123,7 +125,7 @@ public enum Messages {
/**
* Confirm delete a custom paper
*/
- MESSAGE_CONFIRM_DELETE_PAPER("message-confirm-delete-paper"),
+ MESSAGE_CONFIRM_DELETE("message-confirm-delete"),
MESSAGE_FILE_MODIFIED_BY_ANOTHER_APPLICATION("message-file-modified-by-another-application"),
MESSAGE_CONFIRM_SAVE_MALFORMED_XML("message-confirm-save-malformed-xml"),
MESSAGE_CONFIRM_QUIT_UNSAVED_CHANGES("message-confirm-quit-unsaved-changes"),
@@ -140,8 +142,8 @@ public enum Messages {
TOOLTIP_NO_VOLUME_SUPPORT("tooltip-no-volume-support"),
TOOLTIP_ACCURATE_LINE_SPACING("tooltip-accurate-line-spacing"),
TOOLTIP_SIMPLE_LINE_SPACING("tooltip-simple-line-spacing"),
- TOOLTIP_SHOW_OPTIONS("tooltip-show-options"),
- TOOLTIP_HIDE_OPTIONS("tooltip-hide-options"),
+ TOOLTIP_SHOW_CONVERTER("tooltip-show-converter"),
+ TOOLTIP_HIDE_CONVERTER("tooltip-hide-converter"),
VALUE_USE_DEFAULT("value-use-default"),
EXTENSION_FILTER_SUPPORTED_FILES("extension-filter-supported-files"),
EXTENSION_FILTER_ALL_FILES("extension-filter-all-files"),
diff --git a/src/application/l10n/messages.properties b/src/application/l10n/messages.properties
index 78622f1..65346b4 100644
--- a/src/application/l10n/messages.properties
+++ b/src/application/l10n/messages.properties
@@ -12,6 +12,7 @@ button-select=Select
button-add=Add
button-cancel=Cancel
button-emboss=Emboss
+button-delete=Delete
emboss-window-title=Emboss
error-cannot-emboss-invalid-file=Cannot emboss, file has errors
error-failed-to-parse-page-range=Failed to parse page range: {0}
@@ -37,6 +38,7 @@ title-import-source-document-dialog=Import source document
title-export-dialog=Export
title-save-as-dialog=Save As...
title-templates-dialog=Select template ({0})
+title-save-template-dialog=Save template
label-braille-font=Braille font
label-text-font=Text font
label-target-locale=Target locale
@@ -89,6 +91,7 @@ label-line-numbers=Line numbers
label-merge-order=Merge order
label-target-format=Target format
label-make=Make
+label-empty=Empty
message-six-dot-only=6-dot only
message-search-result={0} by {1}
message-unknown-author=Unknown
@@ -96,7 +99,7 @@ message-unknown-title=Untitled
message-paper-details={0} - {1} ({2}: {3})
message-book-dimensions={0} cells wide x {1} cells high
message-file-sent-to-embosser=File has been sent to embosser
-message-confirm-delete-paper=Do you really want to delete {0}?
+message-confirm-delete=Do you really want to delete {0}?
message-file-modified-by-another-application=The file has been modified by another program. Do you want to reload it and lose the changes made here?
message-confirm-save-malformed-xml=The contents is not well-formed XML. Do you want to save anyway?
message-confirm-quit-unsaved-changes=Some open files have been modified but not saved. Do you want to quit anyway?
@@ -129,6 +132,11 @@ menu-item-toggle-viewing-mode=Toggle viewing mode
menu-item-activate-view=Activate view
menu-item-next-editor=Next editor
menu-item-previous-editor=Previous editor
+menu-item-show-converter=Show
+menu-item-apply-template=Apply template...
+menu-item-save-template=Save template...
+menu-item-converter=Converter
+menu-item-update=Update
preferences-window-title=Preferences
tab-emboss=Emboss
tab-general=General
@@ -142,8 +150,8 @@ tooltip-volume-support=Supports volumes
tooltip-no-volume-support=No support for volumes
tooltip-accurate-line-spacing=Supports accurate line spacing
tooltip-simple-line-spacing=Supports simple line spacing only
-tooltip-show-options=Show options
-tooltip-hide-options=Hide options
+tooltip-show-converter=Show converter
+tooltip-hide-converter=Hide converter
tooltip-correct-formatting=Correct formatting
tooltip-move-up=Move the selected file up (Alt + Up)
tooltip-move-down=Move the selected file down (Alt + Down)
diff --git a/src/application/l10n/messages_no.properties b/src/application/l10n/messages_no.properties
index 8e9cc26..3d9bd83 100644
--- a/src/application/l10n/messages_no.properties
+++ b/src/application/l10n/messages_no.properties
@@ -12,6 +12,7 @@ button-select=Velg
button-add=Legg til
button-cancel=Avbryt
button-emboss=Skriv ut
+button-delete=Slette
emboss-window-title=Skriv ut
error-cannot-emboss-invalid-file=Kan ikke skrive ut, filen inneholder feil
error-failed-to-parse-page-range=Klarte ikke å tolke sidespenn: {0}
@@ -37,6 +38,7 @@ title-import-source-document-dialog=Importer kildedokument
title-export-dialog=Eksporter
title-save-as-dialog=Lagre som...
title-templates-dialog=Velg mal ({0})
+title-save-template-dialog=Lagre mal
label-braille-font=Punktskriftfont
label-text-font=Tekstfont
label-target-locale=Målsted
@@ -88,6 +90,7 @@ label-word-wrap=Tekstbryting
label-line-numbers=Linjenummer
label-target-format=Målformat
label-make=Make
+label-empty=Tom
message-six-dot-only=Bare 6-punkt
label-merge-order=Merge order
message-search-result={0} av {1}
@@ -96,7 +99,7 @@ message-unknown-title=ingen tittel
message-paper-details={0} - {1} ({2}: {3})
message-book-dimensions={0} celler bred x {1} celler høy
message-file-sent-to-embosser=Filen har blitt sendt til punktskriftskriveren
-message-confirm-delete-paper=Er du sikker på at du vil slette {0}?
+message-confirm-delete=Er du sikker på at du vil slette {0}?
message-file-modified-by-another-application=Filen har blitt endret av et annet program. Vil du laste den inn på nytt og miste endringene du har gjort her?
message-confirm-save-malformed-xml=Innholdet er ikke velformet XML. Vil du lagre alikevel?
message-confirm-quit-unsaved-changes=Noen filer har blitt endret men ikke lagret. Vil du avslutte alikevel?
@@ -129,6 +132,11 @@ menu-item-toggle-viewing-mode=Toggle viewing mode
menu-item-activate-view=Activate view
menu-item-next-editor=Neste redigeringsprogram
menu-item-previous-editor=Forrige redigeringsprogram
+menu-item-show-converter=Vis
+menu-item-apply-template=Bruk mal...
+menu-item-save-template=Lagre mal...
+menu-item-converter=Converter
+menu-item-update=Oppdater
preferences-window-title=Innstillinger
tab-emboss=Skriv ut
tab-general=Generelt
@@ -142,8 +150,8 @@ tooltip-volume-support=St
tooltip-no-volume-support=Støtter ikke hefter
tooltip-accurate-line-spacing=Supports accurate line spacing
tooltip-simple-line-spacing=Supports simple line spacing only
-tooltip-show-options=Vis alternativer
-tooltip-hide-options=Skjul alternativer
+tooltip-show-converter=Show converter
+tooltip-hide-converter=Hide converter
tooltip-correct-formatting=Rett formatering
tooltip-move-up=Move the selected file up (Alt + Up)
tooltip-move-down=Move the selected file down (Alt + Down)
diff --git a/src/application/l10n/messages_sv.properties b/src/application/l10n/messages_sv.properties
index feeb885..fe03f7a 100644
--- a/src/application/l10n/messages_sv.properties
+++ b/src/application/l10n/messages_sv.properties
@@ -12,6 +12,7 @@ button-select=V
button-add=Lägg till
button-cancel=Avbryt
button-emboss=Skriv ut
+button-delete=Ta bort
emboss-window-title=Skriv ut
error-cannot-emboss-invalid-file=Kan inte skriva ut, filen innehåller fel
error-failed-to-parse-page-range=Kunde inte tolka sidomfånget: {0}
@@ -37,6 +38,7 @@ title-import-source-document-dialog=Importera k
title-export-dialog=Exportera
title-save-as-dialog=Spara som...
title-templates-dialog=Välj mall ({0})
+title-save-template-dialog=Spara mall
label-braille-font=Punktskriftsfont
label-text-font=Textfont
label-target-locale=Målplats
@@ -89,6 +91,7 @@ label-line-numbers=Radnummer
label-merge-order=Sammanslagningsordning
label-target-format=Målformat
label-make=Fabrikat
+label-empty=Tom
message-six-dot-only=Endast 6-punkt
message-search-result={0} av {1}
message-unknown-author=okänd
@@ -96,7 +99,7 @@ message-unknown-title=ingen titel
message-paper-details={0} - {1} ({2}: {3})
message-book-dimensions=Bredd {0} celler, höjd {1} celler
message-file-sent-to-embosser=Filen har skickats till punktskriftsskrivaren
-message-confirm-delete-paper=Vill du verkligen ta bort {0}?
+message-confirm-delete=Vill du verkligen ta bort {0}?
message-file-modified-by-another-application=Filen har ändrats av ett annat program. Vill du ladda om den och förlora ändringarna som gjorts här?
message-confirm-save-malformed-xml=Innehållet är inte välformad XML. Vill du spara ändå?
message-confirm-quit-unsaved-changes=Vissa öppna filer har ändrats men inte sparats. Vill du avsluta ändå?
@@ -129,6 +132,11 @@ menu-item-toggle-viewing-mode=V
menu-item-next-editor=Nästa editor
menu-item-activate-view=Aktivera vy
menu-item-previous-editor=Föregående editor
+menu-item-show-converter=Visa
+menu-item-apply-template=Tillämpa mall...
+menu-item-save-template=Spara mall...
+menu-item-converter=Konverterare
+menu-item-update=Uppdatera
preferences-window-title=Inställningar
tab-emboss=Skriv ut
tab-general=Allmänt
@@ -142,8 +150,8 @@ tooltip-volume-support=St
tooltip-no-volume-support=Inget stöd för volymer
tooltip-accurate-line-spacing=Stödjer noggrant radavstånd
tooltip-simple-line-spacing=Stödjer endast enkelt radavstånd
-tooltip-show-options=Visa alternativ
-tooltip-hide-options=Dölj alternativ
+tooltip-show-converter=Visa konverterare
+tooltip-hide-converter=Dölj konverterare
tooltip-correct-formatting=Rätta formatering
tooltip-move-up=Flytta vald fil uppåt (Alt + Upp)
tooltip-move-down=Flytta vald fil nedåt (Alt + Ner)
diff --git a/src/application/ui/Main.fxml b/src/application/ui/Main.fxml
index cbf1c42..646683c 100644
--- a/src/application/ui/Main.fxml
+++ b/src/application/ui/Main.fxml
@@ -57,7 +57,7 @@
-
+
+
diff --git a/src/application/ui/preview/DotifyController.java b/src/application/ui/preview/DotifyController.java
index d5f2c62..89d65a6 100644
--- a/src/application/ui/preview/DotifyController.java
+++ b/src/application/ui/preview/DotifyController.java
@@ -16,8 +16,10 @@
import java.util.logging.Logger;
import java.util.stream.Collectors;
+import org.daisy.dotify.studio.api.Converter;
import org.daisy.streamline.api.media.AnnotatedFile;
import org.daisy.streamline.api.option.UserOption;
+import org.daisy.streamline.api.option.UserOptionValue;
import org.daisy.streamline.api.tasks.CompiledTaskSystem;
import org.daisy.streamline.api.tasks.InternalTask;
import org.daisy.streamline.api.tasks.TaskSystem;
@@ -27,8 +29,13 @@
import application.common.BuildInfo;
import application.common.FeatureSwitch;
+import application.common.Singleton;
import application.l10n.Messages;
+import application.ui.template.TemplateView;
import javafx.application.Platform;
+import javafx.beans.property.BooleanProperty;
+import javafx.beans.property.ReadOnlyBooleanProperty;
+import javafx.beans.property.SimpleBooleanProperty;
import javafx.concurrent.Task;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
@@ -46,14 +53,16 @@
import javafx.scene.layout.VBox;
import javafx.scene.paint.Paint;
import javafx.scene.text.Font;
+import javafx.stage.Modality;
/**
* Provides a controller for Dotify.
* @author Joel HÃ¥kansson
*
*/
-public class DotifyController extends BorderPane {
+public class DotifyController extends BorderPane implements Converter {
private static final Logger logger = Logger.getLogger(DotifyController.class.getCanonicalName());
+ private final Wrapper