OSDN Git Service

Allow customizing of notebook icons.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / gui / MainMenuBar.java
index ffb1513..08605e4 100644 (file)
@@ -61,6 +61,8 @@ public class MainMenuBar extends QMenuBar {
        public QAction                  editPasteWithoutFormat;         // Paste selected text\r
        public QAction                  editCopy;                                       // Copy selected text;\r
        \r
+       public QAction                  wideListView;                           // View with list on the top\r
+       public QAction                  narrowListView;                         // View with list on the side\r
        public QAction                  thumbnailView;                          // view thumbnails\r
        public QAction                  hideSavedSearches;                      // show/hide saved searches\r
        public QAction                  hideNotebooks;                          // show/hide notebooks\r
@@ -94,11 +96,13 @@ 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
        public QAction                  notebookDeleteAction;           // Delete a notebook\r
        public QAction                  notebookCloseAction;            // Close notebooks\r
+       public QAction                  notebookIconAction;                     // Change the icon\r
        \r
        public QAction                  savedSearchAddAction;           // Add a saved search\r
        public QAction                  savedSearchEditAction;          // Edit a saved search\r
@@ -291,6 +295,18 @@ public class MainMenuBar extends QMenuBar {
                hideNotebooks.setChecked(true);\r
                setupShortcut(hideNotebooks, "View_Show_Notebooks");\r
 \r
+               wideListView = new QAction(tr("Wide List View"), this);\r
+               wideListView.setToolTip("Wide List Viwe");\r
+               wideListView.setCheckable(true);\r
+               wideListView.changed.connect(parent, "wideListView()");\r
+               setupShortcut(wideListView, "View_Wide_List");\r
+               \r
+               narrowListView = new QAction(tr("Narrow List View"), this);\r
+               narrowListView.setToolTip("Narrow List View");\r
+               narrowListView.setCheckable(true);\r
+               narrowListView.changed.connect(parent, "narrowListView()");\r
+               setupShortcut(narrowListView, "View_Narrow_List");\r
+               \r
                thumbnailView = new QAction(tr("Preview"), this);\r
                thumbnailView.setToolTip("Preview Notes");\r
                thumbnailView.triggered.connect(parent, "thumbnailView()");\r
@@ -432,13 +448,14 @@ public class MainMenuBar extends QMenuBar {
                setupShortcut(notebookDeleteAction, "File_Notebook_Delete");\r
                \r
                notebookCloseAction = new QAction(tr("Open/Close Notebooks"), this);\r
-//             if (!Global.mimicEvernoteInterface) {\r
-                       notebookCloseAction.setEnabled(true);\r
-                       notebookCloseAction.triggered.connect(parent, "closeNotebooks()");\r
-                       setupShortcut(notebookCloseAction, "File_Notebook_Close");\r
-//             } else {\r
-//                     notebookCloseAction.setEnabled(false); \r
-//             }\r
+               notebookCloseAction.setEnabled(true);\r
+               notebookCloseAction.triggered.connect(parent, "closeNotebooks()");\r
+               setupShortcut(notebookCloseAction, "File_Notebook_Close");\r
+\r
+               notebookIconAction = new QAction(tr("Change Icon"), this);\r
+               notebookIconAction.setEnabled(false);\r
+               notebookIconAction.triggered.connect(parent, "setNotebookIcon()");\r
+               setupShortcut(notebookIconAction, "File_Notebook_Icon");\r
                \r
                tagAddAction = new QAction(tr("Add"),this);\r
                tagAddAction.triggered.connect(parent, "addTag()");\r
@@ -522,9 +539,18 @@ public class MainMenuBar extends QMenuBar {
                \r
                spellCheckAction = new QAction(tr("Spell Check"), this);\r
                spellCheckAction.setToolTip("Check for spelling errors");\r
-               spellCheckAction.triggered.connect(parent.browserWindow, "doSpellCheck()");\r
+               spellCheckAction.triggered.connect(parent.browserWindow, "spellCheckClicked()");\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
@@ -578,6 +604,8 @@ public class MainMenuBar extends QMenuBar {
                viewMenu = addMenu(tr("&View"));\r
                viewMenu.addAction(noteAttributes);\r
                viewMenu.addSeparator();\r
+               viewMenu.addAction(wideListView);\r
+               viewMenu.addAction(narrowListView);\r
                viewMenu.addAction(thumbnailView);\r
                viewMenu.addSeparator();\r
                viewMenu.addAction(hideNoteList);\r
@@ -628,10 +656,10 @@ public class MainMenuBar extends QMenuBar {
                notebookMenu.addAction(notebookAddAction);\r
                notebookMenu.addAction(notebookEditAction);\r
                notebookMenu.addAction(notebookDeleteAction);\r
-//             if (!Global.mimicEvernoteInterface) {\r
-                       notebookMenu.addSeparator();\r
-                       notebookMenu.addAction(notebookCloseAction);\r
-//             }\r
+               notebookMenu.addSeparator();\r
+               notebookMenu.addAction(notebookCloseAction);\r
+               notebookMenu.addSeparator();\r
+               notebookMenu.addAction(notebookIconAction);\r
                \r
                tagMenu.addAction(tagAddAction);\r
                tagMenu.addAction(tagEditAction);\r
@@ -653,6 +681,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