OSDN Git Service

GitHub最初のコミット(SourceForge.jp 128fa38 2013-02-28 15:28:57 と同じ内容)
authoryuki <kimaira7@gmail.com>
Tue, 12 Mar 2013 09:12:08 +0000 (18:12 +0900)
committeryuki <kimaira7@gmail.com>
Tue, 12 Mar 2013 09:12:08 +0000 (18:12 +0900)
60 files changed:
.classpath
.gitignore
.project
README.txt [deleted file]
build.xml [changed mode: 0755->0644]
install.sh [changed mode: 0755->0644]
install.txt
license.html
neighbornote-osx [moved from nixnote-osx with 56% similarity]
neighbornote.bat [moved from nixnote.bat with 54% similarity]
neighbornote.desktop.desktop [moved from nixnote.desktop with 53% similarity, mode: 0644]
neighbornote.ico [new file with mode: 0644]
neighbornote.png [new file with mode: 0644]
neighbornote.pro [moved from nixnote.pro with 100% similarity]
neighbornote.sh [moved from nixnote.sh with 54% similarity, mode: 0644]
neighbornote_path.sh [new file with mode: 0644]
nixnote.ico [deleted file]
nixnote.png [deleted file]
nixnote_path.sh [deleted file]
release.txt
shortcuts_howto.txt
src/cx/fbn/nevernote/Global.java
src/cx/fbn/nevernote/NeverNote.java
src/cx/fbn/nevernote/dialog/ConfigDialog.java
src/cx/fbn/nevernote/dialog/ConfigRensoNoteListPage.java [new file with mode: 0644]
src/cx/fbn/nevernote/dialog/LogFileDialog.java
src/cx/fbn/nevernote/dialog/NoteQuickLinkDialog.java
src/cx/fbn/nevernote/dialog/OnlineNoteHistory.java
src/cx/fbn/nevernote/gui/BrowserWindow.java
src/cx/fbn/nevernote/gui/ExternalBrowse.java
src/cx/fbn/nevernote/gui/MainMenuBar.java
src/cx/fbn/nevernote/gui/NoteTableContextMenu.java [new file with mode: 0644]
src/cx/fbn/nevernote/gui/RensoNoteList.java [new file with mode: 0644]
src/cx/fbn/nevernote/gui/RensoNoteListItem.java [new file with mode: 0644]
src/cx/fbn/nevernote/gui/ShortcutKeys.java
src/cx/fbn/nevernote/gui/TabBrowse.java [new file with mode: 0644]
src/cx/fbn/nevernote/gui/TabBrowserBar.java [new file with mode: 0644]
src/cx/fbn/nevernote/gui/TabBrowserWidget.java [new file with mode: 0644]
src/cx/fbn/nevernote/gui/TableView.java
src/cx/fbn/nevernote/gui/TrashTreeWidget.java
src/cx/fbn/nevernote/icons/appearance.jpg [deleted file]
src/cx/fbn/nevernote/icons/appearance.png [new file with mode: 0644]
src/cx/fbn/nevernote/icons/debug.jpg
src/cx/fbn/nevernote/icons/rensoNoteList.png [new file with mode: 0644]
src/cx/fbn/nevernote/icons/splash_logo.png
src/cx/fbn/nevernote/icons/star.png [new file with mode: 0644]
src/cx/fbn/nevernote/neighbornote/ClipBoardObserver.java [new file with mode: 0644]
src/cx/fbn/nevernote/oauth/OAuthWindow.java
src/cx/fbn/nevernote/sql/DatabaseConnection.java
src/cx/fbn/nevernote/sql/ExcludedTable.java [new file with mode: 0644]
src/cx/fbn/nevernote/sql/HistoryTable.java [new file with mode: 0644]
src/cx/fbn/nevernote/sql/NoteTable.java
src/cx/fbn/nevernote/sql/StaredTable.java [new file with mode: 0644]
src/cx/fbn/nevernote/threads/CounterRunner.java
src/cx/fbn/nevernote/threads/IndexRunner.java
src/cx/fbn/nevernote/threads/SaveRunner.java
src/cx/fbn/nevernote/threads/SyncRunner.java
src/cx/fbn/nevernote/threads/ThumbnailRunner.java
src/cx/fbn/nevernote/utilities/ListManager.java
uninstall.sh [changed mode: 0755->0644]

