OSDN Git Service

Added the ability to show/hide the pinned note column
authorRandy Baumgarte <randy@fbn.cx>
Sat, 27 Aug 2011 01:10:58 +0000 (21:10 -0400)
committerRandy Baumgarte <randy@fbn.cx>
Sat, 27 Aug 2011 01:10:58 +0000 (21:10 -0400)
src/cx/fbn/nevernote/NeverNote.java
src/cx/fbn/nevernote/gui/TableView.java
src/cx/fbn/nevernote/gui/TableViewHeader.java

index ee88115..1280408 100644 (file)
@@ -4074,6 +4074,7 @@ public class NeverNote extends QMainWindow{
        logger.log(logger.HIGH, "Leaving NeverNote.titleColorChanged");
     }
     // A note has been pinned or unpinned
+       @SuppressWarnings("unused")
        private void notePinned() {
                logger.log(logger.EXTREME, "Entering NeverNote.notePinned()");
 
index 6e7c411..3255221 100644 (file)
@@ -89,6 +89,7 @@ public class TableView extends QTableView {
                header.changedDateAction.toggled.connect(this, "toggleChangedDate(Boolean)");\r
                header.authorAction.toggled.connect(this, "toggleAuthor(Boolean)");\r
                header.urlAction.toggled.connect(this, "toggleSourceUrl(Boolean)");\r
+               header.pinnedAction.toggled.connect(this, "togglePinned(Boolean)");\r
                header.tagsAction.toggled.connect(this, "toggleTags(Boolean)");\r
                header.notebookAction.toggled.connect(this, "toggleNotebook(Boolean)");\r
                header.synchronizedAction.toggled.connect(this, "toggleSynchronized(Boolean)");\r
index 75067de..dc24a01 100644 (file)
@@ -24,6 +24,7 @@ public class TableViewHeader extends QHeaderView {
        public QAction urlAction;\r
        public QAction thumbnailAction;\r
        public QAction guidAction;\r
+       public QAction pinnedAction;\r
        \r
 \r
        public TableViewHeader(Orientation orientation, QWidget parent) {\r
@@ -84,10 +85,15 @@ public class TableViewHeader extends QHeaderView {
                thumbnailAction.setCheckable(true);\r
                contextMenu.addAction(thumbnailAction);\r
                \r
+               pinnedAction = new QAction(this);\r
+               pinnedAction.setText(tr("Pinned"));\r
+               pinnedAction.setCheckable(true);\r
+               contextMenu.addAction(pinnedAction);\r
+               \r
+               \r
                guidAction = new QAction(this);\r
                guidAction.setText(tr("Guid"));\r
                guidAction.setCheckable(true);\r
-//             contextMenu.addAction(guidAction);\r
                setMouseTracking(true);\r
                sectionEntered.connect(this, "sectionClicked(Integer)");\r
                \r
@@ -105,6 +111,7 @@ public class TableViewHeader extends QHeaderView {
                authorAction.setChecked(Global.isColumnVisible("author"));\r
                urlAction.setChecked(Global.isColumnVisible("sourceUrl"));\r
                thumbnailAction.setChecked(Global.isColumnVisible("thumbnail"));\r
+               pinnedAction.setChecked(Global.isColumnVisible("pinned"));\r
                guidAction.setChecked(Global.isColumnVisible("guid"));\r
        }\r
        \r