OSDN Git Service

Merge branch 'master' of ssh://nevernote.git.sourceforge.net/gitroot/nevernote/nevernote
authorRandy Baumgarte <randy@fbn.cx>
Tue, 21 Sep 2010 20:20:26 +0000 (16:20 -0400)
committerRandy Baumgarte <randy@fbn.cx>
Tue, 21 Sep 2010 20:20:26 +0000 (16:20 -0400)
Conflicts:
src/cx/fbn/nevernote/gui/BrowserWindow.java
src/cx/fbn/nevernote/gui/TableViewHeader.java

1  2 
src/cx/fbn/nevernote/gui/BrowserWindow.java
src/cx/fbn/nevernote/gui/TableViewHeader.java

@@@ -200,11 -187,12 +200,20 @@@ public class BrowserWindow extends QWid
        public EditorButtonBar buttonLayout;\r
        public final QComboBox fontList;\r
        public final QAction    fontListAction;\r
++<<<<<<< HEAD
 +      public final QToolButton fontColor;\r
 +      public final QAction    fontColorAction;\r
 +      private final ColorMenu fontColorMenu;\r
 +      public final QToolButton fontHilight;\r
 +      public final QAction    fontHilightAction;\r
++=======
+       public final QPushButton fontColor;\r
+       public final QAction    fontColorAction;\r
+       private final ColorMenu fontColorMenu;\r
+       public final QPushButton fontHilight;\r
+       public final QAction    fontHilightAction;\r
+ //    public final ColorComboBox fontHilight;\r
++>>>>>>> 14a0afe3faba057afbddf62aa8ed25139750d68b
        private final ColorMenu fontHilightColorMenu;\r
        public final QFileSystemWatcher fileWatcher;\r
        public int cursorPosition;\r
                }\r
  \r
  //            buttonLayout.addWidget(newSeparator(), 0);\r
++<<<<<<< HEAD
 +              fontColor = newToolButton("fontColor", tr("Font Color"));\r
++=======
+               fontColor = newEditorButton("fontColor", tr("Font Color"));\r
++>>>>>>> 14a0afe3faba057afbddf62aa8ed25139750d68b
                fontColorMenu = new ColorMenu(this);\r
                fontColor.setMenu(fontColorMenu.getMenu());\r
 +              fontColor.setPopupMode(ToolButtonPopupMode.MenuButtonPopup);\r
 +              fontColor.setAutoRaise(false);\r
                fontColorMenu.getMenu().triggered.connect(this, "fontColorClicked()");\r
                fontColorAction = buttonLayout.addWidget(fontColor);\r
                buttonLayout.toggleFontColorVisible.triggered.connect(this, "toggleFontColorVisible(Boolean)");\r
++<<<<<<< HEAD
 +              fontHilight = newToolButton("fontHilight", tr("Font Hilight Color"));\r
 +              fontHilight.setPopupMode(ToolButtonPopupMode.MenuButtonPopup);\r
 +              fontHilight.setAutoRaise(false);\r
++=======
+               fontHilight = newEditorButton("fontHilight", tr("Font Hilight Color"));\r
++>>>>>>> 14a0afe3faba057afbddf62aa8ed25139750d68b
                fontHilightColorMenu = new ColorMenu(this);\r
 +              fontHilightColorMenu.setDefault(QColor.yellow);\r
                fontHilight.setMenu(fontHilightColorMenu.getMenu());\r
                fontHilightColorMenu.getMenu().triggered.connect(this, "fontHilightClicked()");\r
                fontHilightAction = buttonLayout.addWidget(fontHilight);\r
++<<<<<<< HEAD
 +              fontHilightColorMenu.setDefault(QColor.yellow);\r
++=======
++>>>>>>> 14a0afe3faba057afbddf62aa8ed25139750d68b
                buttonLayout.toggleFontHilight.triggered.connect(this, "toggleFontHilightVisible(Boolean)");\r
  \r
  //            buttonLayout.addWidget(new QLabel(), 1);\r
        }\r
  \r
  \r
