| 74 | } |
| 75 | |
| 76 | void WizExternalEditorInfoDialog::accept() |
| 77 | { |
| 78 | // Check program file existance |
| 79 | QFileInfo program(m_editProgram->text()); |
| 80 | if (!program.exists()) |
| 81 | { |
| 82 | QMessageBox msgBox; |
| 83 | msgBox.setText(tr("Please specify a valid program file.")); |
| 84 | msgBox.exec(); |
| 85 | m_editProgram->setFocus(); |
| 86 | return; |
| 87 | } |
| 88 | // Check name existance |
| 89 | QString name(m_editName->text()); |
| 90 | if (name.isEmpty()) |
| 91 | { |
| 92 | QMessageBox msgBox; |
| 93 | msgBox.setText(tr("Please specify a Name for this editor.")); |
| 94 | msgBox.exec(); |
| 95 | m_editName->setFocus(); |
| 96 | return; |
| 97 | } |
| 98 | // send signal and data |
| 99 | SettingMap data; |
| 100 | data["Name"] = m_editName->text(); |
| 101 | data["ProgramFile"] = m_editProgram->text(); |
| 102 | data["Arguments"] = m_editArguments->text(); |
| 103 | data["TextEditor"] = QString::number(static_cast<int>(m_checkTextEditor->checkState())); |
| 104 | data["UTF8Encoding"] = QString::number(static_cast<int>(m_checkUTF8->checkState())); |
| 105 | data["OpenShortCut"] = m_editOpenShortCut->keySequence().toString(); |
| 106 | |
| 107 | if (m_isEditing) { |
| 108 | emit dataEdited(m_dataRow, data); |
| 109 | } else { |
| 110 | emit dataAdded(data); |
| 111 | } |
| 112 | |
| 113 | QDialog::accept(); |
| 114 | } |
| 115 | |
| 116 | void WizExternalEditorInfoDialog::setSelectedProgramFile() |
| 117 | { |