OSDN Git Service

Evernote関連ノート取得スレッドの生存チェックを追加。
authoryuki <kimaira7@gmail.com>
Wed, 10 Jul 2013 08:31:34 +0000 (17:31 +0900)
committeryuki <kimaira7@gmail.com>
Wed, 10 Jul 2013 08:31:34 +0000 (17:31 +0900)
ノート複製のショートカットキーのバグを修正。
自動ログインのデフォルトをONに変更。

src/cx/fbn/nevernote/Global.java
src/cx/fbn/nevernote/NeverNote.java
src/cx/fbn/nevernote/gui/MainMenuBar.java
src/cx/fbn/nevernote/gui/RensoNoteList.java

index 544d3cf..95b7850 100644 (file)
@@ -611,14 +611,14 @@ public class Global {
     public static boolean automaticLogin() {
        try {
                settings.beginGroup("General");
     public static boolean automaticLogin() {
        try {
                settings.beginGroup("General");
-               String text = (String)settings.value("automaticLogin", "false");
+               String text = (String)settings.value("automaticLogin", "true");
                settings.endGroup();
                if (text.equalsIgnoreCase("true"))
                        return true;
                else
                        return false;           
        } catch (java.lang.ClassCastException e) {
                settings.endGroup();
                if (text.equalsIgnoreCase("true"))
                        return true;
                else
                        return false;           
        } catch (java.lang.ClassCastException e) {
-               Boolean value = (Boolean) settings.value("automaticLogin", false);
+               Boolean value = (Boolean) settings.value("automaticLogin", true);
                settings.endGroup();
                return value;
        }
                settings.endGroup();
                return value;
        }
index ff17b0d..c5d2153 100644 (file)
@@ -329,12 +329,14 @@ 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                                        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                            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
     
     HashMap<String, String>            noteCache;                      // Cash of note content 
     HashMap<String, Boolean>   readOnlyCache;          // List of cashe notes that are read-only
@@ -6746,7 +6748,15 @@ public class NeverNote extends QMainWindow{
                } else
                        indexThreadDeadCount=0;
 
                } 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() {
        }
 
        private void thumbnailTimer() {
index 44fc5f8..3fdc158 100644 (file)
@@ -225,7 +225,8 @@ public class MainMenuBar extends QMenuBar {
                noteDuplicateAction = new QAction(tr("Duplicate"), this);
                noteDuplicateAction.setToolTip(tr("Duplicate this note"));
                noteDuplicateAction.triggered.connect(parent, "duplicateNote()");
                noteDuplicateAction = new QAction(tr("Duplicate"), this);
                noteDuplicateAction.setToolTip(tr("Duplicate this note"));
                noteDuplicateAction.triggered.connect(parent, "duplicateNote()");
-               setupShortcut(noteReindex, "File_Note_Duplicate");
+               // IFIXED
+               setupShortcut(noteDuplicateAction, "File_Note_Duplicate");
                
                noteMergeAction = new QAction(tr("Merge Notes"), this);
                noteMergeAction.setToolTip(tr("Merge Multiple notes"));
                
                noteMergeAction = new QAction(tr("Merge Notes"), this);
                noteMergeAction.setToolTip(tr("Merge Multiple notes"));
index 9355541..75018a4 100644 (file)
@@ -80,7 +80,7 @@ public class RensoNoteList extends QListWidget {
                this.enRelatedNotesRunner = new ENRelatedNotesRunner(this.syncRunner, logger);
                this.enRelatedNotesRunner.enRelatedNotesSignal.getENRelatedNotesFinished.connect(this, "enRelatedNotesComplete()");
                this.enRelatedNotesThread = new QThread(enRelatedNotesRunner, "ENRelatedNotes Thread");
                this.enRelatedNotesRunner = new ENRelatedNotesRunner(this.syncRunner, logger);
                this.enRelatedNotesRunner.enRelatedNotesSignal.getENRelatedNotesFinished.connect(this, "enRelatedNotesComplete()");
                this.enRelatedNotesThread = new QThread(enRelatedNotesRunner, "ENRelatedNotes Thread");
-               this.enRelatedNotesThread.start();
+               this.getEnRelatedNotesThread().start();
                
                rensoNoteListItems = new HashMap<QListWidgetItem, String>();
                rensoNoteListTrueItems = new ArrayList<RensoNoteListItem>();
                
                rensoNoteListItems = new HashMap<QListWidgetItem, String>();
                rensoNoteListTrueItems = new ArrayList<RensoNoteListItem>();
@@ -409,4 +409,8 @@ public class RensoNoteList extends QListWidget {
                }
                return false;
        }
                }
                return false;
        }
+
+       public QThread getEnRelatedNotesThread() {
+               return enRelatedNotesThread;
+       }
 }
 }