OSDN Git Service

データベースステータスで、操作履歴総数を表示できる機能を追加。
authoryuki <kimaira7@gmail.com>
Tue, 21 May 2013 05:23:52 +0000 (14:23 +0900)
committeryuki <kimaira7@gmail.com>
Tue, 21 May 2013 05:23:52 +0000 (14:23 +0900)
src/cx/fbn/nevernote/NeverNote.java
src/cx/fbn/nevernote/dialog/DatabaseStatus.java
src/cx/fbn/nevernote/sql/HistoryTable.java

index b34251d..4ae7d8f 100644 (file)
@@ -3007,6 +3007,7 @@ public class NeverNote extends QMainWindow{
                status.setTagCount(listManager.getTagIndex().size());
                status.setResourceCount(conn.getNoteTable().noteResourceTable.getResourceCount());
                status.setWordCount(conn.getWordsTable().getWordCount());
+               status.setHistoryCount(conn.getHistoryTable().getHistoryCount());
                waitCursor(false);
                status.exec();
        }
index 44ce73c..c13b54e 100644 (file)
@@ -43,6 +43,7 @@ public class DatabaseStatus extends QDialog {
        QLabel resourceCount;\r
        QLabel indexCount;\r
        QLabel resourceIndexNeeded;\r
+       QLabel historyCount;\r
        private final QPushButton ok;\r
     private final String iconPath = new String("classpath:cx/fbn/nevernote/icons/");\r
        \r
@@ -61,6 +62,7 @@ public class DatabaseStatus extends QDialog {
                resourceCount = new QLabel();\r
                resourceIndexNeeded = new QLabel();\r
                indexCount = new QLabel();\r
+               historyCount = new QLabel();\r
                \r
                grid.addWidget(new QLabel(tr("Notebooks:")), 0,0);\r
                grid.addWidget(notebookCount, 0,1);\r
@@ -88,12 +90,15 @@ public class DatabaseStatus extends QDialog {
                \r
                grid.addWidget(new QLabel(tr("Words In Index")), 8,0);\r
                grid.addWidget(indexCount, 8,1);\r
-                       \r
+               \r
+               grid.addWidget(new QLabel(tr("Tobal Behavior History:")), 9, 0);\r
+               grid.addWidget(historyCount, 9,1);\r
+               \r
                QGridLayout buttonLayout = new QGridLayout();\r
                ok = new QPushButton(tr("OK"));\r
                ok.clicked.connect(this, "okPushed()");\r
                buttonLayout.addWidget(ok, 1, 1);\r
-               grid.addLayout(buttonLayout,9,1);\r
+               grid.addLayout(buttonLayout,10,1);\r
        }\r
        \r
        @SuppressWarnings("unused")\r
@@ -127,6 +132,9 @@ public class DatabaseStatus extends QDialog {
        public void setWordCount(int d) {\r
                indexCount.setText(NumberFormat.getInstance().format(d));\r
        }\r
+       public void setHistoryCount(int d) {\r
+               historyCount.setText(NumberFormat.getInstance().format(d));\r
+       }\r
        public QPushButton getOkButton() {\r
                return ok;\r
        }\r
index a89fca3..3ba31bf 100644 (file)
@@ -300,4 +300,13 @@ public class HistoryTable {
                        }
                }
        }
+
+       // 操作履歴数の取得
+       public int getHistoryCount() {
+               NSqlQuery query = new NSqlQuery(db.getBehaviorConnection());
+               query.exec("Select count(*) from History");
+               query.next();
+               int returnValue = new Integer(query.valueString(0));
+               return returnValue;
+       }
 }