index 4472bf0..77ad830 100644 (file)
@@ -1,32 +1,32 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
-       <classpathentry kind="src" path="src"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="lib" path="lib/evernote-api-1.20.jar"/>\r
-       <classpathentry kind="lib" path="lib/h2-1.3.158.jar"/>\r
-       <classpathentry kind="lib" path="lib/libthrift.jar"/>\r
-       <classpathentry kind="lib" path="lib/log4j-1.2.14.jar"/>\r
-       <classpathentry kind="lib" path="lib/commons-lang3-3.0.jar"/>\r
-       <classpathentry kind="lib" path="lib/jtidy-r938.jar"/>\r
-       <classpathentry kind="var" path="QT_JAMBI/qtjambi-4.5.2_01.jar"/>\r
-       <classpathentry kind="var" path="QT_JAMBI/qtjambi-win32-msvc2005-4.5.2_01.jar"/>\r
-       <classpathentry kind="lib" path="lib/poi-scratchpad-3.7-20101029.jar"/>\r
-       <classpathentry kind="lib" path="lib/poi-3.7-20101029.jar"/>\r
-       <classpathentry kind="lib" path="lib/poi-ooxml-schemas-3.7-20101029.jar"/>\r
-       <classpathentry kind="lib" path="lib/xmlbeans-2.3.0.jar"/>\r
-       <classpathentry kind="lib" path="lib/commons-compress-1.2.jar"/>\r
-       <classpathentry kind="lib" path="lib/poi-ooxml-3.7.jar"/>\r
-       <classpathentry kind="lib" path="lib/jaxen-1.1.3.jar"/>\r
-       <classpathentry kind="lib" path="lib/xsdlib-20060615.jar"/>\r
-       <classpathentry kind="lib" path="lib/jazzy.jar"/>\r
-       <classpathentry kind="lib" path="lib/tika.jar"/>\r
-       <classpathentry kind="lib" path="lib/apache-mime4j-0.6.jar"/>\r
-       <classpathentry kind="lib" path="lib/commons-codec-1.5.jar"/>\r
-       <classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/>\r
-       <classpathentry kind="lib" path="lib/httpclient-4.1.1.jar"/>\r
-       <classpathentry kind="lib" path="lib/httpcore-4.1.jar"/>\r
-       <classpathentry kind="lib" path="lib/httpmime-4.1.1.jar"/>\r
-       <classpathentry kind="lib" path="lib/pdfbox-app-1.6.0.jar"/>\r
-       <classpathentry kind="lib" path="C:/repository/nevernote/nixnote/lib/scribe-1.3.0.jar"/>\r
-       <classpathentry kind="output" path="bin"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="lib" path="lib/evernote-api-1.20.jar"/>
+       <classpathentry kind="lib" path="lib/h2-1.3.158.jar"/>
+       <classpathentry kind="lib" path="lib/libthrift.jar"/>
+       <classpathentry kind="lib" path="lib/log4j-1.2.14.jar"/>
+       <classpathentry kind="lib" path="lib/commons-lang3-3.0.jar"/>
+       <classpathentry kind="lib" path="lib/jtidy-r938.jar"/>
+       <classpathentry kind="lib" path="lib/poi-scratchpad-3.7-20101029.jar"/>
+       <classpathentry kind="lib" path="lib/poi-3.7-20101029.jar"/>
+       <classpathentry kind="lib" path="lib/poi-ooxml-schemas-3.7-20101029.jar"/>
+       <classpathentry kind="lib" path="lib/xmlbeans-2.3.0.jar"/>
+       <classpathentry kind="lib" path="lib/commons-compress-1.2.jar"/>
+       <classpathentry kind="lib" path="lib/poi-ooxml-3.7.jar"/>
+       <classpathentry kind="lib" path="lib/jaxen-1.1.3.jar"/>
+       <classpathentry kind="lib" path="lib/xsdlib-20060615.jar"/>
+       <classpathentry kind="lib" path="lib/jazzy.jar"/>
+       <classpathentry kind="lib" path="lib/tika.jar"/>
+       <classpathentry kind="lib" path="lib/apache-mime4j-0.6.jar"/>
+       <classpathentry kind="lib" path="lib/commons-codec-1.5.jar"/>
+       <classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/>
+       <classpathentry kind="lib" path="lib/httpclient-4.1.1.jar"/>
+       <classpathentry kind="lib" path="lib/httpcore-4.1.jar"/>
+       <classpathentry kind="lib" path="lib/httpmime-4.1.1.jar"/>
+       <classpathentry kind="lib" path="lib/pdfbox-app-1.6.0.jar"/>
+       <classpathentry kind="lib" path="/usr/local/Trolltech/qtjambi-linux32-lgpl-4.5.2_01/qtjambi-4.5.2_01.jar"/>
+       <classpathentry kind="lib" path="/usr/local/Trolltech/qtjambi-linux32-lgpl-4.5.2_01/qtjambi-linux32-gcc-4.5.2_01.jar"/>
+       <classpathentry kind="lib" path="/home/zigzag/workspace/NeighborNote/lib/scribe-1.3.0.jar"/>
+       <classpathentry kind="output" path="bin"/>
+</classpath>
index 6c3ab6e..01b5b21 100644 (file)
@@ -17,3 +17,6 @@
 
 #Local platform binaries
 /lib/*.dll
+
+#ini file
+NeighborNote.ini
index 3a0dc3c..a71896b 100644 (file)
--- a/.project
+++ b/.project
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <projectDescription>\r
-       <name>NixNote</name>\r
+       <name>NeighborNote</name>\r
        <comment></comment>\r
        <projects>\r
        </projects>\r
diff --git a/README.txt b/README.txt
deleted file mode 100644 (file)
index d6fdbf8..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-NixNote:: Evernote client clone for Linux, Mac OS X and Windows 
-
-    Copyright 2009-2012, Randy Baumgarte 
-    Licensed under GNU General Public Lisence version 2
-
-This is an incomplete clone of Evernote designed to run on Linux. 
-It is written in Java so it will also run on other platforms as well but the primary focus has been to try 
-and get a usable environment for Linux.  While this is designed to work with Evernote, it is in no way
-connected with or supported by Evernote.  Any problems you encounter will not be corrected by them
-and, since this is GPL software, you are using this software at your own risk.  
-
-See release.txt for details of what works and what doesn't work.
-
-People have used this with both 64 & 32 bit versions of Linux as well as OpenJDK & Sun's Java 
-and (so far) have not encountered any problems with these different environments.
-
-Documents:
-
-release.txt:    Includes new features, known bugs and limitations.
-
-changelog.txt:  ChangeLog and development history
-install.txt:    Build and install instructions
-credit.txt:     Credit of nevernote developers
-gpl.txt:        License description of GPL v2.
-license.txt:    Legal notices for licenses and trademarks
-
-shortcut_howto.txt:  How-to document to setup shortcut keys.
-shurtcut_sample.txt: Its configuration sample
-
old mode 100755 (executable)
new mode 100644 (file)
index 2dca043..d9e0187
--- a/build.xml
+++ b/build.xml
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='utf-8'?>
 <project default="jar" basedir=".">
   <!-- program name -->
-  <property name="project.name" value="nixnote"/>
+  <property name="project.name" value="neighbornote"/>
   <property name="application.name" value="sandbox"/>
 
   <!-- targeted QtJambi library version  -->
   <property name="jvm.gcs" value="incgc"/><!-- GC strategy -->
 
   <!-- product jar file -->
-  <property name="jar.name" value="nixnote.jar"/>
+  <property name="jar.name" value="neighbornote.jar"/>
 
   <!-- product exec command -->
-  <property name="shell.command" value="nixnote.sh"/>
-  <property name="bat.command" value="nixnote.bat"/>
+  <property name="shell.command" value="neighbornote.sh"/>
+  <property name="bat.command" value="neighbornote.bat"/>
 
   <!-- qt utils -->
   <property name="linguist.update" value="lupdate"/>
   <property name="linguist.release" value="lrelease"/>
 
   <!-- translations -->
-  <property name="linguist.project" value="nixnote.pro"/>
+  <property name="linguist.project" value="neighbornote.pro"/>
 
   <!-- documents -->
   <property name="doc.changelog" value="changelog.txt"/>
        <fileset dir="${doc.dir}"/>
      </copy>
      <exec dir="dist" executable="tar">
-         <arg line="czf ../../nixnote-bin.tar.gz ."/>
+         <arg line="czf ../../neighbornote-bin.tar.gz ."/>
      </exec>
   </target>
 
old mode 100755 (executable)
new mode 100644 (file)
index 8eb41d0..77024a3
@@ -7,8 +7,8 @@ if [ "$(id -u)" != "0" ]; then
    exit 1
 fi
 
-cp $package_dir/usr/share/applications/nixnote.desktop /usr/share/applications/nixnote.desktop
-mkdir /usr/share/nixnote
-cp -r $package_dir/usr/share/nixnote/* /usr/share/nixnote/
+cp $package_dir/usr/share/applications/neighbornote.desktop /usr/share/applications/neighbornote.desktop
+mkdir /usr/share/neighbornote
+cp -r $package_dir/usr/share/neighbornote/* /usr/share/neighbornote/
 
 echo "Install complete"
index 9c8c788..b7b7efe 100644 (file)
@@ -1,4 +1,4 @@
-Welcome to NixNote.     
+Welcome to Neighbornote.     
 
 This is a very basic clone of Evernote designed to run on Linux.
 It is written in Java so it will also run on other platforms as well but the primary focus has been to try 
@@ -73,7 +73,7 @@ Only i386 & amd64 are currently supported.  This is due to the fact that Qt Jamb
 -- NOTE: I don't have OS-X so I can't verify the stability or usability of this under OS-X
 1.) Download the Mac install version.
 2.) Run the install program.
-3.) Run nixnote.sh from the installation directory.
+3.) Run neighbornote.sh from the installation directory.
 
 
 
@@ -83,7 +83,7 @@ Only i386 & amd64 are currently supported.  This is due to the fact that Qt Jamb
 =====================
 There are additional options if you wish to run multiple copies under the same userid and options which impact how Java works.  These settings are optional and, depending upon your needs, you probably don't need to touch them. 
 
-To run under multiple IDs, you need to pass a parameter NN_NAME="<name>" to the nixnote.sh shell script where <name> is whatever name you want to identify this instance as.  For example, ./nixnote.sh NN_NAME="test" will create a separate database called "test".  Anything you put in there will be separate from the default NeverNote database, so the username can also be different.
+To run under multiple IDs, you need to pass a parameter NN_NAME="<name>" to the neighbornote.sh shell script where <name> is whatever name you want to identify this instance as.  For example, ./nixnote.sh NN_NAME="test" will create a separate database called "test".  Anything you put in there will be separate from the default NeverNote database, so the username can also be different.
 
 
 
index a6321b0..594fe15 100644 (file)
@@ -1,11 +1,11 @@
 <html><head></head>
 
 <body>
-NixNote 1.0
+NeighborNote 1.0
 <p>
-NixNote is licensed under the Gnu Public License (GPL) version 2.
+NeighborNote is licensed under the Gnu Public License (GPL) version 2.
 <p>
-Evernote is Copyright © 2000-2010 Evernote Corporation.All rights reserved.
+Evernote is Copyright Â© 2000-2010 Evernote Corporation.All rights reserved.
 <p>
 Qt and Jambi the licensed property of Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
 <p>
similarity index 56%
rename from nixnote-osx
rename to neighbornote-osx
index 18a1cd9..78fcadf 100644 (file)
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 ###########################################
-# NixNote Startup script for OS-X
+# NeighborNote Startup script for OS-X
 ###########################################
 
 
@@ -13,8 +13,8 @@ eval $1
 # The ones below are examples only. #
 ###########################################
 
-NIXNOTE=$(cd `dirname $0` && pwd)
-# NIXNOTE=/usr/share/nixnote
+NEIGHBORNOTE=$(cd `dirname $0` && pwd)
+# NEIGHBORNOTE=/usr/share/neighbornote
 
 ########################################
 # Memory settings. These can be tuned #
@@ -54,7 +54,7 @@ NN_GC_OPT=-Xincgc
 ########################################
 # This next variable is optional. It #
 # is only needed if you want to run #
-# multiple copies of NixNote under #
+# multiple copies of NeighborNote under #
 # the same Linux user id. Each #
 # additional copy (after the first) #
 # should have a unique name. This #
@@ -84,40 +84,40 @@ done
 #####################
 # Setup environment #
 #####################
-NN_CLASSPATH=$NIXNOTE/nixnote.jar
-
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/apache-mime4j-0.6.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/commons-codec-1.5.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/commons-compress-1.2.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/commons-lang3-3.0.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/commons-logging-1.1.1.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/evernote-api-1.20.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/h2-1.3.158.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/httpclient-4.1.1.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/httpcore-4.1.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/httpmime-4.1.1.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/jaxen-1.1.3.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/jazzy.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/jtidy-r938.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/libthrift.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/log4j-1.2.14.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/pdfbox-app-1.6.0.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/poi-3.7-20101029.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/poi-ooxml-3.7.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/poi-ooxml-schemas-3.7-20101029.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/poi-scratchpad-3.7-20101029.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/scribe-1.3.0.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/tika.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/xmlbeans-2.3.0.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/xsdlib-20060615.jar
-
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/qtjambi-macosx-4.5.2_01.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/qtjambi-macosx-gcc-4.5.2_01.jar
+NN_CLASSPATH=$NEIGHBORNOTE/neighbornote.jar
+
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/apache-mime4j-0.6.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/commons-codec-1.5.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/commons-compress-1.2.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/commons-lang3-3.0.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/commons-logging-1.1.1.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/evernote-api-1.20.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/h2-1.3.158.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/httpclient-4.1.1.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/httpcore-4.1.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/httpmime-4.1.1.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/jaxen-1.1.3.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/jazzy.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/jtidy-r938.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/libthrift.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/log4j-1.2.14.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/pdfbox-app-1.6.0.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/poi-3.7-20101029.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/poi-ooxml-3.7.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/poi-ooxml-schemas-3.7-20101029.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/poi-scratchpad-3.7-20101029.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/scribe-1.3.0.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/tika.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/xmlbeans-2.3.0.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/xsdlib-20060615.jar
+
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/qtjambi-macosx-4.5.2_01.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/qtjambi-macosx-gcc-4.5.2_01.jar
 
 ###################
 # Run the program #
 ###################
-cd $NIXNOTE
+cd $NEIGHBORNOTE
 
 java -Xmx$NN_XMX -Xms$NN_XMS -XX:NewRatio=$NN_NEW_RATIO $NN_GC_OPT $NN_DEBUG -classpath $NN_CLASSPATH cx.fbn.nevernote.NeverNote --sync-only=$NN_SYNCONLY --home=$NN_HOME --name=$NN_NAME -XstartOnFirstThread -d32 -client
 
similarity index 54%
rename from nixnote.bat
rename to neighbornote.bat
index c2a79f0..6893c6e 100755 (executable)
@@ -2,7 +2,7 @@
 rem #####################\r
 rem # Install variables #\r
 rem #####################\r
-set NIXNOTE=%~dp0\r
+set NEIGHBORNOTE=%~dp0\r
 \r
 rem ########################################\r
 rem # Memory settings.  These can be tuned #\r
@@ -42,7 +42,7 @@ rem set NN_DEBUG=-verbose:gc
 rem ########################################\r
 rem # This next variable is optional. It   #\r
 rem # is only needed if you want to run    #\r
-rem # multiple copies of NixNote under     #\r
+rem # multiple copies of NeighborNote under#\r
 rem # the same user id.  Each              #\r
 rem # additional copy (after the first)    #\r
 rem # should have a unique name.  This     #\r
@@ -77,37 +77,37 @@ GOTO Loop
 rem #####################\r
 rem # Setup environment #\r
 rem #####################\r
-set NN_CLASSPATH=%NIXNOTE%nixnote.jar\r
-\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\apache-mime4j-0.6.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\commons-codec-1.5.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\commons-compress-1.2.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\commons-lang3-3.0.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\commons-logging-1.1.1.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\evernote-api-1.20.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\h2-1.3.158.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\httpclient-4.1.1.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\httpcore-4.1.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\httpmime-4.1.1.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\jaxen-1.1.3.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\jazzy.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\jtidy-r938.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\libthrift.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\log4j-1.2.14.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\pdfbox-app-1.6.0.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\poi-3.7-20101029.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\poi-ooxml-3.7.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\poi-ooxml-schemas-3.7-20101029.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\poi-scratchpad-3.7-20101029.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\scribe-1.3.0.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\tika.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\xmlbeans-2.3.0.jar\r
-set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\xsdlib-20060615.jar\r
-\r
-if exist "%NIXNOTE%lib\qtjambi-win32-4.5.2_01.jar" set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\qtjambi-win32-4.5.2_01.jar\r
-if exist "%NIXNOTE%lib\qtjambi-win32-msvc2005-4.5.2_01.jar" set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\qtjambi-win32-msvc2005-4.5.2_01.jar\r
-if exist "%NIXNOTE%lib\qtjambi-win64-4.5.2_01.jar" set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\qtjambi-win64-4.5.2_01.jar\r
-if exist "%NIXNOTE%lib\qtjambi-win64-msvc2005x64-4.5.2_01.jar" set NN_CLASSPATH=%NN_CLASSPATH%;%NIXNOTE%lib\qtjambi-win64-msvc2005x64-4.5.2_01.jar\r
+set NN_CLASSPATH=%NEIGHBORNOTE%neighbornote.jar\r
+\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\apache-mime4j-0.6.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\commons-codec-1.5.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\commons-compress-1.2.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\commons-lang3-3.0.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\commons-logging-1.1.1.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\evernote-api-1.20.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\h2-1.3.158.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\httpclient-4.1.1.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\httpcore-4.1.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\httpmime-4.1.1.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\jaxen-1.1.3.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\jazzy.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\jtidy-r938.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\libthrift.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\log4j-1.2.14.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\pdfbox-app-1.6.0.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\poi-3.7-20101029.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\poi-ooxml-3.7.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\poi-ooxml-schemas-3.7-20101029.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\poi-scratchpad-3.7-20101029.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\scribe-1.3.0.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\tika.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\xmlbeans-2.3.0.jar\r
+set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\xsdlib-20060615.jar\r
+\r
+if exist "%NEIGHBORNOTE%lib\qtjambi-win32-4.5.2_01.jar" set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\qtjambi-win32-4.5.2_01.jar\r
+if exist "%NEIGHBORNOTE%lib\qtjambi-win32-msvc2005-4.5.2_01.jar" set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\qtjambi-win32-msvc2005-4.5.2_01.jar\r
+if exist "%NEIGHBORNOTE%lib\qtjambi-win64-4.5.2_01.jar" set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\qtjambi-win64-4.5.2_01.jar\r
+if exist "%NEIGHBORNOTE%lib\qtjambi-win64-msvc2005x64-4.5.2_01.jar" set NN_CLASSPATH=%NN_CLASSPATH%;%NEIGHBORNOTE%lib\qtjambi-win64-msvc2005x64-4.5.2_01.jar\r
 \r
 rem set NN_CLASSPATH="%NN_CLASSPATH%"\r
 \r
old mode 100755 (executable)
new mode 100644 (file)
similarity index 53%
rename from nixnote.desktop
rename to neighbornote.desktop.desktop
index 496cafe..4a00ef5
@@ -1,10 +1,12 @@
+
 [Desktop Entry]
-Name=NixNote
+Name=NeighborNote
 Comment=Use with Evernote to remember everything
 GenericName=Evernote-clone
-Exec=/usr/share/nixnote/nixnote.sh
-Icon=/usr/share/nixnote/nixnote.png
+Exec=/usr/share/neighbornote/neighbornote.sh
+Icon=/usr/share/neighbornote/neighbornote.png
 StartupNotify=true
 Terminal=false
 Type=Application
 Categories=Network;
+Name[ja_JP]=neighbornote.desktop
diff --git a/neighbornote.ico b/neighbornote.ico
new file mode 100644 (file)
index 0000000..17fc15b
Binary files /dev/null and b/neighbornote.ico differ
diff --git a/neighbornote.png b/neighbornote.png
new file mode 100644 (file)
index 0000000..22c2e12
Binary files /dev/null and b/neighbornote.png differ
similarity index 100%
rename from nixnote.pro
rename to neighbornote.pro
old mode 100755 (executable)
new mode 100644 (file)
similarity index 54%
rename from nixnote.sh
rename to neighbornote.sh
index eefa460..9dc77b6
@@ -8,8 +8,8 @@ eval $1
 # The ones below are examples only.       #
 ###########################################
 
-NIXNOTE=$(cd `dirname $0` && pwd)
-# NIXNOTE=/usr/share/nixnote
+NEIGHBORNOTE=$(cd `dirname $0` && pwd)
+# NEIGHBORNOTE=/usr/share/neighbornote
 
 ########################################
 # Memory settings.  These can be tuned #
@@ -49,7 +49,7 @@ NN_GC_OPT=-Xincgc
 ########################################
 # This next variable is optional. It   #
 # is only needed if you want to run    #
-# multiple copies of NixNote under     #
+# multiple copies of NeighborNote under     #
 # the same Linux user id.  Each        #
 # additional copy (after the first)    #
 # should have a unique name.  This     #
@@ -79,41 +79,41 @@ done
 #####################
 # Setup environment #
 #####################
-NN_CLASSPATH=$NIXNOTE/nixnote.jar
-
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/apache-mime4j-0.6.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/commons-codec-1.5.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/commons-compress-1.2.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/commons-lang3-3.0.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/commons-logging-1.1.1.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/evernote-api-1.20.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/h2-1.3.158.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/httpclient-4.1.1.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/httpcore-4.1.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/httpmime-4.1.1.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/jaxen-1.1.3.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/jazzy.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/jtidy-r938.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/libthrift.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/log4j-1.2.14.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/scribe-1.3.0.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/pdfbox-app-1.6.0.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/poi-3.7-20101029.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/poi-ooxml-3.7.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/poi-ooxml-schemas-3.7-20101029.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/poi-scratchpad-3.7-20101029.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/tika.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/xmlbeans-2.3.0.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/xsdlib-20060615.jar
-
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/qtjambi-linux32-4.5.2_01.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/qtjambi-linux32-gcc-4.5.2_01.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/qtjambi-linux64-4.5.2_01.jar
-NN_CLASSPATH=$NN_CLASSPATH:$NIXNOTE/lib/qtjambi-linux64-gcc-4.5.2_01.jar
+NN_CLASSPATH=$NEIGHBORNOTE/neighbornote.jar
+
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/apache-mime4j-0.6.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/commons-codec-1.5.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/commons-compress-1.2.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/commons-lang3-3.0.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/commons-logging-1.1.1.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/evernote-api-1.20.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/h2-1.3.158.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/httpclient-4.1.1.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/httpcore-4.1.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/httpmime-4.1.1.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/jaxen-1.1.3.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/jazzy.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/jtidy-r938.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/libthrift.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/log4j-1.2.14.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/scribe-1.3.0.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/pdfbox-app-1.6.0.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/poi-3.7-20101029.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/poi-ooxml-3.7.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/poi-ooxml-schemas-3.7-20101029.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/poi-scratchpad-3.7-20101029.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/tika.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/xmlbeans-2.3.0.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/xsdlib-20060615.jar
+
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/qtjambi-linux32-4.5.2_01.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/qtjambi-linux32-gcc-4.5.2_01.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/qtjambi-linux64-4.5.2_01.jar
+NN_CLASSPATH=$NN_CLASSPATH:$NEIGHBORNOTE/lib/qtjambi-linux64-gcc-4.5.2_01.jar
 
 ###################
 # Run the program #
 ###################
-cd $NIXNOTE
+cd $NEIGHBORNOTE
 java -Xmx$NN_XMX -Xms$NN_XMS -XX:NewRatio=$NN_NEW_RATIO $NN_GC_OPT $NN_DEBUG -classpath $NN_CLASSPATH cx.fbn.nevernote.NeverNote --name=$NN_NAME --home=$NN_HOME --sync-only=$NN_SYNCONLY
 cd -
diff --git a/neighbornote_path.sh b/neighbornote_path.sh
new file mode 100644 (file)
index 0000000..7e12c04
--- /dev/null
@@ -0,0 +1,2 @@
+#! /bin/sh
+/usr/share/neighbornote/neighbornote.sh $*
diff --git a/nixnote.ico b/nixnote.ico
deleted file mode 100644 (file)
index e3b79fb..0000000
Binary files a/nixnote.ico and /dev/null differ
diff --git a/nixnote.png b/nixnote.png
deleted file mode 100644 (file)
index 5c89ec9..0000000
Binary files a/nixnote.png and /dev/null differ
diff --git a/nixnote_path.sh b/nixnote_path.sh
deleted file mode 100755 (executable)
index 3ee3d60..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#! /bin/sh
-/usr/share/nixnote/nixnote.sh $*
index e32370a..8892e2f 100644 (file)
@@ -1,4 +1,4 @@
-Welcome to NixNote
+Welcome to NeighborNote
 
 This is an open source clone of Evernote designed to run on Linux.  It is written in Java so it will also run on Windows & OS-X, but the primary focus has been to try and get a usable environment for Linux.  While this is designed to work with Evernote, it is in no way connectedwith or supported by Evernote.  Any problems you encounter will not be corrected by them and,since this is GPL software, you are using this software at your own risk.
 
index 6147761..347147c 100644 (file)
@@ -1,18 +1,18 @@
-I've tried to add the ability to customize your NixNote menu shortcuts,
+I've tried to add the ability to customize your NeighborNote menu shortcuts,
 but I don't want to take the time to setup a new dialog box and all the
 junk that entails.  So, I chose a text file config instead.  Eventually I 
 may change it so the text file can be edited within the running program, but
 I have other things to spend my time on at the moment.
 
-First, you don't need to do this.  Nixnote comes with a default set of 
+First, you don't need to do this.  Neighbornote comes with a default set of 
 shortcuts.  If you are happy with those then you don't need to do a thing.
 
 If you want to customize your shortcuts then you need to do a little work.
 
 You should have a shortcuts_sample.txt file.  Copy this to shortcuts.txt 
-in your Nixnote home directory (~/.nevernote on Linux & OS-X and your user
+in your Neighbornote home directory (~/.nevernote on Linux & OS-X and your user
 home directory on Windows).  This is the file that is read 
-when Nixnote starts.  Any changes to this file only happen at startup
+when Neighbornote starts.  Any changes to this file only happen at startup
 so if you change it you need to restart the program to see those changes.
 
 This file has three main columns.  
index 89b5966..e9e757d 100644 (file)
-/*\r
- * This file is part of NixNote \r
- * Copyright 2009 Randy Baumgarte\r
- * \r
- * This file may be licensed under the terms of of the\r
- * GNU General Public License Version 2 (the ``GPL'').\r
- *\r
- * Software distributed under the License is distributed\r
- * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either\r
- * express or implied. See the GPL for the specific language\r
- * governing rights and limitations.\r
- *\r
- * You should have received a copy of the GPL along with this\r
- * program. If not, go to http://www.gnu.org/licenses/gpl.html\r
- * or write to the Free Software Foundation, Inc.,\r
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\r
- *\r
-*/\r
-\r
-package cx.fbn.nevernote;\r
-\r
-\r
-import java.io.ByteArrayInputStream;\r
-import java.io.ByteArrayOutputStream;\r
-import java.io.IOException;\r
-import java.io.ObjectInputStream;\r
-import java.io.ObjectOutputStream;\r
-import java.text.SimpleDateFormat;\r
-import java.util.ArrayList;\r
-import java.util.Calendar;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-\r
-import org.apache.commons.lang3.StringEscapeUtils;\r
-\r
-import com.evernote.edam.type.Accounting;\r
-import com.evernote.edam.type.PrivilegeLevel;\r
-import com.evernote.edam.type.User;\r
-import com.evernote.edam.type.UserAttributes;\r
-import com.swabunga.spell.engine.Configuration;\r
-import com.trolltech.qt.core.QByteArray;\r
-import com.trolltech.qt.core.QSettings;\r
-import com.trolltech.qt.core.QSize;\r
-import com.trolltech.qt.gui.QPalette;\r
-import com.trolltech.qt.gui.QSystemTrayIcon;\r
-\r
-import cx.fbn.nevernote.config.FileManager;\r
-import cx.fbn.nevernote.config.InitializationException;\r
-import cx.fbn.nevernote.config.StartupConfig;\r
-import cx.fbn.nevernote.gui.ContainsAttributeFilterTable;\r
-import cx.fbn.nevernote.gui.DateAttributeFilterTable;\r
-import cx.fbn.nevernote.gui.ShortcutKeys;\r
-import cx.fbn.nevernote.utilities.ApplicationLogger;\r
-import cx.fbn.nevernote.utilities.Pair;\r
-\r
-\r
-//*****************************************************\r
-//*****************************************************\r
-//* Global constants & static functions used by \r
-//* multiple threads.\r
-//*****************************************************\r
-//*****************************************************\r
-\r
-public class Global {\r
-       // Set current version and the known versions.\r
-       public static String version = "1.5";\r
-       public static String[] validVersions = {"1.5", "1.4", "1.3", "1.2", "1.1", "1.0", "0.99", "0.98", "0.97", "0.96"};\r
-    public static String username = ""; \r
-    //public static String password = "";     \r
-    \r
-\r
-    // Each thread has an ID.  This is used primarily to check the status\r
-    // of running threads.\r
-    public static final int mainThreadId=0;\r
-    public static final int syncThreadId=1;\r
-    public static final int tagCounterThreadId=2;\r
-    public static final int trashCounterThreadId=3;   // This should always be the highest thread ID\r
-    public static final int indexThreadId=4;           // Thread for indexing words\r
-    public static final int saveThreadId=5;    // Thread used for processing data to saving content\r
-    public static final int notebookCounterThreadId=6;   // Notebook Thread\r
-    public static final int indexThread03Id=7;   // unused\r
-    public static final int indexThread04Id=8;   // unused\r
-    public static final int dbThreadId=9;   // This should always be the highest thread ID\r
-    public static final int threadCount = 10;\r
-    \r
-    \r
-    // These variables deal with where the list of notes appears\r
-    // They will either be vertical (View_List_Narrow) or will be\r
-    // on top of the note (View_List_Wide).  It also has the size of\r
-    // thumbnails displayed in each view\r
-    public static int View_List_Wide = 1;\r
-    public static int View_List_Narrow = 2;\r
-    public static QSize smallThumbnailSize = new QSize(100,75);\r
-    public static QSize largeThumbnailSize = new QSize(300,225);\r
-\r
-    // This is used to keep a running list of passwords that the user\r
-    // wants us to remember.\r
-    public static HashMap<String,Pair<String,String>> passwordSafe = new HashMap<String, Pair<String,String>>();\r
-    public static List<Pair<String,String>> passwordRemember = new ArrayList<Pair<String,String>>();\r
-    \r
-    \r
-    //public static String currentNotebookGuid;\r
-    \r
-    // These deal with Evernote user settings\r
-    public static User user; \r
-    public static long authTimeRemaining;\r
-    public static long authRefreshTime;\r
-    public static long failedRefreshes = 0; \r
-    public static String userStoreUrl;\r
-    public static String noteStoreUrl;\r
-    public static String noteStoreUrlBase;\r
-\r
-    // When we want to shut down we set this to true to short\r
-    // circut other threads\r
-    public static boolean keepRunning;\r
-        \r
-    // In the note list, these are the column numbers\r
-    // so I don't need to hard code numbers.\r
-    public static int noteTableCreationPosition = 0;\r
-    public static int noteTableTitlePosition = 1;\r
-    public static int noteTableTagPosition = 2;\r
-    public static int noteTableNotebookPosition = 3;\r
-    public static int noteTableChangedPosition = 4;\r
-    public static int noteTableGuidPosition = 5;\r
-    public static int noteTableAuthorPosition = 6;\r
-    public static int noteTableSourceUrlPosition = 7;\r
-    public static int noteTableSubjectDatePosition = 8;\r
-    public static int noteTableSynchronizedPosition = 9;\r
-    public static int noteTableThumbnailPosition = 10;\r
-    public static int noteTablePinnedPosition = 11;\r
-    public static int noteTableColumnCount = 12;\r
-    public static Integer cryptCounter = 0;\r
-    \r
-    //public static int minimumWordCount = 2;\r
-    \r
-    // Regular expression to parse text with when indexing\r
-    private static String wordRegex;\r
-    \r
-    // Experimental fixes.  Set via Edit/Preferences/Debugging\r
-    public static boolean enableCarriageReturnFix = false;\r
-    public static boolean enableHTMLEntitiesFix = false;\r
-    \r
-    // Used to set & retrieve ini & Windows registry settings\r
-    public static QSettings    settings;     // Set & get ini settings\r
-    public static boolean isConnected;    // Are we connected to Evernote\r
-    public static boolean showDeleted = false;   // Show deleted notes?\r
-    public static boolean disableUploads = false;  // Should we disable uploads (used in testing features)\r
-       public static int messageLevel;   // The level of messages to write to the log files\r
-       public static String tagDelimeter = ",";   // This is used to separate out tag names when entering above note\r
-       public static String attachmentNameDelimeter = "------";  // Used to separate out attachment names in the res directory\r
-       \r
-       \r
-       //* Database fields\r
-       public static String    databaseName = new String("NeverNote");  // database name.  used for multiple databases to separate settings.\r
-       public static String    indexDatabaseName = new String("Index"); // searchable words database\r
-       public static String    resourceDatabaseName = new String("Resources");  // attachments database\r
-       public static DateAttributeFilterTable createdSinceFilter;\r
-       public static DateAttributeFilterTable createdBeforeFilter;\r
-       public static DateAttributeFilterTable changedSinceFilter;\r
-       public static DateAttributeFilterTable changedBeforeFilter;\r
-       public static ContainsAttributeFilterTable containsFilter;\r
-       \r
-       // Log file used for debugging\r
-       public static ApplicationLogger    logger;\r
-       //PrintStream stdoutStream;\r
-       \r
-       // Application key shortcuts & appearance\r
-       public static QPalette                          originalPalette;\r
-       public static ShortcutKeys                      shortcutKeys;\r
-       \r
-       public static boolean                           disableViewing;  // used to disable the editor\r
-       \r
-       // When saving a note, this is a list of things we strip out because Evernote hates them\r
-       public static List<String>                              invalidElements = new ArrayList<String>();\r
-       public static HashMap<String, ArrayList<String>>        invalidAttributes = new HashMap<String, ArrayList<String>>();\r
-       \r
-       public static boolean mimicEvernoteInterface; // Try to mimic Evernote or allow multiple notebook selection\r
-       public static HashMap<String,String> resourceMap;   // List of attachments for a note.\r
-       public static String cipherPassword = "";    // If the database is encrypted, this stores the password\r
-       public static String databaseCache = "16384";  // Default DB cache size\r
-       \r
-       // These are used for performance testing\r
-       static Calendar startTraceTime;   \r
-       static Calendar intervalTraceTime;\r
-       \r
-       static boolean syncOnly;\r
-       \r
-       private static FileManager fileManager;  // Used to access files & directories\r
-       \r
-    // Do initial setup \r
-    public static void setup(StartupConfig startupConfig) throws InitializationException  {\r
-        settings = new QSettings("fbn.cx", startupConfig.getName());\r
-        disableViewing = startupConfig.getDisableViewing();\r
-        syncOnly = startupConfig.isSyncOnly();\r
-\r
-        fileManager = new FileManager(startupConfig.getHomeDirPath(), startupConfig.getProgramDirPath());\r
-\r
-\r
-               getServer();  // Setup URL to connect to\r
-               \r
-               // Get regular expressions used to parse out words\r
-               settings.beginGroup("General");\r
-               String regex = (String) settings.value("regex", "[,\\s]+");\r
-               setWordRegex(regex);\r
-               settings.endGroup();\r
-               \r
-               //Setup debugging information\r
-               settings.beginGroup("Debug");\r
-               String msglevel = (String) settings.value("messageLevel", "Low");\r
-               settings.endGroup();\r
-               \r
-               \r
-               //messageLevel = 1;\r
-               setMessageLevel(msglevel);\r
-               keepRunning = true;  // Make sure child threads stay running\r
+/*
+ * This file is part of NixNote 
+ * Copyright 2009 Randy Baumgarte
+ * 
+ * This file may be licensed under the terms of of the
+ * GNU General Public License Version 2 (the ``GPL'').
+ *
+ * Software distributed under the License is distributed
+ * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
+ * express or implied. See the GPL for the specific language
+ * governing rights and limitations.
+ *
+ * You should have received a copy of the GPL along with this
+ * program. If not, go to http://www.gnu.org/licenses/gpl.html
+ * or write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+*/
+
+package cx.fbn.nevernote;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.commons.lang3.StringEscapeUtils;
+
+import com.evernote.edam.type.Accounting;
+import com.evernote.edam.type.PrivilegeLevel;
+import com.evernote.edam.type.User;
+import com.evernote.edam.type.UserAttributes;
+import com.swabunga.spell.engine.Configuration;
+import com.trolltech.qt.core.QByteArray;
+import com.trolltech.qt.core.QSettings;
+import com.trolltech.qt.core.QSize;
+import com.trolltech.qt.gui.QPalette;
+import com.trolltech.qt.gui.QSystemTrayIcon;
+
+import cx.fbn.nevernote.config.FileManager;
+import cx.fbn.nevernote.config.InitializationException;
+import cx.fbn.nevernote.config.StartupConfig;
+import cx.fbn.nevernote.gui.ContainsAttributeFilterTable;
+import cx.fbn.nevernote.gui.DateAttributeFilterTable;
+import cx.fbn.nevernote.gui.ShortcutKeys;
+import cx.fbn.nevernote.utilities.ApplicationLogger;
+import cx.fbn.nevernote.utilities.Pair;
+
+
+//*****************************************************
+//*****************************************************
+//* Global constants & static functions used by 
+//* multiple threads.
+//*****************************************************
+//*****************************************************
+
+public class Global {
+       // Set current version and the known versions.
+       // ICHANGED 自分用に変更
+       public static String version = "0.1";
+       public static String[] validVersions = {"0.1"};
+       
+    public static String username = ""; 
+    //public static String password = "";     
+    
+
+    // Each thread has an ID.  This is used primarily to check the status
+    // of running threads.
+    public static final int mainThreadId=0;
+    public static final int syncThreadId=1;
+    public static final int tagCounterThreadId=2;
+    public static final int trashCounterThreadId=3;   // This should always be the highest thread ID
+    public static final int indexThreadId=4;           // Thread for indexing words
+    public static final int saveThreadId=5;    // Thread used for processing data to saving content
+    public static final int notebookCounterThreadId=6;   // Notebook Thread
+    public static final int indexThread03Id=7;   // unused
+    public static final int indexThread04Id=8;   // unused
+    public static final int dbThreadId=9;   // This should always be the highest thread ID
+    public static final int threadCount = 10;
+    
+    
+    // These variables deal with where the list of notes appears
+    // They will either be vertical (View_List_Narrow) or will be
+    // on top of the note (View_List_Wide).  It also has the size of
+    // thumbnails displayed in each view
+    public static int View_List_Wide = 1;
+    public static int View_List_Narrow = 2;
+    public static QSize smallThumbnailSize = new QSize(100,75);
+    public static QSize largeThumbnailSize = new QSize(300,225);
+
+    // This is used to keep a running list of passwords that the user
+    // wants us to remember.
+    public static HashMap<String,Pair<String,String>> passwordSafe = new HashMap<String, Pair<String,String>>();
+    public static List<Pair<String,String>> passwordRemember = new ArrayList<Pair<String,String>>();
+    
+    
+    //public static String currentNotebookGuid;
+    
+    // These deal with Evernote user settings
+    public static User user; 
+    public static long authTimeRemaining;
+    public static long authRefreshTime;
+    public static long failedRefreshes = 0; 
+    public static String userStoreUrl;
+    public static String noteStoreUrl;
+    public static String noteStoreUrlBase;
+
+    // When we want to shut down we set this to true to short
+    // circut other threads
+    public static boolean keepRunning;
+        
+    // In the note list, these are the column numbers
+    // so I don't need to hard code numbers.
+    public static int noteTableCreationPosition = 0;
+    public static int noteTableTitlePosition = 1;
+    public static int noteTableTagPosition = 2;
+    public static int noteTableNotebookPosition = 3;
+    public static int noteTableChangedPosition = 4;
+    public static int noteTableGuidPosition = 5;
+    public static int noteTableAuthorPosition = 6;
+    public static int noteTableSourceUrlPosition = 7;
+    public static int noteTableSubjectDatePosition = 8;
+    public static int noteTableSynchronizedPosition = 9;
+    public static int noteTableThumbnailPosition = 10;
+    public static int noteTablePinnedPosition = 11;
+    public static int noteTableColumnCount = 12;
+    public static Integer cryptCounter = 0;
+    
+    //public static int minimumWordCount = 2;
+    
+    // Regular expression to parse text with when indexing
+    private static String wordRegex;
+    
+    // Experimental fixes.  Set via Edit/Preferences/Debugging
+    public static boolean enableCarriageReturnFix = false;
+    public static boolean enableHTMLEntitiesFix = false;
+    
+    // Used to set & retrieve ini & Windows registry settings
+    public static QSettings    settings;     // Set & get ini settings
+    public static boolean isConnected;    // Are we connected to Evernote
+    public static boolean showDeleted = false;   // Show deleted notes?
+    public static boolean disableUploads = false;  // Should we disable uploads (used in testing features)
+       public static int messageLevel;   // The level of messages to write to the log files
+       public static String tagDelimeter = ",";   // This is used to separate out tag names when entering above note
+       public static String attachmentNameDelimeter = "------";  // Used to separate out attachment names in the res directory
+       
+       
+       //* Database fields
+       public static String    databaseName = new String("NeverNote");  // database name.  used for multiple databases to separate settings.
+       public static String    indexDatabaseName = new String("Index"); // searchable words database
+       public static String    resourceDatabaseName = new String("Resources");  // attachments database
+       
+       // ICHANGED
+       public static String behaviorDatabaseName = new String("Behavior"); // 操作履歴データベース   
+       
+       public static DateAttributeFilterTable createdSinceFilter;
+       public static DateAttributeFilterTable createdBeforeFilter;
+       public static DateAttributeFilterTable changedSinceFilter;
+       public static DateAttributeFilterTable changedBeforeFilter;
+       public static ContainsAttributeFilterTable containsFilter;
+       
+       // Log file used for debugging
+       public static ApplicationLogger    logger;
+       //PrintStream stdoutStream;
+       
+       // Application key shortcuts & appearance
+       public static QPalette                          originalPalette;
+       public static ShortcutKeys                      shortcutKeys;
+       
+       public static boolean                           disableViewing;  // used to disable the editor
+       
+       // When saving a note, this is a list of things we strip out because Evernote hates them
+       public static List<String>                              invalidElements = new ArrayList<String>();
+       public static HashMap<String, ArrayList<String>>        invalidAttributes = new HashMap<String, ArrayList<String>>();
+       
+       public static boolean mimicEvernoteInterface; // Try to mimic Evernote or allow multiple notebook selection
+       public static HashMap<String,String> resourceMap;   // List of attachments for a note.
+       public static String cipherPassword = "";    // If the database is encrypted, this stores the password
+       public static String databaseCache = "16384";  // Default DB cache size
+       
+       // These are used for performance testing
+       static Calendar startTraceTime;   
+       static Calendar intervalTraceTime;
+       
+       static boolean syncOnly;
+       
+       private static FileManager fileManager;  // Used to access files & directories
+       
+    // Do initial setup 
+    public static void setup(StartupConfig startupConfig) throws InitializationException  {
+       // ICHANGED 設定値の保存先を変更
+        settings = new QSettings("NeighborNote.ini", QSettings.Format.IniFormat);
+        
+        disableViewing = startupConfig.getDisableViewing();
+        syncOnly = startupConfig.isSyncOnly();
+
+        fileManager = new FileManager(startupConfig.getHomeDirPath(), startupConfig.getProgramDirPath());
+
+
+               getServer();  // Setup URL to connect to
+               
+               // Get regular expressions used to parse out words
+               settings.beginGroup("General");
+               String regex = (String) settings.value("regex", "[,\\s]+");
+               setWordRegex(regex);
+               settings.endGroup();
+               
+               //Setup debugging information
+               settings.beginGroup("Debug");
+               String msglevel = (String) settings.value("messageLevel", "Low");
+               settings.endGroup();
+               
+               
+               //messageLevel = 1;
+               setMessageLevel(msglevel);
+               keepRunning = true;  // Make sure child threads stay running
                disableUploads = disableUploads();  // Should we upload anything?  Normally false.\r
                //disableUploads = true;  //***** DELETE THIS LINE *******\r
-               enableCarriageReturnFix = enableCarriageReturnFix();  // Enable test fix?\r
-               enableHTMLEntitiesFix = enableHtmlEntitiesFix();  // Enable test fix?\r
-               \r
-               logger = new ApplicationLogger("global.log");  // Setup log for this class \r
-               shortcutKeys = new ShortcutKeys();  // Setup keyboard shortcuts.\r
-               mimicEvernoteInterface = getMimicEvernoteInterface();  // Should we mimic Evernote's notebook behavior\r
-               resourceMap = new HashMap<String,String>();  // Setup resource map used to store attachments when editing\r
-                       \r
-               databaseCache = getDatabaseCacheSize();  // Set database cache size     \r
-               \r
-               Global.username = getUserInformation().getUsername();\r
-    }\r
-\r
-    // Get/Set word parsing regular expression\r
-    public static String getWordRegex() {\r
-       return wordRegex;\r
-    }\r
-    public static void setWordRegex(String r) {\r
-       wordRegex = r;\r
-    }\r
-\r
-   // Set the debug message level\r
-   public static void setMessageLevel(String msglevel) {\r
-       if (msglevel.equalsIgnoreCase("low")) \r
-                       messageLevel = 1;\r
-               if (msglevel.equalsIgnoreCase("medium")) \r
-                       messageLevel = 2;\r
-               if (msglevel.equalsIgnoreCase("high")) \r
-                               messageLevel = 3;\r
-               if (msglevel.equalsIgnoreCase("extreme")) \r
-                                       messageLevel = 4;\r
-               settings.beginGroup("Debug");\r
-               settings.setValue("messageLevel", msglevel);\r
-               settings.endGroup();            \r
-    }\r
-\r
-   //****************************************************\r
-   //****************************************************\r
-   //** Save user account information from Evernote\r
-   //****************************************************\r
-   //****************************************************\r
-    public static void saveUserInformation(User user) {\r
-       settings.beginGroup("User");\r
-               settings.setValue("id", user.getId());\r
-               settings.setValue("username", user.getUsername());\r
-               settings.setValue("email", user.getEmail());\r
-               settings.setValue("name", user.getName());\r
-               settings.setValue("timezone", user.getTimezone());\r
-               settings.setValue("privilege", user.getPrivilege().getValue());\r
-               settings.setValue("created", user.getCreated());\r
-               settings.setValue("updated", user.getUpdated());\r
-               settings.setValue("deleted", user.getDeleted());\r
-               settings.setValue("shard", user.getShardId());\r
-               settings.endGroup();\r
-               isPremium();\r
-               if (user.getAttributes()!=null)\r
-                       saveUserAttributes(user.getAttributes());\r
-               if (user.getAccounting()!=null)\r
-                       saveUserAccounting(user.getAccounting());\r
-\r
-    }\r
-    public static User getUserInformation() {\r
-       User user = new User();\r
-       settings.beginGroup("User");\r
-       try {   \r
-               user.setId((Integer)settings.value("id", 0));                   \r
-       } catch  (java.lang.ClassCastException e) {\r
-               user.setId(new Integer((String)settings.value("id", "0")));\r
-       }\r
-               String username = (String)settings.value("username", "");\r
-               String email = (String)settings.value("email", "");\r
-               String name = (String)settings.value("name", "");\r
-               String timezone = (String)settings.value("timezone", "");\r
-               Integer privilege = 0;\r
-               try {   \r
-                       privilege = new Integer((String)settings.value("privilege", "0"));                      \r
-               } catch (java.lang.ClassCastException e) {\r
-                       privilege = (Integer)settings.value("privilege", 0);\r
-               }\r
-\r
-               try {   \r
-                       String date = (String)settings.value("created", "0");\r
-                       user.setCreated(new Long(date));\r
-                       date = (String)settings.value("updated", "0");\r
-                       user.setUpdated(new Long(date));\r
-                       date = (String)settings.value("deleted", "0");\r
-                       user.setDeleted(new Long(date));\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Long date = (Long)settings.value("created", 0);\r
-                       user.setCreated(date);\r
-                       date = (Long)settings.value("updated", 0);\r
-                       user.setUpdated(date);\r
-                       date = (Long)settings.value("deleted", 0);\r
-                       user.setDeleted(date);\r
-               }\r
-\r
-               String shard = (String)settings.value("shard", "");\r
-       settings.endGroup();\r
-       \r
-       user.setUsername(username);\r
-       user.setEmail(email);\r
-       user.setName(name);\r
-       user.setTimezone(timezone);\r
-       PrivilegeLevel userLevel = PrivilegeLevel.findByValue(privilege);\r
-       user.setPrivilege(userLevel);\r
-       user.setShardId(shard);\r
-       return user;\r
-    }\r
-    \r
-    public static void saveUserAttributes(UserAttributes attrib) {\r
-       settings.beginGroup("UserAttributes");\r
-               settings.setValue("defaultLocationName", attrib.getDefaultLocationName());\r
-               settings.setValue("defaultLatitude", attrib.getDefaultLocationName());\r
-               settings.setValue("defaultLongitude", attrib.getDefaultLocationName());\r
-               settings.setValue("incomingEmailAddress", attrib.getIncomingEmailAddress());\r
-               settings.endGroup();\r
-    }\r
-    public static UserAttributes getUserAttributes() {\r
-       settings.beginGroup("UserAttributes");\r
-       UserAttributes attrib = new UserAttributes();\r
-               attrib.setDefaultLocationName((String)settings.value("defaultLocationName",""));\r
-               attrib.setDefaultLatitudeIsSet(false);\r
-               attrib.setDefaultLongitudeIsSet(false);\r
-               attrib.setIncomingEmailAddress((String)settings.value("incomingEmailAddress", ""));\r
-               settings.endGroup();\r
-               return attrib;\r
-    }\r
-    public static void saveUserAccounting(Accounting acc) {\r
-       settings.beginGroup("UserAccounting");\r
-               settings.setValue("uploadLimit", acc.getUploadLimit());\r
-               settings.setValue("uploadLimitEnd", acc.getUploadLimitEnd());\r
-               settings.setValue("uploadLimitNextMonth", acc.getUploadLimitNextMonth());\r
-               settings.setValue("premiumServiceStart", acc.getPremiumServiceStart());\r
-               settings.setValue("nextPaymentDue", acc.getNextPaymentDue());\r
-               settings.setValue("uploadAmount", acc.getUpdated());\r
-               settings.endGroup();\r
-    }\r
-    public static long getUploadLimitEnd() {\r
-       Long limit;\r
-       settings.beginGroup("UserAccounting");\r
-       \r
-       // Upload limit\r
-               try {\r
-                       String val  = (String)settings.value("uploadLimitEnd", "0");\r
-                       limit = new Long(val.trim());\r
-               } catch (Exception e) {\r
-                       try {\r
-                               limit = (Long)settings.value("uploadLimitEnd", 0);\r
-                       } catch (Exception e1) {\r
-                               limit = new Long(0);\r
-                       }\r
-               }\r
-       \r
-               // return value\r
-       settings.endGroup();\r
-       return limit;\r
-    }\r
-    public static void saveUploadAmount(long amount) {\r
-       settings.beginGroup("UserAccounting");\r
-               settings.setValue("uploadAmount", amount);\r
-               settings.endGroup();\r
-   }\r
-    public static long getUploadAmount() {\r
-               long amt=0;\r
-               settings.beginGroup("UserAccounting");\r
-               try {\r
-                       String num = (String)settings.value("uploadAmount", "0");\r
-                       amt = new Long(num.trim());\r
-               } catch (Exception e) {\r
-                       try {\r
-                               amt = (Integer)settings.value("uploadAmount", 0);\r
-                       } catch (Exception e1) {\r
-                               amt = 0;\r
-                       }\r
-               }\r
-               settings.endGroup();\r
-               return amt;\r
-    }\r
-    public static void saveEvernoteUpdateCount(long amount) {\r
-       settings.beginGroup("UserAccounting");\r
-               settings.setValue("updateCount", amount);\r
-               settings.endGroup();\r
-    }\r
-    public static long getEvernoteUpdateCount() {\r
-               long amt;\r
-               settings.beginGroup("UserAccounting");\r
-               try {\r
-                       String num = (String)settings.value("updateCount", new Long(0).toString());\r
-                       amt = new Long(num.trim());\r
-               } catch (java.lang.ClassCastException e) {\r
-                       amt = 0;\r
-               }\r
-               settings.endGroup();\r
-               return amt;\r
-    }\r
-    public static boolean isPremium() {\r
-               int level;\r
-               settings.beginGroup("User");\r
-               try {\r
-                       String num = (String)settings.value("privilege", "1");\r
-                       level = new Integer(num.trim());\r
-               } catch (java.lang.ClassCastException e) {\r
-                       try {\r
-                               level = (Integer)settings.value("privilege", 1);\r
-                       } catch (Exception e1) {\r
-                               level = 1;\r
-                       }\r
-               }\r
-               settings.endGroup();\r
-               PrivilegeLevel userLevel = PrivilegeLevel.findByValue(level);\r
-               if (userLevel == PrivilegeLevel.NORMAL)\r
-                       return false;\r
-               return true;\r
-               \r
-   }\r
-    public static long getUploadLimit() {\r
-               settings.beginGroup("UserAccounting");\r
-               long limit;\r
-               try {\r
-                       String num = (String)settings.value("uploadLimit", new Long(0).toString());\r
-                       limit = new Long(num.trim());\r
-               } catch (java.lang.ClassCastException e) {\r
-                       limit = 0;\r
-               }\r
-               settings.endGroup();\r
-               return limit;\r
-    }\r
-\r
-    \r
-    \r
-    //****************************************************\r
-    //****************************************************\r
-    //** View settings.  Used to restore settings \r
-    //** when starting and to control how the program\r
-    //** behaves.\r
-    //****************************************************\r
-    //****************************************************\r
-    \r
-    //* Get/Set if we should show a tray icon\r
-    public static boolean showTrayIcon() {\r
-               settings.beginGroup("General");\r
-               try {\r
-                       String max = (String) settings.value("showTrayIcon", "false");\r
-                       settings.endGroup();\r
-                       if (!max.equalsIgnoreCase("true") || !QSystemTrayIcon.isSystemTrayAvailable())\r
-                               return false;\r
-                       else\r
-                               return true;    \r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("showTrayIcon", false);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setShowTrayIcon(boolean val) {\r
-               settings.beginGroup("General");\r
-               if (val)\r
-                       settings.setValue("showTrayIcon", "true");\r
-               else\r
-                       settings.setValue("showTrayIcon", "false");\r
-               settings.endGroup();\r
-    }\r
-    \r
-    // Get/Set window maximized when closed last\r
-    public static boolean wasWindowMaximized() {\r
-       try {\r
-                       settings.beginGroup("General");\r
-                       String max = (String) settings.value("isMaximized", "true");\r
-                       settings.endGroup();\r
-                       if (!max.equalsIgnoreCase("true"))\r
-                               return false;\r
-                       return true;    \r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("isMaximized", true);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void saveWindowMaximized(boolean isMax) {\r
-               settings.beginGroup("General");\r
-               if (isMax)\r
-                       settings.setValue("isMaximized", "true");\r
-               else\r
-                       settings.setValue("isMaximized", "false");\r
-               settings.endGroup();\r
-    }\r
-    \r
-    // Get/set currently viewed note Guid\r
-    public static String getLastViewedNoteGuid() {\r
-               settings.beginGroup("General");\r
-               String guid = (String) settings.value("lastViewedNote", "");\r
-               settings.endGroup();\r
-               return guid;    \r
-    }\r
-    public static void saveCurrentNoteGuid(String guid) {\r
-               settings.beginGroup("General");\r
-               if (guid != null)\r
-                       settings.setValue("lastViewedNote", guid);\r
-               else\r
-                       settings.setValue("lastViewedNote", "");\r
-               settings.endGroup();\r
-    }\r
-    \r
-    // Get/Set the note column we are sorted on and the order\r
-    public static void setSortColumn(int i) {\r
-       int view = Global.getListView();\r
-               settings.beginGroup("General");\r
-       if (view == Global.View_List_Wide)\r
-               settings.setValue("sortColumn", i);\r
-       else\r
-               settings.setValue("sortColumn-Narrow", i);\r
-               settings.endGroup();\r
-    }\r
-    public static int getSortColumn() {;\r
-    String key;\r
-       if (Global.getListView() == Global.View_List_Wide)\r
-               key = "sortColumn";\r
-       else\r
-               key = "sortColumn-Narrow";\r
-\r
-       settings.beginGroup("General");\r
-       int order;      \r
-       try {\r
-               String val  = settings.value(key, new Integer(0)).toString();\r
-               order = new Integer(val.trim());\r
-       } catch (Exception e) {\r
-               try {\r
-                       order = (Integer)settings.value(key, 0);\r
-               } catch (Exception e1) {\r
-                   order = 0;\r
-               }\r
-       }\r
-       \r
-       settings.endGroup();\r
-       return order;\r
-    }\r
-    public static void setSortOrder(int i) {\r
-       int view = Global.getListView();\r
-               settings.beginGroup("General");\r
-       if (view == Global.View_List_Wide)\r
-               settings.setValue("sortOrder", i);\r
-       else\r
-               settings.setValue("sortOrder-Narrow", i);\r
-               settings.endGroup();\r
-    }\r
-    public static int getSortOrder() {\r
-       int view = Global.getListView();\r
-               settings.beginGroup("General");\r
-               String key;\r
-       if (view == Global.View_List_Wide)\r
-               key = "sortOrder";\r
-               else\r
-                       key = "sortOrder-Narrow";\r
-\r
-               int order;      \r
-               try {\r
-                       String val  = settings.value(key, new Integer(0)).toString();\r
-                       order = new Integer(val.trim());\r
-               } catch (Exception e) {\r
-                       try {\r
-                               order = (Integer)settings.value(key, 0);\r
-                       } catch (Exception e1) {\r
-                           order = 0;\r
-                       }\r
-               }\r
-               \r
-               settings.endGroup();\r
-               return order;\r
-    }\r
-    \r
-    // Should we automatically log in to Evernote when starting?\r
-    public static boolean automaticLogin() {\r
-       try {\r
-               settings.beginGroup("General");\r
-               String text = (String)settings.value("automaticLogin", "false");\r
-               settings.endGroup();\r
-               if (text.equalsIgnoreCase("true"))\r
-                       return true;\r
-               else\r
-                       return false;           \r
-       } catch (java.lang.ClassCastException e) {\r
-               Boolean value = (Boolean) settings.value("automaticLogin", false);\r
-               settings.endGroup();\r
-               return value;\r
-       }\r
-    }\r
-    public static void setAutomaticLogin(boolean val) {\r
-               settings.beginGroup("General");\r
-               if (val)\r
-                       settings.setValue("automaticLogin", "true");\r
-               else\r
-                       settings.setValue("automaticLogin", "false");\r
-               settings.endGroup();\r
-    }\r
-\r
-    // Get/set the Evernote server Url.  \r
-    public static void setServer(String server) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("server", server);\r
-               settings.endGroup();            \r
-    }\r
-    public static String getServer() {\r
-               settings.beginGroup("General");\r
-               String text = (String)settings.value("server", "www.evernote.com");\r
-               if (text.equals("www.evernote.com")) {\r
-                       userStoreUrl = "https://www.evernote.com/edam/user";\r
-                   noteStoreUrlBase = "www.evernote.com/edam/note/";   \r
-               } else {\r
-                       userStoreUrl = "https://sandbox.evernote.com/edam/user";\r
-                       noteStoreUrlBase = "sandbox.evernote.com/edam/note/";\r
-               }\r
-               settings.endGroup();\r
-//             if (isPremium())\r
-                       noteStoreUrlBase = "https://" + noteStoreUrlBase;\r
-//             else\r
-//                     noteStoreUrlBase = "http://" + noteStoreUrlBase;\r
-               return text;\r
-    }\r
-\r
-    // Get/Set if we should disable uploads to Evernote\r
-    public static boolean disableUploads() {\r
-       settings.beginGroup("General");\r
-       try {\r
-               String text = (String)settings.value("disableUploads", "false");\r
-               settings.endGroup();\r
-               if (text.equalsIgnoreCase("true"))\r
-                       return true;\r
-               else\r
-                       return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("disableUploads", false);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setDisableUploads(boolean val) {\r
-               settings.beginGroup("General");\r
-               if (val)\r
-                       settings.setValue("disableUploads", "true");\r
-               else\r
-                       settings.setValue("disableUploads", "false");\r
-               settings.endGroup();\r
-               disableUploads = val;\r
-    }\r
\r
-    // Should we view PDF documents inline?\r
-    public static boolean pdfPreview() {\r
-               settings.beginGroup("General");\r
-               try {\r
-                       String text = (String)settings.value("pdfPreview", "true");\r
-                       settings.endGroup();\r
-                       if (text.equalsIgnoreCase("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("pdfPreview", true);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setPdfPreview(boolean val) {\r
-               settings.beginGroup("General");\r
-               if (val)\r
-                       settings.setValue("pdfPreview", "true");\r
-               else\r
-                       settings.setValue("pdfPreview", "false");\r
-               settings.endGroup();\r
-    }\r
-    \r
-    // When creating a new note, should it inherit tags that are currently selected?\r
-    public static boolean newNoteWithSelectedTags() {\r
-               settings.beginGroup("General");\r
-               try {\r
-                       String text = (String)settings.value("newNoteWithSelectedTags", "false");\r
-                       settings.endGroup();\r
-                       if (text.equalsIgnoreCase("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("newNoteWithSelectedTags", false);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setNewNoteWithSelectedTags(boolean val) {\r
-               settings.beginGroup("General");\r
-               if (val)\r
-                       settings.setValue("newNoteWithSelectedTags", "true");\r
-               else\r
-                       settings.setValue("newNoteWithSelectedTags", "false");\r
-               settings.endGroup();\r
-    }\r
-    \r
-    // Minimum weight for text OCRed from Evernote. Anything below this\r
-    // Won't be shown to the user when they search\r
-    public static void setRecognitionWeight(int len) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("recognitionWeight", len);\r
-               settings.endGroup();            \r
-    }\r
-    public static int getRecognitionWeight() {\r
-               settings.beginGroup("General");\r
-               Integer len;\r
-               try {\r
+               enableCarriageReturnFix = enableCarriageReturnFix();  // Enable test fix?
+               enableHTMLEntitiesFix = enableHtmlEntitiesFix();  // Enable test fix?
+               
+               logger = new ApplicationLogger("global.log");  // Setup log for this class 
+               shortcutKeys = new ShortcutKeys();  // Setup keyboard shortcuts.
+               mimicEvernoteInterface = getMimicEvernoteInterface();  // Should we mimic Evernote's notebook behavior
+               resourceMap = new HashMap<String,String>();  // Setup resource map used to store attachments when editing
+                       
+               databaseCache = getDatabaseCacheSize();  // Set database cache size     
+               
+               Global.username = getUserInformation().getUsername();
+    }
+
+    // Get/Set word parsing regular expression
+    public static String getWordRegex() {
+       return wordRegex;
+    }
+    public static void setWordRegex(String r) {
+       wordRegex = r;
+    }
+
+   // Set the debug message level
+   public static void setMessageLevel(String msglevel) {
+       if (msglevel.equalsIgnoreCase("low")) 
+                       messageLevel = 1;
+               if (msglevel.equalsIgnoreCase("medium")) 
+                       messageLevel = 2;
+               if (msglevel.equalsIgnoreCase("high")) 
+                               messageLevel = 3;
+               if (msglevel.equalsIgnoreCase("extreme")) 
+                                       messageLevel = 4;
+               settings.beginGroup("Debug");
+               settings.setValue("messageLevel", msglevel);
+               settings.endGroup();            
+    }
+
+   //****************************************************
+   //****************************************************
+   //** Save user account information from Evernote
+   //****************************************************
+   //****************************************************
+    public static void saveUserInformation(User user) {
+       settings.beginGroup("User");
+               settings.setValue("id", user.getId());
+               settings.setValue("username", user.getUsername());
+               settings.setValue("email", user.getEmail());
+               settings.setValue("name", user.getName());
+               settings.setValue("timezone", user.getTimezone());
+               settings.setValue("privilege", user.getPrivilege().getValue());
+               settings.setValue("created", user.getCreated());
+               settings.setValue("updated", user.getUpdated());
+               settings.setValue("deleted", user.getDeleted());
+               settings.setValue("shard", user.getShardId());
+               settings.endGroup();
+               isPremium();
+               if (user.getAttributes()!=null)
+                       saveUserAttributes(user.getAttributes());
+               if (user.getAccounting()!=null)
+                       saveUserAccounting(user.getAccounting());
+
+    }
+    public static User getUserInformation() {
+       User user = new User();
+       settings.beginGroup("User");
+       try {   
+               user.setId((Integer)settings.value("id", 0));                   
+       } catch  (java.lang.ClassCastException e) {
+               user.setId(new Integer((String)settings.value("id", "0")));
+       }
+               String username = (String)settings.value("username", "");
+               String email = (String)settings.value("email", "");
+               String name = (String)settings.value("name", "");
+               String timezone = (String)settings.value("timezone", "");
+               Integer privilege = 0;
+               try {   
+                       privilege = new Integer((String)settings.value("privilege", "0"));                      
+               } catch (java.lang.ClassCastException e) {
+                       privilege = (Integer)settings.value("privilege", 0);
+               }
+
+               try {   
+                       String date = (String)settings.value("created", "0");
+                       user.setCreated(new Long(date));
+                       date = (String)settings.value("updated", "0");
+                       user.setUpdated(new Long(date));
+                       date = (String)settings.value("deleted", "0");
+                       user.setDeleted(new Long(date));
+               } catch (java.lang.ClassCastException e) {
+                       Long date = (Long)settings.value("created", 0);
+                       user.setCreated(date);
+                       date = (Long)settings.value("updated", 0);
+                       user.setUpdated(date);
+                       date = (Long)settings.value("deleted", 0);
+                       user.setDeleted(date);
+               }
+
+               String shard = (String)settings.value("shard", "");
+       settings.endGroup();
+       
+       user.setUsername(username);
+       user.setEmail(email);
+       user.setName(name);
+       user.setTimezone(timezone);
+       PrivilegeLevel userLevel = PrivilegeLevel.findByValue(privilege);
+       user.setPrivilege(userLevel);
+       user.setShardId(shard);
+       return user;
+    }
+    
+    public static void saveUserAttributes(UserAttributes attrib) {
+       settings.beginGroup("UserAttributes");
+               settings.setValue("defaultLocationName", attrib.getDefaultLocationName());
+               settings.setValue("defaultLatitude", attrib.getDefaultLocationName());
+               settings.setValue("defaultLongitude", attrib.getDefaultLocationName());
+               settings.setValue("incomingEmailAddress", attrib.getIncomingEmailAddress());
+               settings.endGroup();
+    }
+    public static UserAttributes getUserAttributes() {
+       settings.beginGroup("UserAttributes");
+       UserAttributes attrib = new UserAttributes();
+               attrib.setDefaultLocationName((String)settings.value("defaultLocationName",""));
+               attrib.setDefaultLatitudeIsSet(false);
+               attrib.setDefaultLongitudeIsSet(false);
+               attrib.setIncomingEmailAddress((String)settings.value("incomingEmailAddress", ""));
+               settings.endGroup();
+               return attrib;
+    }
+    public static void saveUserAccounting(Accounting acc) {
+       settings.beginGroup("UserAccounting");
+               settings.setValue("uploadLimit", acc.getUploadLimit());
+               settings.setValue("uploadLimitEnd", acc.getUploadLimitEnd());
+               settings.setValue("uploadLimitNextMonth", acc.getUploadLimitNextMonth());
+               settings.setValue("premiumServiceStart", acc.getPremiumServiceStart());
+               settings.setValue("nextPaymentDue", acc.getNextPaymentDue());
+               settings.setValue("uploadAmount", acc.getUpdated());
+               settings.endGroup();
+    }
+    public static long getUploadLimitEnd() {
+       Long limit;
+       settings.beginGroup("UserAccounting");
+       
+       // Upload limit
+               try {
+                       String val  = (String)settings.value("uploadLimitEnd", "0");
+                       limit = new Long(val.trim());
+               } catch (Exception e) {
+                       try {
+                               limit = (Long)settings.value("uploadLimitEnd", 0);
+                       } catch (Exception e1) {
+                               limit = new Long(0);
+                       }
+               }
+       
+               // return value
+       settings.endGroup();
+       return limit;
+    }
+    public static void saveUploadAmount(long amount) {
+       settings.beginGroup("UserAccounting");
+               settings.setValue("uploadAmount", amount);
+               settings.endGroup();
+   }
+    public static long getUploadAmount() {
+               long amt=0;
+               settings.beginGroup("UserAccounting");
+               try {
+                       String num = (String)settings.value("uploadAmount", "0");
+                       amt = new Long(num.trim());
+               } catch (Exception e) {
+                       try {
+                               amt = (Integer)settings.value("uploadAmount", 0);
+                       } catch (Exception e1) {
+                               amt = 0;
+                       }
+               }
+               settings.endGroup();
+               return amt;
+    }
+    public static void saveEvernoteUpdateCount(long amount) {
+       settings.beginGroup("UserAccounting");
+               settings.setValue("updateCount", amount);
+               settings.endGroup();
+    }
+    public static long getEvernoteUpdateCount() {
+               long amt;
+               settings.beginGroup("UserAccounting");
+               try {
+                       String num = (String)settings.value("updateCount", new Long(0).toString());
+                       amt = new Long(num.trim());
+               } catch (java.lang.ClassCastException e) {
+                       amt = 0;
+               }
+               settings.endGroup();
+               return amt;
+    }
+    public static boolean isPremium() {
+               int level;
+               settings.beginGroup("User");
+               try {
+                       String num = (String)settings.value("privilege", "1");
+                       level = new Integer(num.trim());
+               } catch (java.lang.ClassCastException e) {
+                       try {
+                               level = (Integer)settings.value("privilege", 1);
+                       } catch (Exception e1) {
+                               level = 1;
+                       }
+               }
+               settings.endGroup();
+               PrivilegeLevel userLevel = PrivilegeLevel.findByValue(level);
+               if (userLevel == PrivilegeLevel.NORMAL)
+                       return false;
+               return true;
+               
+   }
+    public static long getUploadLimit() {
+               settings.beginGroup("UserAccounting");
+               long limit;
+               try {
+                       String num = (String)settings.value("uploadLimit", new Long(0).toString());
+                       limit = new Long(num.trim());
+               } catch (java.lang.ClassCastException e) {
+                       limit = 0;
+               }
+               settings.endGroup();
+               return limit;
+    }
+
+    
+    
+    //****************************************************
+    //****************************************************
+    //** View settings.  Used to restore settings 
+    //** when starting and to control how the program
+    //** behaves.
+    //****************************************************
+    //****************************************************
+    
+    //* Get/Set if we should show a tray icon
+    public static boolean showTrayIcon() {
+               settings.beginGroup("General");
+               try {
+                       String max = (String) settings.value("showTrayIcon", "false");
+                       settings.endGroup();
+                       if (!max.equalsIgnoreCase("true") || !QSystemTrayIcon.isSystemTrayAvailable())
+                               return false;
+                       else
+                               return true;    
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("showTrayIcon", false);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setShowTrayIcon(boolean val) {
+               settings.beginGroup("General");
+               if (val)
+                       settings.setValue("showTrayIcon", "true");
+               else
+                       settings.setValue("showTrayIcon", "false");
+               settings.endGroup();
+    }
+    
+    // Get/Set window maximized when closed last
+    public static boolean wasWindowMaximized() {
+       try {
+                       settings.beginGroup("General");
+                       String max = (String) settings.value("isMaximized", "true");
+                       settings.endGroup();
+                       if (!max.equalsIgnoreCase("true"))
+                               return false;
+                       return true;    
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("isMaximized", true);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void saveWindowMaximized(boolean isMax) {
+               settings.beginGroup("General");
+               if (isMax)
+                       settings.setValue("isMaximized", "true");
+               else
+                       settings.setValue("isMaximized", "false");
+               settings.endGroup();
+    }
+    
+    // Get/set currently viewed note Guid
+    public static String getLastViewedNoteGuid() {
+               settings.beginGroup("General");
+               String guid = (String) settings.value("lastViewedNote", "");
+               settings.endGroup();
+               return guid;    
+    }
+    public static void saveCurrentNoteGuid(String guid) {
+               settings.beginGroup("General");
+               if (guid != null)
+                       settings.setValue("lastViewedNote", guid);
+               else
+                       settings.setValue("lastViewedNote", "");
+               settings.endGroup();
+    }
+    
+    // Get/Set the note column we are sorted on and the order
+    public static void setSortColumn(int i) {
+       int view = Global.getListView();
+               settings.beginGroup("General");
+       if (view == Global.View_List_Wide)
+               settings.setValue("sortColumn", i);
+       else
+               settings.setValue("sortColumn-Narrow", i);
+               settings.endGroup();
+    }
+    public static int getSortColumn() {;
+    String key;
+       if (Global.getListView() == Global.View_List_Wide)
+               key = "sortColumn";
+       else
+               key = "sortColumn-Narrow";
+
+       settings.beginGroup("General");
+       int order;      
+       try {
+               String val  = settings.value(key, new Integer(0)).toString();
+               order = new Integer(val.trim());
+       } catch (Exception e) {
+               try {
+                       order = (Integer)settings.value(key, 0);
+               } catch (Exception e1) {
+                   order = 0;
+               }
+       }
+       
+       settings.endGroup();
+       return order;
+    }
+    public static void setSortOrder(int i) {
+       int view = Global.getListView();
+               settings.beginGroup("General");
+       if (view == Global.View_List_Wide)
+               settings.setValue("sortOrder", i);
+       else
+               settings.setValue("sortOrder-Narrow", i);
+               settings.endGroup();
+    }
+    public static int getSortOrder() {
+       int view = Global.getListView();
+               settings.beginGroup("General");
+               String key;
+       if (view == Global.View_List_Wide)
+               key = "sortOrder";
+               else
+                       key = "sortOrder-Narrow";
+
+               int order;      
+               try {
+                       String val  = settings.value(key, new Integer(0)).toString();
+                       order = new Integer(val.trim());
+               } catch (Exception e) {
+                       try {
+                               order = (Integer)settings.value(key, 0);
+                       } catch (Exception e1) {
+                           order = 0;
+                       }
+               }
+               
+               settings.endGroup();
+               return order;
+    }
+    
+    // Should we automatically log in to Evernote when starting?
+    public static boolean automaticLogin() {
+       try {
+               settings.beginGroup("General");
+               String text = (String)settings.value("automaticLogin", "false");
+               settings.endGroup();
+               if (text.equalsIgnoreCase("true"))
+                       return true;
+               else
+                       return false;           
+       } catch (java.lang.ClassCastException e) {
+               Boolean value = (Boolean) settings.value("automaticLogin", false);
+               settings.endGroup();
+               return value;
+       }
+    }
+    public static void setAutomaticLogin(boolean val) {
+               settings.beginGroup("General");
+               if (val)
+                       settings.setValue("automaticLogin", "true");
+               else
+                       settings.setValue("automaticLogin", "false");
+               settings.endGroup();
+    }
+
+    // Get/set the Evernote server Url.  
+    public static void setServer(String server) {
+               settings.beginGroup("General");
+               settings.setValue("server", server);
+               settings.endGroup();            
+    }
+    public static String getServer() {
+               settings.beginGroup("General");
+               String text = (String)settings.value("server", "www.evernote.com");
+               if (text.equals("www.evernote.com")) {
+                       userStoreUrl = "https://www.evernote.com/edam/user";
+                   noteStoreUrlBase = "www.evernote.com/edam/note/";   
+               } else {
+                       userStoreUrl = "https://sandbox.evernote.com/edam/user";
+                       noteStoreUrlBase = "sandbox.evernote.com/edam/note/";
+               }
+               settings.endGroup();
+//             if (isPremium())
+                       noteStoreUrlBase = "https://" + noteStoreUrlBase;
+//             else
+//                     noteStoreUrlBase = "http://" + noteStoreUrlBase;
+               return text;
+    }
+
+    // Get/Set if we should disable uploads to Evernote
+    public static boolean disableUploads() {
+       settings.beginGroup("General");
+       try {
+               String text = (String)settings.value("disableUploads", "false");
+               settings.endGroup();
+               if (text.equalsIgnoreCase("true"))
+                       return true;
+               else
+                       return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("disableUploads", false);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setDisableUploads(boolean val) {
+               settings.beginGroup("General");
+               if (val)
+                       settings.setValue("disableUploads", "true");
+               else
+                       settings.setValue("disableUploads", "false");
+               settings.endGroup();
+               disableUploads = val;
+    }
+    // Should we view PDF documents inline?
+    public static boolean pdfPreview() {
+               settings.beginGroup("General");
+               try {
+                       String text = (String)settings.value("pdfPreview", "true");
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("pdfPreview", true);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setPdfPreview(boolean val) {
+               settings.beginGroup("General");
+               if (val)
+                       settings.setValue("pdfPreview", "true");
+               else
+                       settings.setValue("pdfPreview", "false");
+               settings.endGroup();
+    }
+    
+    // When creating a new note, should it inherit tags that are currently selected?
+    public static boolean newNoteWithSelectedTags() {
+               settings.beginGroup("General");
+               try {
+                       String text = (String)settings.value("newNoteWithSelectedTags", "false");
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("newNoteWithSelectedTags", false);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setNewNoteWithSelectedTags(boolean val) {
+               settings.beginGroup("General");
+               if (val)
+                       settings.setValue("newNoteWithSelectedTags", "true");
+               else
+                       settings.setValue("newNoteWithSelectedTags", "false");
+               settings.endGroup();
+    }
+    
+    // Minimum weight for text OCRed from Evernote. Anything below this
+    // Won't be shown to the user when they search
+    public static void setRecognitionWeight(int len) {
+               settings.beginGroup("General");
+               settings.setValue("recognitionWeight", len);
+               settings.endGroup();            
+    }
+    public static int getRecognitionWeight() {
+               settings.beginGroup("General");
+               Integer len;
+               try {
                        len = (Integer)settings.value("recognitionWeight", 30);\r
-               } catch (Exception e) {\r
+               } catch (Exception e) {
                        len = 80;\r
-               }\r
-               settings.endGroup();\r
-               return len;\r
-    }\r
-    \r
-    // get/set current debug message level\r
-    public static String getMessageLevel() {\r
-               settings.beginGroup("Debug");\r
-               String text = (String)settings.value("messageLevel", "Low");\r
-               settings.endGroup();\r
-               setMessageLevel(text);\r
-               return text;\r
-    }\r
-    public static void setDateFormat(String format) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("dateFormat", format);\r
-               settings.endGroup();            \r
-    }\r
-    \r
-    // Get/Set user date/time formats\r
-    public static String getDateFormat() {\r
-               settings.beginGroup("General");\r
-               String text = (String)settings.value("dateFormat", "MM/dd/yyyy");\r
-               settings.endGroup();\r
-               return text;\r
-    }\r
-    public static void setTimeFormat(String format) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("timeFormat", format);\r
-               settings.endGroup();            \r
-    }\r
-    public static String getTimeFormat() {\r
-               settings.beginGroup("General");\r
-               String text = (String)settings.value("timeFormat", "HH:mm:ss");\r
-               settings.endGroup();\r
-               return text;\r
-    }\r
-    \r
-    // How often should we sync with Evernote?\r
-    public static String getSyncInterval() {\r
-               settings.beginGroup("General");\r
-               String text = (String)settings.value("syncInterval", "15 minutes");\r
-               settings.endGroup();\r
-               return text;            \r
-    }\r
-    public static void setSyncInterval(String format) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("syncInterval", format);\r
-               settings.endGroup();            \r
-    }\r
-    \r
-    // Get/Set the width of columns and their position for the \r
-    // next start.\r
-    public static void setColumnWidth(String col, int width) {\r
-       if (Global.getListView() == Global.View_List_Wide)\r
-               settings.beginGroup("ColumnWidths");\r
-       else \r
-               settings.beginGroup("ColumnWidths-Narrow");\r
-               settings.setValue(col, width);\r
-               settings.endGroup();\r
-       }\r
-    public static int getColumnWidth(String col) {\r
-       int view = Global.getListView();\r
-       if (view == Global.View_List_Wide)\r
-               settings.beginGroup("ColumnWidths");\r
-       else\r
-               settings.beginGroup("ColumnWidths-Narrow");\r
-               Integer width;\r
-               try {\r
-                       String val  = (String)settings.value(col, "0");\r
-                       width = new Integer(val.trim());\r
-               } catch (Exception e) {\r
-                       try {\r
-                               width = (Integer)settings.value(col, 0);\r
-                       } catch (Exception e1) {\r
-                               width = 0;\r
-                       }\r
-               }\r
-               settings.endGroup();\r
-               return width;\r
-    }\r
-    public static void setColumnPosition(String col, int width) {\r
-       if (Global.getListView() == Global.View_List_Wide)\r
-               settings.beginGroup("ColumnPosition");\r
-       else\r
-               settings.beginGroup("ColumnPosition-Narrow");\r
-               settings.setValue(col, width);\r
-               settings.endGroup();\r
-    }\r
-    public static int getColumnPosition(String col) {\r
-       if (Global.getListView() == Global.View_List_Wide)\r
-               settings.beginGroup("ColumnPosition");\r
-       else\r
-               settings.beginGroup("ColumnPosition-Narrow");\r
-               Integer width;\r
-               try {\r
-                       String val  = (String)settings.value(col, "-1");\r
-                       width = new Integer(val.trim());\r
-               } catch (Exception e) {\r
-                       try {\r
-                               width = (Integer)settings.value(col, 0);\r
-                       } catch (Exception e1) {\r
-                               width = 0;\r
-                       }\r
-               }\r
-               settings.endGroup();\r
-               return width;\r
-    }\r
-    \r
-    // Ping the user when they try to delete or just do it.\r
-    public static boolean verifyDelete() {\r
-               settings.beginGroup("General");\r
-               try {\r
-                       String text = (String)settings.value("verifyDelete", "true");\r
-                       settings.endGroup();\r
-                       if (text.equalsIgnoreCase("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("verifyDelete", true);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setVerifyDelete(boolean val) {\r
-               settings.beginGroup("General");\r
-               if (val)\r
-                       settings.setValue("verifyDelete", "true");\r
-               else\r
-                       settings.setValue("verifyDelete", "false");\r
-               settings.endGroup();\r
-    }\r
-    \r
-    // Should it start minimized?\r
-    public static boolean startMinimized() {\r
-               settings.beginGroup("General");\r
-               try {\r
-                       String text = (String)settings.value("startMinimized", "false");\r
-                       settings.endGroup();\r
-                       if (text.equalsIgnoreCase("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("startMinimized", false);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setStartMinimized(boolean val) {\r
-               settings.beginGroup("General");\r
-               if (val)\r
-                       settings.setValue("startMinimized", "true");\r
-               else\r
-                       settings.setValue("startMinimized", "false");\r
-               settings.endGroup();\r
-    }\r
-    \r
-    // Should we upload the content of any deleted notes\r
-    public static boolean synchronizeDeletedContent() {\r
-               settings.beginGroup("General");\r
-               try {\r
-                       String text = (String)settings.value("syncDeletedContent", "false");\r
-                       settings.endGroup();\r
-                       if (text.equalsIgnoreCase("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("syncDeletedContent", false);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }  \r
-    public static void setSynchronizeDeletedContent(boolean val) {\r
-               settings.beginGroup("General");\r
-               if (val)\r
-                       settings.setValue("syncDeletedContent", "true");\r
-               else\r
-                       settings.setValue("syncDeletedContent", "false");\r
-               settings.endGroup();\r
-    }\r
-    \r
-    // Is a section of the window visible?  Used to hide things people don't\r
-    // want to see.\r
-    public static boolean isWindowVisible(String window) {\r
-               settings.beginGroup("WindowsVisible");\r
-               try {\r
-                       String defaultValue = "true";\r
-                       if (window.equalsIgnoreCase("noteInformation"))\r
-                               defaultValue = "false";\r
-                       String text = (String)settings.value(window, defaultValue);\r
-                       settings.endGroup();\r
-                       if (text.equalsIgnoreCase("true"))\r
-                               return true;\r
-               else\r
-                       return false;           \r
-               } catch (java.lang.ClassCastException e) {\r
-                       boolean defaultValue = true;\r
-                       if (window.equalsIgnoreCase("noteInformation"))\r
-                               defaultValue = false;\r
-                       Boolean value = (Boolean) settings.value("showTrayIcon", defaultValue);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void saveWindowVisible(String window, boolean val) {\r
-               settings.beginGroup("WindowsVisible");\r
-               if (val)\r
-                       settings.setValue(window, "true");\r
-               else\r
-                       settings.setValue(window, "false");\r
-               settings.endGroup();\r
-    }\r
-    \r
-    // Is a list in the column in the note list visible?  \r
-    public static boolean isColumnVisible(String window) {\r
-       String defaultValue = "true";\r
-       int view = Global.getListView();\r
-       if (Global.getListView() == Global.View_List_Wide)\r
-               settings.beginGroup("ColumnsVisible");\r
-       else\r
-               settings.beginGroup("ColumnsVisible-Narrow"); \r
-               if (window.equalsIgnoreCase("thumbnail") && view == Global.View_List_Wide)\r
-                       defaultValue = "false";\r
-               if (window.equalsIgnoreCase("thumbnail"))\r
-                       defaultValue = "false";\r
-               if (window.equalsIgnoreCase("Guid"))\r
-                       defaultValue = "false";\r
-               try {\r
-                       String text = (String)settings.value(window, defaultValue);\r
-                       settings.endGroup();\r
-                       if (text.equalsIgnoreCase("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       boolean defBool = false;\r
-                       if (window.equalsIgnoreCase("true"))\r
-                               defBool = true;\r
-                       else\r
-                               defBool = false;\r
-                       Boolean value = (Boolean) settings.value(window, defBool);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void saveColumnVisible(String column, boolean val) {\r
-       if (Global.getListView() == Global.View_List_Wide)\r
-               settings.beginGroup("ColumnsVisible");\r
-       else\r
-               settings.beginGroup("ColumnsVisible-Narrow");                   \r
-               if (val)\r
-                       settings.setValue(column, "true");\r
-               else\r
-                       settings.setValue(column, "false");\r
-               settings.endGroup();\r
-    }\r
-    \r
-    // Is a particular editor button visible?\r
-    public static boolean isEditorButtonVisible(String window) {\r
-               settings.beginGroup("EditorButtonsVisible");\r
-               try {\r
-                       String text = (String)settings.value(window, "true");\r
-                       settings.endGroup();\r
-                       if (text.equalsIgnoreCase("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value(window, true);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void saveEditorButtonsVisible(String column, boolean val) {\r
-               settings.beginGroup("EditorButtonsVisible");\r
-               if (val)\r
-                       settings.setValue(column, "true");\r
-               else\r
-                       settings.setValue(column, "false");\r
-               settings.endGroup();\r
-    }\r
-    \r
-    // Should the test fixes be enabled\r
-    public static boolean enableCarriageReturnFix() {\r
-       try {\r
-               settings.beginGroup("Debug");\r
-               String text = (String)settings.value("enableCarriageReturnFix", "false");\r
-               settings.endGroup();\r
-               if (text.equalsIgnoreCase("true"))\r
-                       return true;\r
-               else\r
-                       return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("enableCarriageReturnFix", false);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void saveCarriageReturnFix(boolean val) {\r
-               settings.beginGroup("Debug");\r
-               if (val)\r
-                       settings.setValue("enableCarriageReturnFix", "true");\r
-               else\r
-                       settings.setValue("enableCarriageReturnFix", "false");\r
-               settings.endGroup();\r
-    }\r
-    public static boolean enableHtmlEntitiesFix() {\r
-       try {\r
-               settings.beginGroup("Debug");\r
-               String text = (String)settings.value("enableHtmlEntitiesFix", "false");\r
-               settings.endGroup();\r
-               if (text.equalsIgnoreCase("true"))\r
-                       return true;\r
-               else\r
-                       return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("enableHtmlEntitiesFix", false);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void saveHtmlEntitiesFix(boolean val) {\r
-               settings.beginGroup("Debug");\r
-               if (val)\r
-                       settings.setValue("enableHtmlEntitiesFix", "true");\r
-               else\r
-                       settings.setValue("enableHtmlEntitiesFix", "false");\r
-               settings.endGroup();\r
-    }\r
-\r
-//    public static void setIndexThreads(int val) {\r
-//             settings.beginGroup("General");\r
-//             settings.setValue("indexThreads", val);\r
-//             settings.endGroup();\r
-//   }\r
-//    public static int getIndexThreads() {\r
-//             settings.beginGroup("General");\r
-//             Integer threads;\r
-//             try {\r
-//                     String val  = (String)settings.value("indexThreads", "1");\r
-//                     threads = new Integer(val.trim());\r
-//             } catch (Exception e) {\r
-//                     try {\r
-//                             threads = (Integer)settings.value("indexThreads", 1);\r
-//                     } catch (Exception e1) {\r
-//                             threads = 1;\r
-//                     }\r
-//             }\r
-//             settings.endGroup();\r
-//             threads = 1;\r
-//             return threads;\r
-    \r
-    // Get/Set text zoom factor\r
-//   }\r
-    public static void setZoomFactor(double val) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("zoomFactor", val);\r
-               settings.endGroup();\r
-    }\r
-    public static double getZoomFactor() {\r
-               settings.beginGroup("General");\r
-               Double threads;\r
-               try {\r
-                       String val  = (String)settings.value("zoomFactor", "1.0");\r
-                       threads = new Double(val.trim());\r
-               } catch (Exception e) {\r
-                       try {\r
-                               threads = (Double)settings.value("zoomFactor", 1.0);\r
-                       } catch (Exception e1) {\r
-                               threads = new Double(1);\r
-                       }\r
-               }\r
-               settings.endGroup();\r
-               return threads;\r
-    }\r
-    public static void setTextSizeMultiplier(double val) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("textMultiplier", val);\r
-               settings.endGroup();\r
-    }\r
-    public static double getTextSizeMultiplier() {\r
-               settings.beginGroup("General");\r
-               Double threads;\r
-               try {\r
-                       String val  = (String)settings.value("textMultiplier", "1");\r
-                       threads = new Double(val.trim());\r
-               } catch (Exception e) {\r
-                       try {\r
-                               threads = (Double)settings.value("textMultiplier", 1);\r
-                       } catch (Exception e1) {\r
-                               threads = new Double(1);\r
-                       }\r
-               }\r
-               settings.endGroup();\r
-               return threads;\r
-    }\r
-    \r
-    \r
-    // Should we mimic Evernote and restrict the notebooks selected?\r
-    public static boolean getMimicEvernoteInterface() {\r
-               settings.beginGroup("General");\r
-               try {\r
-                       String text = (String)settings.value("mimicEvernoteInterface", "true");\r
-                       settings.endGroup();\r
-                       if (text.equalsIgnoreCase("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("mimicEvernoteInterface", true);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setMimicEvernoteInterface(boolean value) {\r
-       settings.beginGroup("General");\r
-       if (value)\r
-               settings.setValue("mimicEvernoteInterface", "true");\r
-       else\r
-               settings.setValue("mimicEvernoteInterface", "false"); \r
-       settings.endGroup();\r
-    }\r
-    \r
-    \r
-    // Synchronize with Evernote when closing?\r
-    public static boolean synchronizeOnClose() {\r
-               settings.beginGroup("General");\r
-               try {\r
-                       String text = (String)settings.value("synchronizeOnClose", "false");\r
-                       settings.endGroup();\r
-                       if (text.equalsIgnoreCase("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("synchronizeOnClose", false);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setSynchronizeOnClose(boolean val) {\r
-               settings.beginGroup("General");\r
-               if (val)\r
-                       settings.setValue("synchronizeOnClose", "true");\r
-               else\r
-                       settings.setValue("synchronizeOnClose", "false");\r
-               settings.endGroup();\r
-    }\r
-\r
-    // Get/set the database version.  Not really used any more, but kept\r
-    // for compatibility.\r
-    public static void setDatabaseVersion(String version) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("databaseVersion", version);\r
-               settings.endGroup();\r
-    }\r
-    public static String getDatabaseVersion() {\r
-               settings.beginGroup("General");\r
-               String val  = (String)settings.value("databaseVersion", "0.70");\r
-               settings.endGroup();\r
-               return val;\r
-    }\r
-\r
-    // Get the URL (full path) of the main database\r
-    public static String getDatabaseUrl() {\r
-               settings.beginGroup("General");\r
-               String val  = (String)settings.value("DatabaseURL", "");\r
-               settings.endGroup();\r
-               if (val.equals(""))\r
-                       val = "jdbc:h2:"+Global.getFileManager().getDbDirPath(Global.databaseName);\r
-               return val;\r
-    }\r
-    \r
-    // get the url (full path) of the searchable word database\r
-    public static String getIndexDatabaseUrl() {\r
-               settings.beginGroup("General");\r
-               String val  = (String)settings.value("IndexDatabaseURL", "");\r
-               settings.endGroup();\r
-               if (val.equals(""))\r
-                       val = "jdbc:h2:"+Global.getFileManager().getDbDirPath(Global.indexDatabaseName);\r
-               return val;\r
-    }\r
-    \r
-    // Get the url (full path) of the attachment database\r
-    public static String getResourceDatabaseUrl() {\r
-               settings.beginGroup("General");\r
-               String val  = (String)settings.value("ResourceDatabaseURL", "");\r
-               settings.endGroup();\r
-               if (val.equals(""))\r
-                       val = "jdbc:h2:"+Global.getFileManager().getDbDirPath(Global.resourceDatabaseName);\r
-               return val;\r
-    }\r
-    public static void setDatabaseUrl(String value) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("DatabaseURL", value);\r
-               settings.endGroup();\r
-    }\r
-    public static void setIndexDatabaseUrl(String value) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("IndexDatabaseURL", value);\r
-               settings.endGroup();\r
-    }\r
-    public static void setResourceDatabaseUrl(String value) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("ResourceDatabaseURL", value);\r
-               settings.endGroup();\r
-    }\r
-    public static String getDatabaseUserid() {\r
-               settings.beginGroup("General");\r
-               String val  = (String)settings.value("databaseUserid", "");\r
-               settings.endGroup();\r
-               return val;\r
-    }\r
-    public static String getDatabaseUserPassword() {\r
-               settings.beginGroup("General");\r
-               String val  = (String)settings.value("databaseUserPassword", "");\r
-               settings.endGroup();\r
-               return val;\r
-    }\r
-    \r
-    // get/Set the style sheet and the palette to control the look & feel\r
-    public static void setStyle(String style) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("style", style);\r
-               settings.endGroup();\r
-    }\r
-    public static String getStyle() {\r
-               settings.beginGroup("General");\r
-               String val  = (String)settings.value("style", "Cleanlooks");\r
-               settings.endGroup();\r
-               return val;\r
-    }\r
-    public static boolean useStandardPalette() {\r
-               settings.beginGroup("General");\r
-               try {\r
-                       String text = (String)settings.value("standardPalette", "true");\r
-                       settings.endGroup();\r
-                       if (text.equalsIgnoreCase("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("standardPalette", true);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setStandardPalette(boolean val) {\r
-               settings.beginGroup("General");\r
-               if (val)\r
-                       settings.setValue("standardPalette", "true");\r
-               else\r
-                       settings.setValue("standardPalette", "false");\r
-               settings.endGroup();\r
-    }\r
-    \r
-    // Set the amount of time to wait between indexing\r
-    // Get/Set interval when the index thread wakes up.\r
-    public static void setIndexThreadSleepInterval(int sleep) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("IndexThreadSleepInterval", sleep);\r
-               settings.endGroup();\r
-    }\r
-    public static int getIndexThreadSleepInterval() {\r
-               settings.beginGroup("General");\r
-               Integer sleep;\r
-               try {\r
-                       String val  = (String)settings.value("IndexThreadSleepInterval", "300");\r
-                       sleep = new Integer(val.trim());\r
-               } catch (Exception e) {\r
-                       try {\r
-                               sleep = (Integer)settings.value("IndexThreadSleepInterval", 0);\r
-                       } catch (Exception e1) {\r
-                               sleep = 300;\r
-                       }\r
-               }\r
-               settings.endGroup();\r
-               return sleep;\r
-    }\r
-    \r
-    \r
-    // Get/Set a window state for later restoring\r
-    public static void saveState(String name, QByteArray state) {\r
-       int view = Global.getListView();\r
-       if (view == Global.View_List_Narrow)\r
-               name = name +"Narrow";\r
-               settings.beginGroup("SaveState");\r
-               settings.setValue(name, state);\r
-               settings.endGroup();\r
-    }\r
-    \r
-    public static QByteArray restoreState(String name) {\r
-       int view = Global.getListView();\r
-       if (view == Global.View_List_Narrow)\r
-               name = name +"Narrow";\r
-               settings.beginGroup("SaveState");\r
-               QByteArray state = (QByteArray)settings.value(name);\r
-               settings.endGroup();\r
-               return state;\r
-    }\r
-    public static void saveGeometry(String name, QByteArray state) {\r
-       int view = Global.getListView();\r
-       if (view == Global.View_List_Narrow)\r
-               settings.beginGroup("SaveGeometryNarrow");\r
-       else\r
-               settings.beginGroup("SaveGeometry");\r
-               settings.setValue(name, state);\r
-               settings.endGroup();\r
-    }\r
-    \r
-    public static QByteArray restoreGeometry(String name) {\r
-       int view = Global.getListView();\r
-       if (view == Global.View_List_Narrow)\r
-               settings.beginGroup("SaveGeometryNarrow");\r
-       else\r
-               settings.beginGroup("SaveGeometry");\r
-               QByteArray state = (QByteArray)settings.value(name);\r
-               settings.endGroup();\r
-               return state;\r
-    }\r
-    \r
-    \r
-    // Set how often to do an automatic save\r
-    public static void setAutoSaveInterval(int interval) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("autoSaveInterval", interval);\r
-               settings.endGroup();\r
-    }\r
-    public static int getAutoSaveInterval() {\r
-               settings.beginGroup("General");\r
-               Integer value;\r
-               try {\r
-                       String val  = (String)settings.value("autoSaveInterval", "5");\r
-                       value = new Integer(val.trim());\r
-               } catch (Exception e) {\r
-                       try {\r
-                               value = (Integer)settings.value("autoSaveInterval", 5);\r
-                       } catch (Exception e1) {\r
-                               value = 5;\r
-                       }\r
-               }\r
-               settings.endGroup();\r
-               return value;\r
-    }\r
-     \r
-    // Add an invalid attribute & element to the database so we don't bother parsing it in the future\r
-    // These values we automatically remove from any note.\r
-    // Add invalid attributes\r
-    public static void addInvalidAttribute(String element, String attribute) {\r
-       \r
-               List<String> attributes = invalidAttributes.get(element);\r
-               if (attributes != null) {\r
-                       for (int i=0; i<attributes.size(); i++)\r
-                               if (attribute.equalsIgnoreCase(attributes.get(i))) {\r
-                                       return;\r
-                       }\r
-       }\r
-       \r
-       ArrayList<String> attributeList;\r
-       if (!invalidAttributes.containsKey(element)) {\r
-               attributeList = new ArrayList<String>();\r
-               attributeList.add(attribute);\r
-               invalidAttributes.put(element, attributeList);\r
-       }\r
-       else {\r
-               attributeList = invalidAttributes.get(element);\r
-               attributeList.add(attribute);\r
-               invalidAttributes.put(element,attributeList);\r
-       }\r
-    }\r
-   \r
-    // Add invalid attributes\r
-    public static void addInvalidElement(String element) {\r
-               for (int i=0; i<invalidElements.size(); i++) {\r
-                       if (element.equalsIgnoreCase(invalidElements.get(i)))\r
-                               return;\r
-               }\r
-       invalidElements.add(element);\r
-    }\r
-    \r
-    // Get/Set proxy information\r
-    // Proxy settings\r
-    public static String getProxyValue(String key) {\r
-               settings.beginGroup("Proxy");\r
-               String val  = (String)settings.value(key, "");\r
-               settings.endGroup();\r
-               return val;\r
-    }\r
-    public static void setProxyValue(String key, String value) {\r
-               settings.beginGroup("Proxy");\r
-               settings.setValue(key, value);\r
-               settings.endGroup();\r
-    }\r
-    \r
-    // Change a byte array to a hex string\r
-    // Convert a byte array to a hex string\r
-       public static String byteArrayToHexString(byte data[]) {\r
-               StringBuffer buf = new StringBuffer();\r
-           for (byte element : data) {\r
-               int halfbyte = (element >>> 4) & 0x0F;\r
-               int two_halfs = 0;\r
-               do {\r
-                       if ((0 <= halfbyte) && (halfbyte <= 9))\r
-                              buf.append((char) ('0' + halfbyte));\r
-                          else\r
-                               buf.append((char) ('a' + (halfbyte - 10)));\r
-                       halfbyte = element & 0x0F;\r
-               } while(two_halfs++ < 1);\r
-           }\r
-           return buf.toString();              \r
-       }\r
-\r
-    \r
-       // Get/Set spelling settings\r
-       public static boolean getSpellSetting(String value) {\r
-               settings.beginGroup("Spell");\r
-               String text = (String)settings.value(value, "");\r
-               settings.endGroup();\r
-               if (text.equalsIgnoreCase("true"))\r
-                       return true;\r
-               if (text.equalsIgnoreCase("false"))\r
-                       return false;\r
-               if (value.equalsIgnoreCase(Configuration.SPELL_IGNOREDIGITWORDS))\r
-                       return true;\r
-               if (value.equalsIgnoreCase(Configuration.SPELL_IGNOREINTERNETADDRESSES))\r
-                       return true;\r
-               if (value.equalsIgnoreCase(Configuration.SPELL_IGNOREUPPERCASE))\r
-                       return true;\r
-               if (value.equalsIgnoreCase(Configuration.SPELL_IGNORESENTENCECAPITALIZATION))\r
-                       return true;\r
-               return false;\r
-    }\r
-    public static void setSpellSetting(String setting, boolean val) {\r
-               settings.beginGroup("Spell");\r
-               if (val)\r
-                       settings.setValue(setting, "true");\r
-               else\r
-                       settings.setValue(setting, "false");\r
-               settings.endGroup();\r
-    }\r
-       \r
-       // Get/Set how we should display tags (color them, hide unused, or do nothing)\r
-       // What to do with inactive tags?\r
-       public static String tagBehavior() {\r
-               settings.beginGroup("General");\r
-               String text = (String)settings.value("tagBehavior", "DoNothing");\r
-               settings.endGroup();\r
-               return text;\r
-       }\r
-       // What to do with inactive tags?\r
-       public static void setTagBehavior(String value) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("tagBehavior", value);\r
-               settings.endGroup();\r
-       }\r
-\r
-    \r
-       // Should the toolbar be visible?\r
-       public static boolean isToolbarButtonVisible(String window) {\r
-               settings.beginGroup("ToolbarButtonsVisible");\r
-               try {\r
-                       String text = (String)settings.value(window, "true");\r
-                       settings.endGroup();\r
-                       if (text.equalsIgnoreCase("true"))\r
-                               return true;\r
-                       else\r
-                               return false;   \r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value(window, true);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void saveToolbarButtonsVisible(String column, boolean val) {\r
-               settings.beginGroup("ToolbarButtonsVisible");\r
-               if (val)\r
-                       settings.setValue(column, "true");\r
-               else\r
-                       settings.setValue(column, "false");\r
-               settings.endGroup();\r
-    }\r
-       \r
-    // Are thumbnails enabled?\r
-    \r
-    public static boolean enableThumbnails() {\r
-               settings.beginGroup("Debug");\r
-               try {\r
-                       String text = (String)settings.value("thumbnails", "true");\r
-                       settings.endGroup();\r
-                       if (text.equalsIgnoreCase("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("thumbnails", true);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setEnableThumbnails(boolean val) {\r
-               settings.beginGroup("Debug");\r
-               if (val)\r
-                       settings.setValue("thumbnails", "true");\r
-               else\r
-                       settings.setValue("thumbnails", "false");\r
-               settings.endGroup();\r
-    }\r
-       \r
-    // Trace used for performance tuning.  Not normally used in production.\r
-       // Print date/time.  Used mainly for performance tracing\r
-       public static void trace(boolean resetInterval) {\r
-               String fmt = "MM/dd/yy HH:mm:ss.SSSSSS";\r
-               String dateTimeFormat = new String(fmt);\r
-               SimpleDateFormat simple = new SimpleDateFormat(dateTimeFormat);\r
-               Calendar cal = Calendar.getInstance();\r
-               if (intervalTraceTime == null) \r
-                       intervalTraceTime = Calendar.getInstance();\r
-               if (startTraceTime == null)\r
-                       startTraceTime = Calendar.getInstance();\r
-               \r
-               float interval = (cal.getTimeInMillis() - intervalTraceTime.getTimeInMillis());\r
-               float total = (cal.getTimeInMillis() - startTraceTime.getTimeInMillis());\r
-               \r
-//             if (interval > 00.0) {\r
-                       StackTraceElement[] exceptions = Thread.currentThread().getStackTrace();\r
-                       System.out.println("------------------------------------------");\r
-\r
-                       System.out.println("Date/Time " +simple.format(cal.getTime()));\r
-                       System.out.format("Interval Time: %-10.6f%n", interval);\r
-                       System.out.format("Total Time: %-10.6f%n", total);\r
-                       for (int i=2; i<5 && i<exceptions.length; i++) {\r
-                               System.out.println(exceptions[i]);\r
-                       }\r
-//             }\r
-               if (resetInterval)\r
-                       intervalTraceTime = cal;\r
-       }\r
-       public static void traceReset() {\r
-               intervalTraceTime = null;\r
-               startTraceTime = null;\r
-       }\r
-\r
-    \r
-       // Get the FileManager class to manage local files & directories\r
-       public static FileManager getFileManager() {\r
-        return fileManager;\r
-    }\r
-       \r
-       // Should the note editor be disabled?\r
-    public static boolean getDisableViewing() {\r
-        return disableViewing;\r
-    }\r
-\r
-    //**********************\r
-    //* Thumbnail zoom level\r
-    //**********************\r
-    public static int calculateThumbnailZoom(String content) {\r
-       int zoom = 1;\r
-               if (content.indexOf("application/pdf") == -1) {\r
-                       if (content.indexOf("image/") == -1) {\r
-                               String text =  StringEscapeUtils.unescapeHtml4(content.replaceAll("\\<.*?\\>", ""));\r
-                               zoom = 2;\r
-                               if (text.length() < 500) \r
-                                       zoom = 2;\r
-                               if (text.length() < 250)\r
-                                       zoom = 3;\r
-                               if (text.length() < 100)\r
-                                       zoom = 4;\r
-                               if (text.length() < 50)\r
-                                       zoom = 5;\r
-                               if (text.length() < 10)\r
-                                       zoom = 6;\r
-                       }\r
-               }\r
-               return zoom;\r
-    }\r
-    \r
-    //**********************\r
-    //* List View settings \r
-    //**********************\r
-    public static void setListView(int view) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("listView", view);\r
-               settings.endGroup();\r
-    }\r
-    public static int getListView() {\r
-               settings.beginGroup("General");\r
-               Integer value;\r
-               try {\r
-                       String val  = (String)settings.value("listView", View_List_Wide);\r
-                       value = new Integer(val.trim());\r
-               } catch (Exception e) {\r
-                       try {\r
-                               value = (Integer)settings.value("listView", View_List_Wide);\r
-                       } catch (Exception e1) {\r
-                               value = View_List_Wide;\r
-                       }\r
-               }\r
-               settings.endGroup();\r
-               return value;\r
-    }\r
-\r
-    \r
-    \r
-    //*******************\r
-    // Font Settings\r
-    //*******************\r
-    public static boolean overrideDefaultFont() {\r
-               settings.beginGroup("Font");\r
-               try {\r
-                       String text = (String)settings.value("overrideFont", "false");\r
-                       settings.endGroup();\r
-                       if (text.equalsIgnoreCase("true"))\r
-                               return true;\r
-                       else\r
-                               return false;   \r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("overrideFont", false);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-\r
-    }\r
-    \r
-    //****************************************************\r
-    // Get/Set the default font settings for a new note\r
-    //****************************************************\r
-    public static void setOverrideDefaultFont(boolean value) {\r
-               settings.beginGroup("Font");\r
-               settings.setValue("overrideFont", value);\r
-               settings.endGroup();    \r
-    }\r
-    public static String getDefaultFont() {\r
-               settings.beginGroup("Font");\r
-               String val  = (String)settings.value("font", "");\r
-               settings.endGroup();\r
-               return val;\r
-    }\r
-    public static void setDefaultFont(String value) {\r
-               settings.beginGroup("Font");\r
-               settings.setValue("font", value);\r
-               settings.endGroup();\r
-    }\r
-    public static String getDefaultFontSize() {\r
-               settings.beginGroup("Font");\r
-               String val  = (String)settings.value("fontSize", "");\r
-               settings.endGroup();\r
-               return val;\r
-    }\r
-    public static void setDefaultFontSize(String value) {\r
-               settings.beginGroup("Font");\r
-               settings.setValue("fontSize", value);\r
-               settings.endGroup();\r
-    }\r
-    \r
-    \r
-    //*******************************************\r
-    // Override the close & minimize instead.\r
-    //*******************************************\r
-    public static boolean minimizeOnClose() {\r
-               settings.beginGroup("General");\r
-               try {\r
-                       String text = (String)settings.value("minimizeOnClose", "false");\r
-                       settings.endGroup();\r
-                       if (text.equalsIgnoreCase("true") && QSystemTrayIcon.isSystemTrayAvailable())\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("minimizeOnClose", false);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setMinimizeOnClose(boolean value) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("minimizeOnClose", value);\r
-               settings.endGroup();    \r
-    }\r
-\r
-    //*********************************\r
-    // Check version information\r
-    //*********************************\r
-    public static boolean checkVersionUpgrade() {\r
-               settings.beginGroup("Upgrade");\r
-               try {\r
-                       String text = (String)settings.value("checkForUpdates", "true");\r
-                       settings.endGroup();\r
-                       if (text.equalsIgnoreCase("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("checkForUpdates", true);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setCheckVersionUpgrade(boolean value) {\r
-               settings.beginGroup("Upgrade");\r
-               settings.setValue("checkForUpdates", value);\r
-               settings.endGroup();    \r
-    }\r
-    public static String getUpdatesAvailableUrl() {\r
-               settings.beginGroup("Upgrade");\r
-               String text = (String)settings.value("avialableUrl", "http://nevernote.sourceforge.net/versions.txt");\r
-               settings.endGroup();    \r
-               return text;\r
-    }\r
-    public static String getUpdateAnnounceUrl() {\r
-               settings.beginGroup("Upgrade");\r
-               String text = (String)settings.value("announceUrl", "http://nevernote.sourceforge.net/upgrade.html");\r
-               settings.endGroup();    \r
-               return text;\r
-    }\r
-    \r
-    //*******************\r
-    // Index settings\r
-    //*******************\r
-    // Set/Get if we should index the text of a note\r
-    public static boolean indexNoteBody() {\r
-               settings.beginGroup("Index");\r
-               try {\r
-                       String value = (String)settings.value("indexNoteBody", "true");\r
-                       settings.endGroup();\r
-                       if (value.equals("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("indexNoteBody", true);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setIndexNoteTitle(boolean value) {\r
-               settings.beginGroup("Index");\r
-               settings.setValue("indexNoteTitle", value);\r
-               settings.endGroup();    \r
-    }\r
-    // Set/Get if we should index the title of a note\r
-    public static boolean indexNoteTitle() {\r
-               settings.beginGroup("Index");\r
-               try {\r
-                       String value = (String)settings.value("indexNoteTitle", "true");\r
-                       settings.endGroup();\r
-                       if (value.equals("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("indexNoteTitle", true);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setIndexNoteBody(boolean value) {\r
-               settings.beginGroup("Index");\r
-               settings.setValue("indexNoteBody", value);\r
-               settings.endGroup();    \r
-    }\r
-    // Set/Get if we should index any attachments\r
-    public static boolean indexAttachmentsLocally() {\r
-               settings.beginGroup("Index");\r
-               try {\r
-                       String value = (String)settings.value("indexAttachmentsLocally", "true");\r
-                       settings.endGroup();\r
-                       if (value.equals("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("indexAttachmentsLocally", true);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setIndexImageRecognition(boolean value) {\r
-               settings.beginGroup("Index");\r
-               settings.setValue("indexImageRecognition", value);\r
-               settings.endGroup();    \r
-    }\r
-    public static boolean indexImageRecognition() {\r
-               settings.beginGroup("Index");\r
-               try {\r
-                       String value = (String)settings.value("indexImageRecognition", "true");\r
-                       settings.endGroup();\r
-                       if (value.equals("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("indexImageRecognition", true);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setIndexAttachmentsLocally(boolean value) {\r
-               settings.beginGroup("Index");\r
-               settings.setValue("indexAttachmentsLocally", value);\r
-               settings.endGroup();    \r
-    }\r
-    // Get/Set characters that shouldn't be removed from a word\r
-    public static String getSpecialIndexCharacters() {\r
-               settings.beginGroup("Index");\r
-               String text = (String)settings.value("specialCharacters", "");\r
-               settings.endGroup();    \r
-               return text;\r
-    }\r
-    public static void setSpecialIndexCharacters(String value) {\r
-               settings.beginGroup("Index");\r
-               settings.setValue("specialCharacters", value);\r
-               settings.endGroup();    \r
-               databaseCache = value;\r
-    }\r
-    \r
-    //*****************************************************************************\r
-    // Control how tag selection behaves (should they be "and" or "or" selections\r
-    //*****************************************************************************\r
-    public static boolean anyTagSelectionMatch() {\r
-               settings.beginGroup("General");\r
-               try {\r
-                       String value = (String)settings.value("anyTagSelectionMatch", "false");\r
-                       settings.endGroup();\r
-                       if (value.equals("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("anyTagSelectionMatch", false);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setAnyTagSelectionMatch(boolean value) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("anyTagSelectionMatch", value);\r
-               settings.endGroup();    \r
-    }\r
-\r
-    //*****************************************************************************\r
-    // Control if a user receives a warning when trying to create a note-to-note link\r
-    // when the DB is not synchronized.\r
-    //*****************************************************************************\r
-    public static boolean bypassSynchronizationWarning() {\r
-               settings.beginGroup("User");\r
-               try {\r
-                       String value = (String)settings.value("bypassSynchronizationWarning", "false");\r
-                       settings.endGroup();\r
-                       if (value.equals("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("bypassSynchronizationWarning", false);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-    }\r
-    public static void setBypassSynchronizationWarning(boolean value) {\r
-               settings.beginGroup("User");\r
-               settings.setValue("bypassSynchronizationWarning", value);\r
-               settings.endGroup();    \r
-    }\r
-\r
-    \r
-    //***********************\r
-    //* Database cache size\r
-    //***********************\r
-    public static String getDatabaseCacheSize() {\r
-               settings.beginGroup("Debug");\r
-               String text = (String)settings.value("databaseCache", "16384");\r
-               settings.endGroup();    \r
-               return text;\r
-    }\r
-    public static void setDatabaseCache(String value) {\r
-               settings.beginGroup("Debug");\r
-               settings.setValue("databaseCache", value);\r
-               settings.endGroup();    \r
-               databaseCache = value;\r
-    }\r
-\r
-    \r
-    // This is used to copy a class since Java's normal deep copy is wacked\r
-    public static Object deepCopy(Object oldObj) \r
-    {\r
-       ObjectOutputStream oos = null;\r
-       ObjectInputStream ois = null;\r
-       try\r
-       {\r
-          ByteArrayOutputStream bos = \r
-                new ByteArrayOutputStream(); // A\r
-          oos = new ObjectOutputStream(bos); // B\r
-          // serialize and pass the object\r
-          oos.writeObject(oldObj);   // C\r
-          oos.flush();               // D\r
-          ByteArrayInputStream bin = \r
-                new ByteArrayInputStream(bos.toByteArray()); // E\r
-          ois = new ObjectInputStream(bin);                  // F\r
-          // return the new object\r
-          return ois.readObject(); // G\r
-       }\r
-       catch(Exception e)\r
-       {\r
-          Global.logger.log(logger.LOW, "Exception in ObjectCloner = " + e);\r
-       }\r
-          try {\r
-                       oos.close();\r
-               ois.close();\r
-               } catch (IOException e) {\r
-                       Global.logger.log(logger.LOW, "Exception in ObjectCloner = " + e);\r
-                       e.printStackTrace();\r
-               }\r
-\r
-               return null;\r
-    }\r
-\r
-    // If we should automatically select the children of any tag\r
-    public static boolean includeTagChildren() {\r
-               settings.beginGroup("General");\r
-               try {\r
-                       String value = (String)settings.value("includeTagChildren", "false");\r
-                       settings.endGroup();\r
-                       if (value.equals("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("includeTagChildren", false);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-\r
-    }\r
-    public static void setIncludeTagChildren(boolean value) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("includeTagChildren", value);\r
-               settings.endGroup();    \r
-    }\r
-    \r
-    // If we should automatically wildcard searches\r
-    public static boolean automaticWildcardSearches() {\r
-               settings.beginGroup("General");\r
-               try {\r
-                       String value = (String)settings.value("automaticWildcard", "false");\r
-                       settings.endGroup();\r
-                       if (value.equals("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("automaticWildcard", false);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-\r
-    }\r
-    public static void setAutomaticWildcardSearches(boolean value) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("automaticWildcard", value);\r
-               settings.endGroup();    \r
-    }\r
-\r
-    // If we should automatically select the children of any tag\r
-    public static boolean displayRightToLeft() {\r
-               settings.beginGroup("General");\r
-               try {\r
-                       String value = (String)settings.value("displayRightToLeft", "false");\r
-                       settings.endGroup();\r
-                       if (value.equals("true"))\r
-                               return true;\r
-                       else\r
-                               return false;\r
-               } catch (java.lang.ClassCastException e) {\r
-                       Boolean value = (Boolean) settings.value("displayRightToLeft", false);\r
-                       settings.endGroup();\r
-                       return value;\r
-               }\r
-\r
-    }\r
-    public static void setDisplayRightToLeft(boolean value) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("displayRightToLeft", value);\r
-               settings.endGroup();    \r
-    }\r
-\r
-\r
-    //***********************\r
-    //* Startup Notebook\r
-    //***********************\r
-    public static String getStartupNotebook() {\r
-               settings.beginGroup("General");\r
-               String text = (String)settings.value("startupNotebook", "");\r
-               settings.endGroup();    \r
-               return text;\r
-    }\r
-    public static void setStartupNotebook(String value) {\r
-               settings.beginGroup("General");\r
-               settings.setValue("startupNotebook", value);\r
-               settings.endGroup();    \r
-               databaseCache = value;\r
-    }\r
-}\r
-\r
+               }
+               settings.endGroup();
+               return len;
+    }
+    
+    // get/set current debug message level
+    public static String getMessageLevel() {
+               settings.beginGroup("Debug");
+               String text = (String)settings.value("messageLevel", "Low");
+               settings.endGroup();
+               setMessageLevel(text);
+               return text;
+    }
+    public static void setDateFormat(String format) {
+               settings.beginGroup("General");
+               settings.setValue("dateFormat", format);
+               settings.endGroup();            
+    }
+    
+    // Get/Set user date/time formats
+    public static String getDateFormat() {
+               settings.beginGroup("General");
+               String text = (String)settings.value("dateFormat", "MM/dd/yyyy");
+               settings.endGroup();
+               return text;
+    }
+    public static void setTimeFormat(String format) {
+               settings.beginGroup("General");
+               settings.setValue("timeFormat", format);
+               settings.endGroup();            
+    }
+    public static String getTimeFormat() {
+               settings.beginGroup("General");
+               String text = (String)settings.value("timeFormat", "HH:mm:ss");
+               settings.endGroup();
+               return text;
+    }
+    
+    // How often should we sync with Evernote?
+    public static String getSyncInterval() {
+               settings.beginGroup("General");
+               String text = (String)settings.value("syncInterval", "15 minutes");
+               settings.endGroup();
+               return text;            
+    }
+    public static void setSyncInterval(String format) {
+               settings.beginGroup("General");
+               settings.setValue("syncInterval", format);
+               settings.endGroup();            
+    }
+    
+    // Get/Set the width of columns and their position for the 
+    // next start.
+    public static void setColumnWidth(String col, int width) {
+       if (Global.getListView() == Global.View_List_Wide)
+               settings.beginGroup("ColumnWidths");
+       else 
+               settings.beginGroup("ColumnWidths-Narrow");
+               settings.setValue(col, width);
+               settings.endGroup();
+       }
+    public static int getColumnWidth(String col) {
+       int view = Global.getListView();
+       if (view == Global.View_List_Wide)
+               settings.beginGroup("ColumnWidths");
+       else
+               settings.beginGroup("ColumnWidths-Narrow");
+               Integer width;
+               try {
+                       String val  = (String)settings.value(col, "0");
+                       width = new Integer(val.trim());
+               } catch (Exception e) {
+                       try {
+                               width = (Integer)settings.value(col, 0);
+                       } catch (Exception e1) {
+                               width = 0;
+                       }
+               }
+               settings.endGroup();
+               return width;
+    }
+    public static void setColumnPosition(String col, int width) {
+       if (Global.getListView() == Global.View_List_Wide)
+               settings.beginGroup("ColumnPosition");
+       else
+               settings.beginGroup("ColumnPosition-Narrow");
+               settings.setValue(col, width);
+               settings.endGroup();
+    }
+    public static int getColumnPosition(String col) {
+       if (Global.getListView() == Global.View_List_Wide)
+               settings.beginGroup("ColumnPosition");
+       else
+               settings.beginGroup("ColumnPosition-Narrow");
+               Integer width;
+               try {
+                       String val  = (String)settings.value(col, "-1");
+                       width = new Integer(val.trim());
+               } catch (Exception e) {
+                       try {
+                               width = (Integer)settings.value(col, 0);
+                       } catch (Exception e1) {
+                               width = 0;
+                       }
+               }
+               settings.endGroup();
+               return width;
+    }
+    
+    // Ping the user when they try to delete or just do it.
+    public static boolean verifyDelete() {
+               settings.beginGroup("General");
+               try {
+                       String text = (String)settings.value("verifyDelete", "true");
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("verifyDelete", true);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setVerifyDelete(boolean val) {
+               settings.beginGroup("General");
+               if (val)
+                       settings.setValue("verifyDelete", "true");
+               else
+                       settings.setValue("verifyDelete", "false");
+               settings.endGroup();
+    }
+    
+    // Should it start minimized?
+    public static boolean startMinimized() {
+               settings.beginGroup("General");
+               try {
+                       String text = (String)settings.value("startMinimized", "false");
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("startMinimized", false);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setStartMinimized(boolean val) {
+               settings.beginGroup("General");
+               if (val)
+                       settings.setValue("startMinimized", "true");
+               else
+                       settings.setValue("startMinimized", "false");
+               settings.endGroup();
+    }
+    
+    // Should we upload the content of any deleted notes
+    public static boolean synchronizeDeletedContent() {
+               settings.beginGroup("General");
+               try {
+                       String text = (String)settings.value("syncDeletedContent", "false");
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("syncDeletedContent", false);
+                       settings.endGroup();
+                       return value;
+               }
+    }  
+    public static void setSynchronizeDeletedContent(boolean val) {
+               settings.beginGroup("General");
+               if (val)
+                       settings.setValue("syncDeletedContent", "true");
+               else
+                       settings.setValue("syncDeletedContent", "false");
+               settings.endGroup();
+    }
+    
+    // Is a section of the window visible?  Used to hide things people don't
+    // want to see.
+    public static boolean isWindowVisible(String window) {
+               settings.beginGroup("WindowsVisible");
+               try {
+                       String defaultValue = "true";
+                       if (window.equalsIgnoreCase("noteInformation"))
+                               defaultValue = "false";
+                       String text = (String)settings.value(window, defaultValue);
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true"))
+                               return true;
+               else
+                       return false;           
+               } catch (java.lang.ClassCastException e) {
+                       boolean defaultValue = true;
+                       if (window.equalsIgnoreCase("noteInformation"))
+                               defaultValue = false;
+                       Boolean value = (Boolean) settings.value("showTrayIcon", defaultValue);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void saveWindowVisible(String window, boolean val) {
+               settings.beginGroup("WindowsVisible");
+               if (val)
+                       settings.setValue(window, "true");
+               else
+                       settings.setValue(window, "false");
+               settings.endGroup();
+    }
+    
+    // Is a list in the column in the note list visible?  
+    public static boolean isColumnVisible(String window) {
+       String defaultValue = "true";
+       int view = Global.getListView();
+       if (Global.getListView() == Global.View_List_Wide)
+               settings.beginGroup("ColumnsVisible");
+       else
+               settings.beginGroup("ColumnsVisible-Narrow"); 
+               if (window.equalsIgnoreCase("thumbnail") && view == Global.View_List_Wide)
+                       defaultValue = "false";
+               if (window.equalsIgnoreCase("thumbnail"))
+                       defaultValue = "false";
+               if (window.equalsIgnoreCase("Guid"))
+                       defaultValue = "false";
+               try {
+                       String text = (String)settings.value(window, defaultValue);
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       boolean defBool = false;
+                       if (window.equalsIgnoreCase("true"))
+                               defBool = true;
+                       else
+                               defBool = false;
+                       Boolean value = (Boolean) settings.value(window, defBool);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void saveColumnVisible(String column, boolean val) {
+       if (Global.getListView() == Global.View_List_Wide)
+               settings.beginGroup("ColumnsVisible");
+       else
+               settings.beginGroup("ColumnsVisible-Narrow");                   
+               if (val)
+                       settings.setValue(column, "true");
+               else
+                       settings.setValue(column, "false");
+               settings.endGroup();
+    }
+    
+    // Is a particular editor button visible?
+    public static boolean isEditorButtonVisible(String window) {
+               settings.beginGroup("EditorButtonsVisible");
+               try {
+                       String text = (String)settings.value(window, "true");
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value(window, true);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void saveEditorButtonsVisible(String column, boolean val) {
+               settings.beginGroup("EditorButtonsVisible");
+               if (val)
+                       settings.setValue(column, "true");
+               else
+                       settings.setValue(column, "false");
+               settings.endGroup();
+    }
+    
+    // Should the test fixes be enabled
+    public static boolean enableCarriageReturnFix() {
+       try {
+               settings.beginGroup("Debug");
+               String text = (String)settings.value("enableCarriageReturnFix", "false");
+               settings.endGroup();
+               if (text.equalsIgnoreCase("true"))
+                       return true;
+               else
+                       return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("enableCarriageReturnFix", false);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void saveCarriageReturnFix(boolean val) {
+               settings.beginGroup("Debug");
+               if (val)
+                       settings.setValue("enableCarriageReturnFix", "true");
+               else
+                       settings.setValue("enableCarriageReturnFix", "false");
+               settings.endGroup();
+    }
+    public static boolean enableHtmlEntitiesFix() {
+       try {
+               settings.beginGroup("Debug");
+               String text = (String)settings.value("enableHtmlEntitiesFix", "false");
+               settings.endGroup();
+               if (text.equalsIgnoreCase("true"))
+                       return true;
+               else
+                       return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("enableHtmlEntitiesFix", false);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void saveHtmlEntitiesFix(boolean val) {
+               settings.beginGroup("Debug");
+               if (val)
+                       settings.setValue("enableHtmlEntitiesFix", "true");
+               else
+                       settings.setValue("enableHtmlEntitiesFix", "false");
+               settings.endGroup();
+    }
+
+//    public static void setIndexThreads(int val) {
+//             settings.beginGroup("General");
+//             settings.setValue("indexThreads", val);
+//             settings.endGroup();
+//   }
+//    public static int getIndexThreads() {
+//             settings.beginGroup("General");
+//             Integer threads;
+//             try {
+//                     String val  = (String)settings.value("indexThreads", "1");
+//                     threads = new Integer(val.trim());
+//             } catch (Exception e) {
+//                     try {
+//                             threads = (Integer)settings.value("indexThreads", 1);
+//                     } catch (Exception e1) {
+//                             threads = 1;
+//                     }
+//             }
+//             settings.endGroup();
+//             threads = 1;
+//             return threads;
+    
+    // Get/Set text zoom factor
+//   }
+    public static void setZoomFactor(double val) {
+               settings.beginGroup("General");
+               settings.setValue("zoomFactor", val);
+               settings.endGroup();
+    }
+    public static double getZoomFactor() {
+               settings.beginGroup("General");
+               Double threads;
+               try {
+                       String val  = (String)settings.value("zoomFactor", "1.0");
+                       threads = new Double(val.trim());
+               } catch (Exception e) {
+                       try {
+                               threads = (Double)settings.value("zoomFactor", 1.0);
+                       } catch (Exception e1) {
+                               threads = new Double(1);
+                       }
+               }
+               settings.endGroup();
+               return threads;
+    }
+    public static void setTextSizeMultiplier(double val) {
+               settings.beginGroup("General");
+               settings.setValue("textMultiplier", val);
+               settings.endGroup();
+    }
+    public static double getTextSizeMultiplier() {
+               settings.beginGroup("General");
+               Double threads;
+               try {
+                       String val  = (String)settings.value("textMultiplier", "1");
+                       threads = new Double(val.trim());
+               } catch (Exception e) {
+                       try {
+                               threads = (Double)settings.value("textMultiplier", 1);
+                       } catch (Exception e1) {
+                               threads = new Double(1);
+                       }
+               }
+               settings.endGroup();
+               return threads;
+    }
+    
+    
+    // Should we mimic Evernote and restrict the notebooks selected?
+    public static boolean getMimicEvernoteInterface() {
+               settings.beginGroup("General");
+               try {
+                       String text = (String)settings.value("mimicEvernoteInterface", "true");
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("mimicEvernoteInterface", true);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setMimicEvernoteInterface(boolean value) {
+       settings.beginGroup("General");
+       if (value)
+               settings.setValue("mimicEvernoteInterface", "true");
+       else
+               settings.setValue("mimicEvernoteInterface", "false"); 
+       settings.endGroup();
+    }
+    
+    
+    // Synchronize with Evernote when closing?
+    public static boolean synchronizeOnClose() {
+               settings.beginGroup("General");
+               try {
+                       String text = (String)settings.value("synchronizeOnClose", "false");
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("synchronizeOnClose", false);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setSynchronizeOnClose(boolean val) {
+               settings.beginGroup("General");
+               if (val)
+                       settings.setValue("synchronizeOnClose", "true");
+               else
+                       settings.setValue("synchronizeOnClose", "false");
+               settings.endGroup();
+    }
+
+    // Get/set the database version.  Not really used any more, but kept
+    // for compatibility.
+    public static void setDatabaseVersion(String version) {
+               settings.beginGroup("General");
+               settings.setValue("databaseVersion", version);
+               settings.endGroup();
+    }
+    public static String getDatabaseVersion() {
+               settings.beginGroup("General");
+               String val  = (String)settings.value("databaseVersion", "0.70");
+               settings.endGroup();
+               return val;
+    }
+
+    // Get the URL (full path) of the main database
+    public static String getDatabaseUrl() {
+               settings.beginGroup("General");
+               String val  = (String)settings.value("DatabaseURL", "");
+               settings.endGroup();
+               if (val.equals(""))
+                       val = "jdbc:h2:"+Global.getFileManager().getDbDirPath(Global.databaseName);
+               return val;
+    }
+    
+    // get the url (full path) of the searchable word database
+    public static String getIndexDatabaseUrl() {
+               settings.beginGroup("General");
+               String val  = (String)settings.value("IndexDatabaseURL", "");
+               settings.endGroup();
+               if (val.equals(""))
+                       val = "jdbc:h2:"+Global.getFileManager().getDbDirPath(Global.indexDatabaseName);
+               return val;
+    }
+    
+    // Get the url (full path) of the attachment database
+    public static String getResourceDatabaseUrl() {
+               settings.beginGroup("General");
+               String val  = (String)settings.value("ResourceDatabaseURL", "");
+               settings.endGroup();
+               if (val.equals(""))
+                       val = "jdbc:h2:"+Global.getFileManager().getDbDirPath(Global.resourceDatabaseName);
+               return val;
+    }
+    
+       // ICHANGED
+       // 操作履歴データベースのURL(フルパス)をゲット
+       public static String getBehaviorDatabaseUrl() {
+               settings.beginGroup("General");
+               String val = (String) settings.value("BehaviorDatabaseURL", "");
+               settings.endGroup();
+               if (val.equals(""))
+                       val = "jdbc:h2:"
+                                       + Global.getFileManager().getDbDirPath(
+                                                       Global.behaviorDatabaseName);
+               return val;
+       }
+       
+    public static void setDatabaseUrl(String value) {
+               settings.beginGroup("General");
+               settings.setValue("DatabaseURL", value);
+               settings.endGroup();
+    }
+    public static void setIndexDatabaseUrl(String value) {
+               settings.beginGroup("General");
+               settings.setValue("IndexDatabaseURL", value);
+               settings.endGroup();
+    }
+    public static void setResourceDatabaseUrl(String value) {
+               settings.beginGroup("General");
+               settings.setValue("ResourceDatabaseURL", value);
+               settings.endGroup();
+    }
+    
+       // ICHANGED
+       public static void setBehaviorDatabaseUrl(String value) {
+               settings.beginGroup("General");
+               settings.setValue("BehaviorDatabaseURL", value);
+               settings.endGroup();
+       }
+       
+    public static String getDatabaseUserid() {
+               settings.beginGroup("General");
+               String val  = (String)settings.value("databaseUserid", "");
+               settings.endGroup();
+               return val;
+    }
+    public static String getDatabaseUserPassword() {
+               settings.beginGroup("General");
+               String val  = (String)settings.value("databaseUserPassword", "");
+               settings.endGroup();
+               return val;
+    }
+    
+    // get/Set the style sheet and the palette to control the look & feel
+    public static void setStyle(String style) {
+               settings.beginGroup("General");
+               settings.setValue("style", style);
+               settings.endGroup();
+    }
+    public static String getStyle() {
+               settings.beginGroup("General");
+               String val  = (String)settings.value("style", "Cleanlooks");
+               settings.endGroup();
+               return val;
+    }
+    public static boolean useStandardPalette() {
+               settings.beginGroup("General");
+               try {
+                       String text = (String)settings.value("standardPalette", "true");
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("standardPalette", true);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setStandardPalette(boolean val) {
+               settings.beginGroup("General");
+               if (val)
+                       settings.setValue("standardPalette", "true");
+               else
+                       settings.setValue("standardPalette", "false");
+               settings.endGroup();
+    }
+    
+    // Set the amount of time to wait between indexing
+    // Get/Set interval when the index thread wakes up.
+    public static void setIndexThreadSleepInterval(int sleep) {
+               settings.beginGroup("General");
+               settings.setValue("IndexThreadSleepInterval", sleep);
+               settings.endGroup();
+    }
+    public static int getIndexThreadSleepInterval() {
+               settings.beginGroup("General");
+               Integer sleep;
+               try {
+                       String val  = (String)settings.value("IndexThreadSleepInterval", "300");
+                       sleep = new Integer(val.trim());
+               } catch (Exception e) {
+                       try {
+                               sleep = (Integer)settings.value("IndexThreadSleepInterval", 0);
+                       } catch (Exception e1) {
+                               sleep = 300;
+                       }
+               }
+               settings.endGroup();
+               return sleep;
+    }
+    
+    
+    // Get/Set a window state for later restoring
+    public static void saveState(String name, QByteArray state) {
+       int view = Global.getListView();
+       if (view == Global.View_List_Narrow)
+               name = name +"Narrow";
+               settings.beginGroup("SaveState");
+               settings.setValue(name, state);
+               settings.endGroup();
+    }
+    
+    public static QByteArray restoreState(String name) {
+       int view = Global.getListView();
+       if (view == Global.View_List_Narrow)
+               name = name +"Narrow";
+               settings.beginGroup("SaveState");
+               QByteArray state = (QByteArray)settings.value(name);
+               settings.endGroup();
+               return state;
+    }
+    public static void saveGeometry(String name, QByteArray state) {
+       int view = Global.getListView();
+       if (view == Global.View_List_Narrow)
+               settings.beginGroup("SaveGeometryNarrow");
+       else
+               settings.beginGroup("SaveGeometry");
+               settings.setValue(name, state);
+               settings.endGroup();
+    }
+    
+    public static QByteArray restoreGeometry(String name) {
+       int view = Global.getListView();
+       if (view == Global.View_List_Narrow)
+               settings.beginGroup("SaveGeometryNarrow");
+       else
+               settings.beginGroup("SaveGeometry");
+               QByteArray state = (QByteArray)settings.value(name);
+               settings.endGroup();
+               return state;
+    }
+    
+    
+    // Set how often to do an automatic save
+    public static void setAutoSaveInterval(int interval) {
+               settings.beginGroup("General");
+               settings.setValue("autoSaveInterval", interval);
+               settings.endGroup();
+    }
+    public static int getAutoSaveInterval() {
+               settings.beginGroup("General");
+               Integer value;
+               try {
+                       String val  = (String)settings.value("autoSaveInterval", "5");
+                       value = new Integer(val.trim());
+               } catch (Exception e) {
+                       try {
+                               value = (Integer)settings.value("autoSaveInterval", 5);
+                       } catch (Exception e1) {
+                               value = 5;
+                       }
+               }
+               settings.endGroup();
+               return value;
+    }
+     
+    // Add an invalid attribute & element to the database so we don't bother parsing it in the future
+    // These values we automatically remove from any note.
+    // Add invalid attributes
+    public static void addInvalidAttribute(String element, String attribute) {
+       
+               List<String> attributes = invalidAttributes.get(element);
+               if (attributes != null) {
+                       for (int i=0; i<attributes.size(); i++)
+                               if (attribute.equalsIgnoreCase(attributes.get(i))) {
+                                       return;
+                       }
+       }
+       
+       ArrayList<String> attributeList;
+       if (!invalidAttributes.containsKey(element)) {
+               attributeList = new ArrayList<String>();
+               attributeList.add(attribute);
+               invalidAttributes.put(element, attributeList);
+       }
+       else {
+               attributeList = invalidAttributes.get(element);
+               attributeList.add(attribute);
+               invalidAttributes.put(element,attributeList);
+       }
+    }
+   
+    // Add invalid attributes
+    public static void addInvalidElement(String element) {
+               for (int i=0; i<invalidElements.size(); i++) {
+                       if (element.equalsIgnoreCase(invalidElements.get(i)))
+                               return;
+               }
+       invalidElements.add(element);
+    }
+    
+    // Get/Set proxy information
+    // Proxy settings
+    public static String getProxyValue(String key) {
+               settings.beginGroup("Proxy");
+               String val  = (String)settings.value(key, "");
+               settings.endGroup();
+               return val;
+    }
+    public static void setProxyValue(String key, String value) {
+               settings.beginGroup("Proxy");
+               settings.setValue(key, value);
+               settings.endGroup();
+    }
+    
+    // Change a byte array to a hex string
+    // Convert a byte array to a hex string
+       public static String byteArrayToHexString(byte data[]) {
+               StringBuffer buf = new StringBuffer();
+           for (byte element : data) {
+               int halfbyte = (element >>> 4) & 0x0F;
+               int two_halfs = 0;
+               do {
+                       if ((0 <= halfbyte) && (halfbyte <= 9))
+                              buf.append((char) ('0' + halfbyte));
+                          else
+                               buf.append((char) ('a' + (halfbyte - 10)));
+                       halfbyte = element & 0x0F;
+               } while(two_halfs++ < 1);
+           }
+           return buf.toString();              
+       }
+
+    
+       // Get/Set spelling settings
+       public static boolean getSpellSetting(String value) {
+               settings.beginGroup("Spell");
+               String text = (String)settings.value(value, "");
+               settings.endGroup();
+               if (text.equalsIgnoreCase("true"))
+                       return true;
+               if (text.equalsIgnoreCase("false"))
+                       return false;
+               if (value.equalsIgnoreCase(Configuration.SPELL_IGNOREDIGITWORDS))
+                       return true;
+               if (value.equalsIgnoreCase(Configuration.SPELL_IGNOREINTERNETADDRESSES))
+                       return true;
+               if (value.equalsIgnoreCase(Configuration.SPELL_IGNOREUPPERCASE))
+                       return true;
+               if (value.equalsIgnoreCase(Configuration.SPELL_IGNORESENTENCECAPITALIZATION))
+                       return true;
+               return false;
+    }
+    public static void setSpellSetting(String setting, boolean val) {
+               settings.beginGroup("Spell");
+               if (val)
+                       settings.setValue(setting, "true");
+               else
+                       settings.setValue(setting, "false");
+               settings.endGroup();
+    }
+       
+       // Get/Set how we should display tags (color them, hide unused, or do nothing)
+       // What to do with inactive tags?
+       public static String tagBehavior() {
+               settings.beginGroup("General");
+               String text = (String)settings.value("tagBehavior", "DoNothing");
+               settings.endGroup();
+               return text;
+       }
+       // What to do with inactive tags?
+       public static void setTagBehavior(String value) {
+               settings.beginGroup("General");
+               settings.setValue("tagBehavior", value);
+               settings.endGroup();
+       }
+
+    
+       // Should the toolbar be visible?
+       public static boolean isToolbarButtonVisible(String window) {
+               settings.beginGroup("ToolbarButtonsVisible");
+               try {
+                       String text = (String)settings.value(window, "true");
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true"))
+                               return true;
+                       else
+                               return false;   
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value(window, true);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void saveToolbarButtonsVisible(String column, boolean val) {
+               settings.beginGroup("ToolbarButtonsVisible");
+               if (val)
+                       settings.setValue(column, "true");
+               else
+                       settings.setValue(column, "false");
+               settings.endGroup();
+    }
+       
+    // Are thumbnails enabled?
+    
+    public static boolean enableThumbnails() {
+               settings.beginGroup("Debug");
+               try {
+                       String text = (String)settings.value("thumbnails", "true");
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("thumbnails", true);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setEnableThumbnails(boolean val) {
+               settings.beginGroup("Debug");
+               if (val)
+                       settings.setValue("thumbnails", "true");
+               else
+                       settings.setValue("thumbnails", "false");
+               settings.endGroup();
+    }
+       
+    // Trace used for performance tuning.  Not normally used in production.
+       // Print date/time.  Used mainly for performance tracing
+       public static void trace(boolean resetInterval) {
+               String fmt = "MM/dd/yy HH:mm:ss.SSSSSS";
+               String dateTimeFormat = new String(fmt);
+               SimpleDateFormat simple = new SimpleDateFormat(dateTimeFormat);
+               Calendar cal = Calendar.getInstance();
+               if (intervalTraceTime == null) 
+                       intervalTraceTime = Calendar.getInstance();
+               if (startTraceTime == null)
+                       startTraceTime = Calendar.getInstance();
+               
+               float interval = (cal.getTimeInMillis() - intervalTraceTime.getTimeInMillis());
+               float total = (cal.getTimeInMillis() - startTraceTime.getTimeInMillis());
+               
+//             if (interval > 00.0) {
+                       StackTraceElement[] exceptions = Thread.currentThread().getStackTrace();
+                       System.out.println("------------------------------------------");
+
+                       System.out.println("Date/Time " +simple.format(cal.getTime()));
+                       System.out.format("Interval Time: %-10.6f%n", interval);
+                       System.out.format("Total Time: %-10.6f%n", total);
+                       for (int i=2; i<5 && i<exceptions.length; i++) {
+                               System.out.println(exceptions[i]);
+                       }
+//             }
+               if (resetInterval)
+                       intervalTraceTime = cal;
+       }
+       public static void traceReset() {
+               intervalTraceTime = null;
+               startTraceTime = null;
+       }
+
+    
+       // Get the FileManager class to manage local files & directories
+       public static FileManager getFileManager() {
+        return fileManager;
+    }
+       
+       // Should the note editor be disabled?
+    public static boolean getDisableViewing() {
+        return disableViewing;
+    }
+
+    //**********************
+    //* Thumbnail zoom level
+    //**********************
+    public static int calculateThumbnailZoom(String content) {
+       int zoom = 1;
+               if (content.indexOf("application/pdf") == -1) {
+                       if (content.indexOf("image/") == -1) {
+                               String text =  StringEscapeUtils.unescapeHtml4(content.replaceAll("\\<.*?\\>", ""));
+                               zoom = 2;
+                               if (text.length() < 500) 
+                                       zoom = 2;
+                               if (text.length() < 250)
+                                       zoom = 3;
+                               if (text.length() < 100)
+                                       zoom = 4;
+                               if (text.length() < 50)
+                                       zoom = 5;
+                               if (text.length() < 10)
+                                       zoom = 6;
+                       }
+               }
+               return zoom;
+    }
+    
+    //**********************
+    //* List View settings 
+    //**********************
+    public static void setListView(int view) {
+               settings.beginGroup("General");
+               settings.setValue("listView", view);
+               settings.endGroup();
+    }
+    public static int getListView() {
+               settings.beginGroup("General");
+               Integer value;
+               try {
+                       String val  = (String)settings.value("listView", View_List_Wide);
+                       value = new Integer(val.trim());
+               } catch (Exception e) {
+                       try {
+                               value = (Integer)settings.value("listView", View_List_Wide);
+                       } catch (Exception e1) {
+                               value = View_List_Wide;
+                       }
+               }
+               settings.endGroup();
+               return value;
+    }
+
+    
+    
+    //*******************
+    // Font Settings
+    //*******************
+    public static boolean overrideDefaultFont() {
+               settings.beginGroup("Font");
+               try {
+                       String text = (String)settings.value("overrideFont", "false");
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true"))
+                               return true;
+                       else
+                               return false;   
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("overrideFont", false);
+                       settings.endGroup();
+                       return value;
+               }
+
+    }
+    
+    //****************************************************
+    // Get/Set the default font settings for a new note
+    //****************************************************
+    public static void setOverrideDefaultFont(boolean value) {
+               settings.beginGroup("Font");
+               settings.setValue("overrideFont", value);
+               settings.endGroup();    
+    }
+    public static String getDefaultFont() {
+               settings.beginGroup("Font");
+               String val  = (String)settings.value("font", "");
+               settings.endGroup();
+               return val;
+    }
+    public static void setDefaultFont(String value) {
+               settings.beginGroup("Font");
+               settings.setValue("font", value);
+               settings.endGroup();
+    }
+    public static String getDefaultFontSize() {
+               settings.beginGroup("Font");
+               String val  = (String)settings.value("fontSize", "");
+               settings.endGroup();
+               return val;
+    }
+    public static void setDefaultFontSize(String value) {
+               settings.beginGroup("Font");
+               settings.setValue("fontSize", value);
+               settings.endGroup();
+    }
+    
+    
+    //*******************************************
+    // Override the close & minimize instead.
+    //*******************************************
+    public static boolean minimizeOnClose() {
+               settings.beginGroup("General");
+               try {
+                       String text = (String)settings.value("minimizeOnClose", "false");
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true") && QSystemTrayIcon.isSystemTrayAvailable())
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("minimizeOnClose", false);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setMinimizeOnClose(boolean value) {
+               settings.beginGroup("General");
+               settings.setValue("minimizeOnClose", value);
+               settings.endGroup();    
+    }
+
+    //*********************************
+    // Check version information
+    //*********************************
+    public static boolean checkVersionUpgrade() {
+               settings.beginGroup("Upgrade");
+               try {
+                       String text = (String)settings.value("checkForUpdates", "true");
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("checkForUpdates", true);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setCheckVersionUpgrade(boolean value) {
+               settings.beginGroup("Upgrade");
+               settings.setValue("checkForUpdates", value);
+               settings.endGroup();    
+    }
+    public static String getUpdatesAvailableUrl() {
+               settings.beginGroup("Upgrade");
+               String text = (String)settings.value("avialableUrl", "http://nevernote.sourceforge.net/versions.txt");
+               settings.endGroup();    
+               return text;
+    }
+    public static String getUpdateAnnounceUrl() {
+               settings.beginGroup("Upgrade");
+               String text = (String)settings.value("announceUrl", "http://nevernote.sourceforge.net/upgrade.html");
+               settings.endGroup();    
+               return text;
+    }
+    
+    //*******************
+    // Index settings
+    //*******************
+    // Set/Get if we should index the text of a note
+    public static boolean indexNoteBody() {
+               settings.beginGroup("Index");
+               try {
+                       String value = (String)settings.value("indexNoteBody", "true");
+                       settings.endGroup();
+                       if (value.equals("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("indexNoteBody", true);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setIndexNoteTitle(boolean value) {
+               settings.beginGroup("Index");
+               settings.setValue("indexNoteTitle", value);
+               settings.endGroup();    
+    }
+    // Set/Get if we should index the title of a note
+    public static boolean indexNoteTitle() {
+               settings.beginGroup("Index");
+               try {
+                       String value = (String)settings.value("indexNoteTitle", "true");
+                       settings.endGroup();
+                       if (value.equals("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("indexNoteTitle", true);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setIndexNoteBody(boolean value) {
+               settings.beginGroup("Index");
+               settings.setValue("indexNoteBody", value);
+               settings.endGroup();    
+    }
+    // Set/Get if we should index any attachments
+    public static boolean indexAttachmentsLocally() {
+               settings.beginGroup("Index");
+               try {
+                       String value = (String)settings.value("indexAttachmentsLocally", "true");
+                       settings.endGroup();
+                       if (value.equals("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("indexAttachmentsLocally", true);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setIndexImageRecognition(boolean value) {
+               settings.beginGroup("Index");
+               settings.setValue("indexImageRecognition", value);
+               settings.endGroup();    
+    }
+    public static boolean indexImageRecognition() {
+               settings.beginGroup("Index");
+               try {
+                       String value = (String)settings.value("indexImageRecognition", "true");
+                       settings.endGroup();
+                       if (value.equals("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("indexImageRecognition", true);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setIndexAttachmentsLocally(boolean value) {
+               settings.beginGroup("Index");
+               settings.setValue("indexAttachmentsLocally", value);
+               settings.endGroup();    
+    }
+    // Get/Set characters that shouldn't be removed from a word
+    public static String getSpecialIndexCharacters() {
+               settings.beginGroup("Index");
+               String text = (String)settings.value("specialCharacters", "");
+               settings.endGroup();    
+               return text;
+    }
+    public static void setSpecialIndexCharacters(String value) {
+               settings.beginGroup("Index");
+               settings.setValue("specialCharacters", value);
+               settings.endGroup();    
+               databaseCache = value;
+    }
+    
+    //*****************************************************************************
+    // Control how tag selection behaves (should they be "and" or "or" selections
+    //*****************************************************************************
+    public static boolean anyTagSelectionMatch() {
+               settings.beginGroup("General");
+               try {
+                       String value = (String)settings.value("anyTagSelectionMatch", "false");
+                       settings.endGroup();
+                       if (value.equals("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("anyTagSelectionMatch", false);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setAnyTagSelectionMatch(boolean value) {
+               settings.beginGroup("General");
+               settings.setValue("anyTagSelectionMatch", value);
+               settings.endGroup();    
+    }
+
+    //*****************************************************************************
+    // Control if a user receives a warning when trying to create a note-to-note link
+    // when the DB is not synchronized.
+    //*****************************************************************************
+    public static boolean bypassSynchronizationWarning() {
+               settings.beginGroup("User");
+               try {
+                       String value = (String)settings.value("bypassSynchronizationWarning", "false");
+                       settings.endGroup();
+                       if (value.equals("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("bypassSynchronizationWarning", false);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    public static void setBypassSynchronizationWarning(boolean value) {
+               settings.beginGroup("User");
+               settings.setValue("bypassSynchronizationWarning", value);
+               settings.endGroup();    
+    }
+
+    
+    //***********************
+    //* Database cache size
+    //***********************
+    public static String getDatabaseCacheSize() {
+               settings.beginGroup("Debug");
+               String text = (String)settings.value("databaseCache", "16384");
+               settings.endGroup();    
+               return text;
+    }
+    public static void setDatabaseCache(String value) {
+               settings.beginGroup("Debug");
+               settings.setValue("databaseCache", value);
+               settings.endGroup();    
+               databaseCache = value;
+    }
+
+    
+    // This is used to copy a class since Java's normal deep copy is wacked
+    public static Object deepCopy(Object oldObj) 
+    {
+       ObjectOutputStream oos = null;
+       ObjectInputStream ois = null;
+       try
+       {
+          ByteArrayOutputStream bos = 
+                new ByteArrayOutputStream(); // A
+          oos = new ObjectOutputStream(bos); // B
+          // serialize and pass the object
+          oos.writeObject(oldObj);   // C
+          oos.flush();               // D
+          ByteArrayInputStream bin = 
+                new ByteArrayInputStream(bos.toByteArray()); // E
+          ois = new ObjectInputStream(bin);                  // F
+          // return the new object
+          return ois.readObject(); // G
+       }
+       catch(Exception e)
+       {
+          Global.logger.log(logger.LOW, "Exception in ObjectCloner = " + e);
+       }
+          try {
+                       oos.close();
+               ois.close();
+               } catch (IOException e) {
+                       Global.logger.log(logger.LOW, "Exception in ObjectCloner = " + e);
+                       e.printStackTrace();
+               }
+
+               return null;
+    }
+
+    // If we should automatically select the children of any tag
+    public static boolean includeTagChildren() {
+               settings.beginGroup("General");
+               try {
+                       String value = (String)settings.value("includeTagChildren", "false");
+                       settings.endGroup();
+                       if (value.equals("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("includeTagChildren", false);
+                       settings.endGroup();
+                       return value;
+               }
+
+    }
+    public static void setIncludeTagChildren(boolean value) {
+               settings.beginGroup("General");
+               settings.setValue("includeTagChildren", value);
+               settings.endGroup();    
+    }
+    
+    // If we should automatically wildcard searches
+    public static boolean automaticWildcardSearches() {
+               settings.beginGroup("General");
+               try {
+                       String value = (String)settings.value("automaticWildcard", "false");
+                       settings.endGroup();
+                       if (value.equals("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("automaticWildcard", false);
+                       settings.endGroup();
+                       return value;
+               }
+
+    }
+    public static void setAutomaticWildcardSearches(boolean value) {
+               settings.beginGroup("General");
+               settings.setValue("automaticWildcard", value);
+               settings.endGroup();    
+    }
+
+    // If we should automatically select the children of any tag
+    public static boolean displayRightToLeft() {
+               settings.beginGroup("General");
+               try {
+                       String value = (String)settings.value("displayRightToLeft", "false");
+                       settings.endGroup();
+                       if (value.equals("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("displayRightToLeft", false);
+                       settings.endGroup();
+                       return value;
+               }
+
+    }
+    public static void setDisplayRightToLeft(boolean value) {
+               settings.beginGroup("General");
+               settings.setValue("displayRightToLeft", value);
+               settings.endGroup();    
+    }
+
+
+    //***********************
+    //* Startup Notebook
+    //***********************
+    public static String getStartupNotebook() {
+               settings.beginGroup("General");
+               String text = (String)settings.value("startupNotebook", "");
+               settings.endGroup();    
+               return text;
+    }
+    public static void setStartupNotebook(String value) {
+               settings.beginGroup("General");
+               settings.setValue("startupNotebook", value);
+               settings.endGroup();    
+               databaseCache = value;
+    }
+    
+    // ICHANGED
+    // 複数ノート同時閲覧操作に対する重み付け
+    public static void setBrowseWeight(int weight) {
+               settings.beginGroup("RensoNoteList");
+               settings.setValue("browseWeight", weight);
+               settings.endGroup();            
+    }
+    public static int getBrowseWeight() {
+               settings.beginGroup("RensoNoteList");
+               Integer value;
+               try {
+                       String val  = (String)settings.value("browseWeight", 1);
+                       value = new Integer(val.trim());
+               } catch (Exception e) {
+                       try {
+                               value = (Integer)settings.value("browseWeight", 1);
+                       } catch (Exception e1) {
+                               value = 1;
+                       }
+               }
+               settings.endGroup();
+               return value;
+    }
+    
+    // ICHANGED
+    // ノート内容のコピー&ペースト操作に対する重み付け
+    public static void setCopyPasteWeight(int weight) {
+               settings.beginGroup("RensoNoteList");
+               settings.setValue("copyPasteWeight", weight);
+               settings.endGroup();            
+    }
+    public static int getCopyPasteWeight() {
+               settings.beginGroup("RensoNoteList");
+               Integer value;
+               try {
+                       String val  = (String)settings.value("copyPasteWeight", 3);
+                       value = new Integer(val.trim());
+               } catch (Exception e) {
+                       try {
+                               value = (Integer)settings.value("copyPasteWeight", 3);
+                       } catch (Exception e1) {
+                               value = 3;
+                       }
+               }
+               settings.endGroup();
+               return value;
+    }
+    
+    // ICHANGED
+    // 新規ノート追加操作に対する重み付け
+    public static void setAddNewNoteWeight(int weight) {
+               settings.beginGroup("RensoNoteList");
+               settings.setValue("addNewNoteWeight", weight);
+               settings.endGroup();            
+    }
+       public static int getAddNewNoteWeight() {
+               settings.beginGroup("RensoNoteList");
+               Integer value;
+               try {
+                       String val  = (String)settings.value("addNewNoteWeight", 1);
+                       value = new Integer(val.trim());
+               } catch (Exception e) {
+                       try {
+                               value = (Integer)settings.value("addNewNoteWeight", 1);
+                       } catch (Exception e1) {
+                               value = 1;
+                       }
+               }
+               settings.endGroup();
+               return value;
+       }
+       
+       // ICHANGED
+       // 連想ノートクリック操作に対する重み付け
+    public static void setRensoItemClickWeight(int weight) {
+               settings.beginGroup("RensoNoteList");
+               settings.setValue("rensoItemClickWeight", weight);
+               settings.endGroup();            
+    }
+       public static int getRensoItemClickWeight() {
+               settings.beginGroup("RensoNoteList");
+               Integer value;
+               try {
+                       String val  = (String)settings.value("rensoItemClickWeight", 10);
+                       value = new Integer(val.trim());
+               } catch (Exception e) {
+                       try {
+                               value = (Integer)settings.value("rensoItemClickWeight", 10);
+                       } catch (Exception e1) {
+                               value = 10;
+                       }
+               }
+               settings.endGroup();
+               return value;
+       }
+       
+       // ICHANGED
+       // タグ付け操作に対する重み付け
+    public static void setSameTagWeight(int weight) {
+               settings.beginGroup("RensoNoteList");
+               settings.setValue("sameTagWeight", weight);
+               settings.endGroup();            
+    }
+       public static int getSameTagWeight() {
+               settings.beginGroup("RensoNoteList");
+               Integer value;
+               try {
+                       String val  = (String)settings.value("sameTagWeight", 2);
+                       value = new Integer(val.trim());
+               } catch (Exception e) {
+                       try {
+                               value = (Integer)settings.value("sameTagWeight", 2);
+                       } catch (Exception e1) {
+                               value = 2;
+                       }
+               }
+               settings.endGroup();
+               return value;
+       }
+       
+       // ICHANGED
+       // ノートブック変更操作に対する重み付け
+    public static void setSameNotebookWeight(int weight) {
+               settings.beginGroup("RensoNoteList");
+               settings.setValue("sameNotebookWeight", weight);
+               settings.endGroup();            
+    }
+       public static int getSameNotebookWeight() {
+               settings.beginGroup("RensoNoteList");
+               Integer value;
+               try {
+                       String val  = (String)settings.value("sameNotebookWeight", 2);
+                       value = new Integer(val.trim());
+               } catch (Exception e) {
+                       try {
+                               value = (Integer)settings.value("sameNotebookWeight", 2);
+                       } catch (Exception e1) {
+                               value = 2;
+                       }
+               }
+               settings.endGroup();
+               return value;
+       }
+    
+    //*******************
+    // ノートのマージ・複製の関連ノートリストへの適用
+    //*******************
+    // ICHANGED
+    public static void setMergeRensoNote(boolean value) {
+               settings.beginGroup("RensoNoteList");
+               settings.setValue("mergeRensoNoteList", value);
+               settings.endGroup();    
+    }
+    // ICHANGED
+    public static boolean getMergeRensoNote() {
+               settings.beginGroup("RensoNoteList");
+               try {
+                       String value = (String)settings.value("mergeRensoNoteList", "true");
+                       settings.endGroup();
+                       if (value.equals("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("mergeRensoNoteList", true);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    // ICHANGED
+    public static void setDuplicateRensoNote(boolean value) {
+               settings.beginGroup("RensoNoteList");
+               settings.setValue("duplicateRensoNoteList", value);
+               settings.endGroup();    
+    }
+    // ICHANGED
+    public static boolean getDuplicateRensoNote() {
+               settings.beginGroup("RensoNoteList");
+               try {
+                       String value = (String)settings.value("duplicateRensoNoteList", "true");
+                       settings.endGroup();
+                       if (value.equals("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("duplicateRensoNoteList", true);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    
+    // ICHANGED
+    // 連想ノートリストからノートを除外するときに確認メッセージを表示するかどうか
+    public static boolean verifyExclude() {
+               settings.beginGroup("RensoNoteList");
+               try {
+                       String text = (String)settings.value("verifyExclude", "true");
+                       settings.endGroup();
+                       if (text.equalsIgnoreCase("true"))
+                               return true;
+                       else
+                               return false;
+               } catch (java.lang.ClassCastException e) {
+                       Boolean value = (Boolean) settings.value("verifyExclude", true);
+                       settings.endGroup();
+                       return value;
+               }
+    }
+    // ICHANGED
+    public static void setVerifyExclude(boolean val) {
+               settings.beginGroup("RensoNoteList");
+               if (val)
+                       settings.setValue("verifyExclude", "true");
+               else
+                       settings.setValue("verifyExclude", "false");
+               settings.endGroup();
+    }
+    
+       // ICHANGED
+       // 連想ノートリスト最大表示アイテム数
+    public static void setRensoListItemMaximum(int maximum) {
+               settings.beginGroup("RensoNoteList");
+               settings.setValue("rensoListMaximum", maximum);
+               settings.endGroup();            
+    }
+       public static int getRensoListItemMaximum() {
+               settings.beginGroup("RensoNoteList");
+               Integer value;
+               try {
+                       String val  = (String)settings.value("rensoListMaximum", 20);
+                       value = new Integer(val.trim());
+               } catch (Exception e) {
+                       try {
+                               value = (Integer)settings.value("rensoListMaximum", 20);
+                       } catch (Exception e1) {
+                               value = 20;
+                       }
+               }
+               settings.endGroup();
+               return value;
+       }
+}
+
index 681df70..65ba96e 100644 (file)
@@ -87,6 +87,7 @@ import com.trolltech.qt.core.QTranslator;
 import com.trolltech.qt.core.QUrl;
 import com.trolltech.qt.core.Qt;
 import com.trolltech.qt.core.Qt.BGMode;
+import com.trolltech.qt.core.Qt.DockWidgetArea;
 import com.trolltech.qt.core.Qt.ItemDataRole;
 import com.trolltech.qt.core.Qt.KeyboardModifier;
 import com.trolltech.qt.core.Qt.MouseButton;
@@ -103,6 +104,7 @@ import com.trolltech.qt.gui.QComboBox;
 import com.trolltech.qt.gui.QCursor;
 import com.trolltech.qt.gui.QDesktopServices;
 import com.trolltech.qt.gui.QDialog;
+import com.trolltech.qt.gui.QDockWidget;
 import com.trolltech.qt.gui.QFileDialog;
 import com.trolltech.qt.gui.QFileDialog.AcceptMode;
 import com.trolltech.qt.gui.QFileDialog.FileMode;
@@ -112,6 +114,7 @@ import com.trolltech.qt.gui.QIcon;
 import com.trolltech.qt.gui.QImage;
 import com.trolltech.qt.gui.QKeySequence;
 import com.trolltech.qt.gui.QLabel;
+import com.trolltech.qt.gui.QListWidgetItem;
 import com.trolltech.qt.gui.QMainWindow;
 import com.trolltech.qt.gui.QMenu;
 import com.trolltech.qt.gui.QMessageBox;
@@ -175,13 +178,17 @@ import cx.fbn.nevernote.gui.DateAttributeFilterTable;
 import cx.fbn.nevernote.gui.ExternalBrowse;
 import cx.fbn.nevernote.gui.MainMenuBar;
 import cx.fbn.nevernote.gui.NotebookTreeWidget;
+import cx.fbn.nevernote.gui.RensoNoteList;
 import cx.fbn.nevernote.gui.SavedSearchTreeWidget;
 import cx.fbn.nevernote.gui.SearchPanel;
+import cx.fbn.nevernote.gui.TabBrowse;
+import cx.fbn.nevernote.gui.TabBrowserWidget;
 import cx.fbn.nevernote.gui.TableView;
 import cx.fbn.nevernote.gui.TagTreeWidget;
 import cx.fbn.nevernote.gui.Thumbnailer;
 import cx.fbn.nevernote.gui.TrashTreeWidget;
 import cx.fbn.nevernote.gui.controls.QuotaProgressBar;
+import cx.fbn.nevernote.neighbornote.ClipBoardObserver;
 import cx.fbn.nevernote.oauth.OAuthTokenizer;
 import cx.fbn.nevernote.oauth.OAuthWindow;
 import cx.fbn.nevernote.sql.DatabaseConnection;
@@ -328,9 +335,11 @@ public class NeverNote extends QMainWindow{
     HashMap<String, String>            noteCache;                      // Cash of note content 
     HashMap<String, Boolean>   readOnlyCache;          // List of cashe notes that are read-only
     HashMap<String, Boolean>   inkNoteCache;           // List of cache notes that are ink notes 
-    List<String>               historyGuids;                           // GUIDs of previously viewed items
-    int                                        historyPosition;                        // Position within the viewed items
-    boolean                            fromHistory;                            // Is this from the history queue?
+       // ICHANGED
+       HashMap<Integer, ArrayList<String>> historyGuids;  // タブごとの以前見たノートのGUID
+       HashMap<Integer, Integer> historyPosition; // Position within the viewed items
+       HashMap<Integer, Boolean> fromHistory; // Is this from the history queue?
+       
     String                             trashNoteGuid;                          // Guid to restore / set into or out of trash to save position
     List<Thumbnailer>  thumbGenerators;                                // generate preview image
     ThumbnailViewer            thumbnailViewer;                        // View preview thumbnail; 
@@ -348,6 +357,18 @@ public class NeverNote extends QMainWindow{
     private QTimer             blockTimer;
     BrowserWindow              blockingWindow;
     
+       // ICHANGED
+       private final TabBrowserWidget tabBrowser; // ブラウザウィンドウをタブ化
+       private final HashMap<Integer, TabBrowse> tabWindows; // タブウィンドウ
+       private final RensoNoteList rensoNoteList; // 連想ノートリスト
+       private final QDockWidget rensoNoteListDock; // 連想ノートリストドックウィジェット
+       
+       // ICHANGED
+       ClipBoardObserver cbObserver;
+       
+       // ICHANGED
+       String rensoNotePressedItemGuid;
+       
     String iconPath = new String("classpath:cx/fbn/nevernote/icons/");
        
        
@@ -359,11 +380,14 @@ public class NeverNote extends QMainWindow{
     // Application Constructor 
        @SuppressWarnings("static-access")
        public NeverNote(DatabaseConnection dbConn)  {
+               // ICHANGED
+               cbObserver = new ClipBoardObserver();
+               
                conn = dbConn;          
                if (conn.getConnection() == null) {
                        String msg = new String(tr("Unable to connect to the database.\n\nThe most probable reason is that some other process\n" +
-                               "is accessing the database or NixNote is already running.\n\n" +
-                               "Please end any other process or shutdown the other NixNote before starting.\n\nExiting program."));
+                               "is accessing the database or NeighborNote is already running.\n\n" +
+                               "Please end any other process or shutdown the other NeighborNote before starting.\n\nExiting program."));
                        
             QMessageBox.critical(null, tr("Database Connection Error") ,msg);
                        System.exit(16);
@@ -398,9 +422,12 @@ public class NeverNote extends QMainWindow{
                QApplication.setStyle(Global.getStyle());
                if (Global.useStandardPalette())
                        QApplication.setPalette(QApplication.style().standardPalette());
-        setWindowTitle(tr("NixNote"));
+        setWindowTitle(tr("NeighborNote"));
 
         mainLeftRightSplitter = new QSplitter();
+               // ICHANGED
+               mainLeftRightSplitter.setOrientation(Qt.Orientation.Horizontal);
+               
         setCentralWidget(mainLeftRightSplitter);
         leftSplitter1 = new QSplitter();
         leftSplitter1.setOrientation(Qt.Orientation.Vertical);
@@ -417,9 +444,13 @@ public class NeverNote extends QMainWindow{
         listManager = new ListManager(conn, logger);
         
                logger.log(logger.EXTREME, "Building index runners & timers");
-        indexRunner = new IndexRunner("indexRunner.log", 
-                       Global.getDatabaseUrl(), Global.getIndexDatabaseUrl(), Global.getResourceDatabaseUrl(),
-                       Global.getDatabaseUserid(), Global.getDatabaseUserPassword(), Global.cipherPassword);
+               // ICHANGED Global.getBehaviorDatabaseUrl()を追加
+               indexRunner = new IndexRunner("indexRunner.log",
+                               Global.getDatabaseUrl(), Global.getIndexDatabaseUrl(),
+                               Global.getResourceDatabaseUrl(),
+                               Global.getBehaviorDatabaseUrl(), Global.getDatabaseUserid(),
+                               Global.getDatabaseUserPassword(), Global.cipherPassword);
+               
                indexThread = new QThread(indexRunner, "Index Thread");
         indexRunner.indexAttachmentsLocally = Global.indexAttachmentsLocally();
         indexRunner.indexImageRecognition = Global.indexImageRecognition();
@@ -440,9 +471,12 @@ public class NeverNote extends QMainWindow{
                                
                logger.log(logger.EXTREME, "Setting sync thread & timers");
                syncThreadsReady=1;
-               syncRunner = new SyncRunner("syncRunner.log", 
-                               Global.getDatabaseUrl(), Global.getIndexDatabaseUrl(), Global.getResourceDatabaseUrl(),
-                               Global.getDatabaseUserid(), Global.getDatabaseUserPassword(), Global.cipherPassword);
+               // ICHANGED Global.getBehaviorDatabaseUrl()を追加
+               syncRunner = new SyncRunner("syncRunner.log", Global.getDatabaseUrl(),
+                               Global.getIndexDatabaseUrl(), Global.getResourceDatabaseUrl(),
+                               Global.getBehaviorDatabaseUrl(), Global.getDatabaseUserid(),
+                               Global.getDatabaseUserPassword(), Global.cipherPassword);
+               
                syncTime = new SyncTimes().timeValue(Global.getSyncInterval());
                syncTimer = new QTimer();
                syncTimer.timeout.connect(this, "syncTimer()");
@@ -464,9 +498,13 @@ public class NeverNote extends QMainWindow{
                
                logger.log(logger.EXTREME, "Starting thumnail thread");
                pdfReadyQueue = new ArrayList<String>();
-               thumbnailRunner = new ThumbnailRunner("thumbnailRunner.log", 
-                               Global.getDatabaseUrl(), Global.getIndexDatabaseUrl(), Global.getResourceDatabaseUrl(),
-                               Global.getDatabaseUserid(), Global.getDatabaseUserPassword(), Global.cipherPassword);
+               // ICHANGED Global.getBehaviorDatabaseUrl()を追加
+               thumbnailRunner = new ThumbnailRunner("thumbnailRunner.log",
+                               Global.getDatabaseUrl(), Global.getIndexDatabaseUrl(),
+                               Global.getResourceDatabaseUrl(),
+                               Global.getBehaviorDatabaseUrl(), Global.getDatabaseUserid(),
+                               Global.getDatabaseUserPassword(), Global.cipherPassword);
+               
                thumbnailThread = new QThread(thumbnailRunner, "Thumbnail Thread");
                thumbnailRunner.noteSignal.thumbnailPageReady.connect(this, "thumbnailHTMLReady(String,QByteArray,Integer)");
                thumbnailThread.start();
@@ -510,7 +548,8 @@ public class NeverNote extends QMainWindow{
         tagTree = new TagTreeWidget(conn);
         savedSearchTree = new SavedSearchTreeWidget();
         trashTree = new TrashTreeWidget();
-        noteTableView = new TableView(logger, listManager);        
+               // ICHANGED
+               noteTableView = new TableView(logger, listManager, this);     
         
         searchField = new QComboBox();
         searchField.setObjectName("searchField");
@@ -549,18 +588,55 @@ public class NeverNote extends QMainWindow{
         noteCache = new HashMap<String,String>();
         readOnlyCache = new HashMap<String, Boolean>();
         inkNoteCache = new HashMap<String, Boolean>();
-        browserWindow = new BrowserWindow(conn);
-
+        // ICHANGED
+        browserWindow = new BrowserWindow(conn, cbObserver);
+
+               // ICHANGED 下から移動してきた。
+               historyGuids = new HashMap<Integer, ArrayList<String>>();
+               historyPosition = new HashMap<Integer, Integer>();
+               fromHistory = new HashMap<Integer, Boolean>();
+               
+               // ICHANGED タブブラウザ作成
+               tabWindows = new HashMap<Integer, TabBrowse>();
+               tabBrowser = new TabBrowserWidget(this);
+               tabBrowser.setStyleSheet("QTabBar::tab{width:150px;}");
+               TabBrowse tab = new TabBrowse(conn, tabBrowser, cbObserver);
+               browserWindow = tab.getBrowserWindow();
+               int index = tabBrowser.addNewTab(tab, "");
+               tabWindows.put(index, tab);
+               tabBrowser.setTabsClosable(true);
+               tabBrowser.currentChanged.connect(this, "tabWindowChanged(int)");
+               tabBrowser.tabCloseRequested.connect(this, "tabWindowClosing(int)");
+
+               // ICHANGED
+               // 履歴記録のハッシュマップを初期化
+               historyGuids.put(index, new ArrayList<String>());
+               historyPosition.put(index, 0);
+               fromHistory.put(index, false);
+               
         mainLeftRightSplitter.addWidget(leftSplitter1);
         mainLeftRightSplitter.addWidget(browserIndexSplitter);
         
-        if (Global.getListView() == Global.View_List_Wide) {
-               browserIndexSplitter.addWidget(noteTableView);
-               browserIndexSplitter.addWidget(browserWindow); 
-        } else {
-               mainLeftRightSplitter.addWidget(noteTableView);
-               mainLeftRightSplitter.addWidget(browserWindow); 
-        }
+               // ICHANGED
+               // 連想ノートリストをセットアップ
+               rensoNoteList = new RensoNoteList(conn, this);
+               rensoNoteList.itemPressed.connect(this,
+                               "rensoNoteItemPressed(QListWidgetItem)");
+               rensoNoteListDock = new QDockWidget(tr("Renso Note List"), this);
+               rensoNoteListDock.setWidget(rensoNoteList);
+               addDockWidget(DockWidgetArea.RightDockWidgetArea, rensoNoteListDock);
+
+               if (Global.getListView() == Global.View_List_Wide) {
+                       browserIndexSplitter.addWidget(noteTableView);
+                       // ICHANGED
+                       browserIndexSplitter.addWidget(tabBrowser);
+                       // browserIndexSplitter.addWidget(browserWindow);
+               } else {
+                       mainLeftRightSplitter.addWidget(noteTableView);
+                       // ICHANGED
+                       mainLeftRightSplitter.addWidget(tabBrowser);
+                       // mainLeftRightSplitter.addWidget(browserWindow);
+               }
        
        // Setup the thumbnail viewer
        thumbnailViewer = new ThumbnailViewer();
@@ -622,8 +698,15 @@ public class NeverNote extends QMainWindow{
                savedSearchTree.itemSelectionChanged.connect(this, "updateSavedSearchSelection()");
                savedSearchTree.setVisible(Global.isWindowVisible("savedSearchTree"));
                menuBar.hideSavedSearches.setChecked(Global.isWindowVisible("savedSearchTree"));
+               
+               // ICHANGED noteTableViewに新しいタブで開くを追加
+               noteTableView.setOpenNewTabAction(menuBar.noteOpenNewTab);
                        
                noteTableView.setAddAction(menuBar.noteAdd);
+               
+               // ICHANGED noteTableViewに新しいタブでノート追加を追加
+               noteTableView.setAddNoteNewTabAction(menuBar.noteAddNewTab);
+               
                noteTableView.setDeleteAction(menuBar.noteDelete);
                noteTableView.setRestoreAction(menuBar.noteRestoreAction);
                noteTableView.setNoteDuplicateAction(menuBar.noteDuplicateAction);
@@ -651,15 +734,21 @@ public class NeverNote extends QMainWindow{
                
                if (!Global.isWindowVisible("editorButtonBar"))
                        toggleEditorButtonBar();
+               
                if (!Global.isWindowVisible("leftPanel"))
                        menuBar.hideLeftSide.setChecked(true);
                if (Global.isWindowVisible("noteInformation"))
                        toggleNoteInformation();
                quotaBar.setVisible(Global.isWindowVisible("quota"));
-               if (!quotaBar.isVisible())
+               // IFIXED quotaBar.isVisible() → Global.isWindowVisible("quota")
+               // なぜかquotaBar.isVisible()が常にfalseを返すようなので修正
+               if (!Global.isWindowVisible("quota"))
                        menuBar.hideQuota.setChecked(false);
+               
                searchField.setVisible(Global.isWindowVisible("searchField"));
-               if (!searchField.isVisible())
+               // IFIXED !searchField.isVisible() → !Global.isWindowVisible("searchField")
+               // なぜかsearchField.isVisible()が常にfalseを返すようなので修正
+               if (!Global.isWindowVisible("searchField"))
                        menuBar.hideSearch.setChecked(false);
                
                if (searchField.isHidden() && quotaBar.isHidden() && zoomSpinner.isHidden() && notebookTree.isHidden())
@@ -686,7 +775,7 @@ public class NeverNote extends QMainWindow{
                
                
                trayIcon = new QSystemTrayIcon(this);
-               trayIcon.setToolTip(tr("NixNote"));
+               trayIcon.setToolTip(tr("NeighborNote"));
                trayIcon.setContextMenu(trayMenu);
                trayIcon.activated.connect(this, "trayActivated(com.trolltech.qt.gui.QSystemTrayIcon$ActivationReason)");
 
@@ -694,9 +783,14 @@ public class NeverNote extends QMainWindow{
                currentNoteGuid = Global.getLastViewedNoteGuid();
                if (currentNoteGuid.equals(""))
                        currentNote = new Note();
-       historyGuids = new ArrayList<String>();
-       historyPosition = 0;
-       fromHistory = false;
+               
+               // ICHANGED
+               /* 上に移動したので要らない
+               historyGuids = new ArrayList<String>();
+               historyPosition = 0;
+               fromHistory = false;
+               */
+               
                noteDirty = false;
                if (!currentNoteGuid.trim().equals("")) {
                        currentNote = conn.getNoteTable().getNote(currentNoteGuid, true,true,false,false,true);
@@ -748,8 +842,12 @@ public class NeverNote extends QMainWindow{
        threadMonitorTimer.timeout.connect(this, "threadMonitorCheck()");
        threadMonitorTimer.start(1000*10);  // Check for threads every 10 seconds;              
        
-       historyGuids.add(currentNoteGuid);
-       historyPosition = 1;
+               // ICHANGED たぶんこれはいらない
+               // IFIXED ?
+               /*
+               historyGuids.add(currentNoteGuid);
+               historyPosition = 1;
+               */
        
        menuBar.blockSignals(true);
        menuBar.narrowListView.blockSignals(true);
@@ -763,14 +861,18 @@ public class NeverNote extends QMainWindow{
         menuBar.blockSignals(false);
        menuBar.narrowListView.blockSignals(false);
        menuBar.wideListView.blockSignals(false);
-
-        if (Global.getListView() == Global.View_List_Wide) {
-               browserIndexSplitter.addWidget(noteTableView);
-               browserIndexSplitter.addWidget(browserWindow); 
-        } else {
-               mainLeftRightSplitter.addWidget(noteTableView);
-               mainLeftRightSplitter.addWidget(browserWindow); 
-        }
+       
+               // IFIXED
+               // 上に同じコードがあるよね? とりあえずコメントアウト
+               /*
+                * if (Global.getListView() == Global.View_List_Wide) {
+                * browserIndexSplitter.addWidget(noteTableView); // ICHANGED //
+                * browserIndexSplitter.addWidget(tabBrowser);
+                * browserIndexSplitter.addWidget(browserWindow); } else {
+                * mainLeftRightSplitter.addWidget(noteTableView); // ICHANGED //
+                * mainLeftRightSplitter.addWidget(tabBrowser);
+                * mainLeftRightSplitter.addWidget(browserWindow); }
+                */
         
                messageTimer = new QTimer();
                messageTimer.timeout.connect(this, "clearMessage()");
@@ -800,11 +902,10 @@ public class NeverNote extends QMainWindow{
                }
        }
                
-   
-                       
-                       
-               if (Global.checkVersionUpgrade())
-                       checkForUpdates();
+               if (Global.checkVersionUpgrade()) {
+                       // ICHANGED TODO とりあえず封印
+                       // checkForUpdates();
+               }
        }
        
        
@@ -920,13 +1021,20 @@ public class NeverNote extends QMainWindow{
        
        File f = Global.getFileManager().getDbDirFile(Global.databaseName + ".h2.db");
        File fr = Global.getFileManager().getDbDirFile(Global.resourceDatabaseName + ".h2.db");
-       File fi = Global.getFileManager().getDbDirFile(Global.resourceDatabaseName + ".h2.db");
+               // IFIXED resourceDatabaseNameになっていたので修正
+               File fi = Global.getFileManager().getDbDirFile(Global.indexDatabaseName + ".h2.db");
+               // ICHANGED
+               File fb = Global.getFileManager().getDbDirFile(Global.behaviorDatabaseName + ".h2.db");
+                               
                if (!f.exists())
                        Global.setDatabaseUrl("");
                if (!fr.exists())
                        Global.setResourceDatabaseUrl("");              
                if (!fi.exists())
                        Global.setIndexDatabaseUrl(""); 
+               // ICHANGED
+               if (!fb.exists())
+                       Global.setBehaviorDatabaseUrl("");
        
         if (Global.getDatabaseUrl().toUpperCase().indexOf("CIPHER=") > -1) {
             boolean goodCheck = false;
@@ -940,8 +1048,9 @@ public class NeverNote extends QMainWindow{
                         Global.getDatabaseUserPassword(), Global.cipherPassword);
             }
         }
+        // ICHANGED Global.getBehaviorDatabaserUrl()を追加
                DatabaseConnection dbConn = new DatabaseConnection(logger,Global.getDatabaseUrl(), 
-                               Global.getIndexDatabaseUrl(), Global.getResourceDatabaseUrl(),
+                               Global.getIndexDatabaseUrl(), Global.getResourceDatabaseUrl(), Global.getBehaviorDatabaseUrl(),
                                Global.getDatabaseUserid(), Global.getDatabaseUserPassword(), Global.cipherPassword, 0);
        return dbConn;
     }
@@ -957,6 +1066,10 @@ public class NeverNote extends QMainWindow{
                st.execute("shutdown");
                st = conn.getIndexConnection().createStatement();
                st.execute("shutdown");
+               // ICHANGED
+               st = conn.getBehaviorConnection().createStatement();
+               st.execute("shutdown");
+               
                if (QMessageBox.question(this, tr("Are you sure"), 
                                tr("Are you sure you wish to encrypt the database?"),
                                QMessageBox.StandardButton.Yes, 
@@ -964,9 +1077,14 @@ public class NeverNote extends QMainWindow{
                        ChangeFileEncryption.execute(dbPath, "NeverNote", encryptCipher, null, Global.cipherPassword.toCharArray(), true);
                        ChangeFileEncryption.execute(dbPath, "Resources", encryptCipher, null, Global.cipherPassword.toCharArray(), true);
                        ChangeFileEncryption.execute(dbPath, "Index", encryptCipher, null, Global.cipherPassword.toCharArray(), true);
+                       // ICHANGED
+                       ChangeFileEncryption.execute(dbPath, "Behavior", encryptCipher, null, Global.cipherPassword.toCharArray(), true);
+                       
                        Global.setDatabaseUrl(Global.getDatabaseUrl() + ";CIPHER="+encryptCipher);
                        Global.setResourceDatabaseUrl(Global.getResourceDatabaseUrl() + ";CIPHER="+encryptCipher);
                        Global.setIndexDatabaseUrl(Global.getIndexDatabaseUrl() + ";CIPHER="+encryptCipher);
+                       // ICHANGED
+                               Global.setBehaviorDatabaseUrl(Global.getBehaviorDatabaseUrl() + ";CIPHER=" + encryptCipher);
 
                        QMessageBox.information(this, tr("Encryption Complete"), tr("Encryption is complete"));
                }
@@ -1069,11 +1187,13 @@ public class NeverNote extends QMainWindow{
                logger.log(logger.HIGH, "Entering NeverNote.closeEvent");
                waitCursor(true);
                
-               if (currentNote!= null & browserWindow!=null) {
-                       if (currentNote.getTitle() != null && browserWindow != null 
+               if (currentNote != null & browserWindow != null) {
+                       if (currentNote.getTitle() != null && browserWindow != null
                                        && !currentNote.getTitle().equals(browserWindow.getTitle()))
-                               conn.getNoteTable().updateNoteTitle(currentNote.getGuid(), browserWindow.getTitle());
+                               conn.getNoteTable().updateNoteTitle(currentNote.getGuid(),
+                                               browserWindow.getTitle());
                }
+               
                saveNote();
                setMessage(tr("Beginning shutdown."));
                
@@ -1086,6 +1206,15 @@ public class NeverNote extends QMainWindow{
                        browser.close();
                }
                
+               // ICHANGED タブブラウザに対してクローズ処理を行う
+               Collection<TabBrowse> win = tabWindows.values();
+               Iterator<TabBrowse> it = win.iterator();
+               tabBrowser.currentChanged.disconnect();
+               tabBrowser.tabCloseRequested.disconnect();
+               while (it.hasNext()) {
+                       TabBrowse browser = it.next();
+                       browser.close();
+               }
                
                externalFileEditedSaver();
                if (Global.isConnected && Global.synchronizeOnClose()) {
@@ -1302,6 +1431,7 @@ public class NeverNote extends QMainWindow{
        @SuppressWarnings("unused")
        private void settings() {
                logger.log(logger.HIGH, "Entering NeverNote.settings");
+
                saveNoteColumnPositions();
                saveNoteIndexWidth();
                showColumns();
@@ -1323,8 +1453,14 @@ public class NeverNote extends QMainWindow{
         else
                trayIcon.hide();
         showColumns();
-        if (menuBar.showEditorBar.isChecked())
-               showEditorButtons(browserWindow);
+        if (menuBar.showEditorBar.isChecked()){
+               // ICHANGED 
+               for(int i = 0; i < tabBrowser.count(); i++){
+                       BrowserWindow browser = ((TabBrowse) tabBrowser.widget(i)).getBrowserWindow();
+                       showEditorButtons(browser);
+               }
+               
+        }
         
         // Reset the save timer
         if (Global.getAutoSaveInterval() > 0)
@@ -1357,7 +1493,9 @@ public class NeverNote extends QMainWindow{
         restoreState(Global.restoreState(objectName()));
                mainLeftRightSplitter.setObjectName("mainLeftRightSplitter");
                browserIndexSplitter.setObjectName("browserIndexSplitter");
-               leftSplitter1.setObjectName("leftSplitter1");   
+               leftSplitter1.setObjectName("leftSplitter1");
+               // ICHANGED
+               rensoNoteListDock.setObjectName("rensoNoteListDock");
                
                // Restore the actual positions.
                if (mainWindow)
@@ -1365,6 +1503,8 @@ public class NeverNote extends QMainWindow{
         mainLeftRightSplitter.restoreState(Global.restoreState(mainLeftRightSplitter.objectName()));
         browserIndexSplitter.restoreState(Global.restoreState(browserIndexSplitter.objectName()));
         leftSplitter1.restoreState(Global.restoreState(leftSplitter1.objectName()));
+        // ICHANGED
+       rensoNoteListDock.restoreGeometry(Global.restoreGeometry(rensoNoteListDock.objectName()));
        
        }
        // Save window positions for the next start
@@ -1374,6 +1514,8 @@ public class NeverNote extends QMainWindow{
                Global.saveState(browserIndexSplitter.objectName(), browserIndexSplitter.saveState());
                Global.saveState(leftSplitter1.objectName(), leftSplitter1.saveState());
                Global.saveState(objectName(), saveState());
+               // ICHANGED
+               Global.saveGeometry(rensoNoteListDock.objectName(), rensoNoteListDock.saveGeometry());
        }    
        // Load the style sheet
        private void loadStyleSheet() {
@@ -1512,6 +1654,12 @@ public class NeverNote extends QMainWindow{
        menuBar.notebookShareAction.setEnabled(true);
        menuBar.notebookIconAction.setEnabled(true);
        menuBar.notebookStackAction.setEnabled(true);
+       
+               // ICHANGED ゴミ箱から元の画面に戻す。連想ノートリストをONに。
+               if (!rensoNoteListDock.isEnabled()) {
+                       rensoNoteListDock.setEnabled(true);
+               }
+               
        List<QTreeWidgetItem> selections = notebookTree.selectedItems();
        selectedNotebookGUIDs.clear();
                String guid = "";
@@ -1779,6 +1927,14 @@ public class NeverNote extends QMainWindow{
                Iterator<String> set = externalWindows.keySet().iterator();
                while(set.hasNext())
                        externalWindows.get(set.next()).getBrowserWindow().setNotebookList(filteredBooks);
+               
+               // ICHANGED
+               Iterator<Integer>it = tabWindows.keySet().iterator();
+               while (it.hasNext()) {
+                       tabWindows.get(it.next()).getBrowserWindow()
+                                       .setNotebookList(filteredBooks);
+               }
+               
                logger.log(logger.HIGH, "Leaving NeverNote.editNotebook");
        }
        // Publish a notebook
@@ -1924,6 +2080,8 @@ public class NeverNote extends QMainWindow{
        // A note's notebook has been updated
        @SuppressWarnings("unused")
        private void updateNoteNotebook(String guid, String notebookGuid) {
+               // ICHANGED 同じノートブックに入れられたノート間の履歴を登録
+               conn.getHistoryTable().addSameNotebookHistory(guid, notebookGuid);
                
                // Update the list manager
                listManager.updateNoteNotebook(guid, notebookGuid);
@@ -2017,6 +2175,14 @@ public class NeverNote extends QMainWindow{
                while(set.hasNext())
                        externalWindows.get(set.next()).getBrowserWindow().setNotebookList(filteredBooks);
                
+               // ICHANGED
+               // 全てのタブウィンドウを更新
+               Iterator<Integer> it = tabWindows.keySet().iterator();
+               while (it.hasNext()) {
+                       tabWindows.get(it.next()).getBrowserWindow()
+                                       .setNotebookList(filteredBooks);
+               }
+               
                waitCursor(false);
        }
        // Change the notebook's icon
@@ -2262,6 +2428,11 @@ public class NeverNote extends QMainWindow{
        
                menuBar.noteRestoreAction.setVisible(false);
                
+               // ICHANGED ゴミ箱から元の画面に戻す。連想ノートリストをONに。
+               if (!rensoNoteListDock.isEnabled()) {
+                       rensoNoteListDock.setEnabled(true);
+               }
+               
        List<QTreeWidgetItem> selections = tagTree.selectedItems();
        QTreeWidgetItem currentSelection;
        selectedTagGUIDs.clear();
@@ -2615,6 +2786,12 @@ public class NeverNote extends QMainWindow{
        menuBar.savedSearchEditAction.setEnabled(true);
        menuBar.savedSearchDeleteAction.setEnabled(true);
        menuBar.savedSearchIconAction.setEnabled(true);
+       
+               // ICHANGED ゴミ箱から元の画面に戻す。連想ノートリストをONに。
+               if (!rensoNoteListDock.isEnabled()) {
+                       rensoNoteListDock.setEnabled(true);
+               }
+               
        List<QTreeWidgetItem> selections = savedSearchTree.selectedItems();
        QTreeWidgetItem currentSelection;
        selectedSavedSearchGUID = "";
@@ -2770,7 +2947,7 @@ public class NeverNote extends QMainWindow{
        logger.log(logger.HIGH, "Entering NeverNote.compactDatabase");
                if (QMessageBox.question(this, tr("Confirmation"), tr("This will free unused space in the database, "+
                                "but please be aware that depending upon the size of your database this can be time consuming " +
-                               "and NixNote will be unresponsive until it is complete.  Do you wish to continue?"),
+                               "and NeighborNote will be unresponsive until it is complete.  Do you wish to continue?"),
                                QMessageBox.StandardButton.Yes, 
                                QMessageBox.StandardButton.No)==StandardButton.No.value() && Global.verifyDelete() == true) {
                                                        return;
@@ -2820,10 +2997,11 @@ public class NeverNote extends QMainWindow{
        @SuppressWarnings("unused")
        private void about() {
                logger.log(logger.HIGH, "Entering NeverNote.about");
+               // ICHANGED based on...の記述を付加
                QMessageBox.about(this, 
-                                               tr("About NixNote"),
-                                               tr("<h4><center><b>NixNote</b></center></h4><hr><center>Version ")
-                                               +Global.version
+                                               tr("About NeighborNote"),
+                                               tr("<h4><center><b>NeighborNote</b></center></h4><hr><center>Version ")
+                                               +Global.version + "(based on NixNote 1.5)"
                                                //+"1.2.120724"
                                                +tr("<hr>"
                                                                +"Open Source Evernote Client.<br><br>" 
@@ -3065,7 +3243,7 @@ public class NeverNote extends QMainWindow{
        attributeButton = toolBar.addAction(tr("Attributes")); 
        QIcon attributeIcon = new QIcon(iconPath+"attribute.png");
        attributeButton.setIcon(attributeIcon);
-       attributeButton.triggered.connect(this, "toggleNoteInformation()");
+       attributeButton.triggered.connect(this, "toggleNoteAttributes()");
        toggleAttributeButton(Global.isToolbarButtonVisible("attribute"));
                
        emailButton = toolBar.addAction(tr("Email"));
@@ -3368,12 +3546,17 @@ public class NeverNote extends QMainWindow{
                Global.showDeleted = false;
                menuBar.noteRestoreAction.setEnabled(false);
                menuBar.noteRestoreAction.setVisible(false);
+                       // ICHANGED ゴミ箱から元の画面に戻す。連想ノートリストをONに。
+                       rensoNoteListDock.setEnabled(true);
        }
        else {
                trashNoteGuid = tempGuid;
                currentNoteGuid = trashNoteGuid;
                menuBar.noteRestoreAction.setEnabled(true);
                menuBar.noteRestoreAction.setVisible(true);
+               // ICHANGED ゴミ箱を開く。連想ノートリストをOFFに。
+               rensoNoteListDock.setEnabled(false);
+                                       
                Global.showDeleted = true;
        }
        listManager.loadNotesIndex();
@@ -3409,6 +3592,11 @@ public class NeverNote extends QMainWindow{
                
                listManager.loadNotesIndex();
                noteIndexUpdated(false);
+               
+               // ICHANGED ゴミ箱から元の画面に戻す。連想ノートリストをONに。
+               if (!rensoNoteListDock.isEnabled()) {
+                       rensoNoteListDock.setEnabled(true);
+               }
        }       
    }
     // Show/Hide trash window
@@ -3577,6 +3765,11 @@ public class NeverNote extends QMainWindow{
 //     clearNotebookFilter();
        clearTrashFilter();
 //     clearSavedSearchFilter();
+       
+               // ICHANGED ゴミ箱から元の画面に戻す。連想ノートリストをONに。
+               if (!rensoNoteListDock.isEnabled()) {
+                       rensoNoteListDock.setEnabled(true);
+               }
 
        if (attributeTreeSelected == null || item.nativeId() != attributeTreeSelected.nativeId()) {
                if (item.childCount() > 0) {
@@ -3688,6 +3881,31 @@ public class NeverNote extends QMainWindow{
 
                saveNote();
                
+               // ICHANGED
+               // Ctrlを押しながらノートテーブルを選択した時に選択ノート数0になってしまうのを止める
+               if (noteTableView.selectionModel().selectedRows().size() == 0) {
+                       scrollToGuid(currentNoteGuid);
+                       return;
+               }
+               
+               // ICHANGED
+               // 右クリックだったときの処理
+               if (QApplication.mouseButtons().isSet(MouseButton.RightButton)) {
+                       // 選択されたノート(current)のguidをcurrentnoteguidにセット
+                       List<QModelIndex> selections = noteTableView.selectionModel().selectedRows();
+                       if(selections.size() > 0){
+                               selectedNoteGUIDs.clear();
+                               for(int i = 0; i < selections.size(); i++){
+                                       int row = selections.get(i).row();
+                                       QModelIndex index = noteTableView.proxyModel.index(row, Global.noteTableGuidPosition);
+                                       SortedMap<Integer, Object> ix = noteTableView.proxyModel.itemData(index);
+                                       currentNoteGuid = (String) ix.values().toArray()[0];
+                                       selectedNoteGUIDs.add(currentNoteGuid);
+                               }
+                       }
+                       return;
+               }
+               
                // If we have more than one selection, then set the merge note action to true.
        List<QModelIndex> selections = noteTableView.selectionModel().selectedRows();
                if (selections.size() > 1) 
@@ -3697,14 +3915,26 @@ public class NeverNote extends QMainWindow{
 
                // If the ctrl key is pressed, then they are selecting multiple 
                // entries and we don't want to change the currently viewed note.
+               // ICHANGED
                if (QApplication.keyboardModifiers().isSet(KeyboardModifier.ControlModifier) &&
-                               QApplication.mouseButtons().isSet(MouseButton.LeftButton)) 
+                               QApplication.mouseButtons().isSet(MouseButton.LeftButton)){
+                       selectedNoteGUIDs.clear();
+               for (int i=0; i<selections.size(); i++) {
+                       int row = selections.get(i).row();
+                       QModelIndex index = noteTableView.proxyModel.index(row, Global.noteTableGuidPosition);
+                       SortedMap<Integer, Object> ix = noteTableView.proxyModel.itemData(index);
+                       selectedNoteGUIDs.add((String)ix.values().toArray()[0]);
+               }
                        return;
-
-               if (historyGuids.size() == 0) {
+               }
+               
+               // ICHANGED たぶんこれは不要
+               // IFIXED ?
+               /*if (historyGuids.size() == 0) {
                        historyGuids.add(currentNoteGuid);
                        historyPosition = 1;
-               }
+               }*/
+
        noteTableView.showColumn(Global.noteTableGuidPosition);
        
        if (!Global.isColumnVisible("guid"))
@@ -3737,6 +3967,7 @@ public class NeverNote extends QMainWindow{
                                downButton.setEnabled(false);
                        index = noteTableView.proxyModel.index(row, Global.noteTableGuidPosition);
                        SortedMap<Integer, Object> ix = noteTableView.proxyModel.itemData(index);
+                               
                        currentNoteGuid = (String)ix.values().toArray()[0];
                        selectedNoteGUIDs.add(currentNoteGuid);
                }
@@ -3744,25 +3975,79 @@ public class NeverNote extends QMainWindow{
        
        nextButton.setEnabled(true);
                prevButton.setEnabled(true);
-       if (!fromHistory) {
-               int endPosition = historyGuids.size()-1;
-               for (int j=historyPosition; j<=endPosition; j++) {
-                       historyGuids.remove(historyGuids.size()-1);
-               }
-               historyGuids.add(currentNoteGuid);
-               historyPosition = historyGuids.size();
-       } 
-       if (historyPosition <= 1)
-               prevButton.setEnabled(false);
-       if (historyPosition == historyGuids.size())
-               nextButton.setEnabled(false);
-               
-       fromHistory = false;
+               
+               // ICHANGED
+               int currentIndex = tabBrowser.currentIndex();
+               ArrayList<String> histGuids = historyGuids.get(currentIndex);
+               int histPosition = historyPosition.get(currentIndex);
+               boolean fromHist = fromHistory.get(currentIndex);
+               
+               // ICHANGED
+               if (!fromHist) {
+                       int endPosition = histGuids.size() - 1;
+
+                       for (int j = histPosition; j <= endPosition; j++) {
+                               histGuids.remove(histGuids.size() - 1);
+                       }
+                       histGuids.add(currentNoteGuid);
+                       historyPosition.put(currentIndex, histGuids.size());
+                       histPosition = histGuids.size();
+               }
+               if (histPosition <= 1){
+                       prevButton.setEnabled(false);
+               }
+               if (histPosition == histGuids.size())
+                       nextButton.setEnabled(false);
+               fromHistory.put(currentIndex, false);
+               fromHist = false;
+               
        scrollToGuid(currentNoteGuid);
        refreshEvernoteNote(true);
-       waitCursor(false);
+       
+               // ICHANGED
+               if (currentNoteGuid != null && !currentNoteGuid.equals("")) {
+                       if (!Global.showDeleted) { // ゴミ箱じゃなければ
+                               addBrowseHistory();
+                       }
+               }
+
+               // ICHANGED
+               // 連想ノートリストを更新
+               rensoNoteList.refreshRensoNoteList(currentNoteGuid);
+               
+               waitCursor(false);
                logger.log(logger.HIGH, "Leaving NeverNote.noteTableSelection");
-    }    
+    }
+    
+
+       // ICHANGED
+    // 複数ノートの同時閲覧履歴をデータベースに保存
+       private void addBrowseHistory() {
+               // このノートと他のタブウィンドウノートの関連性を内部データベースのHistoryテーブルに登録
+               if (tabWindows.size() >= 2) {
+                       Iterator<Integer> it = tabWindows.keySet().iterator();
+                       while (it.hasNext()) {
+                               int tabIndex = it.next();
+                               String nextGuid = ((TabBrowse) tabBrowser.widget(tabIndex)).getBrowserWindow().getNote().getGuid();
+                               // guid1=guid2のデータは登録しない
+                               if (!currentNoteGuid.equals(nextGuid)) {
+                                       conn.getHistoryTable().addHistory("browse", currentNoteGuid, nextGuid);
+                               }
+                       }
+               }
+               // このノートと他の外部ウィンドウノートの関連性を内部データベースのHistoryテーブルに登録
+               if (externalWindows.size() >= 1) {
+                       Iterator<String> it = externalWindows.keySet().iterator();
+                       while (it.hasNext()) {
+                               String nextGuid = it.next();
+                               // guid1=guid2のデータは登録しない
+                               if (!currentNoteGuid.equals(nextGuid)) {
+                                       conn.getHistoryTable().addHistory("browse", currentNoteGuid, nextGuid);
+                               }
+                       }
+               }
+       }
+       
        // Trigger a refresh when the note db has been updated
        private void noteIndexUpdated(boolean reload) {
                logger.log(logger.HIGH, "Entering NeverNote.noteIndexUpdated");
@@ -3800,9 +4085,13 @@ public class NeverNote extends QMainWindow{
                
                String saveCurrentNoteGuid = new String();
                String tempNoteGuid = new String();
-                               
-               historyGuids.clear();
-               historyPosition = 0;
+               
+               // ICHANGED
+               int currentIndex = tabBrowser.currentIndex();
+               ArrayList<String> histGuids = historyGuids.get(currentIndex);
+               histGuids.clear();
+               historyPosition.put(currentIndex, 0);
+               
                prevButton.setEnabled(false);
                nextButton.setEnabled(false);
                
@@ -3840,48 +4129,68 @@ public class NeverNote extends QMainWindow{
 
                logger.log(logger.HIGH, "Leaving NeverNote.refreshEvernoteNoteList");
        } 
-    // Called when the previous arrow button is clicked 
-    @SuppressWarnings("unused")
+    
+       // ICHANGED
+       // Called when the previous arrow button is clicked
+       @SuppressWarnings("unused")
        private void previousViewedAction() {
-       if (!prevButton.isEnabled())
-               return;
-       if (historyPosition == 0)
-               return;
-               historyPosition--;
-       if (historyPosition <= 0)
-               return;
-        String historyGuid = historyGuids.get(historyPosition-1);
-        fromHistory = true;
-       for (int i=0; i<noteTableView.model().rowCount(); i++) {
-               QModelIndex modelIndex =  noteTableView.model().index(i, Global.noteTableGuidPosition);
-               if (modelIndex != null) {
-                       SortedMap<Integer, Object> ix = noteTableView.model().itemData(modelIndex);
-                       String tableGuid =  (String)ix.values().toArray()[0];
-                       if (tableGuid.equals(historyGuid)) {
-                               noteTableView.selectRow(i);
-                               return;
-                       }       
-               }
-       }
-    }
+               int currentIndex = tabBrowser.currentIndex();
+               ArrayList<String> histGuids = historyGuids.get(currentIndex);
+               int histPosition = historyPosition.get(currentIndex);
+               boolean fromHist = fromHistory.get(currentIndex);
+               if (!prevButton.isEnabled())
+                       return;
+               if (histPosition == 0)
+                       return;
+               histPosition--;
+               historyPosition.put(currentIndex, histPosition);
+               if (histPosition <= 0)
+                       return;
+               String historyGuid = histGuids.get(histPosition - 1);
+               fromHistory.put(currentIndex, true);
+               fromHist = true;
+               for (int i = 0; i < noteTableView.model().rowCount(); i++) {
+                       QModelIndex modelIndex = noteTableView.model().index(i,
+