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