2 * This file is part of NeverNote
\r
3 * Copyright 2009 Randy Baumgarte
\r
5 * This file may be licensed under the terms of of the
\r
6 * GNU General Public License Version 2 (the ``GPL'').
\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
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
19 package cx.fbn.nevernote.gui;
\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
25 import cx.fbn.nevernote.Global;
\r
26 import cx.fbn.nevernote.NeverNote;
\r
28 public class MainMenuBar extends QMenuBar {
\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 selectiveSyncAction; // Specify which notebooks or tags to ignore
\r
36 public QAction settingsAction; // Show user config settings
\r
37 public QAction emailAction; // Action when a user selects "email"
\r
38 public QAction backupAction; // Backup the database
\r
39 public QAction restoreAction; // Restore from a backup
\r
40 public QAction emptyTrashAction; // Action when a user wants to clear the trash file
\r
41 public QAction exitAction; // Action when user selects "exit"
\r
42 public QAction aboutAction; // Action when a user selects "About"
\r
43 public QAction checkForUpdates; // Check for newer versions
\r
44 public QAction loggerAction; // Action when a user selects "Log"
\r
45 public QAction releaseAction; // Release notes
\r
47 public QAction noteAdd; // Add a note
\r
48 public QAction noteAttributes; // Action when a user selects note attributes
\r
49 public QAction noteTags; // Assign a note tags
\r
50 public QAction noteDelete; // Delete the current note
\r
51 public QAction noteRestoreAction; // Restore a note
\r
52 public QAction noteReindex; // Action when a user wants to reindex a note
\r
53 public QAction noteDuplicateAction; // Duplicate an existing note
\r
54 public QAction noteMergeAction; // Merge notes
\r
55 public QAction noteExportAction; // Export notes
\r
56 public QAction noteImportAction; // Import notes
\r
58 public QAction editFind; // find text in the current note
\r
59 public QAction editUndo; // Undo last change
\r
60 public QAction editRedo; // Redo last change
\r
61 public QAction editCut; // Cut selected text
\r
62 public QAction editPaste; // Paste selected text
\r
63 public QAction editPasteWithoutFormat; // Paste selected text
\r
64 public QAction editCopy; // Copy selected text;
\r
66 public QAction wideListView; // View with list on the top
\r
67 public QAction narrowListView; // View with list on the side
\r
68 public QAction thumbnailView; // view thumbnails
\r
69 public QAction hideSavedSearches; // show/hide saved searches
\r
70 public QAction hideZoom; // show/hide the zoom spinner
\r
71 public QAction hideSearch; // Show/hide the search window
\r
72 public QAction hideQuota; // show/hide the quota window
\r
73 public QAction hideNotebooks; // show/hide notebooks
\r
74 public QAction hideTags; // show/hide tags
\r
75 public QAction hideAttributes; // show/hide note information
\r
76 public QAction hideTrash; // show/hide trash tree
\r
77 public QAction hideNoteList; // show/hide the list of notes
\r
78 public QAction showEditorBar; // show/hide the editor button bar
\r
79 public QAction hideLeftSide; // Hide the entire left side
\r
81 public QAction formatBold; // Bold selected text
\r
82 public QAction formatItalic; // Italics selected text
\r
83 public QAction formatUnderline; // Underline selected text
\r
84 public QAction formatStrikethrough; // Strikethrough selected text
\r
85 public QAction formatSuperscript; // Superscript selected text
\r
86 public QAction formatSubscript; // Subscript selected text
\r
87 public QAction formatNumberList; // insert a numbered list
\r
88 public QAction formatBulletList; // insert a bulleted list;
\r
89 public QAction alignLeftAction; // Left justify text
\r
90 public QAction alignRightAction; // Right justify text
\r
91 public QAction alignCenterAction; // Center text
\r
92 public QAction horizontalLineAction; // Insert a horizontal line
\r
93 public QAction indentAction; // Indent
\r
94 public QAction outdentAction; // outdent menu action
\r
96 public QAction noteOnlineHistoryAction; // Pull note history from Evernote
\r
98 public QAction accountAction; // Account dialog box action
\r
99 public QAction disableIndexing; // put indexing on hold.
\r
100 // public QAction compactAction; // free unused space in the database
\r
101 public QAction databaseStatusAction; // Current database status
\r
102 public QAction folderImportAction; // Automatically import files
\r
103 public QAction spellCheckAction; // Spell checker
\r
104 public QAction encryptDatabaseAction; // Encrypt the local database
\r
106 public QAction notebookEditAction; // Edit the selected notebook
\r
107 public QAction notebookAddAction; // Add a new notebook
\r
108 public QAction notebookDeleteAction; // Delete a notebook
\r
109 public QAction notebookPublishAction; // Publish a notebook
\r
110 public QAction notebookShareAction; // Share a notebook with others
\r
111 public QAction notebookCloseAction; // Close notebooks
\r
112 public QAction notebookIconAction; // Change the icon
\r
113 public QAction notebookStackAction; // Stack/Unstack the icon.
\r
115 public QAction savedSearchAddAction; // Add a saved search
\r
116 public QAction savedSearchEditAction; // Edit a saved search
\r
117 public QAction savedSearchDeleteAction; // Delete a saved search
\r
118 public QAction savedSearchIconAction; // Change a saved search icon
\r
120 public QAction tagEditAction; // Edit a tag
\r
121 public QAction tagAddAction; // Add a tag
\r
122 public QAction tagDeleteAction; // Delete a tag
\r
123 public QAction tagIconAction; // Change the icon
\r
124 public QAction tagMergeAction; // Merge tags
\r
126 //**************************************************************************
\r
127 //* Menu Bar Titles
\r
128 //**************************************************************************
\r
130 private QMenu fileMenu; // File menu
\r
131 private QMenu noteMenu; // Note menu
\r
132 private QMenu notebookMenu; // Notebook menu
\r
133 private QMenu tagMenu; // Tag menu
\r
134 private QMenu savedSearchMenu; // Saved Searches
\r
136 private QMenu editMenu; // Edit menu
\r
138 private QMenu formatMenu; // Text format menu
\r
139 private QMenu viewMenu; // show/hide stuff
\r
140 private QMenu listMenu; // bullet or numbered list
\r
141 private QMenu indentMenu; // indent or outdent menu
\r
142 private QMenu alignMenu; // Left/Right/Center justify
\r
144 private QMenu onlineMenu; // View online stuff (if connected)
\r
146 private QMenu toolsMenu; // Tools menu
\r
148 private QMenu helpMenu;
\r
150 public MainMenuBar(NeverNote p) {
\r
154 fullReindexAction = new QAction(tr("Reindex Database"), this);
\r
155 fullReindexAction.setToolTip("Reindex all notes");
\r
156 fullReindexAction.triggered.connect(parent, "fullReindex()");
\r
157 setupShortcut(fullReindexAction, "Tools_Reindex_Database");
\r
159 printAction = new QAction(tr("Print"), this);
\r
160 printAction.setToolTip("Print the current note");
\r
161 printAction.triggered.connect(parent, "printNote()");
\r
162 setupShortcut(printAction, "File_Print");
\r
164 emailAction = new QAction(tr("Email"), this);
\r
165 emailAction.setToolTip("Email the current note");
\r
166 emailAction.triggered.connect(parent, "emailNote()");
\r
167 setupShortcut(emailAction, "File_Email");
\r
169 backupAction = new QAction(tr("Backup Database"), this);
\r
170 backupAction.setToolTip("Backup the current database");
\r
171 backupAction.triggered.connect(parent, "databaseBackup()");
\r
172 setupShortcut(backupAction, "File_Backup");
\r
174 restoreAction = new QAction(tr("Restore Database"), this);
\r
175 restoreAction.setToolTip("Restore the database from a backup");
\r
176 restoreAction.triggered.connect(parent, "databaseRestore()");
\r
177 setupShortcut(restoreAction, "File_Restore");
\r
179 emptyTrashAction = new QAction(tr("Empty Trash"), this);
\r
180 emptyTrashAction.setToolTip("Empty the trash folder");
\r
181 emptyTrashAction.triggered.connect(parent, "emptyTrash()");
\r
182 setupShortcut(emptyTrashAction, "File_Empty_Trash");
\r
184 noteRestoreAction = new QAction(tr("Restore"), this);
\r
185 noteRestoreAction.setToolTip("Restore a deleted file from the trash");
\r
186 noteRestoreAction.triggered.connect(parent, "restoreNote()");
\r
187 noteRestoreAction.setVisible(false);
\r
188 setupShortcut(noteRestoreAction, "File_Note_Restore");
\r
190 settingsAction = new QAction(tr("Preferences"), this);
\r
191 settingsAction.setToolTip("Program settings");
\r
192 settingsAction.triggered.connect(parent, "settings()");
\r
193 setupShortcut(settingsAction, "Edit_Preferences");
\r
195 exitAction = new QAction(tr("Exit"), this);
\r
196 exitAction.setToolTip("Close the program");
\r
197 exitAction.triggered.connect(parent, "closeNeverNote()");
\r
198 exitAction.setShortcut("Ctrl+Q");
\r
199 setupShortcut(exitAction, "File_Exit");
\r
201 noteAttributes = new QAction(tr("Extended Information"), this);
\r
202 noteAttributes.setToolTip("Show/Hide extended note attributes");
\r
203 noteAttributes.triggered.connect(parent, "toggleNoteInformation()");
\r
204 noteAttributes.setShortcut("F8");
\r
205 setupShortcut(noteAttributes, "View_Extended_Information");
\r
207 noteReindex = new QAction(tr("Reindex"), this);
\r
208 noteReindex.setToolTip(tr("Reindex this note"));
\r
209 noteReindex.triggered.connect(parent, "reindexNote()");
\r
210 setupShortcut(noteReindex, "File_Note_Reindex");
\r
212 noteDuplicateAction = new QAction(tr("Duplicate"), this);
\r
213 noteDuplicateAction.setToolTip(tr("Duplicate this note"));
\r
214 noteDuplicateAction.triggered.connect(parent, "duplicateNote()");
\r
215 setupShortcut(noteReindex, "File_Note_Duplicate");
\r
217 noteMergeAction = new QAction(tr("Merge Notes"), this);
\r
218 noteMergeAction.setToolTip(tr("Merge Multiple notes"));
\r
219 noteMergeAction.triggered.connect(parent, "mergeNotes()");
\r
220 setupShortcut(noteMergeAction, "File_Note_Merge");
\r
222 noteExportAction = new QAction(tr("Export Selected Notes"), this);
\r
223 noteExportAction.setToolTip(tr("Export selected notes"));
\r
224 noteExportAction.triggered.connect(parent, "exportNotes()");
\r
225 setupShortcut(noteExportAction, "File_Note_Export");
\r
227 noteImportAction = new QAction(tr("Import Notes"), this);
\r
228 noteImportAction.setToolTip(tr("Import notes"));
\r
229 noteImportAction.triggered.connect(parent, "importNotes()");
\r
230 setupShortcut(noteImportAction, "File_Note_Import");
\r
232 noteAdd = new QAction(tr("Add"), this);
\r
233 noteAdd.setToolTip(tr("Add a new note"));
\r
234 noteAdd.triggered.connect(parent, "addNote()");
\r
235 setupShortcut(noteAdd, "File_Note_Add");
\r
236 //noteAdd.setShortcut("Ctrl+N");
\r
238 noteTags = new QAction(tr("Modify Tags"), this);
\r
239 noteTags.setToolTip(tr("Change the tags assigned to this note"));
\r
240 noteTags.triggered.connect(parent.browserWindow, "modifyTags()");
\r
241 setupShortcut(noteTags, "File_Note_Modify_Tags");
\r
243 noteDelete = new QAction(tr("Delete"), this);
\r
244 noteDelete.setToolTip(tr("Delete this note"));
\r
245 noteDelete.triggered.connect(parent, "deleteNote()");
\r
246 setupShortcut(noteDelete, "File_Note_Delete");
\r
248 editFind = new QAction(tr("Find In Note"), this);
\r
249 editFind.setToolTip(tr("Find a string in the current note"));
\r
250 editFind.triggered.connect(parent, "findText()");
\r
251 setupShortcut(editFind, "Edit_Find_In_Note");
\r
252 //editFind.setShortcut("Ctrl+F");
\r
254 editUndo = new QAction(tr("Undo"), this);
\r
255 editUndo.setToolTip(tr("Undo"));
\r
256 editUndo.triggered.connect(parent.browserWindow, "undoClicked()");
\r
257 setupShortcut(editUndo, "Edit_Undo");
\r
258 //editUndo.setShortcut("Ctrl+Z");
\r
260 editRedo = new QAction(tr("Redo"), this);
\r
261 editRedo.setToolTip(tr("Redo"));
\r
262 editRedo.triggered.connect(parent.browserWindow, "redoClicked()");
\r
263 setupShortcut(editRedo, "Edit_Redo");
\r
264 //editRedo.setShortcut("Ctrl+Y");
\r
266 editCut = new QAction(tr("Cut"), this);
\r
267 editCut.setToolTip(tr("Cut"));
\r
268 editCut.triggered.connect(parent.browserWindow, "cutClicked()");
\r
269 setupShortcut(editCut, "Edit_Cut");
\r
270 //editCut.setShortcut("Ctrl+X");
\r
272 editCopy = new QAction(tr("Copy"), this);
\r
273 editCopy.setToolTip(tr("Copy"));
\r
274 editCopy.triggered.connect(parent.browserWindow, "copyClicked()");
\r
275 setupShortcut(editCopy, "Edit_Copy");
\r
276 //editCopy.setShortcut("Ctrl+C");
\r
278 editPaste = new QAction(tr("Paste"), this);
\r
279 editPaste.setToolTip(tr("Paste"));
\r
280 editPaste.triggered.connect(parent.browserWindow, "pasteClicked()");
\r
281 setupShortcut(editPaste, "Edit_Paste");
\r
283 editPasteWithoutFormat = new QAction(tr("Paste Without Formatting"), this);
\r
284 editPasteWithoutFormat.setToolTip(tr("Paste Without Formatting"));
\r
285 editPasteWithoutFormat.triggered.connect(parent.browserWindow, "pasteWithoutFormattingClicked()");
\r
286 setupShortcut(editPasteWithoutFormat, "Edit_Paste_Without_Formatting");
\r
288 hideNoteList = new QAction(tr("Show Note List"), this);
\r
289 hideNoteList.setToolTip("Show/Hide Note List");
\r
290 hideNoteList.triggered.connect(parent, "toggleNoteListWindow()");
\r
291 hideNoteList.setCheckable(true);
\r
292 hideNoteList.setChecked(true);
\r
293 setupShortcut(hideNoteList, "View_Show_Note_List");
\r
295 hideTags = new QAction(tr("Show Tags"), this);
\r
296 hideTags.setToolTip("Show/Hide Tags");
\r
297 hideTags.triggered.connect(parent, "toggleTagWindow()");
\r
298 hideTags.setCheckable(true);
\r
299 hideTags.setChecked(true);
\r
300 setupShortcut(hideTags, "View_Show_Tags");
\r
302 hideNotebooks = new QAction(tr("Show Notebooks"), this);
\r
303 hideNotebooks.setToolTip("Show/Hide Notebooks");
\r
304 hideNotebooks.triggered.connect(parent, "toggleNotebookWindow()");
\r
305 hideNotebooks.setCheckable(true);
\r
306 hideNotebooks.setChecked(true);
\r
307 setupShortcut(hideNotebooks, "View_Show_Notebooks");
\r
309 hideZoom = new QAction(tr("Show Zoom"), this);
\r
310 hideZoom.setToolTip("Show/Hide Zoom");
\r
311 hideZoom.triggered.connect(parent, "toggleZoomWindow()");
\r
312 hideZoom.setCheckable(true);
\r
313 hideZoom.setChecked(true);
\r
314 setupShortcut(hideZoom, "View_Show_Zoom");
\r
316 hideQuota = new QAction(tr("Show Quota Bar"), this);
\r
317 hideQuota.setToolTip("Show/Hide Quota");
\r
318 hideQuota.triggered.connect(parent, "toggleQuotaWindow()");
\r
319 hideQuota.setCheckable(true);
\r
320 hideQuota.setChecked(true);
\r
321 setupShortcut(hideQuota, "View_Show_Quota");
\r
323 hideSearch = new QAction(tr("Show Search Box"), this);
\r
324 hideSearch.setToolTip("Show/Hide Search Box");
\r
325 hideSearch.triggered.connect(parent, "toggleSearchWindow()");
\r
326 hideSearch.setCheckable(true);
\r
327 hideSearch.setChecked(true);
\r
328 setupShortcut(hideSearch, "View_Show_Search");
\r
330 wideListView = new QAction(tr("Wide List View"), this);
\r
331 wideListView.setToolTip("Wide List Viwe");
\r
332 wideListView.setCheckable(true);
\r
333 wideListView.changed.connect(parent, "wideListView()");
\r
334 setupShortcut(wideListView, "View_Wide_List");
\r
336 narrowListView = new QAction(tr("Narrow List View"), this);
\r
337 narrowListView.setToolTip("Narrow List View");
\r
338 narrowListView.setCheckable(true);
\r
339 narrowListView.changed.connect(parent, "narrowListView()");
\r
340 setupShortcut(narrowListView, "View_Narrow_List");
\r
342 thumbnailView = new QAction(tr("Preview"), this);
\r
343 thumbnailView.setToolTip("Preview Notes");
\r
344 thumbnailView.triggered.connect(parent, "thumbnailView()");
\r
345 setupShortcut(thumbnailView, "View_Thumbnail");
\r
347 hideSavedSearches = new QAction(tr("Show Saved Searches"), this);
\r
348 hideSavedSearches.setToolTip("Show/Hide Saved Searches");
\r
349 hideSavedSearches.triggered.connect(parent, "toggleSavedSearchWindow()");
\r
350 hideSavedSearches.setCheckable(true);
\r
351 hideSavedSearches.setChecked(true);
\r
352 setupShortcut(hideSavedSearches, "View_Show_SavedSearches");
\r
354 hideAttributes = new QAction(tr("Show Attribute Searches"), this);
\r
355 hideAttributes.setToolTip("Show/Hide Attribute Searches");
\r
356 hideAttributes.triggered.connect(parent, "toggleAttributesWindow()");
\r
357 hideAttributes.setCheckable(true);
\r
358 hideAttributes.setChecked(true);
\r
359 setupShortcut(hideAttributes, "View_Show_Attribute_Searches");
\r
361 hideTrash = new QAction(tr("Show Trash"), this);
\r
362 hideTrash.setToolTip("Show/Hide Trash Tree");
\r
363 hideTrash.triggered.connect(parent, "toggleTrashWindow()");
\r
364 hideTrash.setCheckable(true);
\r
365 hideTrash.setChecked(true);
\r
366 setupShortcut(hideTrash, "View_Show_Trash");
\r
369 showEditorBar = new QAction(tr("Show Editor Button Bar"), this);
\r
370 showEditorBar.setToolTip("Show/Hide Editor Button Bar");
\r
371 showEditorBar.triggered.connect(parent, "toggleEditorButtonBar()");
\r
372 showEditorBar.setCheckable(true);
\r
373 showEditorBar.setChecked(true);
\r
374 setupShortcut(showEditorBar, "View_Show_Editor_Button_Bar");
\r
377 hideLeftSide = new QAction(tr("Hide Left Side Panels"), this);
\r
378 hideLeftSide.setToolTip("Hide The Entire Left Side");
\r
379 hideLeftSide.triggered.connect(parent, "toggleLeftSide()");
\r
380 hideLeftSide.setCheckable(true);
\r
381 hideLeftSide.setChecked(false);
\r
382 setupShortcut(hideLeftSide, "View_Show_Left_Side");
\r
383 //hideLeftSide.setShortcut("F11");
\r
385 alignLeftAction = new QAction(tr("Left"), this);
\r
386 alignLeftAction.setToolTip(tr("Left Align"));
\r
387 alignLeftAction.triggered.connect(parent.browserWindow, "justifyLeftClicked()");
\r
388 setupShortcut(alignLeftAction, "Format_Alignment_Left");
\r
389 //alignLeftAction.setShortcut("Ctrl+L");
\r
391 alignRightAction = new QAction(tr("Right"), this);
\r
392 alignRightAction.setToolTip(tr("Right Align"));
\r
393 alignRightAction.triggered.connect(parent.browserWindow, "justifyRightClicked()");
\r
394 setupShortcut(alignRightAction, "Format_Alignment_Right");
\r
395 //alignRightAction.setShortcut("Ctrl+R");
\r
397 alignCenterAction = new QAction(tr("Center"), this);
\r
398 alignCenterAction.setToolTip(tr("Center Align"));
\r
399 alignCenterAction.triggered.connect(parent.browserWindow, "justifyCenterClicked()");
\r
400 setupShortcut(alignCenterAction, "Format_Alignment_Center");
\r
401 //alignCenterAction.setShortcut("Ctrl+C");
\r
403 formatBold = new QAction(tr("Bold"), this);
\r
404 formatBold.setToolTip(tr("Bold"));
\r
405 formatBold.triggered.connect(parent.browserWindow, "boldClicked()");
\r
406 setupShortcut(formatBold, "Format_Bold");
\r
407 //formatBold.setShortcut("Ctrl+B");
\r
409 formatItalic = new QAction(tr("Italic"), this);
\r
410 formatItalic.setToolTip(tr("Italic"));
\r
411 formatItalic.triggered.connect(parent.browserWindow, "italicClicked()");
\r
412 setupShortcut(formatItalic, "Format_Italic");
\r
413 //formatItalic.setShortcut("Ctrl+I");
\r
415 formatUnderline = new QAction(tr("Underline"), this);
\r
416 formatUnderline.setToolTip(tr("Underline"));
\r
417 formatUnderline.triggered.connect(parent.browserWindow, "underlineClicked()");
\r
418 setupShortcut(formatUnderline, "Format_Underline");
\r
419 // formatUnderline.setShortcut("Ctrl+U");
\r
422 formatSuperscript = new QAction(tr("Superscript"), this);
\r
423 formatSuperscript.setToolTip(tr("Superscript"));
\r
424 formatSuperscript.triggered.connect(parent.browserWindow, "superscriptClicked()");
\r
425 setupShortcut(formatSuperscript, "Format_Superscript");
\r
428 formatSubscript = new QAction(tr("Subscript"), this);
\r
429 formatSubscript.setToolTip(tr("Subscript"));
\r
430 formatSubscript.triggered.connect(parent.browserWindow, "subscriptClicked()");
\r
431 setupShortcut(formatSubscript, "Format_Subscript");
\r
434 formatStrikethrough = new QAction(tr("Strikethrough"), this);
\r
435 formatStrikethrough.setToolTip(tr("Strikethrough"));
\r
436 formatStrikethrough.triggered.connect(parent.browserWindow, "strikethroughClicked()");
\r
437 setupShortcut(formatStrikethrough, "Format_Strikethrough");
\r
439 horizontalLineAction = new QAction(tr("Horizontal Line"), this);
\r
440 horizontalLineAction.setToolTip(tr("Horizontal Line"));
\r
441 horizontalLineAction.triggered.connect(parent.browserWindow, "hlineClicked()");
\r
442 setupShortcut(horizontalLineAction, "Format_Horizontal_Line");
\r
444 formatBulletList = new QAction(tr("Bulleted List"), this);
\r
445 // formatBulletList.setText(tr("Numbered List"));
\r
446 formatBulletList.triggered.connect(parent.browserWindow, "bulletListClicked()");
\r
447 setupShortcut(formatBulletList, "Format_List_Bullet");
\r
448 // formatBulletList.setShortcut("Ctrl+Shift+B");
\r
450 formatNumberList = new QAction(tr("Numbered List"), this);
\r
451 formatNumberList.setText(tr("Numbered list"));
\r
452 formatNumberList.triggered.connect(parent.browserWindow, "numberListClicked()");
\r
453 setupShortcut(formatNumberList, "Format_List_Numbered");
\r
454 // formatNumberList.setShortcut("Ctrl+Shift+O");
\r
456 indentAction = new QAction(tr(">> Increase"), this);
\r
457 indentAction.setText(tr(">> Increase"));
\r
458 indentAction.triggered.connect(parent.browserWindow, "indentClicked()");
\r
459 setupShortcut(indentAction, "Format_Indent_Increase");
\r
460 //indentAction.setShortcut("Ctrl+M");
\r
462 outdentAction = new QAction(tr("<< Decrease"), this);
\r
463 outdentAction.setText(tr("<< Decrease"));
\r
464 outdentAction.triggered.connect(parent.browserWindow, "outdentClicked()");
\r
465 setupShortcut(outdentAction, "Format_Indent_Decrease");
\r
466 //outdentAction.setShortcut("Ctrl+Shift+M");
\r
468 notebookAddAction = new QAction(tr("Add"), this);
\r
469 notebookAddAction.triggered.connect(parent, "addNotebook()");
\r
470 setupShortcut(notebookAddAction, "File_Notebook_Add");
\r
472 notebookEditAction = new QAction(tr("Edit"), this);
\r
473 notebookEditAction.setEnabled(false);
\r
474 notebookEditAction.triggered.connect(parent, "editNotebook()");
\r
475 setupShortcut(notebookEditAction, "File_Notebook_Edit");
\r
477 notebookDeleteAction = new QAction(tr("Delete"), this);
\r
478 notebookDeleteAction.setEnabled(false);
\r
479 notebookDeleteAction.triggered.connect(parent, "deleteNotebook()");
\r
480 setupShortcut(notebookDeleteAction, "File_Notebook_Delete");
\r
482 notebookPublishAction = new QAction(tr("Share With The World"), this);
\r
483 notebookPublishAction.setEnabled(false);
\r
484 notebookPublishAction.setVisible(false);
\r
485 notebookPublishAction.triggered.connect(parent, "publishNotebook()");
\r
486 setupShortcut(notebookPublishAction, "File_Notebook_Publish");
\r
488 notebookShareAction = new QAction(tr("Share With Individuals"), this);
\r
489 notebookShareAction.setEnabled(false);
\r
490 notebookShareAction.setVisible(false);
\r
491 notebookShareAction.triggered.connect(parent, "shareNotebook()");
\r
492 setupShortcut(notebookShareAction, "File_Notebook_Share");
\r
495 notebookCloseAction = new QAction(tr("Open/Close Notebooks"), this);
\r
496 notebookCloseAction.setEnabled(true);
\r
497 notebookCloseAction.triggered.connect(parent, "closeNotebooks()");
\r
498 setupShortcut(notebookCloseAction, "File_Notebook_Close");
\r
500 notebookIconAction = new QAction(tr("Change Icon"), this);
\r
501 notebookIconAction.setEnabled(false);
\r
502 notebookIconAction.triggered.connect(parent, "setNotebookIcon()");
\r
503 setupShortcut(notebookIconAction, "File_Notebook_Icon");
\r
505 notebookStackAction = new QAction(tr("Set Stack"), this);
\r
506 notebookStackAction.setEnabled(false);
\r
507 notebookStackAction.triggered.connect(parent, "stackNotebook()");
\r
508 setupShortcut(notebookStackAction, "File_Notebook_Stack");
\r
510 tagAddAction = new QAction(tr("Add"),this);
\r
511 tagAddAction.triggered.connect(parent, "addTag()");
\r
512 //tagAddAction.setShortcut("Ctrl+Shift+T");
\r
513 setupShortcut(tagAddAction, "File_Tag_Add");
\r
515 tagEditAction = new QAction(tr("Edit"), this);
\r
516 tagEditAction.triggered.connect(parent, "editTag()");
\r
517 tagEditAction.setEnabled(false);
\r
518 setupShortcut(tagEditAction, "File_Tag_Edit");
\r
520 tagDeleteAction = new QAction(tr("Delete"), this);
\r
521 tagDeleteAction.triggered.connect(parent, "deleteTag()");
\r
522 tagDeleteAction.setEnabled(false);
\r
523 setupShortcut(tagDeleteAction, "File_Tag_Delete");
\r
525 tagIconAction = new QAction(tr("Change Icon"), this);
\r
526 tagIconAction.triggered.connect(parent, "setTagIcon()");
\r
527 tagIconAction.setEnabled(false);
\r
528 setupShortcut(tagIconAction, "File_Tag_Icon");
\r
530 tagMergeAction = new QAction(tr("Merge Tags"), this);
\r
531 tagMergeAction.triggered.connect(parent, "mergeTags()");
\r
532 tagMergeAction.setEnabled(false);
\r
533 setupShortcut(tagMergeAction, "File_Tag_Merge");
\r
535 savedSearchAddAction = new QAction(tr("Add"),this);
\r
536 savedSearchAddAction.triggered.connect(parent, "addSavedSearch()");
\r
537 setupShortcut(savedSearchAddAction, "File_SavedSearch_Add");
\r
539 savedSearchEditAction = new QAction(tr("Edit"), this);
\r
540 savedSearchEditAction.triggered.connect(parent, "editSavedSearch()");
\r
541 savedSearchEditAction.setEnabled(false);
\r
542 setupShortcut(savedSearchEditAction, "File_SavedSearch_Edit");
\r
544 savedSearchDeleteAction = new QAction(tr("Delete"), this);
\r
545 savedSearchDeleteAction.triggered.connect(parent, "deleteSavedSearch()");
\r
546 savedSearchDeleteAction.setEnabled(false);
\r
547 setupShortcut(savedSearchDeleteAction, "File_SavedSearch_Delete");
\r
549 savedSearchIconAction = new QAction(tr("Change Icon"), this);
\r
550 savedSearchIconAction.triggered.connect(parent, "setSavedSearchIcon()");
\r
551 savedSearchIconAction.setEnabled(false);
\r
552 setupShortcut(savedSearchIconAction, "File_SavedSearch_Icon");
\r
554 connectAction = new QAction(tr("Connect"), this);
\r
555 connectAction.setToolTip("Connect to Evernote");
\r
556 connectAction.triggered.connect(parent, "remoteConnect()");
\r
557 setupShortcut(connectAction, "Online_Connect");
\r
559 synchronizeAction = new QAction(tr("Synchronize with Evernote"), this);
\r
560 synchronizeAction.setToolTip("Delete all local data & get a fresh copy");
\r
561 synchronizeAction.triggered.connect(parent, "evernoteSync()");
\r
562 synchronizeAction.setEnabled(false);
\r
563 setupShortcut(synchronizeAction, "Online_Synchronize");
\r
564 //synchronizeAction.setShortcut("F9");
\r
566 noteOnlineHistoryAction = new QAction(tr("Note History"), this);
\r
567 noteOnlineHistoryAction.triggered.connect(parent, "viewNoteHistory()");
\r
568 noteOnlineHistoryAction.setEnabled(false);
\r
569 setupShortcut(noteOnlineHistoryAction, "Online_Note_History");
\r
571 selectiveSyncAction = new QAction(tr("Selective Synchronize"), this);
\r
572 selectiveSyncAction.setToolTip("Selectively ignore some notes");
\r
573 selectiveSyncAction.triggered.connect(parent, "setupSelectiveSync()");
\r
574 selectiveSyncAction.setEnabled(false);
\r
575 setupShortcut(synchronizeAction, "Online_Selective_Sync");
\r
579 accountAction = new QAction(tr("Account Information"), this);
\r
580 accountAction.setToolTip(tr("Account Information"));
\r
581 accountAction.triggered.connect(parent, "accountInformation()");
\r
582 setupShortcut(accountAction, "Tools_Account_Information");
\r
584 // compactAction = new QAction(tr("Compact Database"), this);
\r
585 // compactAction.setToolTip(tr("Free unused database space"));
\r
586 // compactAction.triggered.connect(parent, "compactDatabase()");
\r
587 // setupShortcut(compactAction, "Tools_Compact_Database");
\r
589 databaseStatusAction = new QAction(tr("Database Status"), this);
\r
590 databaseStatusAction.setToolTip(tr("Show current database information"));
\r
591 databaseStatusAction.triggered.connect(parent, "databaseStatus()");
\r
592 setupShortcut(databaseStatusAction, "Tools_Database_Status");
\r
595 disableIndexing = new QAction(tr("Disable Note Indexing"), this);
\r
596 disableIndexing.setToolTip("Manually Stop Note Indexing");
\r
597 disableIndexing.triggered.connect(parent, "toggleNoteIndexing()");
\r
598 disableIndexing.setCheckable(true);
\r
599 disableIndexing.setChecked(false);
\r
600 setupShortcut(disableIndexing, "Tools_Disable_Note_Indexing");
\r
603 folderImportAction = new QAction(tr("Automatic Folder Importing"), this);
\r
604 folderImportAction.setToolTip("Import Files Automatically");
\r
605 folderImportAction.triggered.connect(parent, "folderImport()");
\r
606 setupShortcut(folderImportAction, "Tools_Folder_Import");
\r
608 spellCheckAction = new QAction(tr("Spell Check"), this);
\r
609 spellCheckAction.setToolTip("Check for spelling errors");
\r
610 spellCheckAction.triggered.connect(parent.browserWindow, "spellCheckClicked()");
\r
611 setupShortcut(spellCheckAction, "Tools_Spell_Check");
\r
613 encryptDatabaseAction = new QAction(tr("Encrypt Database"), this);
\r
614 encryptDatabaseAction.setToolTip("Encrypt the database upon shutdown");
\r
615 encryptDatabaseAction.triggered.connect(parent, "doDatabaseEncrypt()");
\r
616 setupShortcut(encryptDatabaseAction, "Tools_Database_Encrypt");
\r
617 if (Global.cipherPassword != null && Global.cipherPassword != "") {
\r
618 encryptDatabaseAction.setText("Decrypt Database");
\r
619 encryptDatabaseAction.setToolTip("Decrypt the database upon shutdown");
\r
622 loggerAction = new QAction(tr("Logs"), this);
\r
623 loggerAction.setToolTip("Show the detailed application log");
\r
624 loggerAction.triggered.connect(parent, "logger()");
\r
625 setupShortcut(loggerAction, "About_Log");
\r
627 releaseAction = new QAction(tr("Release Notes"), this);
\r
628 releaseAction.setToolTip("Release notes");
\r
629 releaseAction.triggered.connect(parent, "releaseNotes()");
\r
630 setupShortcut(releaseAction, "About_Release_Notes");
\r
632 checkForUpdates = new QAction(tr("Check For Updates"), this);
\r
633 checkForUpdates.setToolTip("Check for newer versions");
\r
634 checkForUpdates.triggered.connect(parent, "checkForUpdates()");
\r
635 setupShortcut(checkForUpdates, "Help_Check_For_Updates");
\r
637 aboutAction = new QAction(tr("About"), this);
\r
638 aboutAction.setToolTip("About NeverNote");
\r
639 aboutAction.triggered.connect(parent, "about()");
\r
640 setupShortcut(aboutAction, "About_About");
\r
645 public void setupMenuBar() {
\r
646 fileMenu = addMenu(tr("&File"));
\r
648 noteMenu = fileMenu.addMenu(tr("&Note"));
\r
649 notebookMenu = fileMenu.addMenu(tr("Notebook"));
\r
650 tagMenu = fileMenu.addMenu(tr("Tag"));
\r
651 savedSearchMenu = fileMenu.addMenu(tr("Saved Searches"));
\r
652 fileMenu.addSeparator();
\r
653 fileMenu.addAction(emailAction);
\r
654 fileMenu.addAction(printAction);
\r
655 fileMenu.addSeparator();
\r
656 fileMenu.addAction(noteImportAction);
\r
657 fileMenu.addAction(noteExportAction);
\r
658 fileMenu.addAction(backupAction);
\r
659 fileMenu.addAction(restoreAction);
\r
660 fileMenu.addSeparator();
\r
661 fileMenu.addAction(emptyTrashAction);
\r
662 fileMenu.addAction(exitAction);
\r
664 editMenu = addMenu(tr("&Edit"));
\r
665 editMenu.addAction(editFind);
\r
666 editMenu.addSeparator();
\r
667 editMenu.addAction(editUndo);
\r
668 editMenu.addAction(editRedo);
\r
669 editMenu.addSeparator();
\r
670 editMenu.addAction(editCut);
\r
671 editMenu.addAction(editCopy);
\r
672 editMenu.addAction(editPaste);
\r
673 editMenu.addAction(editPasteWithoutFormat);
\r
674 editMenu.addSeparator();
\r
675 editMenu.addAction(settingsAction);
\r
677 viewMenu = addMenu(tr("&View"));
\r
678 viewMenu.addAction(noteAttributes);
\r
679 viewMenu.addSeparator();
\r
680 viewMenu.addAction(wideListView);
\r
681 viewMenu.addAction(narrowListView);
\r
682 viewMenu.addAction(thumbnailView);
\r
683 viewMenu.addSeparator();
\r
684 viewMenu.addAction(hideNoteList);
\r
685 viewMenu.addAction(hideSearch);
\r
686 viewMenu.addAction(hideQuota);
\r
687 viewMenu.addAction(hideZoom);
\r
688 viewMenu.addAction(hideNotebooks);
\r
689 viewMenu.addAction(hideTags);
\r
690 viewMenu.addAction(hideAttributes);
\r
691 viewMenu.addAction(hideSavedSearches);
\r
692 viewMenu.addAction(hideTrash);
\r
693 viewMenu.addAction(showEditorBar);
\r
694 viewMenu.addAction(hideLeftSide);
\r
696 formatMenu = addMenu(tr("&Format"));
\r
697 formatMenu.addAction(formatBold);
\r
698 formatMenu.addAction(formatUnderline);
\r
699 formatMenu.addAction(formatItalic);
\r
700 formatMenu.addSeparator();
\r
701 formatMenu.addAction(formatStrikethrough);
\r
702 formatMenu.addAction(horizontalLineAction);
\r
703 formatMenu.addSeparator();
\r
704 formatMenu.addAction(formatSuperscript);
\r
705 formatMenu.addAction(formatSubscript);
\r
706 formatMenu.addSeparator();
\r
708 alignMenu = formatMenu.addMenu(tr("Alignment"));
\r
709 alignMenu.addAction(alignLeftAction);
\r
710 alignMenu.addAction(alignCenterAction);
\r
711 alignMenu.addAction(alignRightAction);
\r
713 listMenu = formatMenu.addMenu(tr("Lists"));
\r
714 listMenu.addAction(formatBulletList);
\r
715 listMenu.addAction(formatNumberList);
\r
716 indentMenu = formatMenu.addMenu(tr("Indent"));
\r
717 indentMenu.addAction(indentAction);
\r
718 indentMenu.addAction(outdentAction);
\r
720 noteAttributes.setCheckable(true);
\r
721 noteMenu.addAction(noteAdd);
\r
722 noteMenu.addAction(noteDelete);
\r
723 noteMenu.addAction(noteReindex);
\r
724 noteMenu.addSeparator();
\r
725 noteMenu.addAction(noteTags);
\r
726 noteMenu.addAction(noteRestoreAction);
\r
727 noteMenu.addSeparator();
\r
728 noteMenu.addAction(noteDuplicateAction);
\r
729 noteMenu.addAction(noteMergeAction);
\r
732 notebookMenu.addAction(notebookAddAction);
\r
733 notebookMenu.addAction(notebookEditAction);
\r
734 notebookMenu.addAction(notebookDeleteAction);
\r
735 notebookMenu.addSeparator();
\r
736 notebookMenu.addAction(notebookPublishAction);
\r
737 notebookMenu.addAction(notebookShareAction);
\r
738 notebookMenu.addSeparator();
\r
739 notebookMenu.addAction(notebookStackAction);
\r
740 notebookMenu.addAction(notebookCloseAction);
\r
741 notebookMenu.addSeparator();
\r
742 notebookMenu.addAction(notebookIconAction);
\r
744 tagMenu.addAction(tagAddAction);
\r
745 tagMenu.addAction(tagEditAction);
\r
746 tagMenu.addAction(tagDeleteAction);
\r
747 tagMenu.addAction(tagMergeAction);
\r
748 tagMenu.addSeparator();
\r
749 tagMenu.addAction(tagIconAction);
\r
751 savedSearchMenu.addAction(savedSearchAddAction);
\r
752 savedSearchMenu.addAction(savedSearchEditAction);
\r
753 savedSearchMenu.addAction(savedSearchDeleteAction);
\r
754 savedSearchMenu.addSeparator();
\r
755 savedSearchMenu.addAction(savedSearchIconAction);
\r
757 onlineMenu = addMenu(tr("&Online"));
\r
758 onlineMenu.addAction(synchronizeAction);
\r
759 onlineMenu.addAction(connectAction);
\r
760 onlineMenu.addSeparator();
\r
761 onlineMenu.addAction(noteOnlineHistoryAction);
\r
762 onlineMenu.addAction(selectiveSyncAction);
\r
764 toolsMenu = addMenu(tr("&Tools"));
\r
765 toolsMenu.addAction(spellCheckAction);
\r
766 toolsMenu.addAction(accountAction);
\r
767 toolsMenu.addAction(fullReindexAction);
\r
768 toolsMenu.addAction(disableIndexing);
\r
769 // toolsMenu.addAction(compactAction);
\r
770 toolsMenu.addSeparator();
\r
771 toolsMenu.addAction(encryptDatabaseAction);
\r
772 toolsMenu.addAction(databaseStatusAction);
\r
773 toolsMenu.addSeparator();
\r
774 toolsMenu.addAction(folderImportAction);
\r
776 helpMenu = addMenu(tr("&Help"));
\r
777 helpMenu.addAction(releaseAction);
\r
778 helpMenu.addAction(checkForUpdates);
\r
779 helpMenu.addAction(loggerAction);
\r
780 helpMenu.addSeparator();
\r
781 helpMenu.addAction(aboutAction);
\r
786 addMenu(formatMenu);
\r
787 addMenu(onlineMenu);
\r
788 addMenu(toolsMenu);
\r
793 public void setupToolBarVisible() {
\r
794 viewMenu.addAction(parent.toolBar.toggleViewAction());
\r
795 setupShortcut(parent.toolBar.toggleViewAction(), "View_Toolbar");
\r
798 private void setupShortcut(QAction action, String text) {
\r
799 if (!Global.shortcutKeys.containsAction(text))
\r
801 action.setShortcut(Global.shortcutKeys.getShortcut(text));
\r