OSDN Git Service

設定ページからEvernote関連ノートリスト統合機能の重み付けを変更できるように変更。設定完了後に連想ノートをリフレッシュするように変更。
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / NeverNote.java
index 08793af..ff17b0d 100644 (file)
@@ -47,7 +47,6 @@ import java.util.Vector;
 
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
-import org.apache.thrift.TException;
 import org.h2.tools.ChangeFileEncryption;
 
 import com.evernote.edam.error.EDAMNotFoundException;
@@ -66,6 +65,7 @@ import com.evernote.edam.type.Resource;
 import com.evernote.edam.type.SavedSearch;
 import com.evernote.edam.type.Tag;
 import com.evernote.edam.type.User;
+import com.evernote.thrift.TException;
 import com.trolltech.qt.QThread;
 import com.trolltech.qt.core.QByteArray;
 import com.trolltech.qt.core.QDateTime;
@@ -208,6 +208,7 @@ import cx.fbn.nevernote.xml.ExportData;
 import cx.fbn.nevernote.xml.ImportData;
 import cx.fbn.nevernote.xml.ImportEnex;
 import cx.fbn.nevernote.xml.NoteFormatter;
+//import org.apache.thrift.TException;
 
 
 public class NeverNote extends QMainWindow{
@@ -625,7 +626,7 @@ public class NeverNote extends QMainWindow{
         
                // ICHANGED
                // 連想ノートリストをセットアップ
-               rensoNoteList = new RensoNoteList(conn, this);
+               rensoNoteList = new RensoNoteList(conn, this, syncRunner);
                rensoNoteList.itemPressed.connect(this,
                                "rensoNoteItemPressed(QListWidgetItem)");
                rensoNoteListDock = new QDockWidget(tr("Renso Note List"), this);
@@ -916,8 +917,7 @@ public class NeverNote extends QMainWindow{
        }
                
                if (Global.checkVersionUpgrade()) {
-                       // ICHANGED TODO とりあえず封印
-                       // checkForUpdates();
+                       checkForUpdates();
                }
                
                // ICHANGED
@@ -1251,6 +1251,9 @@ public class NeverNote extends QMainWindow{
                saveNote();
                listManager.stop();
                saveWindowState();
+               
+               // 連想ノートリストのEvernote関連ノート取得スレッドを終了
+               rensoNoteList.stopThread();
 
                if (tempFiles != null)
                        tempFiles.clear();
@@ -2964,6 +2967,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();
        }
@@ -5669,12 +5673,6 @@ public class NeverNote extends QMainWindow{
        // IFIXED こいつのせいで、ノート追加時にcurrentNoteGuidが更新されないので消す
        // noteTableView.clearSelection();
        
-       refreshEvernoteNote(true);
-       listManager.countNotebookResults(listManager.getNoteIndex());
-       browserWindow.titleLabel.setFocus();
-       browserWindow.titleLabel.selectAll();
-//     notebookTree.updateCounts(listManager.getNotebookIndex(), listManager.getNotebookCounter());
-       
        // ICHANGED 新規に作成したノートとそれまで開いていたノートの関連性を追加
        if (prevCurrentNoteGuid != null && !prevCurrentNoteGuid.equals("")) {
                if (currentNoteGuid != null && !currentNoteGuid.equals("")) {
@@ -5682,6 +5680,12 @@ public class NeverNote extends QMainWindow{
                }
        }
        
+       refreshEvernoteNote(true);
+       listManager.countNotebookResults(listManager.getNoteIndex());
+       browserWindow.titleLabel.setFocus();
+       browserWindow.titleLabel.selectAll();
+//     notebookTree.updateCounts(listManager.getNotebookIndex(), listManager.getNotebookCounter());
+       
        // If the window is hidden, then we want to popup this in an external window & 
        if (!isVisible())
                listDoubleClick();
@@ -7630,7 +7634,7 @@ public class NeverNote extends QMainWindow{
                                String tableGuid = (String) ix.values().toArray()[0];
                                if (tableGuid.equals(rensoNotePressedItemGuid)) {
                                        noteTableView.selectRow(i);
-                                       return;
+                                       break;
                                }
                        }
                }
@@ -7756,4 +7760,9 @@ public class NeverNote extends QMainWindow{
                fromHistory.put(from,  fromHistory.get(to));
                fromHistory.put(to, fromHist);
        }
+       
+       // 連想ノートリストのgetter
+       public RensoNoteList getRensoNoteList() {
+               return rensoNoteList;
+       }
 }