OSDN Git Service

Add automatic wildcard option.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / dialog / ConfigDialog.java
index 472ad73..9be08dc 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
- * This file is part of NeverNote \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
  *\r
 */\r
 \r
+//**********************************************\r
+//**********************************************\r
+//* This dialog is the debugging information \r
+//* page used in the Edit/Preferences dialog\r
+//**********************************************\r
+//**********************************************\r
+\r
 package cx.fbn.nevernote.dialog;\r
 \r
 import java.io.FileInputStream;\r
@@ -102,6 +109,10 @@ public class ConfigDialog extends QDialog {
                \r
                loadSettings();\r
        }\r
+\r
+       //******************************************\r
+       //* Ok button is pushed.  Save values\r
+       //******************************************\r
        public void okPushed() {\r
                Global.setServer(debugPage.getServer());\r
                Global.setEnableThumbnails(debugPage.getEnableThumbnails());\r
@@ -138,6 +149,11 @@ public class ConfigDialog extends QDialog {
                else\r
                        Global.setNewNoteWithSelectedTags(false);\r
                \r
+               if (appearancePage.getAnyTagSelection())\r
+                       Global.setAnyTagSelectionMatch(true);\r
+               else\r
+                       Global.setAnyTagSelectionMatch(false);\r
+               \r
                Global.setAutoSaveInterval(appearancePage.getAutoSaveInterval());\r
                                                \r
                Global.setAutomaticLogin(connectionPage.getAutomaticLogin());\r
@@ -157,6 +173,13 @@ public class ConfigDialog extends QDialog {
                Global.setSynchronizeDeletedContent(connectionPage.getSynchronizeDeletedContent());\r
                Global.setTagBehavior(appearancePage.getTagBehavior());\r
                Global.setIndexAttachmentsLocally(indexPage.getIndexAttachmentsLocally());\r
+               Global.setIndexNoteBody(indexPage.getIndexNoteBody());\r
+               Global.setIndexNoteTitle(indexPage.getIndexNoteTitle());\r
+               Global.setIndexImageRecognition(indexPage.getIndexImageRecognition());\r
+               Global.setAutomaticWildcardSearches(indexPage.getAutomaticWildcardSearches());\r
+               Global.setSpecialIndexCharacters(indexPage.getSpecialCharacters());\r
+               Global.setIncludeTagChildren(appearancePage.getIncludeTagChildren());\r
+               \r
        FileOutputStream out = null;\r
                try {\r
                        out = new FileOutputStream(Global.getFileManager().getHomeDirFile("secure.txt"));\r
@@ -172,6 +195,8 @@ public class ConfigDialog extends QDialog {
                Global.setMessageLevel( debugPage.getDebugLevel());\r
                Global.saveCarriageReturnFix(debugPage.getCarriageReturnFix());\r
                Global.enableCarriageReturnFix = debugPage.getCarriageReturnFix();\r
+               Global.saveHtmlEntitiesFix(debugPage.getHtmlEntitiesFix());\r
+               Global.enableHTMLEntitiesFix = debugPage.getHtmlEntitiesFix();\r
                \r
                Global.setSpellSetting(Configuration.SPELL_IGNOREDIGITWORDS, spellPage.getIgnoreDigitWords());\r
                Global.setSpellSetting(Configuration.SPELL_IGNOREINTERNETADDRESSES, spellPage.getIgnoreInternetAddresses());\r
@@ -204,24 +229,30 @@ public class ConfigDialog extends QDialog {
                Global.setOverrideDefaultFont(fontPage.overrideFont());\r
                Global.setDefaultFont(fontPage.getFont());\r
                Global.setDefaultFontSize(fontPage.getFontSize());\r
+               Global.setDatabaseCache(debugPage.getDatabaseCacheSize());\r
                                \r
                close();\r
        }\r
+       \r
+       \r
+       // Reject the current style\r
        @Override\r
        public void reject() {\r
                QApplication.setStyle(Global.getStyle());\r
                super.reject();\r
        }\r
        \r
+       //* return the debugging information page\r
        public ConfigDebugPage getDebugPage() {\r
                return debugPage;\r
        }\r
        \r
-       \r
+       // Get the Evernote connection page\r
        public ConfigConnectionPage getConfigPage() {\r
                return connectionPage;\r
        }\r
        \r
+       // Create icons used for navigating the page\r
        public void createIcons() {\r
                String iconPath = new String("classpath:cx/fbn/nevernote/icons/");\r
 \r
@@ -265,10 +296,12 @@ public class ConfigDialog extends QDialog {
                contentsWidget.currentItemChanged.connect(this, "changePage(QListWidgetItem, QListWidgetItem)");\r
        }\r
        \r
+       // this is called when the user switches config pages\r
        protected void changePage(QListWidgetItem current, QListWidgetItem previous) {\r
                pagesWidget.setCurrentIndex(contentsWidget.row(current));\r
        }\r
        \r
+       // Load initial settings\r
        private void loadSettings() {\r
                Global.originalPalette = QApplication.palette();\r
                \r
@@ -306,9 +339,11 @@ public class ConfigDialog extends QDialog {
                appearancePage.setPdfPreview(Global.pdfPreview());\r
                appearancePage.setCheckForUpdates(Global.checkVersionUpgrade());\r
                appearancePage.setNewNoteWithTags(Global.newNoteWithSelectedTags());\r
+               appearancePage.setAnyTagSelection(Global.anyTagSelectionMatch());\r
                appearancePage.setShowSplashScreen(Global.isWindowVisible("SplashScreen"));\r
                appearancePage.setTagBehavior(Global.tagBehavior());\r
                appearancePage.setMinimizeOnClose(Global.minimizeOnClose());\r
+               appearancePage.setIncludeTagChildren(Global.includeTagChildren());\r
                \r
                indexPage.setRegex(Global.getWordRegex());\r
                indexPage.setSleepInterval(Global.getIndexThreadSleepInterval());\r
@@ -321,6 +356,7 @@ public class ConfigDialog extends QDialog {
                                                \r
                debugPage.setDebugLevel(Global.getMessageLevel());\r
                debugPage.setCarriageReturnFix(Global.enableCarriageReturnFix());\r
+               debugPage.setHtmlEntitiesFix(Global.enableHTMLEntitiesFix);\r
                \r
        }\r
        \r