- nikiroo-utils updated to 1.4.0 (with new R/W bundles and UI configuration controls)
- new Options menu in UI to configure the program (minimalist UI for now)
# Fanfix
+## Version (wip)
+
+- New Options menu in UI to configure the program (minimalist for now)
+
## Version 1.4.1
- Fix UpdateChecker which showed the changes of ALL versions instead of the newer ones only
class InfoText extends Text {
// quote chars
- private char openQuote = Instance.getTrans().getChar(
+ private char openQuote = Instance.getTrans().getCharacter(
StringId.OPEN_SINGLE_QUOTE);
- private char closeQuote = Instance.getTrans().getChar(
+ private char closeQuote = Instance.getTrans().getCharacter(
StringId.CLOSE_SINGLE_QUOTE);
- private char openDoubleQuote = Instance.getTrans().getChar(
+ private char openDoubleQuote = Instance.getTrans().getCharacter(
StringId.OPEN_DOUBLE_QUOTE);
- private char closeDoubleQuote = Instance.getTrans().getChar(
+ private char closeDoubleQuote = Instance.getTrans().getCharacter(
StringId.CLOSE_DOUBLE_QUOTE);
@Override
private boolean lastWasQuote = false;
// quote chars
- private char openQuote = Instance.getTrans().getChar(
+ private char openQuote = Instance.getTrans().getCharacter(
StringId.OPEN_SINGLE_QUOTE);
- private char closeQuote = Instance.getTrans().getChar(
+ private char closeQuote = Instance.getTrans().getCharacter(
StringId.CLOSE_SINGLE_QUOTE);
- private char openDoubleQuote = Instance.getTrans().getChar(
+ private char openDoubleQuote = Instance.getTrans().getCharacter(
StringId.OPEN_DOUBLE_QUOTE);
- private char closeDoubleQuote = Instance.getTrans().getChar(
+ private char closeDoubleQuote = Instance.getTrans().getCharacter(
StringId.CLOSE_DOUBLE_QUOTE);
@Override
import be.nikiroo.fanfix.Instance;
import be.nikiroo.fanfix.Library;
+import be.nikiroo.fanfix.bundles.Config;
import be.nikiroo.fanfix.bundles.UiConfig;
import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.data.Story;
import be.nikiroo.fanfix.reader.LocalReaderBook.BookActionListener;
import be.nikiroo.utils.Progress;
import be.nikiroo.utils.Version;
+import be.nikiroo.utils.ui.ConfigEditor;
import be.nikiroo.utils.ui.ProgressBar;
/**
bar.add(authors);
+ JMenu options = new JMenu("Options");
+ options.setMnemonic(KeyEvent.VK_O);
+ options.add(createMenuItemConfig());
+ options.add(createMenuItemUiConfig());
+ bar.add(options);
+
return bar;
}
+ /**
+ * Create the Fanfix Configuration menu item.
+ *
+ * @return the item
+ */
+ private JMenuItem createMenuItemConfig() {
+ final String title = "Fanfix Configuration";
+ JMenuItem item = new JMenuItem(title);
+ item.setMnemonic(KeyEvent.VK_F);
+
+ item.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ ConfigEditor<Config> ed = new ConfigEditor<Config>(
+ Config.class, Instance.getConfig(),
+ "This is where you configure the options of the program.");
+ JFrame frame = new JFrame(title);
+ frame.add(ed);
+ frame.setSize(800, 600);
+ frame.setVisible(true);
+ }
+ });
+
+ return item;
+ }
+
+ /**
+ * Create the UI Configuration menu item.
+ *
+ * @return the item
+ */
+ private JMenuItem createMenuItemUiConfig() {
+ final String title = "UI Configuration";
+ JMenuItem item = new JMenuItem(title);
+ item.setMnemonic(KeyEvent.VK_U);
+
+ item.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ ConfigEditor<UiConfig> ed = new ConfigEditor<UiConfig>(
+ UiConfig.class, Instance.getUiConfig(),
+ "This is where you configure the graphical appearence of the program.");
+ JFrame frame = new JFrame(title);
+ frame.add(ed);
+ frame.setSize(800, 600);
+ frame.setVisible(true);
+ }
+ });
+
+ return item;
+ }
+
/**
* Create the export menu item.
*
private URL currentReferer; // with only one 'r', as in 'HTTP'...
// quote chars
- private char openQuote = Instance.getTrans().getChar(
+ private char openQuote = Instance.getTrans().getCharacter(
StringId.OPEN_SINGLE_QUOTE);
- private char closeQuote = Instance.getTrans().getChar(
+ private char closeQuote = Instance.getTrans().getCharacter(
StringId.CLOSE_SINGLE_QUOTE);
- private char openDoubleQuote = Instance.getTrans().getChar(
+ private char openDoubleQuote = Instance.getTrans().getCharacter(
StringId.OPEN_DOUBLE_QUOTE);
- private char closeDoubleQuote = Instance.getTrans().getChar(
+ private char closeDoubleQuote = Instance.getTrans().getCharacter(
StringId.CLOSE_DOUBLE_QUOTE);
/**
public class BasicSupportTest extends TestLauncher {
// quote chars
- private char openQuote = Instance.getTrans().getChar(
+ private char openQuote = Instance.getTrans().getCharacter(
StringId.OPEN_SINGLE_QUOTE);
- private char closeQuote = Instance.getTrans().getChar(
+ private char closeQuote = Instance.getTrans().getCharacter(
StringId.CLOSE_SINGLE_QUOTE);
- private char openDoubleQuote = Instance.getTrans().getChar(
+ private char openDoubleQuote = Instance.getTrans().getCharacter(
StringId.OPEN_DOUBLE_QUOTE);
- private char closeDoubleQuote = Instance.getTrans().getChar(
+ private char closeDoubleQuote = Instance.getTrans().getCharacter(
StringId.CLOSE_DOUBLE_QUOTE);
public BasicSupportTest(String[] args) {
public void test() throws Exception {
BasicSupportEmpty support = new BasicSupportEmpty();
- char openDoubleQuote = Instance.getTrans().getChar(
- StringId.OPEN_DOUBLE_QUOTE);
- char closeDoubleQuote = Instance.getTrans().getChar(
- StringId.CLOSE_DOUBLE_QUOTE);
+ char openDoubleQuote = Instance.getTrans()
+ .getCharacter(StringId.OPEN_DOUBLE_QUOTE);
+ char closeDoubleQuote = Instance.getTrans()
+ .getCharacter(StringId.CLOSE_DOUBLE_QUOTE);
String content = null;
Paragraph para = null;