++<<<<<<< HEAD
 +      // Invoke spell checker dialog\r
 +      private void doSpellCheck() {\r
 +\r
 +              File wordList = new File(Global.getFileManager().getSpellDirPath()+Locale.getDefault()+".dic");\r
 +          SpellDictionary dictionary;\r
 +              try {\r
 +                      dictionary = new SpellDictionaryHashMap(wordList);\r
 +                      SpellChecker spellChecker = new SpellChecker(dictionary);\r
 +                      SuggestionListener spellListener = new SuggestionListener(this);\r
 +                      spellChecker.addSpellCheckListener(spellListener);\r
 +\r
 +                      String content = getBrowser().page().mainFrame().toPlainText();\r
 +                      StringWordTokenizer tokenizer = new StringWordTokenizer(content);\r
 +                      if (!tokenizer.hasMoreWords())\r
 +                              return;\r
 +                      String word = tokenizer.nextWord();\r
 +                      getBrowser().page().action(WebAction.MoveToStartOfDocument);\r
 +                      QWebPage.FindFlags flags = new QWebPage.FindFlags();\r
 +                      flags.set(QWebPage.FindFlag.FindBackward);\r
 +\r
 +                      getBrowser().setFocus();\r
 +                      boolean found = getBrowser().page().findText(word);\r
 +                      if (!found) {\r
 +                              QMessageBox.critical(this, tr("Spell Check Error"), \r
 +                                              tr("An error has occurred while launching the spell check.  The most probable" +\r
 +                                                              " cause is that the cursor was not at the beginning of the document.\n\n" +\r
 +                                                              "Please place the cursor at the beginning & try again"));\r
 +                              return;\r
 +                      }\r
 +                      while (found) {\r
 +                              found = getBrowser().page().findText(word);\r
 +                      }\r
 +              \r
 +                      spellChecker.checkSpelling(new StringWordTokenizer(word));\r
 +                      getBrowser().setFocus();\r
 +                      \r
 +                      flags = new QWebPage.FindFlags();\r
 +                      tokenizer = new StringWordTokenizer(content);\r
 +                      \r
 +                      while(tokenizer.hasMoreWords()) {\r
 +                              word = tokenizer.nextWord();\r
 +                              found = getBrowser().page().findText(word);\r
 +                              if (found && !spellListener.abortSpellCheck) {\r
 +                                      spellChecker.checkSpelling(new StringWordTokenizer(word));\r
 +                                      getBrowser().setFocus();\r
 +                              }\r
 +                      }\r
 +                      spellChecker.removeSpellCheckListener(spellListener);\r
 +                      if (!spellListener.errorsFound)\r
 +                              QMessageBox.information(this, tr("Spell Check Complete"), \r
 +                                              tr("No spelling errors found"));\r
 +              } catch (FileNotFoundException e) {\r
 +                      QMessageBox.critical(this, tr("Spell Check Error"), \r
 +                                      tr("Dictionary "+ Global.getFileManager().getSpellDirPath()+Locale.getDefault()+\r
 +                                              ".dic was not found."));\r
 +              } catch (IOException e) {\r
 +                      QMessageBox.critical(this, tr("Spell Check Error"), \r
 +                                      tr("Dictionary "+ Global.getFileManager().getSpellDirPath()+Locale.getDefault()+\r
 +                                              ".dic is invalid."));\r
 +              }\r
 +\r
 +    }\r
++=======
\r
++>>>>>>> 14a0afe3faba057afbddf62aa8ed25139750d68b
  \r
  }\r
@@@ -24,9 -24,6 +24,12 @@@ public class TableViewHeader extends QH
        public TableViewHeader(Orientation orientation, QWidget parent) {\r
                super(orientation, parent);\r
                \r
++<<<<<<< HEAD
 +              setSortIndicatorShown(true);\r
 +              setClickable(true);\r
 +              \r
++=======
++>>>>>>> 14a0afe3faba057afbddf62aa8ed25139750d68b
                contextMenu = new QMenu();\r
  \r
                createdDateAction = new QAction(this);\r