OSDN Git Service

Remove visibility of "share with individuals" because that information isn't currentl...
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / gui / MainMenuBar.java
1 /*\r
2  * This file is part of NeverNote \r
3  * Copyright 2009 Randy Baumgarte\r
4  * \r
5  * This file may be licensed under the terms of of the\r
6  * GNU General Public License Version 2 (the ``GPL'').\r
7  *\r
8  * Software distributed under the License is distributed\r
9  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either\r
10  * express or implied. See the GPL for the specific language\r
11  * governing rights and limitations.\r
12  *\r
13  * You should have received a copy of the GPL along with this\r
14  * program. If not, go to http://www.gnu.org/licenses/gpl.html\r
15  * or write to the Free Software Foundation, Inc.,\r
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\r
17  *\r
18 */\r
19 package cx.fbn.nevernote.gui;\r
20 \r
21 import com.trolltech.qt.gui.QAction;\r
22 import com.trolltech.qt.gui.QMenu;\r
23 import com.trolltech.qt.gui.QMenuBar;\r
24 \r
25 import cx.fbn.nevernote.Global;\r
26 import cx.fbn.nevernote.NeverNote;\r
27 \r
28 public class MainMenuBar extends QMenuBar {\r
29 \r
30         private final NeverNote                 parent;\r
31         public QAction                  printAction;                            // Action when a user selects Print from the file menu\r
32         public QAction                  connectAction;                          // Connect/Disconnect to Evernote\r
33         public QAction                  fullReindexAction;                      // Action when a user wants to reindex the entire database\r
34         public QAction                  synchronizeAction;                      // Synchronize data with Evernote                                       \r
35         public QAction                  settingsAction;                         // Show user config settings\r
36         public QAction                  emailAction;                            // Action when a user selects "email"\r
37         public QAction                  backupAction;                           // Backup the database\r
38         public QAction                  restoreAction;                          // Restore from a backup\r
39         public QAction                  emptyTrashAction;                       // Action when a user wants to clear the trash file\r
40         public QAction                  exitAction;                                     // Action when user selects "exit"\r
41         public QAction                  aboutAction;                            // Action when a user selects "About"\r
42         public QAction                  loggerAction;                           // Action when a user selects "Log"\r
43         public QAction                  releaseAction;                          // Release notes\r
44 \r
45         public QAction                  noteAdd;                                        // Add a note\r
46         public QAction                  noteAttributes;                         // Action when a user selects note attributes\r
47         public QAction                  noteTags;                                       // Assign a note tags\r
48         public QAction                  noteDelete;                                     // Delete the current note\r
49         public QAction                  noteRestoreAction;                      // Restore a note\r
50         public QAction                  noteReindex;                            // Action when a user wants to reindex a note\r
51         public QAction                  noteDuplicateAction;            // Duplicate an existing note\r
52         public QAction                  noteMergeAction;                        // Merge notes\r
53         public QAction                  noteExportAction;                       // Export notes\r
54         public QAction                  noteImportAction;                       // Import notes\r
55         \r
56         public QAction                  editFind;                                       // find text in the current note\r
57         public QAction                  editUndo;                                       // Undo last change\r
58         public QAction                  editRedo;                                       // Redo last change\r
59         public QAction                  editCut;                                        // Cut selected text\r
60         public QAction                  editPaste;                                      // Paste selected text\r
61         public QAction                  editPasteWithoutFormat;         // Paste selected text\r
62         public QAction                  editCopy;                                       // Copy selected text;\r
63         \r
64         public QAction                  wideListView;                           // View with list on the top\r
65         public QAction                  narrowListView;                         // View with list on the side\r
66         public QAction                  thumbnailView;                          // view thumbnails\r
67         public QAction                  hideSavedSearches;                      // show/hide saved searches\r
68         public QAction                  hideNotebooks;                          // show/hide notebooks\r
69         public QAction                  hideTags;                                       // show/hide tags\r
70         public QAction                  hideAttributes;                         // show/hide note information\r
71         public QAction                  hideTrash;                                      // show/hide trash tree\r
72         public QAction                  hideNoteList;                           // show/hide the list of notes\r
73         public QAction                  showEditorBar;                          // show/hide the editor button bar\r
74         public QAction                  hideLeftSide;                           // Hide the entire left side\r
75         \r
76         public QAction                  formatBold;                                     // Bold selected text\r
77         public QAction                  formatItalic;                           // Italics selected text\r
78         public QAction                  formatUnderline;                        // Underline selected text\r
79         public QAction                  formatStrikethrough;            // Strikethrough selected text\r
80         public QAction                  formatSuperscript;                      // Superscript selected text\r
81         public QAction                  formatSubscript;                        // Subscript selected text\r
82         public QAction                  formatNumberList;                       // insert a numbered list\r
83         public QAction                  formatBulletList;                       // insert a bulleted list;\r
84         public QAction                  alignLeftAction;                        // Left justify text\r
85         public QAction                  alignRightAction;                       // Right justify text\r
86         public QAction                  alignCenterAction;                      // Center text\r
87         public QAction                  horizontalLineAction;           // Insert a horizontal line\r
88         public QAction                  indentAction;                           // Indent\r
89         public QAction                  outdentAction;                          // outdent menu action\r
90         \r
91         public QAction                  noteOnlineHistoryAction;        // Pull note history from Evernote\r
92         \r
93         public QAction                  accountAction;                          // Account dialog box action\r
94         public QAction                  disableIndexing;                        // put indexing on hold.\r
95 //      public QAction                  compactAction;                          // free unused space in the database\r
96         public QAction                  databaseStatusAction;           // Current database status\r
97         public QAction                  folderImportAction;                     // Automatically import files \r
98         public QAction                  spellCheckAction;                       // Spell checker\r
99         public QAction                  encryptDatabaseAction;          // Encrypt the local database\r
100         \r
101         public QAction                  notebookEditAction;                     // Edit the selected notebook\r
102         public QAction                  notebookAddAction;                      // Add a new notebook\r
103         public QAction                  notebookDeleteAction;           // Delete a notebook\r
104         public QAction                  notebookPublishAction;          // Publish a notebook\r
105         public QAction                  notebookShareAction;            // Share a notebook with others\r
106         public QAction                  notebookCloseAction;            // Close notebooks\r
107         public QAction                  notebookIconAction;                     // Change the icon\r
108         public QAction                  notebookStackAction;            // Stack/Unstack the icon.\r
109         \r
110         public QAction                  savedSearchAddAction;           // Add a saved search\r
111         public QAction                  savedSearchEditAction;          // Edit a saved search\r
112         public QAction                  savedSearchDeleteAction;        // Delete a saved search\r
113         public QAction                  savedSearchIconAction;          // Change a saved search icon\r
114         \r
115         public QAction                  tagEditAction;                          // Edit a tag\r
116         public QAction                  tagAddAction;                           // Add a tag\r
117         public QAction                  tagDeleteAction;                        // Delete a tag\r
118         public QAction                  tagIconAction;                          // Change the icon\r
119         \r
120         //**************************************************************************\r
121         //* Menu Bar Titles\r
122         //**************************************************************************\r
123         \r
124         private QMenu                   fileMenu;                                       // File menu\r
125         private QMenu                   noteMenu;                                       // Note menu \r
126         private QMenu                   notebookMenu;                           // Notebook menu\r
127         private QMenu                   tagMenu;                                        // Tag menu\r
128         private QMenu                   savedSearchMenu;                        // Saved Searches               \r
129 \r
130         private QMenu                   editMenu;                                       // Edit menu\r
131 \r
132         private QMenu                   formatMenu;                                     // Text format menu\r
133         private QMenu                   viewMenu;                                       // show/hide stuff\r
134         private QMenu                   listMenu;                                       // bullet or numbered list\r
135         private QMenu                   indentMenu;                                     // indent or outdent menu\r
136         private QMenu                   alignMenu;                                      // Left/Right/Center justify\r
137         \r
138         private QMenu                   onlineMenu;                                     // View online stuff (if connected)\r
139         \r
140         private QMenu                   toolsMenu;                                      // Tools menu\r
141         \r
142         private QMenu                   helpMenu;       \r
143         \r
144         public MainMenuBar(NeverNote p) {\r
145                 parent = p;\r
146                 \r
147                 \r
148                 fullReindexAction = new QAction(tr("Reindex Database"), this);\r
149                 fullReindexAction.setToolTip("Reindex all notes");\r
150                 fullReindexAction.triggered.connect(parent, "fullReindex()");\r
151                 setupShortcut(fullReindexAction, "Tools_Reindex_Database");\r
152                                 \r
153                 printAction = new QAction(tr("Print"), this);\r
154                 printAction.setToolTip("Print the current note");\r
155                 printAction.triggered.connect(parent, "printNote()");\r
156                 setupShortcut(printAction, "File_Print");\r
157                 \r
158                 emailAction = new QAction(tr("Email"), this);\r
159                 emailAction.setToolTip("Email the current note");\r
160                 emailAction.triggered.connect(parent, "emailNote()");\r
161                 setupShortcut(emailAction, "File_Email");\r
162                 \r
163                 backupAction = new QAction(tr("Backup Database"), this);\r
164                 backupAction.setToolTip("Backup the current database");\r
165                 backupAction.triggered.connect(parent, "databaseBackup()");\r
166                 setupShortcut(backupAction, "File_Backup");\r
167 \r
168                 restoreAction = new QAction(tr("Restore Database"), this);\r
169                 restoreAction.setToolTip("Restore the database from a backup");\r
170                 restoreAction.triggered.connect(parent, "databaseRestore()");\r
171                 setupShortcut(restoreAction, "File_Restore");\r
172                         \r
173                 emptyTrashAction = new QAction(tr("Empty Trash"), this);\r
174                 emptyTrashAction.setToolTip("Empty the trash folder");\r
175                 emptyTrashAction.triggered.connect(parent, "emptyTrash()");\r
176                 setupShortcut(emptyTrashAction, "File_Empty_Trash");\r
177                 \r
178                 noteRestoreAction = new QAction(tr("Restore"), this);\r
179                 noteRestoreAction.setToolTip("Restore a deleted file from the trash");\r
180                 noteRestoreAction.triggered.connect(parent, "restoreNote()");\r
181                 noteRestoreAction.setVisible(false);\r
182                 setupShortcut(noteRestoreAction, "File_Note_Restore");\r
183                                 \r
184                 settingsAction = new QAction(tr("Preferences"), this);\r
185                 settingsAction.setToolTip("Program settings");\r
186                 settingsAction.triggered.connect(parent, "settings()");\r
187                 setupShortcut(settingsAction, "Edit_Preferences");\r
188                 \r
189                 exitAction = new QAction(tr("Exit"), this);\r
190                 exitAction.setToolTip("Close the program");\r
191                 exitAction.triggered.connect(parent, "close()");\r
192                 exitAction.setShortcut("Ctrl+Q");\r
193                 setupShortcut(exitAction, "File_Exit");\r
194                 \r
195                 noteAttributes = new QAction(tr("Extended Information"), this);\r
196                 noteAttributes.setToolTip("Show/Hide extended note attributes");\r
197                 noteAttributes.triggered.connect(parent, "toggleNoteInformation()");\r
198                 noteAttributes.setShortcut("F8");\r
199                 setupShortcut(noteAttributes, "View_Extended_Information");\r
200                 \r
201                 noteReindex = new QAction(tr("Reindex"), this);\r
202                 noteReindex.setToolTip(tr("Reindex this note"));\r
203                 noteReindex.triggered.connect(parent, "reindexNote()");\r
204                 setupShortcut(noteReindex, "File_Note_Reindex");\r
205                 \r
206                 noteDuplicateAction = new QAction(tr("Duplicate"), this);\r
207                 noteDuplicateAction.setToolTip(tr("Duplicate this note"));\r
208                 noteDuplicateAction.triggered.connect(parent, "duplicateNote()");\r
209                 setupShortcut(noteReindex, "File_Note_Duplicate");\r
210                 \r
211                 noteMergeAction = new QAction(tr("Merge Notes"), this);\r
212                 noteMergeAction.setToolTip(tr("Merge Multiple notes"));\r
213                 noteMergeAction.triggered.connect(parent, "mergeNotes()");\r
214                 setupShortcut(noteMergeAction, "File_Note_Merge");\r
215                 \r
216                 noteExportAction = new QAction(tr("Export Selected Notes"), this);\r
217                 noteExportAction.setToolTip(tr("Export selected notes"));\r
218                 noteExportAction.triggered.connect(parent, "exportNotes()");\r
219                 setupShortcut(noteExportAction, "File_Note_Export");\r
220                 \r
221                 noteImportAction = new QAction(tr("Import Notes"), this);\r
222                 noteImportAction.setToolTip(tr("Import notes"));\r
223                 noteImportAction.triggered.connect(parent, "importNotes()");\r
224                 setupShortcut(noteImportAction, "File_Note_Import");\r
225                 \r
226                 noteAdd = new QAction(tr("Add"), this);\r
227                 noteAdd.setToolTip(tr("Add a new note"));\r
228                 noteAdd.triggered.connect(parent, "addNote()");\r
229                 setupShortcut(noteAdd, "File_Note_Add");\r
230                 //noteAdd.setShortcut("Ctrl+N");\r
231                 \r
232                 noteTags = new QAction(tr("Modify Tags"), this);\r
233                 noteTags.setToolTip(tr("Change the tags assigned to this note"));\r
234                 noteTags.triggered.connect(parent.browserWindow, "modifyTags()");\r
235                 setupShortcut(noteTags, "File_Note_Modify_Tags");\r
236                 \r
237                 noteDelete = new QAction(tr("Delete"), this);\r
238                 noteDelete.setToolTip(tr("Delete this note"));\r
239                 noteDelete.triggered.connect(parent, "deleteNote()");\r
240                 setupShortcut(noteDelete, "File_Note_Delete");\r
241         \r
242                 editFind = new QAction(tr("Find In Note"), this);\r
243                 editFind.setToolTip(tr("Find a string in the current note"));\r
244                 editFind.triggered.connect(parent, "findText()");\r
245                 setupShortcut(editFind, "Edit_Find_In_Note");\r
246                 //editFind.setShortcut("Ctrl+F");\r
247                 \r
248                 editUndo = new QAction(tr("Undo"), this);\r
249                 editUndo.setToolTip(tr("Undo"));\r
250                 editUndo.triggered.connect(parent.browserWindow, "undoClicked()");      \r
251                 setupShortcut(editUndo, "Edit_Undo");\r
252                 //editUndo.setShortcut("Ctrl+Z");\r
253                 \r
254                 editRedo = new QAction(tr("Redo"), this);\r
255                 editRedo.setToolTip(tr("Redo"));\r
256                 editRedo.triggered.connect(parent.browserWindow, "redoClicked()");\r
257                 setupShortcut(editRedo, "Edit_Redo");\r
258                 //editRedo.setShortcut("Ctrl+Y");\r
259         \r
260                 editCut = new QAction(tr("Cut"), this);\r
261                 editCut.setToolTip(tr("Cut"));\r
262                 editCut.triggered.connect(parent.browserWindow, "cutClicked()");\r
263                 setupShortcut(editCut, "Edit_Cut");\r
264                 //editCut.setShortcut("Ctrl+X");\r
265                 \r
266                 editCopy = new QAction(tr("Copy"), this);\r
267                 editCopy.setToolTip(tr("Copy"));\r
268                 editCopy.triggered.connect(parent.browserWindow, "copyClicked()");\r
269                 setupShortcut(editCopy, "Edit_Copy");\r
270                 //editCopy.setShortcut("Ctrl+C");\r
271                 \r
272                 editPaste = new QAction(tr("Paste"), this);\r
273                 editPaste.setToolTip(tr("Paste"));\r
274                 editPaste.triggered.connect(parent.browserWindow, "pasteClicked()");\r
275                 setupShortcut(editPaste, "Edit_Paste");\r
276 \r
277                 editPasteWithoutFormat = new QAction(tr("Paste Without Formatting"), this);\r
278                 editPasteWithoutFormat.setToolTip(tr("Paste Without Formatting"));\r
279                 editPasteWithoutFormat.triggered.connect(parent.browserWindow, "pasteWithoutFormattingClicked()");\r
280                 setupShortcut(editPasteWithoutFormat, "Edit_Paste_Without_Formatting");\r
281                 \r
282                 hideNoteList = new QAction(tr("Show Note List"), this);\r
283                 hideNoteList.setToolTip("Show/Hide Note List");\r
284                 hideNoteList.triggered.connect(parent, "toggleNoteListWindow()");\r
285                 hideNoteList.setCheckable(true);\r
286                 hideNoteList.setChecked(true);\r
287                 setupShortcut(hideNoteList, "View_Show_Note_List");\r
288                 \r
289                 hideTags = new QAction(tr("Show Tags"), this);\r
290                 hideTags.setToolTip("Show/Hide Tags");\r
291                 hideTags.triggered.connect(parent, "toggleTagWindow()");\r
292                 hideTags.setCheckable(true);\r
293                 hideTags.setChecked(true);\r
294                 setupShortcut(hideTags, "View_Show_Tags");\r
295                         \r
296                 hideNotebooks = new QAction(tr("Show Notebooks"), this);\r
297                 hideNotebooks.setToolTip("Show/Hide Notebooks");\r
298                 hideNotebooks.triggered.connect(parent, "toggleNotebookWindow()");\r
299                 hideNotebooks.setCheckable(true);\r
300                 hideNotebooks.setChecked(true);\r
301                 setupShortcut(hideNotebooks, "View_Show_Notebooks");\r
302 \r
303                 wideListView = new QAction(tr("Wide List View"), this);\r
304                 wideListView.setToolTip("Wide List Viwe");\r
305                 wideListView.setCheckable(true);\r
306                 wideListView.changed.connect(parent, "wideListView()");\r
307                 setupShortcut(wideListView, "View_Wide_List");\r
308                 \r
309                 narrowListView = new QAction(tr("Narrow List View"), this);\r
310                 narrowListView.setToolTip("Narrow List View");\r
311                 narrowListView.setCheckable(true);\r
312                 narrowListView.changed.connect(parent, "narrowListView()");\r
313                 setupShortcut(narrowListView, "View_Narrow_List");\r
314                 \r
315                 thumbnailView = new QAction(tr("Preview"), this);\r
316                 thumbnailView.setToolTip("Preview Notes");\r
317                 thumbnailView.triggered.connect(parent, "thumbnailView()");\r
318                 setupShortcut(thumbnailView, "View_Thumbnail");\r
319                 \r
320                 hideSavedSearches = new QAction(tr("Show Saved Searches"), this);\r
321                 hideSavedSearches.setToolTip("Show/Hide Saved Searches");\r
322                 hideSavedSearches.triggered.connect(parent, "toggleSavedSearchWindow()");\r
323                 hideSavedSearches.setCheckable(true);\r
324                 hideSavedSearches.setChecked(true);\r
325                 setupShortcut(hideSavedSearches, "View_Show_SavedSearches");\r
326                 \r
327                 hideAttributes = new QAction(tr("Show Attribute Searches"), this);\r
328                 hideAttributes.setToolTip("Show/Hide Attribute Searches");\r
329                 hideAttributes.triggered.connect(parent, "toggleAttributesWindow()");\r
330                 hideAttributes.setCheckable(true);\r
331                 hideAttributes.setChecked(true);\r
332                 setupShortcut(hideAttributes, "View_Show_Attribute_Searches");\r
333 \r
334                 hideTrash = new QAction(tr("Show Trash"), this);\r
335                 hideTrash.setToolTip("Show/Hide Trash Tree");\r
336                 hideTrash.triggered.connect(parent, "toggleTrashWindow()");\r
337                 hideTrash.setCheckable(true);\r
338                 hideTrash.setChecked(true);\r
339                 setupShortcut(hideTrash, "View_Show_Trash");\r
340                 \r
341 \r
342                 showEditorBar = new QAction(tr("Show Editor Button Bar"), this);\r
343                 showEditorBar.setToolTip("Show/Hide Editor Button Bar");\r
344                 showEditorBar.triggered.connect(parent, "toggleEditorButtonBar()");\r
345                 showEditorBar.setCheckable(true);\r
346                 showEditorBar.setChecked(true);\r
347                 setupShortcut(showEditorBar, "View_Show_Editor_Button_Bar");\r
348                 \r
349 \r
350                 hideLeftSide = new QAction(tr("Hide Left Side Panels"), this);\r
351                 hideLeftSide.setToolTip("Hide The Entire Left Side");\r
352                 hideLeftSide.triggered.connect(parent, "toggleLeftSide()");\r
353                 hideLeftSide.setCheckable(true);\r
354                 hideLeftSide.setChecked(false);\r
355                 setupShortcut(hideLeftSide, "View_Show_Left_Side");\r
356                 //hideLeftSide.setShortcut("F11");\r
357 \r
358                 alignLeftAction = new QAction(tr("Left"), this);\r
359                 alignLeftAction.setToolTip(tr("Left Align"));\r
360                 alignLeftAction.triggered.connect(parent.browserWindow, "justifyLeftClicked()");\r
361                 setupShortcut(alignLeftAction, "Format_Alignment_Left");\r
362                 //alignLeftAction.setShortcut("Ctrl+L");\r
363                 \r
364                 alignRightAction = new QAction(tr("Right"), this);\r
365                 alignRightAction.setToolTip(tr("Right Align"));\r
366                 alignRightAction.triggered.connect(parent.browserWindow, "justifyRightClicked()");\r
367                 setupShortcut(alignRightAction, "Format_Alignment_Right");\r
368                 //alignRightAction.setShortcut("Ctrl+R");\r
369                 \r
370                 alignCenterAction = new QAction(tr("Center"), this);\r
371                 alignCenterAction.setToolTip(tr("Center Align"));\r
372                 alignCenterAction.triggered.connect(parent.browserWindow, "justifyCenterClicked()");\r
373                 setupShortcut(alignCenterAction, "Format_Alignment_Center");\r
374                 //alignCenterAction.setShortcut("Ctrl+C");\r
375                 \r
376                 formatBold = new QAction(tr("Bold"), this);\r
377                 formatBold.setToolTip(tr("Bold"));\r
378                 formatBold.triggered.connect(parent.browserWindow, "boldClicked()");\r
379                 setupShortcut(formatBold, "Format_Bold");\r
380                 //formatBold.setShortcut("Ctrl+B");\r
381                 \r
382                 formatItalic = new QAction(tr("Italic"), this);\r
383                 formatItalic.setToolTip(tr("Italic"));\r
384                 formatItalic.triggered.connect(parent.browserWindow, "italicClicked()");\r
385                 setupShortcut(formatItalic, "Format_Italic");\r
386                 //formatItalic.setShortcut("Ctrl+I");\r
387                 \r
388                 formatUnderline = new QAction(tr("Underline"), this);\r
389                 formatUnderline.setToolTip(tr("Underline"));\r
390                 formatUnderline.triggered.connect(parent.browserWindow, "underlineClicked()");\r
391                 setupShortcut(formatUnderline, "Format_Underline");\r
392 //              formatUnderline.setShortcut("Ctrl+U");\r
393 \r
394                 \r
395                 formatSuperscript = new QAction(tr("Superscript"), this);\r
396                 formatSuperscript.setToolTip(tr("Superscript"));\r
397                 formatSuperscript.triggered.connect(parent.browserWindow, "superscriptClicked()");\r
398                 setupShortcut(formatSuperscript, "Format_Superscript");\r
399 \r
400 \r
401                 formatSubscript = new QAction(tr("Subscript"), this);\r
402                 formatSubscript.setToolTip(tr("Subscript"));\r
403                 formatSubscript.triggered.connect(parent.browserWindow, "subscriptClicked()");\r
404                 setupShortcut(formatSubscript, "Format_Subscript");\r
405 \r
406                 \r
407                 formatStrikethrough = new QAction(tr("Strikethrough"), this);\r
408                 formatStrikethrough.setToolTip(tr("Strikethrough"));\r
409                 formatStrikethrough.triggered.connect(parent.browserWindow, "strikethroughClicked()");\r
410                 setupShortcut(formatStrikethrough, "Format_Strikethrough");\r
411 \r
412                 horizontalLineAction = new QAction(tr("Horizontal Line"), this);\r
413                 horizontalLineAction.setToolTip(tr("Horizontal Line"));\r
414                 horizontalLineAction.triggered.connect(parent.browserWindow, "hlineClicked()");\r
415                 setupShortcut(horizontalLineAction, "Format_Horizontal_Line");\r
416                 \r
417                 formatBulletList = new QAction(tr("Bulleted List"), this);\r
418 //              formatBulletList.setText(tr("Numbered List"));\r
419                 formatBulletList.triggered.connect(parent.browserWindow, "bulletListClicked()");\r
420                 setupShortcut(formatBulletList, "Format_List_Bullet");\r
421 //              formatBulletList.setShortcut("Ctrl+Shift+B");\r
422                 \r
423                 formatNumberList = new QAction(tr("Numbered List"), this);\r
424                 formatNumberList.setText(tr("Numbered list"));\r
425                 formatNumberList.triggered.connect(parent.browserWindow, "numberListClicked()");\r
426                 setupShortcut(formatNumberList, "Format_List_Numbered");\r
427 //              formatNumberList.setShortcut("Ctrl+Shift+O");\r
428 \r
429                 indentAction = new QAction(tr(">> Increase"), this);\r
430                 indentAction.setText(tr(">> Increase"));\r
431                 indentAction.triggered.connect(parent.browserWindow, "indentClicked()");\r
432                 setupShortcut(indentAction, "Format_Indent_Increase");\r
433                 //indentAction.setShortcut("Ctrl+M");\r
434 \r
435                 outdentAction = new QAction(tr("<< Decrease"), this);\r
436                 outdentAction.setText(tr("<< Decrease"));\r
437                 outdentAction.triggered.connect(parent.browserWindow, "outdentClicked()");\r
438                 setupShortcut(outdentAction, "Format_Indent_Decrease");\r
439                 //outdentAction.setShortcut("Ctrl+Shift+M");\r
440                 \r
441                 notebookAddAction = new QAction(tr("Add"), this);\r
442                 notebookAddAction.triggered.connect(parent, "addNotebook()");\r
443                 setupShortcut(notebookAddAction, "File_Notebook_Add");\r
444                 \r
445                 notebookEditAction = new QAction(tr("Edit"), this);\r
446                 notebookEditAction.setEnabled(false);\r
447                 notebookEditAction.triggered.connect(parent, "editNotebook()");\r
448                 setupShortcut(notebookEditAction, "File_Notebook_Edit");\r
449                 \r
450                 notebookDeleteAction = new QAction(tr("Delete"), this);\r
451                 notebookDeleteAction.setEnabled(false);\r
452                 notebookDeleteAction.triggered.connect(parent, "deleteNotebook()");\r
453                 setupShortcut(notebookDeleteAction, "File_Notebook_Delete");\r
454                 \r
455                 notebookPublishAction = new QAction(tr("Share With The World"), this);\r
456                 notebookPublishAction.setEnabled(false);\r
457                 notebookPublishAction.triggered.connect(parent, "publishNotebook()");\r
458                 setupShortcut(notebookPublishAction, "File_Notebook_Publish");\r
459 \r
460                 notebookShareAction = new QAction(tr("Share With Individuals"), this);\r
461                 notebookShareAction.setEnabled(false);\r
462                 notebookShareAction.setVisible(false);\r
463                 notebookShareAction.triggered.connect(parent, "shareNotebook()");\r
464                 setupShortcut(notebookShareAction, "File_Notebook_Share");\r
465                 \r
466                 \r
467                 notebookCloseAction = new QAction(tr("Open/Close Notebooks"), this);\r
468                 notebookCloseAction.setEnabled(true);\r
469                 notebookCloseAction.triggered.connect(parent, "closeNotebooks()");\r
470                 setupShortcut(notebookCloseAction, "File_Notebook_Close");\r
471 \r
472                 notebookIconAction = new QAction(tr("Change Icon"), this);\r
473                 notebookIconAction.setEnabled(false);\r
474                 notebookIconAction.triggered.connect(parent, "setNotebookIcon()");\r
475                 setupShortcut(notebookIconAction, "File_Notebook_Icon");\r
476                 \r
477                 notebookStackAction = new QAction(tr("Set Stack"), this);\r
478                 notebookStackAction.setEnabled(false);\r
479                 notebookStackAction.triggered.connect(parent, "stackNotebook()");\r
480                 setupShortcut(notebookStackAction, "File_Notebook_Stack");\r
481                 \r
482                 tagAddAction = new QAction(tr("Add"),this);\r
483                 tagAddAction.triggered.connect(parent, "addTag()");\r
484                 //tagAddAction.setShortcut("Ctrl+Shift+T");\r
485                 setupShortcut(tagAddAction, "File_Tag_Add");\r
486                 \r
487                 tagEditAction = new QAction(tr("Edit"), this);\r
488                 tagEditAction.triggered.connect(parent, "editTag()");\r
489                 tagEditAction.setEnabled(false);\r
490                 setupShortcut(tagEditAction, "File_Tag_Edit");\r
491                 \r
492                 tagDeleteAction = new QAction(tr("Delete"), this);\r
493                 tagDeleteAction.triggered.connect(parent, "deleteTag()");\r
494                 tagDeleteAction.setEnabled(false);              \r
495                 setupShortcut(tagDeleteAction, "File_Tag_Delete");\r
496                                 \r
497                 tagIconAction = new QAction(tr("Change Icon"), this);\r
498                 tagIconAction.triggered.connect(parent, "setTagIcon()");\r
499                 tagIconAction.setEnabled(false);                \r
500                 setupShortcut(tagIconAction, "File_Tag_Icon");\r
501                                 \r
502                 savedSearchAddAction = new QAction(tr("Add"),this);\r
503                 savedSearchAddAction.triggered.connect(parent, "addSavedSearch()");\r
504                 setupShortcut(savedSearchAddAction, "File_SavedSearch_Add");\r
505                 \r
506                 savedSearchEditAction = new QAction(tr("Edit"), this);\r
507                 savedSearchEditAction.triggered.connect(parent, "editSavedSearch()");\r
508                 savedSearchEditAction.setEnabled(false);\r
509                 setupShortcut(savedSearchEditAction, "File_SavedSearch_Edit");\r
510                 \r
511                 savedSearchDeleteAction = new QAction(tr("Delete"), this);\r
512                 savedSearchDeleteAction.triggered.connect(parent, "deleteSavedSearch()");\r
513                 savedSearchDeleteAction.setEnabled(false);              \r
514                 setupShortcut(savedSearchDeleteAction, "File_SavedSearch_Delete");\r
515 \r
516                 savedSearchIconAction = new QAction(tr("Change Icon"), this);\r
517                 savedSearchIconAction.triggered.connect(parent, "setSavedSearchIcon()");\r
518                 savedSearchIconAction.setEnabled(false);                \r
519                 setupShortcut(savedSearchIconAction, "File_SavedSearch_Icon");          \r
520                                 \r
521                 connectAction = new QAction(tr("Connect"), this);\r
522                 connectAction.setToolTip("Connect to Evernote");\r
523                 connectAction.triggered.connect(parent, "remoteConnect()");\r
524                 setupShortcut(connectAction, "Online_Connect");\r
525                 \r
526                 synchronizeAction = new QAction(tr("Synchronize with Evernote"), this);\r
527                 synchronizeAction.setToolTip("Delete all local data & get a fresh copy");\r
528                 synchronizeAction.triggered.connect(parent, "evernoteSync()");\r
529                 synchronizeAction.setEnabled(false);\r
530                 setupShortcut(synchronizeAction, "Online_Synchronize");\r
531                 //synchronizeAction.setShortcut("F9");\r
532                 \r
533                 noteOnlineHistoryAction = new QAction(tr("Note History"), this);\r
534                 noteOnlineHistoryAction.triggered.connect(parent, "viewNoteHistory()");\r
535                 noteOnlineHistoryAction.setEnabled(false);\r
536                 setupShortcut(noteOnlineHistoryAction, "Online_Note_History");\r
537                 \r
538                 \r
539                 \r
540                 \r
541                 \r
542                 accountAction = new QAction(tr("Account Information"), this);\r
543                 accountAction.setToolTip(tr("Account Information"));\r
544                 accountAction.triggered.connect(parent, "accountInformation()");\r
545                 setupShortcut(accountAction, "Tools_Account_Information");\r
546                 \r
547 //              compactAction = new QAction(tr("Compact Database"), this);\r
548 //              compactAction.setToolTip(tr("Free unused database space"));\r
549 //              compactAction.triggered.connect(parent, "compactDatabase()");\r
550 //              setupShortcut(compactAction, "Tools_Compact_Database");\r
551 \r
552                 databaseStatusAction = new QAction(tr("Database Status"), this);\r
553                 databaseStatusAction.setToolTip(tr("Show current database information"));\r
554                 databaseStatusAction.triggered.connect(parent, "databaseStatus()");\r
555                 setupShortcut(databaseStatusAction, "Tools_Database_Status");\r
556                 \r
557                 \r
558                 disableIndexing = new QAction(tr("Disable Note Indexing"), this);\r
559                 disableIndexing.setToolTip("Manually Stop Note Indexing");\r
560                 disableIndexing.triggered.connect(parent, "toggleNoteIndexing()");\r
561                 disableIndexing.setCheckable(true);\r
562                 disableIndexing.setChecked(false);\r
563                 setupShortcut(disableIndexing, "Tools_Disable_Note_Indexing");\r
564                 \r
565                 \r
566                 folderImportAction = new QAction(tr("Automatic Folder Importing"), this);\r
567                 folderImportAction.setToolTip("Import Files Automatically");\r
568                 folderImportAction.triggered.connect(parent, "folderImport()");\r
569                 setupShortcut(folderImportAction, "Tools_Folder_Import");\r
570                 \r
571                 spellCheckAction = new QAction(tr("Spell Check"), this);\r
572                 spellCheckAction.setToolTip("Check for spelling errors");\r
573                 spellCheckAction.triggered.connect(parent.browserWindow, "spellCheckClicked()");\r
574                 setupShortcut(spellCheckAction, "Tools_Spell_Check");\r
575 \r
576                 encryptDatabaseAction = new QAction(tr("Encrypt Database"), this);\r
577                 encryptDatabaseAction.setToolTip("Encrypt the database upon shutdown");\r
578                 encryptDatabaseAction.triggered.connect(parent, "doDatabaseEncrypt()");\r
579                 setupShortcut(encryptDatabaseAction, "Tools_Database_Encrypt");\r
580                 if (Global.cipherPassword != null && Global.cipherPassword != "") {\r
581                         encryptDatabaseAction.setText("Decrypt Database");\r
582                         encryptDatabaseAction.setToolTip("Decrypt the database upon shutdown");\r
583                 }\r
584                 \r
585                 loggerAction = new QAction(tr("Log"), this);\r
586                 loggerAction.setToolTip("Show the detailed application log");\r
587                 loggerAction.triggered.connect(parent, "logger()");\r
588                 setupShortcut(loggerAction, "About_Log");\r
589                                 \r
590                 releaseAction = new QAction(tr("Release Notes"), this);\r
591                 releaseAction.setToolTip("Release notes");\r
592                 releaseAction.triggered.connect(parent, "releaseNotes()");      \r
593                 setupShortcut(releaseAction, "About_Release_Notes");\r
594                 \r
595                 aboutAction = new QAction(tr("About"), this);\r
596                 aboutAction.setToolTip("About NeverNote");\r
597                 aboutAction.triggered.connect(parent, "about()"); \r
598                 setupShortcut(aboutAction, "About_About");\r
599                 \r
600                 setupMenuBar();\r
601         }\r
602         \r
603         public void setupMenuBar() {\r
604                 fileMenu = addMenu(tr("&File"));\r
605                 \r
606                 noteMenu = fileMenu.addMenu(tr("&Note"));\r
607                 notebookMenu = fileMenu.addMenu(tr("Notebook"));\r
608                 tagMenu = fileMenu.addMenu(tr("Tag"));\r
609                 savedSearchMenu = fileMenu.addMenu(tr("Saved Searches"));\r
610                 fileMenu.addSeparator();\r
611                 fileMenu.addAction(emailAction);\r
612                 fileMenu.addAction(printAction);\r
613                 fileMenu.addSeparator();\r
614                 fileMenu.addAction(noteImportAction);\r
615                 fileMenu.addAction(noteExportAction);\r
616                 fileMenu.addAction(backupAction);\r
617                 fileMenu.addAction(restoreAction);\r
618                 fileMenu.addSeparator();\r
619                 fileMenu.addAction(emptyTrashAction);\r
620                 fileMenu.addAction(exitAction);\r
621 \r
622                 editMenu = addMenu(tr("&Edit"));\r
623                 editMenu.addAction(editFind);\r
624                 editMenu.addSeparator();\r
625                 editMenu.addAction(editUndo);\r
626                 editMenu.addAction(editRedo);\r
627                 editMenu.addSeparator();\r
628                 editMenu.addAction(editCut);\r
629                 editMenu.addAction(editCopy);\r
630                 editMenu.addAction(editPaste);\r
631                 editMenu.addAction(editPasteWithoutFormat);\r
632                 editMenu.addSeparator();\r
633                 editMenu.addAction(settingsAction);\r
634                 \r
635                 viewMenu = addMenu(tr("&View"));\r
636                 viewMenu.addAction(noteAttributes);\r
637                 viewMenu.addSeparator();\r
638                 viewMenu.addAction(wideListView);\r
639                 viewMenu.addAction(narrowListView);\r
640                 viewMenu.addAction(thumbnailView);\r
641                 viewMenu.addSeparator();\r
642                 viewMenu.addAction(hideNoteList);\r
643                 viewMenu.addAction(hideNotebooks);\r
644                 viewMenu.addAction(hideTags);\r
645                 viewMenu.addAction(hideAttributes);\r
646                 viewMenu.addAction(hideSavedSearches);\r
647                 viewMenu.addAction(hideTrash);\r
648                 viewMenu.addAction(showEditorBar);\r
649                 viewMenu.addAction(hideLeftSide);\r
650                 \r
651                 formatMenu = addMenu(tr("&Format"));\r
652                 formatMenu.addAction(formatBold);\r
653                 formatMenu.addAction(formatUnderline);\r
654                 formatMenu.addAction(formatItalic);\r
655                 formatMenu.addSeparator();\r
656                 formatMenu.addAction(formatStrikethrough);\r
657                 formatMenu.addAction(horizontalLineAction);\r
658                 formatMenu.addSeparator();\r
659                 formatMenu.addAction(formatSuperscript);\r
660                 formatMenu.addAction(formatSubscript);\r
661                 formatMenu.addSeparator();\r
662 \r
663                 alignMenu = formatMenu.addMenu(tr("Alignment"));\r
664                 alignMenu.addAction(alignLeftAction);\r
665                 alignMenu.addAction(alignCenterAction);\r
666                 alignMenu.addAction(alignRightAction);\r
667                 \r
668                 listMenu = formatMenu.addMenu(tr("Lists"));\r
669                 listMenu.addAction(formatBulletList);\r
670                 listMenu.addAction(formatNumberList);\r
671                 indentMenu = formatMenu.addMenu(tr("Indent"));\r
672                 indentMenu.addAction(indentAction);\r
673                 indentMenu.addAction(outdentAction);\r
674                 \r
675                 noteAttributes.setCheckable(true);\r
676                 noteMenu.addAction(noteAdd);\r
677                 noteMenu.addAction(noteDelete);\r
678                 noteMenu.addAction(noteReindex);\r
679                 noteMenu.addSeparator();\r
680                 noteMenu.addAction(noteTags);\r
681                 noteMenu.addAction(noteRestoreAction);\r
682                 noteMenu.addSeparator();\r
683                 noteMenu.addAction(noteDuplicateAction);\r
684                 noteMenu.addAction(noteMergeAction);\r
685 \r
686                                 \r
687                 notebookMenu.addAction(notebookAddAction);\r
688                 notebookMenu.addAction(notebookEditAction);\r
689                 notebookMenu.addAction(notebookDeleteAction);\r
690                 notebookMenu.addSeparator();\r
691                 notebookMenu.addAction(notebookPublishAction);\r
692                 notebookMenu.addAction(notebookShareAction);\r
693                 notebookMenu.addSeparator();\r
694                 notebookMenu.addAction(notebookStackAction);\r
695                 notebookMenu.addAction(notebookCloseAction);\r
696                 notebookMenu.addSeparator();\r
697                 notebookMenu.addAction(notebookIconAction);\r
698                 \r
699                 tagMenu.addAction(tagAddAction);\r
700                 tagMenu.addAction(tagEditAction);\r
701                 tagMenu.addAction(tagDeleteAction);\r
702                 tagMenu.addSeparator();\r
703                 tagMenu.addAction(tagIconAction);\r
704                 \r
705                 savedSearchMenu.addAction(savedSearchAddAction);\r
706                 savedSearchMenu.addAction(savedSearchEditAction);\r
707                 savedSearchMenu.addAction(savedSearchDeleteAction);\r
708                 savedSearchMenu.addSeparator();\r
709                 savedSearchMenu.addAction(savedSearchIconAction);\r
710                 \r
711                 onlineMenu = addMenu(tr("&Online"));\r
712                 onlineMenu.addAction(synchronizeAction);\r
713                 onlineMenu.addAction(connectAction);\r
714                 onlineMenu.addSeparator();\r
715                 onlineMenu.addAction(noteOnlineHistoryAction);\r
716                 \r
717                 toolsMenu = addMenu(tr("&Tools"));\r
718                 toolsMenu.addAction(spellCheckAction);\r
719                 toolsMenu.addAction(accountAction);\r
720                 toolsMenu.addAction(fullReindexAction);\r
721                 toolsMenu.addAction(disableIndexing);\r
722 //              toolsMenu.addAction(compactAction);\r
723                 toolsMenu.addSeparator();\r
724                 toolsMenu.addAction(encryptDatabaseAction);\r
725                 toolsMenu.addAction(databaseStatusAction);\r
726                 toolsMenu.addSeparator();\r
727                 toolsMenu.addAction(folderImportAction);\r
728 \r
729                 helpMenu = addMenu(tr("&Help"));\r
730                 helpMenu.addAction(releaseAction);\r
731                 helpMenu.addAction(loggerAction);\r
732                 helpMenu.addSeparator();\r
733                 helpMenu.addAction(aboutAction);\r
734                 \r
735                 addMenu(fileMenu);\r
736                 addMenu(editMenu);\r
737                 addMenu(viewMenu);\r
738                 addMenu(formatMenu);\r
739                 addMenu(onlineMenu);\r
740                 addMenu(toolsMenu);\r
741                 addMenu(helpMenu);\r
742 \r
743         }\r
744 \r
745         public void setupToolBarVisible() {\r
746                 viewMenu.addAction(parent.toolBar.toggleViewAction());\r
747                 setupShortcut(parent.toolBar.toggleViewAction(), "View_Toolbar");\r
748         }\r
749         \r
750         private void setupShortcut(QAction action, String text) {\r
751                 if (!Global.shortcutKeys.containsAction(text))\r
752                         return;\r
753                 action.setShortcut(Global.shortcutKeys.getShortcut(text));\r
754         }\r
755 \r
756 }\r