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;
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;
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{
int tagDeadCount=0; // number of consecutive dead times for the tag thread
int trashDeadCount=0; // number of consecutive dead times for the trash thread
int saveThreadDeadCount=0; // number of consecutive dead times for the save thread
+ int enRelatedNotesThreadDeadCount=0; // number of consecutive dead times for the EvernoteRelatedNotes Thread
boolean disableTagThreadCheck=false;
boolean disableNotebookThreadCheck=false;
boolean disableTrashThreadCheck=false;
boolean disableSaveThreadCheck=false;
boolean disableSyncThreadCheck=false;
boolean disableIndexThreadCheck=false;
+ boolean disableENRelatedNotesThreadCheck=false;
HashMap<String, String> noteCache; // Cash of note content
HashMap<String, Boolean> readOnlyCache; // List of cashe notes that are read-only
indexThread = new QThread(indexRunner, "Index Thread");
indexRunner.indexAttachmentsLocally = Global.indexAttachmentsLocally();
indexRunner.indexImageRecognition = Global.indexImageRecognition();
- indexRunner.indexNoteBody = Global.indexNoteBody();
- indexRunner.indexNoteTitle = Global.indexNoteTitle();
- indexRunner.specialIndexCharacters = Global.getSpecialIndexCharacters();
+// indexRunner.indexNoteBody = Global.indexNoteBody();
+// indexRunner.indexNoteTitle = Global.indexNoteTitle();
+// indexRunner.specialIndexCharacters = Global.getSpecialIndexCharacters();
indexThread.start();
synchronizeAnimationTimer = new QTimer();
// 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);
saveNote();
listManager.stop();
saveWindowState();
+
+ // 連想ノートリストのEvernote関連ノート取得スレッドを終了
+ rensoNoteList.stopThread();
if (tempFiles != null)
tempFiles.clear();
saveNoteColumnPositions();
saveNoteIndexWidth();
showColumns();
- ConfigDialog settings = new ConfigDialog(this);
+ ConfigDialog settings = new ConfigDialog(this, conn);
String dateFormat = Global.getDateFormat();
String timeFormat = Global.getTimeFormat();
settings.exec();
indexRunner.indexAttachmentsLocally = Global.indexAttachmentsLocally();
- indexRunner.indexNoteBody = Global.indexNoteBody();
- indexRunner.indexNoteTitle = Global.indexNoteTitle();
- indexRunner.specialIndexCharacters = Global.getSpecialIndexCharacters();
+// indexRunner.indexNoteBody = Global.indexNoteBody();
+// indexRunner.indexNoteTitle = Global.indexNoteTitle();
+// indexRunner.specialIndexCharacters = Global.getSpecialIndexCharacters();
indexRunner.indexImageRecognition = Global.indexImageRecognition();
if (Global.showTrayIcon() || Global.minimizeOnClose())
trayIcon.show();
} else
indexThreadDeadCount=0;
-
+ if (!rensoNoteList.getEnRelatedNotesThread().isAlive()) {
+ enRelatedNotesThreadDeadCount++;
+ if (enRelatedNotesThreadDeadCount > MAX && !disableENRelatedNotesThreadCheck) {
+ QMessageBox.information(this, tr("A thread has died."), tr("It appears as the Evernote Related Notes thread has died. I recommend "+
+ "checking stopping NeighborNote, saving the logs for later viewing, and restarting. Sorry."));
+ disableENRelatedNotesThreadCheck = true;
+ }
+ } else
+ enRelatedNotesThreadDeadCount=0;
}
private void thumbnailTimer() {
fromHistory.put(from, fromHistory.get(to));
fromHistory.put(to, fromHist);
}
+
+ // 連想ノートリストのgetter
+ public RensoNoteList getRensoNoteList() {
+ return rensoNoteList;
+ }
}