MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / accept

Method accept

src/widgets/WizExternalEditorSettingDialog.cpp:76–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void 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
116void WizExternalEditorInfoDialog::setSelectedProgramFile()
117{

Callers 3

contextMenuEventMethod · 0.45
keyPressEventMethod · 0.45
downloadRequestedMethod · 0.45

Calls 5

isEmptyMethod · 0.80
textMethod · 0.45
setTextMethod · 0.45
execMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected