OSDN Git Service

Change tag & notebook colors to orange for shared notebooks
authorRandy Baumgarte <randy@fbn.cx>
Sun, 19 Dec 2010 04:33:32 +0000 (23:33 -0500)
committerRandy Baumgarte <randy@fbn.cx>
Sun, 19 Dec 2010 04:33:32 +0000 (23:33 -0500)
.classpath
src/cx/fbn/nevernote/gui/NotebookTreeWidget.java
src/cx/fbn/nevernote/gui/TagTreeWidget.java
src/cx/fbn/nevernote/icons/notebook-orange.png [new file with mode: 0644]
src/cx/fbn/nevernote/icons/notebook-yellow.png
src/cx/fbn/nevernote/icons/tag-orange.png [new file with mode: 0644]

index 6a4b15d..fe5bb05 100644 (file)
@@ -1,16 +1,32 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="src" path="src"/>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-       <classpathentry kind="lib" path="lib/evernote.jar"/>
-       <classpathentry kind="lib" path="lib/h2-1.2.136.jar"/>
-       <classpathentry kind="lib" path="lib/libthrift.jar"/>
-       <classpathentry kind="lib" path="lib/log4j-1.2.14.jar"/>
-       <classpathentry kind="lib" path="lib/PDFRenderer.jar"/>
-       <classpathentry kind="lib" path="lib/commons-lang-2.4.jar"/>
-       <classpathentry kind="lib" path="lib/jtidy-r938.jar"/>
-       <classpathentry kind="var" path="QT_JAMBI/qtjambi-4.6.3.jar"/>
-       <classpathentry kind="var" path="QT_JAMBI/qtjambi-linux32-gcc-4.6.3.jar"/>
-       <classpathentry kind="var" path="QT_JAMBI/qtjambi-util-4.6.3.jar"/>
-       <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+       <classpathentry kind="src" path="src"/>\r
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+       <classpathentry kind="lib" path="lib/evernote.jar"/>\r
+       <classpathentry kind="lib" path="lib/h2-1.2.136.jar"/>\r
+       <classpathentry kind="lib" path="lib/libthrift.jar"/>\r
+       <classpathentry kind="lib" path="lib/log4j-1.2.14.jar"/>\r
+       <classpathentry kind="lib" path="lib/PDFRenderer.jar"/>\r
+       <classpathentry kind="lib" path="lib/commons-lang-2.4.jar"/>\r
+       <classpathentry kind="lib" path="lib/jtidy-r938.jar"/>\r
+       <classpathentry kind="var" path="QT_JAMBI/qtjambi-4.5.0_01.jar"/>\r
+       <classpathentry kind="var" path="QT_JAMBI/qtjambi-win32-msvc2005-4.5.0_01.jar"/>\r
+       <classpathentry kind="lib" path="lib/poi-scratchpad-3.7-20101029.jar"/>\r
+       <classpathentry kind="lib" path="lib/poi-3.7-20101029.jar"/>\r
+       <classpathentry kind="lib" path="lib/poi-ooxml-schemas-3.7-20101029.jar"/>\r
+       <classpathentry kind="lib" path="lib/xmlbeans-2.3.0.jar"/>\r
+       <classpathentry kind="lib" path="lib/pdfbox-app-1.3.1.jar"/>\r
+       <classpathentry kind="lib" path="lib/commons-compress-1.1.jar"/>\r
+       <classpathentry kind="lib" path="lib/poi-ooxml-3.7.jar"/>\r
+       <classpathentry kind="lib" path="lib/jaxen-1.1.3.jar"/>\r
+       <classpathentry kind="lib" path="lib/xsdlib-20060615.jar"/>\r
+       <classpathentry kind="lib" path="lib/jazzy.jar"/>\r
+       <classpathentry kind="lib" path="lib/tika.jar"/>\r
+       <classpathentry kind="lib" path="lib/apache-mime4j-0.6.jar"/>\r
+       <classpathentry kind="lib" path="lib/commons-codec-1.3.jar"/>\r
+       <classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/>\r
+       <classpathentry kind="lib" path="lib/httpclient-4.0.3.jar"/>\r
+       <classpathentry kind="lib" path="lib/httpcore-4.0.1.jar"/>\r
+       <classpathentry kind="lib" path="lib/httpmime-4.0.3.jar"/>\r
+       <classpathentry kind="output" path="bin"/>\r
+</classpath>\r
index 23f1bcf..7926fa1 100644 (file)
@@ -163,6 +163,7 @@ public class NotebookTreeWidget extends QTreeWidget {
        QIcon greenIcon = new QIcon(iconPath+"notebook-green.png");\r
        QIcon redIcon = new QIcon(iconPath+"notebook-red.png");\r
        QIcon yellowIcon = new QIcon(iconPath+"notebook-yellow.png");\r
+       QIcon orangeIcon = new QIcon(iconPath+"notebook-orange.png");\r
 \r
                if (localBooks.contains(guid)) {\r
                        return yellowIcon;\r
@@ -174,6 +175,9 @@ public class NotebookTreeWidget extends QTreeWidget {
                                return redIcon;\r
                if (isPublished)\r
                        return blueIcon;\r
+               \r
+               if (db.getNotebookTable().isLinked(guid))\r
+                       return orangeIcon;\r
 \r
                return greenIcon;\r
        }\r
index f3402f2..086838d 100644 (file)
@@ -131,6 +131,18 @@ public class TagTreeWidget extends QTreeWidget {
        sortItems(0, SortOrder.AscendingOrder);\r
        }\r
        \r
+       private QIcon findDefaultIcon(String guid) {\r
+       String iconPath = new String("classpath:cx/fbn/nevernote/icons/");\r
+               QIcon icon = new QIcon(iconPath+"tag.png");\r
+               QIcon linkedIcon = new QIcon(iconPath+"tag-orange.png");\r
+\r
+               if (db.getTagTable().getNotebookGuid(guid) == null || \r
+                               db.getTagTable().getNotebookGuid(guid).equals(""))\r
+                       return icon;\r
+               else\r
+                       return linkedIcon;\r
+       }\r
+       \r
        public void load(List<Tag> tags) {\r
        Tag tag;\r
        List<QTreeWidgetItem> index = new ArrayList<QTreeWidgetItem>();\r
@@ -156,7 +168,7 @@ public class TagTreeWidget extends QTreeWidget {
                                child = new QTreeWidgetItem();\r
                                child.setText(0, tag.getName());\r
                                if (icons != null && !icons.containsKey(tag.getGuid())) {\r
-                                       child.setIcon(0, icon);\r
+                                       child.setIcon(0, findDefaultIcon(tag.getGuid()));\r
                                } else {\r
                                        child.setIcon(0, icons.get(tag.getGuid()));\r
                                }\r
diff --git a/src/cx/fbn/nevernote/icons/notebook-orange.png b/src/cx/fbn/nevernote/icons/notebook-orange.png
new file mode 100644 (file)
index 0000000..e1096b6
Binary files /dev/null and b/src/cx/fbn/nevernote/icons/notebook-orange.png differ
index 88e9d26..db5130a 100644 (file)
Binary files a/src/cx/fbn/nevernote/icons/notebook-yellow.png and b/src/cx/fbn/nevernote/icons/notebook-yellow.png differ
diff --git a/src/cx/fbn/nevernote/icons/tag-orange.png b/src/cx/fbn/nevernote/icons/tag-orange.png
new file mode 100644 (file)
index 0000000..f75a338
Binary files /dev/null and b/src/cx/fbn/nevernote/icons/tag-orange.png differ