OSDN Git Service

Added todo to editor button bar.
authorRandy Baumgarte <randy@fbn.cx>
Wed, 6 Oct 2010 16:06:10 +0000 (12:06 -0400)
committerRandy Baumgarte <randy@fbn.cx>
Sun, 10 Oct 2010 14:03:51 +0000 (10:03 -0400)
src/cx/fbn/nevernote/gui/BrowserWindow.java
src/cx/fbn/nevernote/gui/EditorButtonBar.java
src/cx/fbn/nevernote/icons/todo.gif [new file with mode: 0644]

index c49febb..db005a9 100644 (file)
@@ -199,6 +199,8 @@ public class BrowserWindow extends QWidget {
        public final QAction    numberListAction;\r
        public final QPushButton spellCheckButton;\r
        public final QAction    spellCheckAction;\r
+       public final QPushButton todoButton;\r
+       public final QAction    todoAction;\r
 \r
        public final QShortcut focusTitleShortcut;\r
        public final QShortcut focusTagShortcut;\r
@@ -428,6 +430,7 @@ public class BrowserWindow extends QWidget {
                bulletListButton = newEditorButton("bulletList", tr("Bullet List"));\r
                numberListButton = newEditorButton("numberList", tr("Number List"));\r
                spellCheckButton = newEditorButton("spellCheck", tr("Spell Check"));\r
+               todoButton = newEditorButton("todo", tr("To-do"));\r
 \r
                \r
                buttonLayout = new EditorButtonBar();\r
@@ -522,6 +525,10 @@ public class BrowserWindow extends QWidget {
                spellCheckAction = buttonLayout.addWidget(spellCheckButton);\r
                buttonLayout.toggleNumberListVisible.triggered.connect(this, "spellCheckClicked()");\r
                buttonLayout.toggleSpellCheck.triggered.connect(this, "toggleSpellCheckVisible(Boolean)");\r
+               \r
+               todoAction = buttonLayout.addWidget(todoButton);\r
+               buttonLayout.toggleNumberListVisible.triggered.connect(this, "todoClicked()");\r
+               buttonLayout.toggleTodo.triggered.connect(this, "toggleTodoVisible(Boolean)");\r
 \r
 \r
 //             buttonLayout.addWidget(new QLabel(), 1);\r
@@ -2621,6 +2628,10 @@ public class BrowserWindow extends QWidget {
                indentAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("indent", toggle);\r
        }\r
+       private void toggleTodoVisible(Boolean toggle) {\r
+               todoAction.setVisible(toggle);\r
+               Global.saveEditorButtonsVisible("todo", toggle);\r
+       }\r
        private void toggleOutdentVisible(Boolean toggle) {\r
                outdentAction.setVisible(toggle);\r
                Global.saveEditorButtonsVisible("outdent", toggle);\r
index c210bc5..a2d226f 100644 (file)
@@ -34,6 +34,7 @@ public class EditorButtonBar extends QToolBar {
        QAction toggleFontColorVisible;\r
        QAction toggleFontHilight;\r
        QAction toggleSpellCheck;\r
+       QAction toggleTodo;\r
        \r
 \r
 \r
@@ -65,6 +66,7 @@ public class EditorButtonBar extends QToolBar {
                toggleFontColorVisible = addAction("fontColor", tr("Font Color"));\r
                toggleFontHilight = addAction("fontHilight", tr("Font Hilight"));\r
                toggleSpellCheck = addAction("spellCheck", tr("Spell Check"));\r
+               toggleTodo = addAction("todo", tr("To-Do"));\r
        }\r
        \r
        \r
diff --git a/src/cx/fbn/nevernote/icons/todo.gif b/src/cx/fbn/nevernote/icons/todo.gif
new file mode 100644 (file)
index 0000000..50da4df
Binary files /dev/null and b/src/cx/fbn/nevernote/icons/todo.gif differ