OSDN Git Service

Add the ability to encrypt & decrypt the database more easily.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / gui / MainMenuBar.java
index 375a5da..97cbaaf 100644 (file)
@@ -93,6 +93,8 @@ public class MainMenuBar extends QMenuBar {
 //     public QAction                  compactAction;                          // free unused space in the database\r
        public QAction                  databaseStatusAction;           // Current database status\r
        public QAction                  folderImportAction;                     // Automatically import files \r
+       public QAction                  spellCheckAction;                       // Spell checker\r
+       public QAction                  encryptDatabaseAction;          // Encrypt the local database\r
        \r
        public QAction                  notebookEditAction;                     // Edit the selected notebook\r
        public QAction                  notebookAddAction;                      // Add a new notebook\r
@@ -518,8 +520,21 @@ public class MainMenuBar extends QMenuBar {
                folderImportAction.setToolTip("Import Files Automatically");\r
                folderImportAction.triggered.connect(parent, "folderImport()");\r
                setupShortcut(folderImportAction, "Tools_Folder_Import");\r
+               \r
+               spellCheckAction = new QAction(tr("Spell Check"), this);\r
+               spellCheckAction.setToolTip("Check for spelling errors");\r
+               spellCheckAction.triggered.connect(parent.browserWindow, "doSpellCheck()");\r
+               setupShortcut(spellCheckAction, "Tools_Spell_Check");\r
 \r
-\r
+               encryptDatabaseAction = new QAction(tr("Encrypt Database"), this);\r
+               encryptDatabaseAction.setToolTip("Encrypt the database upon shutdown");\r
+               encryptDatabaseAction.triggered.connect(parent, "doDatabaseEncrypt()");\r
+               setupShortcut(encryptDatabaseAction, "Tools_Database_Encrypt");\r
+               if (Global.cipherPassword != null && Global.cipherPassword != "") {\r
+                       encryptDatabaseAction.setText("Decrypt Database");\r
+                       encryptDatabaseAction.setToolTip("Decrypt the database upon shutdown");\r
+               }\r
+               \r
                loggerAction = new QAction(tr("Log"), this);\r
                loggerAction.setToolTip("Show the detailed application log");\r
                loggerAction.triggered.connect(parent, "logger()");\r
@@ -643,10 +658,13 @@ public class MainMenuBar extends QMenuBar {
                onlineMenu.addAction(noteOnlineHistoryAction);\r
                \r
                toolsMenu = addMenu(tr("&Tools"));\r
+               toolsMenu.addAction(spellCheckAction);\r
                toolsMenu.addAction(accountAction);\r
                toolsMenu.addAction(fullReindexAction);\r
                toolsMenu.addAction(disableIndexing);\r
 //             toolsMenu.addAction(compactAction);\r
+               toolsMenu.addSeparator();\r
+               toolsMenu.addAction(encryptDatabaseAction);\r
                toolsMenu.addAction(databaseStatusAction);\r
                toolsMenu.addSeparator();\r
                toolsMenu.addAction(folderImportAction);\r