setWindowIcon(new QIcon(iconPath+"spellCheck.png"));
replacePressed = false;
cancelPressed = false;
this.checker = checker;
setWindowTitle(tr("Spell Check"));
QGridLayout grid = new QGridLayout();
setLayout(grid);
QGridLayout suggestionGrid = new QGridLayout();
QGridLayout buttonGrid = new QGridLayout();
currentWord = new QLabel(misspelledWord);
replacementWord = new QLineEdit();
suggestions = new QListWidget();
replacementWord.textChanged.connect(this, "validateInput()");
suggestions.itemSelectionChanged.connect(this, "replacementChosen()");
suggestionGrid.addWidget(currentWord, 1, 1);
suggestionGrid.addWidget(new QLabel(tr("Suggestion")), 2,1);
suggestionGrid.addWidget(replacementWord, 3, 1);
suggestionGrid.addWidget(suggestions,4,1);
suggestionGrid.setContentsMargins(10, 10, -10, -10);
grid.addLayout(suggestionGrid,1,1);
replace = new QPushButton(tr("Replace"));
ignore = new QPushButton(tr("Ignore"));
ignoreAll = new QPushButton(tr("Ignore All"));
addToDictionary = new QPushButton(tr("Add To Dictionary"));
replace.clicked.connect(this, "replaceButtonPressed()");
ignore.clicked.connect(this, "ignoreButtonPressed()");
ignoreAll.clicked.connect(this, "ignoreAllButtonPressed()");
addToDictionary.clicked.connect(this, "addToDictionaryButtonPressed()");
QPushButton cancel = new QPushButton(tr("Cancel"));
cancel.clicked.connect(this, "cancelButtonPressed()");
suggestionGrid.addWidget(replace, 1, 2);
suggestionGrid.addWidget(ignore, 2, 2);
suggestionGrid.addWidget(ignoreAll,3,2);
suggestionGrid.addWidget(addToDictionary,4,2);
suggestionGrid.setAlignment(addToDictionary, AlignmentFlag.AlignTop);
buttonGrid.addWidget(new QLabel(), 1,1);
buttonGrid.addWidget(cancel, 1,2);
buttonGrid.addWidget(new QLabel(), 1,3);
buttonGrid.setColumnStretch(1, 10);
buttonGrid.setColumnStretch(3, 10);
grid.addLayout(buttonGrid,2,1);
}