OSDN Git Service

Add logic to remember if note information was displayed and restore it after a restart.
authorRandy Baumgarte <randy@fbn.cx>
Thu, 7 Oct 2010 16:19:09 +0000 (12:19 -0400)
committerRandy Baumgarte <randy@fbn.cx>
Sun, 10 Oct 2010 14:04:16 +0000 (10:04 -0400)
src/cx/fbn/nevernote/Global.java
src/cx/fbn/nevernote/NeverNote.java

index 0cdf3b9..a13f695 100644 (file)
@@ -693,7 +693,10 @@ public class Global {
     }\r
     public static boolean isWindowVisible(String window) {\r
                settings.beginGroup("WindowsVisible");\r
-               String text = (String)settings.value(window, "true");\r
+               String defaultValue = "true";\r
+               if (window.equalsIgnoreCase("noteInformation"))\r
+                       defaultValue = "false";\r
+               String text = (String)settings.value(window, defaultValue);\r
                settings.endGroup();\r
                if (text.equalsIgnoreCase("true"))\r
                        return true;\r
index f42365f..7cf0ac0 100644 (file)
@@ -515,6 +515,8 @@ public class NeverNote extends QMainWindow{
                        toggleEditorButtonBar();
                if (!Global.isWindowVisible("leftPanel"))
                        menuBar.hideLeftSide.setChecked(true);
+               if (Global.isWindowVisible("noteInformation"))
+                       toggleNoteInformation();
                
                setMenuBar(menuBar);
                setupToolBar();
@@ -3191,6 +3193,7 @@ public class NeverNote extends QMainWindow{
                logger.log(logger.HIGH, "Entering NeverNote.toggleNoteInformation");
        browserWindow.toggleInformation();
        menuBar.noteAttributes.setChecked(browserWindow.isExtended());
+       Global.saveWindowVisible("noteInformation", browserWindow.isExtended());
        logger.log(logger.HIGH, "Leaving NeverNote.toggleNoteInformation");
     }
        // Listener triggered when a print button is pressed