MCPcopy Create free account
hub / github.com/Project-LemonLime/Project_LemonLime / validateCurrentPage

Method validateCurrentPage

src/addcompilerwizard.cpp:85–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85auto AddCompilerWizard::validateCurrentPage() -> bool {
86 if (currentId() == 1) {
87 if (ui->compilerName->text().isEmpty()) {
88 ui->compilerName->setFocus();
89 QMessageBox::warning(this, tr("Error"), tr("Empty compiler name!"), QMessageBox::Close);
90 return false;
91 }
92
93 if (ui->compilerLocation->isEnabled() && ui->compilerLocation->text().isEmpty()) {
94 ui->compilerLocation->setFocus();
95 QMessageBox::warning(this, tr("Error"), tr("Empty compiler location!"), QMessageBox::Close);
96 return false;
97 }
98
99 if (ui->interpreterLocation->isEnabled() && ui->interpreterLocation->text().isEmpty()) {
100 ui->interpreterLocation->setFocus();
101 QMessageBox::warning(this, tr("Error"), tr("Empty interpreter location!"), QMessageBox::Close);
102 return false;
103 }
104
105 if (ui->sourceFileExtensions->text().isEmpty()) {
106 ui->sourceFileExtensions->setFocus();
107 QMessageBox::warning(this, tr("Error"), tr("Empty source file extensions!"), QMessageBox::Close);
108 return false;
109 }
110
111 if (ui->bytecodeFileExtensions->isEnabled() && ui->bytecodeFileExtensions->text().isEmpty()) {
112 ui->bytecodeFileExtensions->setFocus();
113 QMessageBox::warning(this, tr("Error"), tr("Empty byte-code file extensions!"),
114 QMessageBox::Close);
115 return false;
116 }
117
118 QString text;
119 text += tr("[Custom Compiler]") + "\n";
120 text += tr("Compiler Name: ") + ui->compilerName->text() + "\n";
121 text += tr("Compiler Type: ") + ui->typeSelect->currentText() + "\n";
122
123 if (ui->compilerLocation->isEnabled()) {
124 text += tr("Compiler\'s Location: ") + ui->compilerLocation->text() + "\n";
125 }
126
127 if (ui->interpreterLocation->isEnabled()) {
128 text += tr("Interpreter\'s Location: ") + ui->interpreterLocation->text() + "\n";
129 }
130
131 text += tr("Source File Extensions: ") + ui->sourceFileExtensions->text() + "\n";
132
133 if (ui->bytecodeFileExtensions->isEnabled()) {
134 text += tr("Byte-code File Extensions: ") + ui->bytecodeFileExtensions->text() + "\n";
135 }
136
137 if (ui->defaultCompilerArguments->isEnabled()) {
138 text += tr("Default Compiler\'s Arguments: ") + ui->defaultCompilerArguments->text() + "\n";
139 }
140
141 if (ui->defaultInterpreterArguments->isEnabled()) {
142 text += tr("Default Interpreter\'s Arguments: ") + ui->defaultInterpreterArguments->text() + "\n";

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected