OSDN Git Service

Add the ability to encrypt & decrypt the database more easily.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / gui / MainMenuBar.java
index ffb1513..97cbaaf 100644 (file)
@@ -94,6 +94,7 @@ public class MainMenuBar extends QMenuBar {
        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
@@ -525,6 +526,15 @@ public class MainMenuBar extends QMenuBar {
                spellCheckAction.triggered.connect(parent.browserWindow, "doSpellCheck()");\r
                setupShortcut(spellCheckAction, "Tools_Spell_Check");\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
@@ -653,6 +663,8 @@ public class MainMenuBar extends QMenuBar {
                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