From 26a35f113725976515393ed39f0bd963e948aa9c Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Sun, 21 Oct 2012 22:05:45 -0500 Subject: [PATCH 1/3] Changed behaviour on init: Open last file. jMemorize will now open the last file on startup; if the file was moved or deleted, there will be no error message and jMemorize will simply startup silently. --- src/jmemorize/core/Main.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/jmemorize/core/Main.java b/src/jmemorize/core/Main.java index 2c6f185..9e09811 100644 --- a/src/jmemorize/core/Main.java +++ b/src/jmemorize/core/Main.java @@ -545,9 +545,19 @@ private void fireLessonModified(Lesson lesson) /** * @param args the command line arguments */ - public static void main(String args[]) + public static void main(String args[]) { - File file = args.length >= 1 ? new File(args[0]) : null; - Main.getInstance().run(file); + File file = null; + if (args.length >= 1) { + file = new File(args[0]); + } + else if (Main.getInstance().getRecentLessonFiles().size() >= 1) { + String filename = Main.getInstance().getRecentLessonFiles().get(0); + file = new File(filename); + if (!file.exists()) { + file = null; + } + } + Main.getInstance().run(file); } } From 25ee3a8ebe7a8db0471df058952db284d539a1dd Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Sun, 21 Oct 2012 22:22:25 -0500 Subject: [PATCH 2/3] Fixed checkstyle errors - brackets on newline --- src/jmemorize/core/Main.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/jmemorize/core/Main.java b/src/jmemorize/core/Main.java index 9e09811..48ab5da 100644 --- a/src/jmemorize/core/Main.java +++ b/src/jmemorize/core/Main.java @@ -548,13 +548,16 @@ private void fireLessonModified(Lesson lesson) public static void main(String args[]) { File file = null; - if (args.length >= 1) { + if (args.length >= 1) + { file = new File(args[0]); } - else if (Main.getInstance().getRecentLessonFiles().size() >= 1) { + else if (Main.getInstance().getRecentLessonFiles().size() >= 1) + { String filename = Main.getInstance().getRecentLessonFiles().get(0); file = new File(filename); - if (!file.exists()) { + if (!file.exists()) + { file = null; } } From 703842c6cda6764dba5c3cfaffb4105d9631c27d Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Sun, 21 Oct 2012 22:24:09 -0500 Subject: [PATCH 3/3] Added missing configuration files for checkstyle --- checkstyle_config/checkstyle_packages.xml | 9 ++++ checkstyle_config/gpl-header-check.txt | 17 +++++++ checkstyle_config/jmemorize-checkstyle.xml | 57 ++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 checkstyle_config/checkstyle_packages.xml create mode 100644 checkstyle_config/gpl-header-check.txt create mode 100644 checkstyle_config/jmemorize-checkstyle.xml diff --git a/checkstyle_config/checkstyle_packages.xml b/checkstyle_config/checkstyle_packages.xml new file mode 100644 index 0000000..4279531 --- /dev/null +++ b/checkstyle_config/checkstyle_packages.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/checkstyle_config/gpl-header-check.txt b/checkstyle_config/gpl-header-check.txt new file mode 100644 index 0000000..5d4846d --- /dev/null +++ b/checkstyle_config/gpl-header-check.txt @@ -0,0 +1,17 @@ +^/\* +^ \* jMemorize - Learning made easy \(and fun\) - A Leitner flashcards tool +^ \* Copyright\(C\).* +^ \* +^ \* This program is free software; you can redistribute it and/or modify +^ \* it under the terms of the GNU General Public License as published by +^ \* the Free Software Foundation; .* +^ \* .*any later version. +^ \* +^ \* This program is distributed in the hope that it will be useful, +^ \* but WITHOUT ANY WARRANTY; without even the implied warranty of +^ \* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\. See the +^ \* GNU General Public License for more details. +^ \* +^ \* You should have received a copy of the GNU General Public License +^ \* along with this program; if not, write to the Free Software +^ \* Foundation, Inc\., .* diff --git a/checkstyle_config/jmemorize-checkstyle.xml b/checkstyle_config/jmemorize-checkstyle.xml new file mode 100644 index 0000000..8b5fb0d --- /dev/null +++ b/checkstyle_config/jmemorize-checkstyle.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +