OSDN Git Service

Save/Restore main window state
authorRandy Baumgarte <randy@fbn.cx>
Fri, 18 Mar 2011 19:00:14 +0000 (15:00 -0400)
committerRandy Baumgarte <randy@fbn.cx>
Sun, 3 Apr 2011 18:02:45 +0000 (14:02 -0400)
src/cx/fbn/nevernote/NeverNote.java
src/cx/fbn/nevernote/utilities/ListManager.java

index 232c113..4ccdfa9 100644 (file)
@@ -354,7 +354,7 @@ public class NeverNote extends QMainWindow{
             QMessageBox.critical(null, tr("Database Connection Error") ,msg);
                        System.exit(16);
                }
             QMessageBox.critical(null, tr("Database Connection Error") ,msg);
                        System.exit(16);
                }
-
+               setObjectName("mainWindow");
 //             thread().setPriority(Thread.MAX_PRIORITY);
                
                logger = new ApplicationLogger("nevernote.log");
 //             thread().setPriority(Thread.MAX_PRIORITY);
                
                logger = new ApplicationLogger("nevernote.log");
@@ -1204,6 +1204,7 @@ public class NeverNote extends QMainWindow{
        private void restoreWindowState(boolean mainWindow) {
                // We need to name things or this doesn't work.
                setObjectName("NeverNote");
        private void restoreWindowState(boolean mainWindow) {
                // We need to name things or this doesn't work.
                setObjectName("NeverNote");
+        restoreState(Global.restoreState(objectName()));
                mainLeftRightSplitter.setObjectName("mainLeftRightSplitter");
                browserIndexSplitter.setObjectName("browserIndexSplitter");
                leftSplitter1.setObjectName("leftSplitter1");   
                mainLeftRightSplitter.setObjectName("mainLeftRightSplitter");
                browserIndexSplitter.setObjectName("browserIndexSplitter");
                leftSplitter1.setObjectName("leftSplitter1");   
@@ -1222,6 +1223,7 @@ public class NeverNote extends QMainWindow{
                Global.saveState(mainLeftRightSplitter.objectName(), mainLeftRightSplitter.saveState());
                Global.saveState(browserIndexSplitter.objectName(), browserIndexSplitter.saveState());
                Global.saveState(leftSplitter1.objectName(), leftSplitter1.saveState());
                Global.saveState(mainLeftRightSplitter.objectName(), mainLeftRightSplitter.saveState());
                Global.saveState(browserIndexSplitter.objectName(), browserIndexSplitter.saveState());
                Global.saveState(leftSplitter1.objectName(), leftSplitter1.saveState());
+               Global.saveState(objectName(), saveState());
        }    
        // Load the style sheet
        private void loadStyleSheet() {
        }    
        // Load the style sheet
        private void loadStyleSheet() {
@@ -2778,6 +2780,7 @@ public class NeverNote extends QMainWindow{
     private void setupToolBar() {
        logger.log(logger.HIGH, "Entering NeverNote.setupToolBar");
        toolBar = addToolBar(tr("Tool Bar"));   
     private void setupToolBar() {
        logger.log(logger.HIGH, "Entering NeverNote.setupToolBar");
        toolBar = addToolBar(tr("Tool Bar"));   
+       toolBar.setObjectName("toolBar");
        menuBar.setupToolBarVisible();
        if (!Global.isWindowVisible("toolBar"))
                toolBar.setVisible(false);
        menuBar.setupToolBarVisible();
        if (!Global.isWindowVisible("toolBar"))
                toolBar.setVisible(false);
index 9193f96..1edad42 100644 (file)
@@ -111,7 +111,8 @@ public class ListManager  {
        public ListManager(DatabaseConnection d, ApplicationLogger l) {\r
                conn = d;\r
                logger = l;\r
        public ListManager(DatabaseConnection d, ApplicationLogger l) {\r
                conn = d;\r
                logger = l;\r
-               \r
+                       \r
+               conn.getTagTable().cleanupTags();\r
        status = new StatusSignal();\r
                signals = new ThreadSignal();\r
                \r
        status = new StatusSignal();\r
                signals = new ThreadSignal();\r
                \r
@@ -260,7 +261,6 @@ public class ListManager  {
        }\r
 \r
        public void reloadTagIndex() {\r
        }\r
 \r
        public void reloadTagIndex() {\r
-//             conn.getTagTable().cleanupTags();\r
                setTagIndex(conn.getTagTable().getAll());       \r
        }\r
        public void reloadIndexes() {\r
                setTagIndex(conn.getTagTable().getAll());       \r
        }\r
        public void reloadIndexes() {\r