OSDN Git Service

Merge branch 'checkUpdate' into develop
authoryuki <kimaira7@gmail.com>
Wed, 22 May 2013 02:26:15 +0000 (11:26 +0900)
committeryuki <kimaira7@gmail.com>
Wed, 22 May 2013 02:26:15 +0000 (11:26 +0900)
README.md
src/cx/fbn/nevernote/Global.java
src/cx/fbn/nevernote/NeverNote.java
src/cx/fbn/nevernote/dialog/DatabaseStatus.java
src/cx/fbn/nevernote/gui/RensoNoteListItem.java
src/cx/fbn/nevernote/gui/TabBrowserWidget.java
src/cx/fbn/nevernote/sql/DatabaseConnection.java
src/cx/fbn/nevernote/sql/HistoryTable.java

index f790b26..8ed29ab 100644 (file)
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ neighbornote.batを実行して下さい。
 
 要件
 ------------
-OpenSSLが必要です。Windowsを使っているのであれば、[Shining Light Productions - Win32 OpenSSL](http://slproweb.com/products/Win32OpenSSL.html)から"Win32 OpenSSL v0.9.8y Light"をダウンロードしてインストールする必要があるかもしれません。
+OpenSSLが必要です。Windowsを使っているのであれば、[Shining Light Productions - Win32 OpenSSL](http://slproweb.com/products/Win32OpenSSL.html)から"(Win32/Win64) OpenSSL v0.9.8y Light"をダウンロードしてインストールする必要があるかもしれません。
 
 Download
 ------------
@@ -29,4 +29,4 @@ Please run the neighbornote.bat.
 
 Requirements
 ------------
-OpenSSL is needed. If you are using Windows, you may need to download and install "Win32 OpenSSL v0.9.8y Light" from [Shining Light Productions - Win32 OpenSSL](http://slproweb.com/products/Win32OpenSSL.html).
+OpenSSL is needed. If you are using Windows, you may need to download and install "(Win32/Win64) OpenSSL v0.9.8y Light" from [Shining Light Productions - Win32 OpenSSL](http://slproweb.com/products/Win32OpenSSL.html).
index b6bd5e5..4d3fb6e 100644 (file)
@@ -65,8 +65,8 @@ import cx.fbn.nevernote.utilities.Pair;
 public class Global {
        // Set current version and the known versions.
        // ICHANGED 自分用に変更
-       public static String version = "0.1";
-       public static String[] validVersions = {"0.1"};
+       public static String version = "0.1.1";
+       public static String[] validVersions = {"0.1.1", "0.1"};
        
     public static String username = ""; 
     //public static String password = "";     
@@ -2303,56 +2303,5 @@ public class Global {
                settings.endGroup();
                return value;
        }
-       
-       // 最後に開いていたノート群を取得
-       public static HashMap<Integer, String> getLastViewedTabs() {
-               settings.beginGroup("General");
-               
-               @SuppressWarnings("unchecked")
-               HashMap<Integer, String> tabWindows = (HashMap<Integer, String>) settings.value("lastViewedTabs", null);
-               
-               settings.endGroup();
-               return tabWindows;
-       }
-       
-       // 最後に開いていたノート群を保存
-       public static void saveLastViewedTabs(HashMap<Integer, String> tabs) {
-               settings.beginGroup("General");
-               if (tabs != null) {
-                       settings.setValue("lastViewedTabs", tabs);
-               } else {
-                       settings.setValue("lastViewedTabs", "");
-               }
-               settings.endGroup();
-       }
-       
-    // 最後に開いていたタブのインデックスを取得
-    public static int getLastViewedTabIndex() {
-               settings.beginGroup("General");
-               Integer index;
-               try {
-                       String val = (String) settings.value("lastViewedTabIndex", 0);
-                       index = new Integer(val.trim());
-               } catch (Exception e) {
-                       try {
-                               index = (Integer) settings.value("lastViewedTabIndex", 0);
-                       } catch (Exception e1) {
-                               index = 0;
-                       }
-               }
-               settings.endGroup();
-               return index;
-    }
-    
-    // 最後に開いていたタブのインデックスを保存
-    public static void saveLastViewedTabIndex(Integer index) {
-               settings.beginGroup("General");
-               if (index != null) {
-                       settings.setValue("lastViewedTabIndex", index);
-               } else {
-                       settings.setValue("lastViewedTabIndex", 0);
-               }
-               settings.endGroup();
-    }
 }
 
index b2ac51e..c745cff 100644 (file)
@@ -600,12 +600,25 @@ public class NeverNote extends QMainWindow{
                tabBrowser = new TabBrowserWidget(this);
                tabBrowser.setStyleSheet("QTabBar::tab{width:150px;}");
                tabBrowser.setMovable(true);
+               TabBrowse tab = new TabBrowse(conn, tabBrowser, cbObserver);
+               browserWindow = tab.getBrowserWindow();
+               int index = tabBrowser.addNewTab(tab, "");
+               tabWindows.put(index, tab);
                tabBrowser.setTabsClosable(true);
                tabBrowser.currentChanged.connect(this, "tabWindowChanged(int)");
                tabBrowser.tabCloseRequested.connect(this, "tabWindowClosing(int)");
                
+               noteDirty = new HashMap<Integer, Boolean>();
+               noteDirty.put(index, false);
+               
                inkNote = new HashMap<Integer, Boolean>();
                readOnly = new HashMap<Integer, Boolean>();
+
+               // ICHANGED
+               // 履歴記録のハッシュマップを初期化
+               historyGuids.put(index, new ArrayList<String>());
+               historyPosition.put(index, 0);
+               fromHistory.put(index, false);
                
         mainLeftRightSplitter.addWidget(leftSplitter1);
         mainLeftRightSplitter.addWidget(browserIndexSplitter);
@@ -779,60 +792,21 @@ public class NeverNote extends QMainWindow{
                trayIcon.setToolTip(tr("NeighborNote"));
                trayIcon.setContextMenu(trayMenu);
                trayIcon.activated.connect(this, "trayActivated(com.trolltech.qt.gui.QSystemTrayIcon$ActivationReason)");
-               
-               // 前回のタブを復元
-               noteTableView.load(true);
-               HashMap<Integer, String> tabs = new HashMap<Integer, String>();
-               if (Global.getLastViewedTabs() != null) {
-                       tabs.putAll(Global.getLastViewedTabs());
-               }
-               
-               Collection<String>              guids = tabs.values();
-               Iterator<String>                guidIterator = guids.iterator();
-               Collection<Integer>             indexes = tabs.keySet();
-               Iterator<Integer>               indexIterator = indexes.iterator();
-               noteDirty = new HashMap<Integer, Boolean>();
-               
-               while (guidIterator.hasNext()) {
-                       String guid = guidIterator.next();
-                       int tabIndex = indexIterator.next();
-                       
-                       currentNoteGuid = guid;
-                       noteDirty.put(tabIndex, false);
-                       if (!currentNoteGuid.trim().equals("")) {
-                               currentNote = conn.getNoteTable().getNote(currentNoteGuid, true, true, false, false, true);
-                               if (currentNote != null) {
-                                       openTabEditor(guid, tabIndex);
-                               }
-                       }
-               }
-               
-               // タブが0個だったら作る
-               if (tabBrowser.count() <= 0) {
-                       TabBrowse tab = new TabBrowse(conn, tabBrowser, cbObserver);
-                       browserWindow = tab.getBrowserWindow();
-                       tabBrowser.currentChanged.disconnect();
-                       int index = tabBrowser.addNewTab(tab, "");
-                       tabBrowser.currentChanged.connect(this, "tabWindowChanged(int)");
-                       tabWindows.put(index, tab);
-                       noteDirty.put(index, false);
-                       
-                       // 履歴記録のハッシュマップを初期化
-                       historyGuids.put(index, new ArrayList<String>());
-                       historyPosition.put(index, 0);
-                       fromHistory.put(index, false);
-               }
-               
+
+               currentNoteGuid="";
                currentNoteGuid = Global.getLastViewedNoteGuid();
-               if (currentNoteGuid.trim().equals("")) {
+               if (currentNoteGuid.equals(""))
                        currentNote = new Note();
-               } else {
-                       currentNote = conn.getNoteTable().getNote(currentNoteGuid, true,true,false,false,true);
-               }
                
-               // タブのフォーカスをlastViewedTabIndexに移す
-               if (tabBrowser.count() >= 2) {
-                       tabBrowser.setCurrentIndex(Global.getLastViewedTabIndex());
+               // ICHANGED
+               /* 上に移動したので要らない
+               historyGuids = new ArrayList<String>();
+               historyPosition = 0;
+               fromHistory = false;
+               */
+               
+               if (!currentNoteGuid.trim().equals("")) {
+                       currentNote = conn.getNoteTable().getNote(currentNoteGuid, true,true,false,false,true);
                }
                
                noteIndexUpdated(true);
@@ -1303,23 +1277,6 @@ public class NeverNote extends QMainWindow{
                
                Global.saveWindowMaximized(isMaximized());
                Global.saveCurrentNoteGuid(currentNoteGuid);
-               Global.saveLastViewedTabIndex(tabBrowser.currentIndex());
-               
-               // 開いていたタブ群をsettingsに保存しておく
-               Collection<TabBrowse>           tabBrowsers = tabWindows.values();
-               Iterator<TabBrowse>                     tabIterator = tabBrowsers.iterator();
-               Collection<Integer>                     tabIndexes = tabWindows.keySet();
-               Iterator<Integer>                       indexIterator = tabIndexes.iterator();
-               HashMap<Integer, String>        tabs = new HashMap<Integer, String>();
-               while (tabIterator.hasNext()) {
-                       TabBrowse tab = tabIterator.next();
-                       int index = indexIterator.next();
-                       if (tab.getBrowserWindow() != null && tab.getBrowserWindow().getNote() != null) {
-                               String guid = tab.getBrowserWindow().getNote().getGuid();
-                               tabs.put(index, guid);
-                       }
-               }
-               Global.saveLastViewedTabs(tabs);
                        
                int sortCol = noteTableView.proxyModel.sortColumn();
                int sortOrder = noteTableView.proxyModel.sortOrder().value();
@@ -3006,6 +2963,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();
        }
@@ -4831,36 +4789,17 @@ public class NeverNote extends QMainWindow{
                        conn.getHistoryTable().addHistory("rensoItemClick", prevCurrentNoteGuid, rensoNotePressedItemGuid);
                }
        }
-       
-       private void openTabEditor(String guid) {
-               openTabEditor(guid, -1);
-       }
 
-       // オーバーロード insertIndex < 0 ならば普通に追加
-       private void openTabEditor(String guid, int insertIndex) {
+       // ICHANGED
+       private void openTabEditor(String guid) {
+               
                Note note = conn.getNoteTable().getNote(guid, true, true, false, true, true);
                // 新しいタブエディタを作成
                TabBrowse newBrowser = new TabBrowse(conn, tabBrowser, cbObserver);
                showEditorButtons(newBrowser.getBrowserWindow());
                
                String noteTitle = note.getTitle();
-               int index;
-               // 最初のタブだけ、追加後に自動的にフォーカスが移ってしまうので、一度切断する
-               if (tabBrowser.count() == 0) {
-                       tabBrowser.currentChanged.disconnect();
-                       if (insertIndex < 0) {
-                               index = tabBrowser.addNewTab(newBrowser, noteTitle);
-                       } else {
-                               index = tabBrowser.insertNewTab(insertIndex, newBrowser, noteTitle);
-                       }
-                       tabBrowser.currentChanged.connect(this, "tabWindowChanged(int)");
-               } else {
-                       if (insertIndex < 0) {
-                               index = tabBrowser.addNewTab(newBrowser, noteTitle);
-                       } else {
-                               index = tabBrowser.insertNewTab(insertIndex, newBrowser, noteTitle);
-                       }
-               }
+               int index = tabBrowser.addNewTab(newBrowser, noteTitle);
                tabWindows.put(index, newBrowser);
                noteDirty.put(index, false);
                
@@ -4896,8 +4835,6 @@ public class NeverNote extends QMainWindow{
                                addBrowseHistory();
                        }
                }
-               
-               rensoNoteList.refreshRensoNoteList(currentNoteGuid);
        }
 
        // ICHANGED タブが閉じられた
@@ -7693,7 +7630,7 @@ public class NeverNote extends QMainWindow{
                                String tableGuid = (String) ix.values().toArray()[0];
                                if (tableGuid.equals(rensoNotePressedItemGuid)) {
                                        noteTableView.selectRow(i);
-                                       return;
+                                       break;
                                }
                        }
                }
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 7aa7ab0..294495b 100644 (file)
@@ -34,6 +34,7 @@ import com.trolltech.qt.gui.QMouseEvent;
 import com.trolltech.qt.gui.QPaintEvent;
 import com.trolltech.qt.gui.QPainter;
 import com.trolltech.qt.gui.QPalette;
+import com.trolltech.qt.gui.QPen;
 import com.trolltech.qt.gui.QTextOption;
 import com.trolltech.qt.gui.QWidget;
 
@@ -51,6 +52,7 @@ public class RensoNoteListItem extends QWidget{
        private final RensoNoteList parent;
        private final boolean isStared;
        private final int allPointSum;
+       private final QPalette palette;
        
        private final String iconPath = new String("classpath:cx/fbn/nevernote/icons/");
        
@@ -85,9 +87,9 @@ public class RensoNoteListItem extends QWidget{
                String kaigyo = System.getProperty("line.separator");
                this.noteContent = this.noteContent.replaceAll(kaigyo, "");
                
-               QPalette p = new QPalette();
-               p.setColor(QPalette.ColorRole.Window, new QColor(255, 255, 255));
-               this.setPalette(p);
+               palette = new QPalette();
+               palette.setColor(QPalette.ColorRole.Window, new QColor(255, 255, 255));
+               this.setPalette(palette);
                this.setAutoFillBackground(true);
                this.setBackgroundRole(QPalette.ColorRole.Window);
        }
@@ -111,12 +113,6 @@ public class RensoNoteListItem extends QWidget{
                QFont normalFont = new QFont();
                normalFont.setPixelSize(12);
                
-               // 関連度
-               double ratio = (double)relationPoints / allPointSum;
-               int green = (int) (255 * (1.0 - ratio));
-               painter.setPen(new QColor(255, green, 0));
-               painter.setFont(relationFont);
-               painter.drawText(70, size().height() - 30, size().width() - 70, 30, Qt.AlignmentFlag.AlignRight.value(), String.valueOf((int)(ratio * 100)) + "%");
                // タイトル
                painter.setPen(QColor.black);
                painter.setFont(titleFont);
@@ -129,11 +125,34 @@ public class RensoNoteListItem extends QWidget{
                painter.setPen(QColor.black);
                painter.drawText(165, 23, size().width() - 165, 17, Qt.AlignmentFlag.AlignLeft.value(), tagNames);
                // ノート内容
+               QPen tmpPen = painter.pen();
+               painter.setPen(new QColor(100, 100, 100));
                QTextOption option = new QTextOption();
                option.setAlignment(Qt.AlignmentFlag.AlignLeft);
                option.setUseDesignMetrics(true);
-               painter.drawText(new QRectF(85, 40, width() - 85, 40), noteContent, option);
+               painter.drawText(new QRectF(85, 40, width() - 85, 45), noteContent, option);
+               painter.setPen(tmpPen);
                
+               // 関連度
+               double ratio = (double)relationPoints / allPointSum;
+               QColor relationColor;
+               if (ratio >= 0.8) {
+                       relationColor = new QColor(255, 0, 0);
+               } else if (ratio >= 0.5) {
+                       relationColor = new QColor(255, 100, 0);
+               } else {
+                       relationColor = new QColor(255, 200, 0);
+               }
+               painter.setFont(relationFont);
+               tmpPen = painter.pen();
+               painter.setPen(this.palette().color(QPalette.ColorRole.Window));
+               painter.drawText(size().width() - 70, size().height() - 33, 67, 33, Qt.AlignmentFlag.AlignRight.value(), String.valueOf((int)(ratio * 100)) + "%");
+               painter.drawText(size().width() - 70, size().height() - 33, 73, 33, Qt.AlignmentFlag.AlignRight.value(), String.valueOf((int)(ratio * 100)) + "%");
+               painter.drawText(70, size().height() - 36, size().width() - 70, 36, Qt.AlignmentFlag.AlignRight.value(), String.valueOf((int)(ratio * 100)) + "%");
+               painter.drawText(70, size().height() - 30, size().width() - 70, 30, Qt.AlignmentFlag.AlignRight.value(), String.valueOf((int)(ratio * 100)) + "%");
+               painter.setPen(relationColor);
+               painter.drawText(70, size().height() - 33, size().width() - 70, 33, Qt.AlignmentFlag.AlignRight.value(), String.valueOf((int)(ratio * 100)) + "%");             
+               painter.setPen(tmpPen);
                // サムネイル
                QImage img;
                String thumbnailName = Global.getFileManager().getResDirPath("thumbnail-" + noteGuid + ".png");
@@ -161,9 +180,8 @@ public class RensoNoteListItem extends QWidget{
        @Override
        protected void enterEvent(QEvent e){
                if (!parent.isContextMenuVisible()) {
-                       QPalette p = new QPalette();
-                       p.setColor(QPalette.ColorRole.Window, new QColor(225, 235, 255));
-                       this.setPalette(p);
+                       palette.setColor(QPalette.ColorRole.Window, new QColor(225, 235, 255));
+                       this.setPalette(palette);
                }
        }
        
@@ -176,16 +194,15 @@ public class RensoNoteListItem extends QWidget{
        
        @Override
        protected void mousePressEvent(QMouseEvent e) {
-               QPalette p = new QPalette();
-               p.setColor(QPalette.ColorRole.Window, new QColor(165, 175, 255));
-               this.setPalette(p);
+               
+               palette.setColor(QPalette.ColorRole.Window, new QColor(165, 175, 255));
+               this.setPalette(palette);
                
                super.mousePressEvent(e);
        }
        
        public void setDefaultBackground() {
-               QPalette p = new QPalette();
-               p.setColor(QPalette.ColorRole.Window, new QColor(255, 255, 255));
-               this.setPalette(p);
+               palette.setColor(QPalette.ColorRole.Window, new QColor(255, 255, 255));
+               this.setPalette(palette);
        }
 }
index 3232e30..83debac 100644 (file)
@@ -48,12 +48,5 @@ public class TabBrowserWidget extends QTabWidget {
                bar.setTabTitle(index, title);
                this.setTabToolTip(index, title);
        }
-
-       public int insertNewTab(int index, QWidget widget, String title) {
-               int trueIndex = this.insertTab(index, widget, new String());
-               bar.addNewTab(trueIndex, title);
-               this.setTabToolTip(trueIndex, title);
-               return trueIndex;
-       }
        
 }
index ef314b5..72caf26 100644 (file)
@@ -209,62 +209,6 @@ public class DatabaseConnection {
        }
        
        public void upgradeDb(String version) {
-               if (version.equals("0.85")) {
-                       executeSql("alter table note add column titleColor integer");
-                       executeSql("alter table note add column thumbnail blob");
-                       executeSql("alter table note add column thumbnailneeded boolean");
-                       executeSql("Update note set thumbnailneeded = true;");
-                       executeSql("create index NOTE_NOTEBOOK_INDEX on note (notebookguid, guid);");
-                       executeSql("create index NOTETAGS_TAG_INDEX on notetags (tagguid, noteguid);");
-                       version = "0.86";
-                       Global.setDatabaseVersion(version);
-               } 
-               if (version.equals("0.86")) {
-       
-                       executeSql("alter table notebook add column publishingUri VarChar");
-                       executeSql("alter table notebook add column publishingOrder Integer");
-                       executeSql("alter table notebook add column publishingAscending Boolean");
-                       executeSql("alter table notebook add column publishingPublicDescription varchar");
-                       executeSql("alter table notebook add column stack varchar");
-                       executeSql("alter table notebook add column icon blob");
-                       executeSql("alter table notebook add column readOnly boolean");
-                       executeSql("alter table notebook add column linked boolean");
-                       
-                       executeSql("alter table tag add column realname varchar");
-                       executeSql("alter table tag add column linked boolean");
-                       executeSql("alter table tag add column icon blob");
-                       executeSql("alter table tag add column notebookguid varchar");
-                       executeSql("alter table SavedSearch add column icon blob");
-
-                       executeSql("create index NOTE_THUMBNAIL_INDEX on note (thumbnailneeded, guid);");
-                       executeSql("create index NOTE_EXPUNGED_INDEX on note (isExpunged, guid);");
-                       executeSql("create index NOTE_DUEDATE_INDEX on note (attributeSubjectDate, guid);");
-                       executeSql("create index TAG_NOTEBOOK_INDEX on tag (notebookGuid);");
-                       
-                       executeSql("update note set thumbnailneeded=true, thumbnail=null;");
-                       executeSql("update notebook set publishingUri='', " +
-                                       "publishingAscending=false, stack='', readonly=false, publishingOrder=1, " +
-                                       "publishingPublicDescription='', linked=false");
-                       executeSql("update tag set linked=false, realname='', notebookguid=''");
-                       
-                       sharedNotebookTable.createTable();
-                       linkedNotebookTable.createTable();
-                       systemIconTable.createTable();
-                       inkImagesTable.createTable();
-                       
-                       version = "0.95";
-                       executeSql("Insert into Sync (key, value) values ('FullNotebookSync', 'true')");
-                       executeSql("Insert into Sync (key, value) values ('FullLinkedNotebookSync', 'true')");
-                       executeSql("Insert into Sync (key, value) values ('FullSharedNotebookSync', 'true')");
-                       executeSql("Insert into Sync (key, value) values ('FullInkNoteImageSync', 'true')");
-                       Global.setDatabaseVersion(version);
-               } 
-               if (version.equals("0.95")) {
-                       if (dbTableExists("words"))
-                               executeSql("Drop table words;");
-                       if (dbTableExists("NoteResources"))
-                               executeSql("Drop table NoteResources;");
-               }
                if (!dbTableColumnExists("NOTE", "ORIGINAL_GUID")) {
                        executeSql("alter table note add column ORIGINAL_GUID VarChar");
                        executeSql("create index NOTE_ORIGINAL_GUID_INDEX on note (original_guid, guid);");
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;
+       }
 }