OSDN Git Service

「ノート」メニューにメニューバーから直接アクセスできるように変更した
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / gui / MainMenuBar.java
1 /*
2  * This file is part of NixNote/NeighborNote 
3  * Copyright 2009 Randy Baumgarte
4  * Copyright 2013 Yuki Takahashi
5  * 
6  * This file may be licensed under the terms of of the
7  * GNU General Public License Version 2 (the ``GPL'').
8  *
9  * Software distributed under the License is distributed
10  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
11  * express or implied. See the GPL for the specific language
12  * governing rights and limitations.
13  *
14  * You should have received a copy of the GPL along with this
15  * program. If not, go to http://www.gnu.org/licenses/gpl.html
16  * or write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19 */
20 package cx.fbn.nevernote.gui;
21
22 import com.trolltech.qt.gui.QAction;
23 import com.trolltech.qt.gui.QMenu;
24 import com.trolltech.qt.gui.QMenuBar;
25
26 import cx.fbn.nevernote.Global;
27 import cx.fbn.nevernote.NeverNote;
28
29 public class MainMenuBar extends QMenuBar {
30
31         private final NeverNote                 parent;
32         public QAction                  printAction;                            // Action when a user selects Print from the file menu
33         public QAction                  connectAction;                          // Connect/Disconnect to Evernote
34         public QAction                  fullReindexAction;                      // Action when a user wants to reindex the entire database
35         public QAction                  synchronizeAction;                      // Synchronize data with Evernote       
36         public QAction                  selectiveSyncAction;            // Specify which notebooks or tags to ignore
37         public QAction                  settingsAction;                         // Show user config settings
38         public QAction                  emailAction;                            // Action when a user selects "email"
39         public QAction                  backupAction;                           // Backup the database
40         public QAction                  restoreAction;                          // Restore from a backup
41         public QAction                  emptyTrashAction;                       // Action when a user wants to clear the trash file
42         public QAction                  exitAction;                                     // Action when user selects "exit"
43         public QAction                  aboutAction;                            // Action when a user selects "About"
44         public QAction                  checkForUpdates;                        // Check for newer versions
45         public QAction                  loggerAction;                           // Action when a user selects "Log"
46         public QAction                  releaseAction;                          // Release notes
47
48         public QAction                  noteAdd;                                        // Add a note
49         public QAction                  noteAttributes;                         // Action when a user selects note attributes
50         public QAction                  noteTags;                                       // Assign a note tags
51         public QAction                  noteDelete;                                     // Delete the current note
52         public QAction                  noteRestoreAction;                      // Restore a note
53         public QAction                  noteReindex;                            // Action when a user wants to reindex a note
54         public QAction                  noteDuplicateAction;            // Duplicate an existing note
55         public QAction                  noteMergeAction;                        // Merge notes
56         public QAction                  noteExportAction;                       // Export notes
57         public QAction                  noteImportAction;                       // Import notes
58         public QAction                  noteCopyAsUrlAction;            // Copy the note as a URL
59         // ICHANGED
60         public QAction                  noteOpenNewTab;                         // 新しいタブで開く
61         public QAction                  noteAddNewTab;                          // 新しいタブでノート追加
62         
63         public QAction                  editFind;                                       // find text in the current note
64         public QAction                  editUndo;                                       // Undo last change
65         public QAction                  editRedo;                                       // Redo last change
66         public QAction                  editCut;                                        // Cut selected text
67         public QAction                  editPaste;                                      // Paste selected text
68         public QAction                  editPasteWithoutFormat;         // Paste selected text
69         public QAction                  editCopy;                                       // Copy selected text;
70         
71         public QAction                  wideListView;                           // View with list on the top
72         public QAction                  narrowListView;                         // View with list on the side
73         public QAction                  thumbnailView;                          // view thumbnails
74         public QAction                  hideSavedSearches;                      // show/hide saved searches
75         public QAction                  hideZoom;                                       // show/hide the zoom spinner
76         public QAction                  hideSearch;                                     // Show/hide the search window
77         public QAction                  hideQuota;                                      // show/hide the quota window
78         public QAction                  hideNotebooks;                          // show/hide notebooks
79         public QAction                  hideTags;                                       // show/hide tags
80         public QAction                  hideAttributes;                         // show/hide note information
81         public QAction                  hideTrash;                                      // show/hide trash tree
82         public QAction                  hideNoteList;                           // show/hide the list of notes
83         public QAction                  showEditorBar;                          // show/hide the editor button bar
84         public QAction                  hideLeftSide;                           // Hide the entire left side
85         public QAction                  viewSource;                                     // View the source HTML of a note
86         
87         public QAction                  formatBold;                                     // Bold selected text
88         public QAction                  formatItalic;                           // Italics selected text
89         public QAction                  formatUnderline;                        // Underline selected text
90         public QAction                  formatStrikethrough;            // Strikethrough selected text
91         public QAction                  formatSuperscript;                      // Superscript selected text
92         public QAction                  formatSubscript;                        // Subscript selected text
93         public QAction                  formatNumberList;                       // insert a numbered list
94         public QAction                  formatBulletList;                       // insert a bulleted list;
95         public QAction                  alignLeftAction;                        // Left justify text
96         public QAction                  alignRightAction;                       // Right justify text
97         public QAction                  alignCenterAction;                      // Center text
98         public QAction                  horizontalLineAction;           // Insert a horizontal line
99         public QAction                  indentAction;                           // Indent
100         public QAction                  outdentAction;                          // outdent menu action
101         
102         public QAction                  noteOnlineHistoryAction;        // Pull note history from Evernote
103         
104         public QAction                  accountAction;                          // Account dialog box action
105         public QAction                  disableIndexing;                        // put indexing on hold.
106 //      public QAction                  compactAction;                          // free unused space in the database
107         public QAction                  databaseStatusAction;           // Current database status
108         public QAction                  folderImportAction;                     // Automatically import files 
109         public QAction                  spellCheckAction;                       // Spell checker
110         public QAction                  encryptDatabaseAction;          // Encrypt the local database
111         
112         public QAction                  notebookEditAction;                     // Edit the selected notebook
113         public QAction                  notebookAddAction;                      // Add a new notebook
114         public QAction                  notebookDeleteAction;           // Delete a notebook
115         public QAction                  notebookPublishAction;          // Publish a notebook
116         public QAction                  notebookShareAction;            // Share a notebook with others
117         public QAction                  notebookCloseAction;            // Close notebooks
118         public QAction                  notebookIconAction;                     // Change the icon
119         public QAction                  notebookStackAction;            // Stack/Unstack the icon.
120         
121         public QAction                  savedSearchAddAction;           // Add a saved search
122         public QAction                  savedSearchEditAction;          // Edit a saved search
123         public QAction                  savedSearchDeleteAction;        // Delete a saved search
124         public QAction                  savedSearchIconAction;          // Change a saved search icon
125         
126         public QAction                  tagEditAction;                          // Edit a tag
127         public QAction                  tagAddAction;                           // Add a tag
128         public QAction                  tagDeleteAction;                        // Delete a tag
129         public QAction                  tagIconAction;                          // Change the icon
130         public QAction                  tagMergeAction;                         // Merge tags
131         
132         //**************************************************************************
133         //* Menu Bar Titles
134         //**************************************************************************
135         
136         private QMenu                   fileMenu;                                       // File menu
137         private QMenu                   noteMenu;                                       // Note menu 
138         private QMenu                   notebookMenu;                           // Notebook menu
139         private QMenu                   tagMenu;                                        // Tag menu
140         private QMenu                   savedSearchMenu;                        // Saved Searches               
141
142         private QMenu                   editMenu;                                       // Edit menu
143
144         private QMenu                   formatMenu;                                     // Text format menu
145         private QMenu                   viewMenu;                                       // show/hide stuff
146         private QMenu                   listMenu;                                       // bullet or numbered list
147         private QMenu                   indentMenu;                                     // indent or outdent menu
148         private QMenu                   alignMenu;                                      // Left/Right/Center justify
149         
150 //      private QMenu                   onlineMenu;                                     // View online stuff (if connected)
151         
152         private QMenu                   toolsMenu;                                      // Tools menu
153         
154         private QMenu                   helpMenu;
155         
156         // ICHANGED
157         private QMenu tableMenu;
158         private QMenu imageMenu;
159         private BrowserWindow prevBW;
160         
161         public MainMenuBar(NeverNote p) {
162                 parent = p;
163                 
164                 // ICHANGED
165                 prevBW = parent.browserWindow;
166                 
167                 fullReindexAction = new QAction(tr("Reindex Database"), this);
168                 fullReindexAction.setToolTip(tr("Reindex all notes"));
169                 fullReindexAction.triggered.connect(parent, "fullReindex()");
170                 setupShortcut(fullReindexAction, "Tools_Reindex_Database");
171                                 
172                 printAction = new QAction(tr("Print"), this);
173                 printAction.setToolTip(tr("Print the current note"));
174                 printAction.triggered.connect(parent, "printNote()");
175                 setupShortcut(printAction, "File_Print");
176                 
177                 emailAction = new QAction(tr("Email"), this);
178                 emailAction.setToolTip(tr("Email the current note"));
179                 emailAction.triggered.connect(parent, "emailNote()");
180                 setupShortcut(emailAction, "File_Email");
181                 
182                 backupAction = new QAction(tr("Backup Database"), this);
183                 backupAction.setToolTip(tr("Backup the current database"));
184                 backupAction.triggered.connect(parent, "databaseBackup()");
185                 setupShortcut(backupAction, "File_Backup");
186
187                 restoreAction = new QAction(tr("Restore Database"), this);
188                 restoreAction.setToolTip(tr("Restore the database from a backup"));
189                 restoreAction.triggered.connect(parent, "databaseRestore()");
190                 setupShortcut(restoreAction, "File_Restore");
191                         
192                 emptyTrashAction = new QAction(tr("Empty Trash"), this);
193                 emptyTrashAction.setToolTip(tr("Empty the trash folder"));
194                 emptyTrashAction.triggered.connect(parent, "emptyTrash()");
195                 setupShortcut(emptyTrashAction, "File_Empty_Trash");
196                 
197                 noteRestoreAction = new QAction(tr("Restore"), this);
198                 noteRestoreAction.setToolTip(tr("Restore a deleted file from the trash"));
199                 noteRestoreAction.triggered.connect(parent, "restoreNote()");
200                 noteRestoreAction.setVisible(false);
201                 setupShortcut(noteRestoreAction, "File_Note_Restore");
202                                 
203                 settingsAction = new QAction(tr("Preferences"), this);
204                 settingsAction.setToolTip(tr("Program settings"));
205                 settingsAction.triggered.connect(parent, "settings()");
206                 setupShortcut(settingsAction, "Edit_Preferences");
207                 
208                 exitAction = new QAction(tr("Exit"), this);
209                 exitAction.setToolTip(tr("Close the program"));
210                 exitAction.triggered.connect(parent, "closeNeverNote()");
211                 exitAction.setShortcut("Ctrl+Q");
212                 setupShortcut(exitAction, "File_Exit");
213                 
214                 noteAttributes = new QAction(tr("Extended Information"), this);
215                 noteAttributes.setToolTip(tr("Show/Hide extended note attributes"));
216                 noteAttributes.triggered.connect(parent, "toggleNoteInformation()");
217                 noteAttributes.setShortcut("F8");
218                 setupShortcut(noteAttributes, "View_Extended_Information");
219                 
220                 noteReindex = new QAction(tr("Reindex"), this);
221                 noteReindex.setToolTip(tr("Reindex this note"));
222                 noteReindex.triggered.connect(parent, "reindexNote()");
223                 setupShortcut(noteReindex, "File_Note_Reindex");
224                 
225                 noteDuplicateAction = new QAction(tr("Duplicate"), this);
226                 noteDuplicateAction.setToolTip(tr("Duplicate this note"));
227                 noteDuplicateAction.triggered.connect(parent, "duplicateNote()");
228                 // IFIXED
229                 setupShortcut(noteDuplicateAction, "File_Note_Duplicate");
230                 
231                 noteMergeAction = new QAction(tr("Merge Notes"), this);
232                 noteMergeAction.setToolTip(tr("Merge Multiple notes"));
233                 noteMergeAction.triggered.connect(parent, "mergeNotes()");
234                 setupShortcut(noteMergeAction, "File_Note_Merge");
235                 
236                 noteExportAction = new QAction(tr("Export Selected Notes"), this);
237                 noteExportAction.setToolTip(tr("Export selected notes"));
238                 noteExportAction.triggered.connect(parent, "exportNotes()");
239                 setupShortcut(noteExportAction, "File_Note_Export");
240                 
241                 noteCopyAsUrlAction = new QAction(tr("Copy as URL"), this);
242                 noteCopyAsUrlAction.setToolTip(tr("Copy as URL"));
243                 noteCopyAsUrlAction.triggered.connect(parent, "copyAsUrlClicked()");
244                 setupShortcut(noteCopyAsUrlAction, "Note_Copy_As_Url");
245                 
246                 noteImportAction = new QAction(tr("Import Notes"), this);
247                 noteImportAction.setToolTip(tr("Import notes"));
248                 noteImportAction.triggered.connect(parent, "importNotes()");
249                 setupShortcut(noteImportAction, "File_Note_Import");
250                 
251                 noteAdd = new QAction(tr("Add"), this);
252                 noteAdd.setToolTip(tr("Add a new note"));
253                 noteAdd.triggered.connect(parent, "addNote()");
254                 setupShortcut(noteAdd, "File_Note_Add");
255                 
256                 noteTags = new QAction(tr("Modify Tags"), this);
257                 noteTags.setToolTip(tr("Change the tags assigned to this note"));
258                 noteTags.triggered.connect(parent.browserWindow, "modifyTags()");
259                 setupShortcut(noteTags, "File_Note_Modify_Tags");
260                 
261                 noteDelete = new QAction(tr("Delete"), this);
262                 noteDelete.setToolTip(tr("Delete this note"));
263                 noteDelete.triggered.connect(parent, "deleteNote()");
264                 setupShortcut(noteDelete, "File_Note_Delete");
265                 
266                 // ICHANGED 新しいタブで開くアクション生成
267                 noteOpenNewTab = new QAction(tr("Open in New Tab"), this);
268                 noteOpenNewTab.setToolTip(tr("Open this note in new tab"));
269                 noteOpenNewTab.triggered.connect(parent, "openNewTab()");
270                 setupShortcut(noteOpenNewTab, "File_Note_Open_New_Tab");
271                 
272                 // ICHANGED 新しいタブでノート追加アクション生成
273                 noteAddNewTab = new QAction(tr("Add in New Tab"), this);
274                 noteAddNewTab.setToolTip(tr("Add a new note in new tab"));
275                 noteAddNewTab.triggered.connect(parent, "noteAddNewTab()");
276                 setupShortcut(noteAddNewTab, "File_Note_Add_New_Tab");
277         
278                 editFind = new QAction(tr("Find In Note"), this);
279                 editFind.setToolTip(tr("Find a string in the current note"));
280                 editFind.triggered.connect(parent, "findText()");
281                 setupShortcut(editFind, "Edit_Find_In_Note");
282                 //editFind.setShortcut("Ctrl+F");
283                 
284                 editUndo = new QAction(tr("Undo"), this);
285                 editUndo.setToolTip(tr("Undo"));
286                 editUndo.triggered.connect(parent.browserWindow, "undoClicked()");      
287                 setupShortcut(editUndo, "Edit_Undo");
288                 //editUndo.setShortcut("Ctrl+Z");
289                 
290                 editRedo = new QAction(tr("Redo"), this);
291                 editRedo.setToolTip(tr("Redo"));
292                 editRedo.triggered.connect(parent.browserWindow, "redoClicked()");
293                 setupShortcut(editRedo, "Edit_Redo");
294                 //editRedo.setShortcut("Ctrl+Y");
295         
296                 editCut = new QAction(tr("Cut"), this);
297                 editCut.setToolTip(tr("Cut"));
298                 editCut.triggered.connect(parent.browserWindow, "cutClicked()");
299                 setupShortcut(editCut, "Edit_Cut");
300                 //editCut.setShortcut("Ctrl+X");
301                 
302                 editCopy = new QAction(tr("Copy"), this);
303                 editCopy.setToolTip(tr("Copy"));
304                 editCopy.triggered.connect(parent.browserWindow, "copyClicked()");
305                 setupShortcut(editCopy, "Edit_Copy");
306                 //editCopy.setShortcut("Ctrl+C");
307
308                 
309                 editPaste = new QAction(tr("Paste"), this);
310                 editPaste.setToolTip(tr("Paste"));
311                 editPaste.triggered.connect(parent.browserWindow, "pasteClicked()");
312                 setupShortcut(editPaste, "Edit_Paste");
313
314                 editPasteWithoutFormat = new QAction(tr("Paste Without Formatting"), this);
315                 editPasteWithoutFormat.setToolTip(tr("Paste Without Formatting"));
316                 editPasteWithoutFormat.triggered.connect(parent.browserWindow, "pasteWithoutFormattingClicked()");
317                 setupShortcut(editPasteWithoutFormat, "Edit_Paste_Without_Formatting");
318                 
319                 hideNoteList = new QAction(tr("Show Note List"), this);
320                 hideNoteList.setToolTip(tr("Show/Hide Note List"));
321                 hideNoteList.triggered.connect(parent, "toggleNoteListWindow()");
322                 hideNoteList.setCheckable(true);
323                 hideNoteList.setChecked(true);
324                 setupShortcut(hideNoteList, "View_Show_Note_List");
325                 
326                 hideTags = new QAction(tr("Show Tags"), this);
327                 hideTags.setToolTip(tr("Show/Hide Tags"));
328                 hideTags.triggered.connect(parent, "toggleTagWindow()");
329                 hideTags.setCheckable(true);
330                 hideTags.setChecked(true);
331                 setupShortcut(hideTags, "View_Show_Tags");
332                         
333                 hideNotebooks = new QAction(tr("Show Notebooks"), this);
334                 hideNotebooks.setToolTip(tr("Show/Hide Notebooks"));
335                 hideNotebooks.triggered.connect(parent, "toggleNotebookWindow()");
336                 hideNotebooks.setCheckable(true);
337                 hideNotebooks.setChecked(true);
338                 setupShortcut(hideNotebooks, "View_Show_Notebooks");
339                 
340                 hideZoom = new QAction(tr("Show Zoom"), this);
341                 hideZoom.setToolTip(tr("Show/Hide Zoom"));
342                 hideZoom.triggered.connect(parent, "toggleZoomWindow()");
343                 hideZoom.setCheckable(true);
344                 hideZoom.setChecked(true);
345                 setupShortcut(hideZoom, "View_Show_Zoom");
346                 
347                 hideQuota = new QAction(tr("Show Quota Bar"), this);
348                 hideQuota.setToolTip(tr("Show/Hide Quota"));
349                 hideQuota.triggered.connect(parent, "toggleQuotaWindow()");
350                 hideQuota.setCheckable(true);
351                 hideQuota.setChecked(true);
352                 setupShortcut(hideQuota, "View_Show_Quota");
353                 
354                 hideSearch = new QAction(tr("Show Search Box"), this);
355                 hideSearch.setToolTip(tr("Show/Hide Search Box"));
356                 hideSearch.triggered.connect(parent, "toggleSearchWindow()");
357                 hideSearch.setCheckable(true);
358                 hideSearch.setChecked(true);
359                 setupShortcut(hideSearch, "View_Show_Search");
360
361                 wideListView = new QAction(tr("Wide List View"), this);
362                 wideListView.setToolTip(tr("Wide List View"));
363                 wideListView.setCheckable(true);
364                 wideListView.changed.connect(parent, "wideListView()");
365                 setupShortcut(wideListView, "View_Wide_List");
366                 
367                 narrowListView = new QAction(tr("Narrow List View"), this);
368                 narrowListView.setToolTip(tr("Narrow List View"));
369                 narrowListView.setCheckable(true);
370                 narrowListView.changed.connect(parent, "narrowListView()");
371                 setupShortcut(narrowListView, "View_Narrow_List");
372                 
373                 thumbnailView = new QAction(tr("Preview"), this);
374                 thumbnailView.setToolTip(tr("Preview Notes"));
375                 thumbnailView.triggered.connect(parent, "thumbnailView()");
376                 setupShortcut(thumbnailView, "View_Thumbnail");
377                 
378                 hideSavedSearches = new QAction(tr("Show Saved Searches"), this);
379                 hideSavedSearches.setToolTip(tr("Show/Hide Saved Searches"));
380                 hideSavedSearches.triggered.connect(parent, "toggleSavedSearchWindow()");
381                 hideSavedSearches.setCheckable(true);
382                 hideSavedSearches.setChecked(true);
383                 setupShortcut(hideSavedSearches, "View_Show_SavedSearches");
384                 
385                 hideAttributes = new QAction(tr("Show Attribute Searches"), this);
386                 hideAttributes.setToolTip(tr("Show/Hide Attribute Searches"));
387                 hideAttributes.triggered.connect(parent, "toggleAttributesWindow()");
388                 hideAttributes.setCheckable(true);
389                 hideAttributes.setChecked(true);
390                 setupShortcut(hideAttributes, "View_Show_Attribute_Searches");
391
392                 hideTrash = new QAction(tr("Show Trash"), this);
393                 hideTrash.setToolTip(tr("Show/Hide Trash Tree"));
394                 hideTrash.triggered.connect(parent, "toggleTrashWindow()");
395                 hideTrash.setCheckable(true);
396                 hideTrash.setChecked(true);
397                 setupShortcut(hideTrash, "View_Show_Trash");
398                 
399
400                 showEditorBar = new QAction(tr("Show Editor Button Bar"), this);
401                 showEditorBar.setToolTip(tr("Show/Hide Editor Button Bar"));
402                 showEditorBar.triggered.connect(parent, "toggleEditorButtonBar()");
403                 showEditorBar.setCheckable(true);
404                 showEditorBar.setChecked(true);
405                 setupShortcut(showEditorBar, "View_Show_Editor_Button_Bar");
406                 
407
408                 hideLeftSide = new QAction(tr("Hide Left Side Panels"), this);
409                 hideLeftSide.setToolTip(tr("Hide The Entire Left Side"));
410                 hideLeftSide.triggered.connect(parent, "toggleLeftSide()");
411                 hideLeftSide.setCheckable(true);
412                 hideLeftSide.setChecked(false);
413                 setupShortcut(hideLeftSide, "View_Show_Left_Side");
414                 //hideLeftSide.setShortcut("F11");
415                 
416                 viewSource = new QAction(tr("View Source"), this);
417                 viewSource.setToolTip(tr("View the source HTML for a note"));
418                 viewSource.triggered.connect(parent, "viewSource()");
419                 viewSource.setCheckable(true);
420                 viewSource.setChecked(false);
421                 setupShortcut(viewSource, "View_Source");
422                 //hideLeftSide.setShortcut("F11");
423
424                 alignLeftAction = new QAction(tr("Left"), this);
425                 alignLeftAction.setToolTip(tr("Left Align"));
426                 alignLeftAction.triggered.connect(parent.browserWindow, "justifyLeftClicked()");
427                 setupShortcut(alignLeftAction, "Format_Alignment_Left");
428                 //alignLeftAction.setShortcut("Ctrl+L");
429                 
430                 alignRightAction = new QAction(tr("Right"), this);
431                 alignRightAction.setToolTip(tr("Right Align"));
432                 alignRightAction.triggered.connect(parent.browserWindow, "justifyRightClicked()");
433                 setupShortcut(alignRightAction, "Format_Alignment_Right");
434                 //alignRightAction.setShortcut("Ctrl+R");
435                 
436                 alignCenterAction = new QAction(tr("Center"), this);
437                 alignCenterAction.setToolTip(tr("Center Align"));
438                 alignCenterAction.triggered.connect(parent.browserWindow, "justifyCenterClicked()");
439                 setupShortcut(alignCenterAction, "Format_Alignment_Center");
440                 //alignCenterAction.setShortcut("Ctrl+C");
441                 
442                 formatBold = new QAction(tr("Bold"), this);
443                 formatBold.setToolTip(tr("Bold"));
444                 formatBold.triggered.connect(parent.browserWindow, "boldClicked()");
445                 setupShortcut(formatBold, "Format_Bold");
446                 //formatBold.setShortcut("Ctrl+B");
447                 
448                 formatItalic = new QAction(tr("Italic"), this);
449                 formatItalic.setToolTip(tr("Italic"));
450                 formatItalic.triggered.connect(parent.browserWindow, "italicClicked()");
451                 setupShortcut(formatItalic, "Format_Italic");
452                 //formatItalic.setShortcut("Ctrl+I");
453                 
454                 formatUnderline = new QAction(tr("Underline"), this);
455                 formatUnderline.setToolTip(tr("Underline"));
456                 formatUnderline.triggered.connect(parent.browserWindow, "underlineClicked()");
457                 setupShortcut(formatUnderline, "Format_Underline");
458 //              formatUnderline.setShortcut("Ctrl+U");
459
460                 
461                 formatSuperscript = new QAction(tr("Superscript"), this);
462                 formatSuperscript.setToolTip(tr("Superscript"));
463                 formatSuperscript.triggered.connect(parent.browserWindow, "superscriptClicked()");
464                 setupShortcut(formatSuperscript, "Format_Superscript");
465
466
467                 formatSubscript = new QAction(tr("Subscript"), this);
468                 formatSubscript.setToolTip(tr("Subscript"));
469                 formatSubscript.triggered.connect(parent.browserWindow, "subscriptClicked()");
470                 setupShortcut(formatSubscript, "Format_Subscript");
471
472                 
473                 formatStrikethrough = new QAction(tr("Strikethrough"), this);
474                 formatStrikethrough.setToolTip(tr("Strikethrough"));
475                 formatStrikethrough.triggered.connect(parent.browserWindow, "strikethroughClicked()");
476                 setupShortcut(formatStrikethrough, "Format_Strikethrough");
477
478                 horizontalLineAction = new QAction(tr("Horizontal Line"), this);
479                 horizontalLineAction.setToolTip(tr("Horizontal Line"));
480                 horizontalLineAction.triggered.connect(parent.browserWindow, "hlineClicked()");
481                 setupShortcut(horizontalLineAction, "Format_Horizontal_Line");
482                 
483                 formatBulletList = new QAction(tr("Bulleted List"), this);
484 //              formatBulletList.setText(tr("Numbered List"));
485                 formatBulletList.triggered.connect(parent.browserWindow, "bulletListClicked()");
486                 setupShortcut(formatBulletList, "Format_List_Bullet");
487 //              formatBulletList.setShortcut("Ctrl+Shift+B");
488                 
489                 formatNumberList = new QAction(tr("Numbered List"), this);
490                 formatNumberList.setText(tr("Numbered list"));
491                 formatNumberList.triggered.connect(parent.browserWindow, "numberListClicked()");
492                 setupShortcut(formatNumberList, "Format_List_Numbered");
493 //              formatNumberList.setShortcut("Ctrl+Shift+O");
494
495                 indentAction = new QAction(tr(">> Increase"), this);
496                 indentAction.setText(tr(">> Increase"));
497                 indentAction.triggered.connect(parent.browserWindow, "indentClicked()");
498                 setupShortcut(indentAction, "Format_Indent_Increase");
499                 //indentAction.setShortcut("Ctrl+M");
500
501                 outdentAction = new QAction(tr("<< Decrease"), this);
502                 outdentAction.setText(tr("<< Decrease"));
503                 outdentAction.triggered.connect(parent.browserWindow, "outdentClicked()");
504                 setupShortcut(outdentAction, "Format_Indent_Decrease");
505                 //outdentAction.setShortcut("Ctrl+Shift+M");
506                 
507                 notebookAddAction = new QAction(tr("Add"), this);
508                 notebookAddAction.triggered.connect(parent, "addNotebook()");
509                 setupShortcut(notebookAddAction, "File_Notebook_Add");
510                 
511                 notebookEditAction = new QAction(tr("Edit"), this);
512                 notebookEditAction.setEnabled(false);
513                 notebookEditAction.triggered.connect(parent, "editNotebook()");
514                 setupShortcut(notebookEditAction, "File_Notebook_Edit");
515                 
516                 notebookDeleteAction = new QAction(tr("Delete"), this);
517                 notebookDeleteAction.setEnabled(false);
518                 notebookDeleteAction.triggered.connect(parent, "deleteNotebook()");
519                 setupShortcut(notebookDeleteAction, "File_Notebook_Delete");
520                 
521                 notebookPublishAction = new QAction(tr("Share With The World"), this);
522                 notebookPublishAction.setEnabled(false);
523                 notebookPublishAction.setVisible(false);
524                 notebookPublishAction.triggered.connect(parent, "publishNotebook()");
525                 setupShortcut(notebookPublishAction, "File_Notebook_Publish");
526
527                 notebookShareAction = new QAction(tr("Share With Individuals"), this);
528                 notebookShareAction.setEnabled(false);
529                 notebookShareAction.setVisible(false);
530                 notebookShareAction.triggered.connect(parent, "shareNotebook()");
531                 setupShortcut(notebookShareAction, "File_Notebook_Share");
532                 
533                 
534                 notebookCloseAction = new QAction(tr("Open/Close Notebooks"), this);
535                 notebookCloseAction.setEnabled(true);
536                 notebookCloseAction.triggered.connect(parent, "closeNotebooks()");
537                 setupShortcut(notebookCloseAction, "File_Notebook_Close");
538
539                 notebookIconAction = new QAction(tr("Change Icon"), this);
540                 notebookIconAction.setEnabled(false);
541                 notebookIconAction.triggered.connect(parent, "setNotebookIcon()");
542                 setupShortcut(notebookIconAction, "File_Notebook_Icon");
543                 
544                 notebookStackAction = new QAction(tr("Set Stack"), this);
545                 notebookStackAction.setEnabled(false);
546                 notebookStackAction.triggered.connect(parent, "stackNotebook()");
547                 setupShortcut(notebookStackAction, "File_Notebook_Stack");
548                 
549                 tagAddAction = new QAction(tr("Add"),this);
550                 tagAddAction.triggered.connect(parent, "addTag()");
551                 setupShortcut(tagAddAction, "File_Tag_Add");
552                 
553                 tagEditAction = new QAction(tr("Edit"), this);
554                 tagEditAction.triggered.connect(parent, "editTag()");
555                 tagEditAction.setEnabled(false);
556                 setupShortcut(tagEditAction, "File_Tag_Edit");
557                 
558                 tagDeleteAction = new QAction(tr("Delete"), this);
559                 tagDeleteAction.triggered.connect(parent, "deleteTag()");
560                 tagDeleteAction.setEnabled(false);              
561                 setupShortcut(tagDeleteAction, "File_Tag_Delete");
562                                 
563                 tagIconAction = new QAction(tr("Change Icon"), this);
564                 tagIconAction.triggered.connect(parent, "setTagIcon()");
565                 tagIconAction.setEnabled(false);                
566                 setupShortcut(tagIconAction, "File_Tag_Icon");
567                 
568                 tagMergeAction = new QAction(tr("Merge Tags"), this);
569                 tagMergeAction.triggered.connect(parent, "mergeTags()");
570                 tagMergeAction.setEnabled(false);               
571                 setupShortcut(tagMergeAction, "File_Tag_Merge");
572                                 
573                 savedSearchAddAction = new QAction(tr("Add"),this);
574                 savedSearchAddAction.triggered.connect(parent, "addSavedSearch()");
575                 setupShortcut(savedSearchAddAction, "File_SavedSearch_Add");
576                 
577                 savedSearchEditAction = new QAction(tr("Edit"), this);
578                 savedSearchEditAction.triggered.connect(parent, "editSavedSearch()");
579                 savedSearchEditAction.setEnabled(false);
580                 setupShortcut(savedSearchEditAction, "File_SavedSearch_Edit");
581                 
582                 savedSearchDeleteAction = new QAction(tr("Delete"), this);
583                 savedSearchDeleteAction.triggered.connect(parent, "deleteSavedSearch()");
584                 savedSearchDeleteAction.setEnabled(false);              
585                 setupShortcut(savedSearchDeleteAction, "File_SavedSearch_Delete");
586
587                 savedSearchIconAction = new QAction(tr("Change Icon"), this);
588                 savedSearchIconAction.triggered.connect(parent, "setSavedSearchIcon()");
589                 savedSearchIconAction.setEnabled(false);                
590                 setupShortcut(savedSearchIconAction, "File_SavedSearch_Icon");          
591                                 
592                 connectAction = new QAction(tr("Connect"), this);
593                 connectAction.setToolTip("Connect to Evernote");
594                 connectAction.triggered.connect(parent, "remoteConnect()");
595                 setupShortcut(connectAction, "Tools_Connect");
596                 
597                 synchronizeAction = new QAction(tr("Synchronize with Evernote"), this);
598                 synchronizeAction.setToolTip("Delete all local data & get a fresh copy");
599                 synchronizeAction.triggered.connect(parent, "evernoteSync()");
600                 synchronizeAction.setEnabled(false);
601                 setupShortcut(synchronizeAction, "Tools_Synchronize");
602                 //synchronizeAction.setShortcut("F9");
603                 
604                 noteOnlineHistoryAction = new QAction(tr("Note History"), this);
605                 noteOnlineHistoryAction.triggered.connect(parent, "viewNoteHistory()");
606                 noteOnlineHistoryAction.setEnabled(false);
607                 setupShortcut(noteOnlineHistoryAction, "File_Note_History");
608                 
609                 selectiveSyncAction = new QAction(tr("Selective Synchronize"), this);
610                 selectiveSyncAction.setToolTip("Selectively ignore some notes");
611                 selectiveSyncAction.triggered.connect(parent, "setupSelectiveSync()");
612                 selectiveSyncAction.setEnabled(false);
613                 setupShortcut(synchronizeAction, "File_Selective_Sync");
614                 
615                 
616                 
617                 accountAction = new QAction(tr("Account Information"), this);
618                 accountAction.setToolTip(tr("Account Information"));
619                 accountAction.triggered.connect(parent, "accountInformation()");
620                 setupShortcut(accountAction, "Tools_Account_Information");
621                 
622 //              compactAction = new QAction(tr("Compact Database"), this);
623 //              compactAction.setToolTip(tr("Free unused database space"));
624 //              compactAction.triggered.connect(parent, "compactDatabase()");
625 //              setupShortcut(compactAction, "Tools_Compact_Database");
626
627                 databaseStatusAction = new QAction(tr("Database Status"), this);
628                 databaseStatusAction.setToolTip(tr("Show current database information"));
629                 databaseStatusAction.triggered.connect(parent, "databaseStatus()");
630                 setupShortcut(databaseStatusAction, "Tools_Database_Status");
631                 
632                 
633                 disableIndexing = new QAction(tr("Disable Note Indexing"), this);
634                 disableIndexing.setToolTip(tr("Manually Stop Note Indexing"));
635                 disableIndexing.triggered.connect(parent, "toggleNoteIndexing()");
636                 disableIndexing.setCheckable(true);
637                 disableIndexing.setChecked(false);
638                 setupShortcut(disableIndexing, "Tools_Disable_Note_Indexing");
639                 
640                 
641                 folderImportAction = new QAction(tr("Automatic Folder Importing"), this);
642                 folderImportAction.setToolTip(tr("Import Files Automatically"));
643                 folderImportAction.triggered.connect(parent, "folderImport()");
644                 setupShortcut(folderImportAction, "Tools_Folder_Import");
645                 
646                 spellCheckAction = new QAction(tr("Spell Check"), this);
647                 spellCheckAction.setToolTip(tr("Check for spelling errors"));
648                 spellCheckAction.triggered.connect(parent.browserWindow, "spellCheckClicked()");
649                 setupShortcut(spellCheckAction, "Tools_Spell_Check");
650
651                 encryptDatabaseAction = new QAction(tr("Encrypt Database"), this);
652                 encryptDatabaseAction.setToolTip(tr("Encrypt the database upon shutdown"));
653                 encryptDatabaseAction.triggered.connect(parent, "doDatabaseEncrypt()");
654                 setupShortcut(encryptDatabaseAction, "Tools_Database_Encrypt");
655                 if (Global.cipherPassword != null && Global.cipherPassword != "") {
656                         encryptDatabaseAction.setText("Decrypt Database");
657                         encryptDatabaseAction.setToolTip("Decrypt the database upon shutdown");
658                 }
659                 
660                 loggerAction = new QAction(tr("Logs"), this);
661                 loggerAction.setToolTip(tr("Show the detailed application log"));
662                 loggerAction.triggered.connect(parent, "logger()");
663                 setupShortcut(loggerAction, "About_Log");
664                                 
665                 releaseAction = new QAction(tr("Release Notes"), this);
666                 releaseAction.setToolTip(tr("Release notes"));
667                 releaseAction.triggered.connect(parent, "releaseNotes()");      
668                 setupShortcut(releaseAction, "About_Release_Notes");
669                 
670                 checkForUpdates = new QAction(tr("Check For Updates"), this);
671                 checkForUpdates.setToolTip(tr("Check for newer versions"));
672                 checkForUpdates.triggered.connect(parent, "checkForUpdates()"); 
673                 setupShortcut(checkForUpdates, "Help_Check_For_Updates");
674                 checkForUpdates.setEnabled(true);
675                 
676                 aboutAction = new QAction(tr("About"), this);
677                 aboutAction.setToolTip(tr("About NeighborNote"));
678                 aboutAction.triggered.connect(parent, "about()"); 
679                 setupShortcut(aboutAction, "About_About");
680                 
681                 setupMenuBar();
682         }
683         
684         public void setupMenuBar() {
685                 fileMenu = addMenu(tr("&File"));
686                 
687                 notebookMenu = fileMenu.addMenu(tr("Notebook"));
688                 tagMenu = fileMenu.addMenu(tr("Tag"));
689                 savedSearchMenu = fileMenu.addMenu(tr("Saved Searches"));
690                 fileMenu.addSeparator();
691                 fileMenu.addAction(emailAction);
692                 fileMenu.addAction(printAction);
693                 fileMenu.addSeparator();
694                 fileMenu.addAction(noteImportAction);
695                 fileMenu.addAction(noteExportAction);
696                 fileMenu.addAction(backupAction);
697                 fileMenu.addAction(restoreAction);
698                 fileMenu.addSeparator();
699                 fileMenu.addAction(selectiveSyncAction);
700                 //fileMenu.addAction(parent.browserWindow.browser.downloadAttachment);
701                 fileMenu.addSeparator();
702                 fileMenu.addAction(emptyTrashAction);
703                 fileMenu.addAction(exitAction);
704
705                 editMenu = addMenu(tr("&Edit"));
706                 editMenu.addAction(editFind);
707                 editMenu.addSeparator();
708                 editMenu.addAction(editUndo);
709                 editMenu.addAction(editRedo);
710                 editMenu.addSeparator();
711                 editMenu.addAction(editCut);
712                 editMenu.addAction(editCopy);
713                 editMenu.addAction(editPaste);
714                 editMenu.addAction(editPasteWithoutFormat);
715                 editMenu.addSeparator();
716                 editMenu.addAction(settingsAction);
717                 
718                 viewMenu = addMenu(tr("&View"));
719                 viewMenu.addAction(noteAttributes);
720                 viewMenu.addAction(viewSource);
721                 viewMenu.addSeparator();
722                 viewMenu.addAction(wideListView);
723                 viewMenu.addAction(narrowListView);
724                 viewMenu.addAction(thumbnailView);
725                 viewMenu.addSeparator();
726                 viewMenu.addAction(hideNoteList);
727                 viewMenu.addAction(hideSearch);
728                 viewMenu.addAction(hideQuota);
729                 viewMenu.addAction(hideZoom);
730                 viewMenu.addAction(hideNotebooks);
731                 viewMenu.addAction(hideTags);
732                 viewMenu.addAction(hideAttributes);
733                 viewMenu.addAction(hideSavedSearches);
734                 viewMenu.addAction(hideTrash);
735                 viewMenu.addAction(showEditorBar);
736                 viewMenu.addAction(hideLeftSide);
737                 
738                 noteMenu = addMenu(tr("&Note"));
739                 
740                 formatMenu = addMenu(tr("F&ormat"));
741                 formatMenu.addAction(formatBold);
742                 formatMenu.addAction(formatUnderline);
743                 formatMenu.addAction(formatItalic);
744                 formatMenu.addSeparator();
745                 formatMenu.addAction(formatStrikethrough);
746                 formatMenu.addAction(horizontalLineAction);
747                 formatMenu.addSeparator();
748                 formatMenu.addAction(formatSuperscript);
749                 formatMenu.addAction(formatSubscript);
750                 formatMenu.addSeparator();
751                 //formatMenu.addAction(parent.browserWindow.browser.todoAction);
752                 //formatMenu.addAction(parent.browserWindow.browser.encryptAction);
753                 //formatMenu.addAction(parent.browserWindow.browser.insertLinkAction);
754                 //formatMenu.addAction(parent.browserWindow.browser.insertQuickLinkAction);
755                 //formatMenu.addAction(parent.browserWindow.browser.insertLatexAction);
756                 formatMenu.addMenu(parent.browserWindow.browser.tableMenu);
757                 formatMenu.addMenu(parent.browserWindow.browser.imageMenu);
758                 formatMenu.addSeparator();
759                 
760                 // ICHANGED
761                 // ライブラリにremoveMenu()が存在しないので、removeAction()で消せるようにTable,Imageメニューをここで再定義
762                 tableMenu = new QMenu();
763                 tableMenu.setTitle(tr("Table"));
764                 tableMenu.addAction(parent.browserWindow.browser.insertTableAction);
765                 tableMenu.addAction(parent.browserWindow.browser.insertTableRowAction);
766                 tableMenu
767                                 .addAction(parent.browserWindow.browser.insertTableColumnAction);
768                 tableMenu.addAction(parent.browserWindow.browser.deleteTableRowAction);
769                 tableMenu
770                                 .addAction(parent.browserWindow.browser.deleteTableColumnAction);
771                 imageMenu = new QMenu();
772                 imageMenu.setTitle(tr("Image"));
773                 imageMenu.addAction(parent.browserWindow.browser.downloadImage);
774                 imageMenu.addAction(parent.browserWindow.browser.rotateImageRight);
775                 imageMenu.addAction(parent.browserWindow.browser.rotateImageLeft);
776
777                 alignMenu = formatMenu.addMenu(tr("Alignment"));
778                 alignMenu.addAction(alignLeftAction);
779                 alignMenu.addAction(alignCenterAction);
780                 alignMenu.addAction(alignRightAction);
781                 
782                 listMenu = formatMenu.addMenu(tr("Lists"));
783                 listMenu.addAction(formatBulletList);
784                 listMenu.addAction(formatNumberList);
785                 indentMenu = formatMenu.addMenu(tr("Indent"));
786                 indentMenu.addAction(indentAction);
787                 indentMenu.addAction(outdentAction);
788                 
789                 noteAttributes.setCheckable(true);
790                 // ICHANGED
791                 noteMenu.addAction(noteOpenNewTab);
792                 
793                 noteMenu.addAction(noteAdd);
794                 // ICHANGED
795                 noteMenu.addAction(noteAddNewTab);
796                 
797                 noteMenu.addAction(noteDelete);
798                 //noteMenu.addAction(noteCopyAsUrlAction);
799                 noteMenu.addAction(noteReindex);
800                 noteMenu.addSeparator();
801                 noteMenu.addAction(noteTags);
802                 noteMenu.addAction(noteRestoreAction);
803                 noteMenu.addSeparator();
804                 noteMenu.addAction(noteOnlineHistoryAction);
805                 noteMenu.addAction(noteDuplicateAction);
806                 noteMenu.addAction(noteMergeAction);
807
808                                 
809                 notebookMenu.addAction(notebookAddAction);
810                 notebookMenu.addAction(notebookEditAction);
811                 notebookMenu.addAction(notebookDeleteAction);
812                 notebookMenu.addSeparator();
813                 notebookMenu.addAction(notebookPublishAction);
814                 notebookMenu.addAction(notebookShareAction);
815                 notebookMenu.addSeparator();
816                 notebookMenu.addAction(notebookStackAction);
817                 notebookMenu.addAction(notebookCloseAction);
818                 notebookMenu.addSeparator();
819                 notebookMenu.addAction(notebookIconAction);
820                 
821                 tagMenu.addAction(tagAddAction);
822                 tagMenu.addAction(tagEditAction);
823                 tagMenu.addAction(tagDeleteAction);
824                 tagMenu.addAction(tagMergeAction);
825                 tagMenu.addSeparator();
826                 tagMenu.addAction(tagIconAction);
827                 
828                 savedSearchMenu.addAction(savedSearchAddAction);
829                 savedSearchMenu.addAction(savedSearchEditAction);
830                 savedSearchMenu.addAction(savedSearchDeleteAction);
831                 savedSearchMenu.addSeparator();
832                 savedSearchMenu.addAction(savedSearchIconAction);
833                 
834 //              onlineMenu = addMenu(tr("&Online"));
835 //              onlineMenu.addAction(synchronizeAction);
836 //              onlineMenu.addAction(connectAction);
837 //              onlineMenu.addSeparator();
838 //              onlineMenu.addAction(noteOnlineHistoryAction);
839 //              onlineMenu.addAction(selectiveSyncAction);
840                 
841                 toolsMenu = addMenu(tr("&Tools"));
842                 toolsMenu.addAction(synchronizeAction);
843                 toolsMenu.addAction(connectAction);
844                 toolsMenu.addSeparator();
845                 toolsMenu.addAction(spellCheckAction);
846                 toolsMenu.addAction(accountAction);
847                 toolsMenu.addAction(fullReindexAction);
848                 toolsMenu.addAction(disableIndexing);
849 //              toolsMenu.addAction(compactAction);
850                 toolsMenu.addSeparator();
851                 toolsMenu.addAction(encryptDatabaseAction);
852                 toolsMenu.addAction(databaseStatusAction);
853                 toolsMenu.addSeparator();
854                 toolsMenu.addAction(folderImportAction);
855
856                 helpMenu = addMenu(tr("&Help"));
857                 helpMenu.addAction(releaseAction);
858                 helpMenu.addAction(checkForUpdates);
859                 helpMenu.addAction(loggerAction);
860                 helpMenu.addSeparator();
861                 helpMenu.addAction(aboutAction);
862                 
863                 addMenu(fileMenu);
864                 addMenu(editMenu);
865                 addMenu(viewMenu);
866                 addMenu(noteMenu);
867                 addMenu(formatMenu);
868 //              addMenu(onlineMenu);
869                 addMenu(toolsMenu);
870                 addMenu(helpMenu);
871
872         }
873
874         public void setupToolBarVisible() {
875                 viewMenu.addAction(parent.toolBar.toggleViewAction());
876                 setupShortcut(parent.toolBar.toggleViewAction(), "View_Toolbar");
877         }
878         
879         private void setupShortcut(QAction action, String text) {
880                 if (!Global.shortcutKeys.containsAction(text))
881                         return;
882                 action.setShortcut(Global.shortcutKeys.getShortcut(text));
883         }
884         
885         // ICHANGED
886         public void refreshTargetWindow() {
887                 // 以前のブラウザウィンドウとの接続を切断
888                 noteTags.triggered.disconnect(prevBW, "modifyTags()");
889                 editUndo.triggered.disconnect(prevBW, "undoClicked()");
890                 editRedo.triggered.disconnect(prevBW, "redoClicked()");
891                 editCut.triggered.disconnect(prevBW, "cutClicked()");
892                 editCopy.triggered.disconnect(prevBW, "copyClicked()");
893                 editPaste.triggered.disconnect(prevBW, "pasteClicked()");
894                 editPasteWithoutFormat.triggered.disconnect(prevBW,
895                                 "pasteWithoutFormattingClicked()");
896
897                 alignLeftAction.triggered.disconnect(prevBW, "justifyLeftClicked()");
898                 alignRightAction.triggered.disconnect(prevBW, "justifyRightClicked()");
899                 alignCenterAction.triggered
900                                 .disconnect(prevBW, "justifyCenterClicked()");
901                 formatBold.triggered.disconnect(prevBW, "boldClicked()");
902                 formatItalic.triggered.disconnect(prevBW, "italicClicked()");
903                 formatUnderline.triggered.disconnect(prevBW, "underlineClicked()");
904                 formatSuperscript.triggered.disconnect(prevBW, "superscriptClicked()");
905                 formatSubscript.triggered.disconnect(prevBW, "subscriptClicked()");
906                 formatStrikethrough.triggered.disconnect(prevBW,
907                                 "strikethroughClicked()");
908                 horizontalLineAction.triggered.disconnect(prevBW, "hlineClicked()");
909                 formatBulletList.triggered.disconnect(prevBW, "bulletListClicked()");
910                 formatNumberList.triggered.disconnect(prevBW, "numberListClicked()");
911                 indentAction.triggered.disconnect(prevBW, "indentClicked()");
912                 outdentAction.triggered.disconnect(prevBW, "outdentClicked()");
913
914                 spellCheckAction.triggered.disconnect(prevBW, "spellCheckClicked()");
915
916                 // 新たなブラウザウィンドウと接続
917                 noteTags.triggered.connect(parent.browserWindow, "modifyTags()");
918                 editUndo.triggered.connect(parent.browserWindow, "undoClicked()");
919                 editRedo.triggered.connect(parent.browserWindow, "redoClicked()");
920                 editCut.triggered.connect(parent.browserWindow, "cutClicked()");
921                 editCopy.triggered.connect(parent.browserWindow, "copyClicked()");
922                 editPaste.triggered.connect(parent.browserWindow, "pasteClicked()");
923                 editPasteWithoutFormat.triggered.connect(parent.browserWindow,
924                                 "pasteWithoutFormattingClicked()");
925
926                 alignLeftAction.triggered.connect(parent.browserWindow,
927                                 "justifyLeftClicked()");
928                 alignRightAction.triggered.connect(parent.browserWindow,
929                                 "justifyRightClicked()");
930                 alignCenterAction.triggered.connect(parent.browserWindow,
931                                 "justifyCenterClicked()");
932                 formatBold.triggered.connect(parent.browserWindow, "boldClicked()");
933                 formatItalic.triggered.connect(parent.browserWindow, "italicClicked()");
934                 formatUnderline.triggered.connect(parent.browserWindow,
935                                 "underlineClicked()");
936                 formatSuperscript.triggered.connect(parent.browserWindow,
937                                 "superscriptClicked()");
938                 formatSubscript.triggered.connect(parent.browserWindow,
939                                 "subscriptClicked()");
940                 formatStrikethrough.triggered.connect(parent.browserWindow,
941                                 "strikethroughClicked()");
942                 horizontalLineAction.triggered.connect(parent.browserWindow,
943                                 "hlineClicked()");
944                 formatBulletList.triggered.connect(parent.browserWindow,
945                                 "bulletListClicked()");
946                 formatNumberList.triggered.connect(parent.browserWindow,
947                                 "numberListClicked()");
948                 indentAction.triggered.connect(parent.browserWindow, "indentClicked()");
949                 outdentAction.triggered.connect(parent.browserWindow,
950                                 "outdentClicked()");
951
952                 spellCheckAction.triggered.connect(parent.browserWindow,
953                                 "spellCheckClicked()");
954
955                 // メニューバーに新しいアクションを挿入
956                 fileMenu.insertAction(prevBW.browser.downloadAttachment,
957                                 parent.browserWindow.browser.downloadAttachment);
958
959                 formatMenu.insertAction(prevBW.browser.todoAction,
960                                 parent.browserWindow.browser.todoAction);
961                 formatMenu.insertAction(prevBW.browser.encryptAction,
962                                 parent.browserWindow.browser.encryptAction);
963                 formatMenu.insertAction(prevBW.browser.insertLinkAction,
964                                 parent.browserWindow.browser.insertLinkAction);
965                 formatMenu.insertAction(prevBW.browser.insertQuickLinkAction,
966                                 parent.browserWindow.browser.insertQuickLinkAction);
967                 formatMenu.insertAction(prevBW.browser.insertLatexAction,
968                                 parent.browserWindow.browser.insertLatexAction);
969
970                 tableMenu.insertAction(prevBW.browser.insertTableAction,
971                                 parent.browserWindow.browser.insertTableAction);
972                 tableMenu.insertAction(prevBW.browser.insertTableRowAction,
973                                 parent.browserWindow.browser.insertTableRowAction);
974                 tableMenu.insertAction(prevBW.browser.insertTableColumnAction,
975                                 parent.browserWindow.browser.insertTableColumnAction);
976                 tableMenu.insertAction(prevBW.browser.deleteTableRowAction,
977                                 parent.browserWindow.browser.deleteTableRowAction);
978                 tableMenu.insertAction(prevBW.browser.deleteTableColumnAction,
979                                 parent.browserWindow.browser.deleteTableColumnAction);
980
981                 imageMenu.insertAction(prevBW.browser.downloadImage,
982                                 parent.browserWindow.browser.downloadImage);
983                 imageMenu.insertAction(prevBW.browser.rotateImageRight,
984                                 parent.browserWindow.browser.rotateImageRight);
985                 imageMenu.insertAction(prevBW.browser.rotateImageLeft,
986                                 parent.browserWindow.browser.rotateImageLeft);
987
988                 // メニューバーから古いアクションを削除
989                 fileMenu.removeAction(prevBW.browser.downloadAttachment);
990
991                 formatMenu.removeAction(prevBW.browser.todoAction);
992                 formatMenu.removeAction(prevBW.browser.encryptAction);
993                 formatMenu.removeAction(prevBW.browser.insertLinkAction);
994                 formatMenu.removeAction(prevBW.browser.insertQuickLinkAction);
995                 formatMenu.removeAction(prevBW.browser.insertLatexAction);
996
997                 tableMenu.removeAction(prevBW.browser.insertTableAction);
998                 tableMenu.removeAction(prevBW.browser.insertTableRowAction);
999                 tableMenu.removeAction(prevBW.browser.insertTableColumnAction);
1000                 tableMenu.removeAction(prevBW.browser.deleteTableRowAction);
1001                 tableMenu.removeAction(prevBW.browser.deleteTableColumnAction);
1002
1003                 imageMenu.removeAction(prevBW.browser.downloadImage);
1004                 imageMenu.removeAction(prevBW.browser.rotateImageRight);
1005                 imageMenu.removeAction(prevBW.browser.rotateImageLeft);
1006
1007                 // prevBWを更新
1008                 prevBW = parent.browserWindow;
1009         }
1010
1011 }