OSDN Git Service

Add some of the context menu options to the main menu bar.
authorRandy Baumgarte <randy@fbn.cx>
Mon, 23 Jan 2012 12:48:46 +0000 (07:48 -0500)
committerRandy Baumgarte <randy@fbn.cx>
Mon, 23 Jan 2012 12:48:46 +0000 (07:48 -0500)
src/cx/fbn/nevernote/gui/BrowserWindow.java
src/cx/fbn/nevernote/gui/ContentView.java
src/cx/fbn/nevernote/gui/MainMenuBar.java

index bb5c05a..879f899 100644 (file)
@@ -167,7 +167,7 @@ public class BrowserWindow extends QWidget {
        private boolean extendedOn;\r
        public boolean buttonsVisible;\r
        private final String iconPath;\r
-       private final ContentView browser;\r
+       public final ContentView browser;\r
        private final QTextEdit sourceEdit;\r
        private String sourceEditHeader;\r
        Highlighter syntaxHighlighter;\r
@@ -711,6 +711,7 @@ public class BrowserWindow extends QWidget {
                alteredTime.setEnabled(!v);\r
                subjectTime.setEnabled(!v);\r
                getBrowser().setEnabled(true);\r
+               getBrowser().page().setContentEditable(!v);\r
 //             getBrowser().setEnabled(!v);\r
        }\r
        \r
index e3cac5b..1c461e1 100644 (file)
@@ -77,6 +77,7 @@ public class ContentView extends QWebView {
        QAction openAction;\r
        QAction insertQuickLinkAction;\r
        QShortcut insertQuickLinkShortcut;\r
+       QMenu imageMenu;\r
        \r
        QAction redBackgroundColor;\r
        \r
@@ -239,7 +240,7 @@ public class ContentView extends QWebView {
                insertDateTimeShortcut.activated.connect(parent, "insertDateTime()");\r
                setupShortcut(insertDateTimeShortcut, "Insert_DateTime");\r
                        \r
-               QMenu imageMenu = new QMenu();\r
+               imageMenu = new QMenu();\r
                imageMenu.setTitle(tr("Image"));\r
                contextMenu.addMenu(imageMenu);\r
                downloadImage = pageAction(QWebPage.WebAction.DownloadImageToDisk);\r
index 8b24646..b1e42db 100644 (file)
@@ -673,6 +673,7 @@ public class MainMenuBar extends QMenuBar {
                fileMenu.addAction(restoreAction);\r
                fileMenu.addSeparator();\r
                fileMenu.addAction(selectiveSyncAction);\r
+               fileMenu.addAction(parent.browserWindow.browser.downloadAttachment);\r
                fileMenu.addSeparator();\r
                fileMenu.addAction(emptyTrashAction);\r
                fileMenu.addAction(exitAction);\r
@@ -721,6 +722,14 @@ public class MainMenuBar extends QMenuBar {
                formatMenu.addAction(formatSuperscript);\r
                formatMenu.addAction(formatSubscript);\r
                formatMenu.addSeparator();\r
+               formatMenu.addAction(parent.browserWindow.browser.todoAction);\r
+               formatMenu.addAction(parent.browserWindow.browser.encryptAction);\r
+               formatMenu.addAction(parent.browserWindow.browser.insertLinkAction);\r
+               formatMenu.addAction(parent.browserWindow.browser.insertQuickLinkAction);\r
+               formatMenu.addAction(parent.browserWindow.browser.insertLatexAction);\r
+               formatMenu.addMenu(parent.browserWindow.browser.tableMenu);\r
+               formatMenu.addMenu(parent.browserWindow.browser.imageMenu);\r
+               formatMenu.addSeparator();\r
 \r
                alignMenu = formatMenu.addMenu(tr("Alignment"));\r
                alignMenu.addAction(alignLeftAction);\r